ESP32, PlatformIO

PlatformIO is an opensource ecosystem (as it’s defined in the homepage of the project) to develop IoT projects.

The heart of the platform is a software component named PlatformIO Core. This component includes:

  • a cross-platform compiler
  • a libraries and dependences manager
  • a serial monitor

PlatformIO Core is developed in Python and therefore it can run on different operating systems (Windows, Linux, MacOS).

Although you can use the Core component directly, PlatformIO’s strength lies in its IDE, which allows the development of multi-platform projects and integrates with the Core itself.

In this article I’m going to show you how to use PlatformIO to develop projects running on the esp32 chip.

Installation

PlatformIO IDE is provided as a plugin for two different development tools: Atom and VisualStudio Code. I tried both solutions and I preferred VSCode: both the installation and the use are simpler and more immediate.

Install VSCode after having downloaded the package from Microsoft’s website (the installer is available for Windows, Linux and MacOS).

Open the Package Manager:

pio-001

search the PlatformIO IDE package, then click on Install:

pio-002

wait until the installation is complete:

pio-003

Hello world

Now it’s time to develop your first program, which traditionally will display the sentence Hello world! on the terminal.

If it doesn’t show up automatically, open the PlatformIO’s homepage:

pio-004

then click on New Project:

pio-005

give a name to the project and choose a devboard based on the esp32 chip (in this example I’ll use a Lolin32 board by Wemos). PlatformIO supports both the esp-idf framework and the arduino-esp32 one. All my tutorials are based on the first one:

pio-006

PlatformIO automatically creates some folders for your project. Choose the src folder (it stands for source, that is the folder which will contain the source code) and create a new file:

pio-007

name the file main.c and type the simple program as it follows:

pio-008

run the compiler by clicking on the corresponding button in the bottom bar:

pio-009

the editor displays an error… indeed your code is using the printf() function without having included the library:

pio-010

add the missing line, now you should be able to complile the code without errors:

pio-011

PlatformIO can also upload the compiled program to your board. Thanks to its auto-detect feature, you usually don’t need to specify the serial port the board is connected to:

pio-012

Serial monitor

PlatformIO also includes a serial monitor you can use to test your program. By default, this monitor connects to the serial port with a speed of 9600 baud. The esp32 chip instead has a default speed of 115200 baud; you have therefore to change the platformio.ini file included in your folder as it follows:

pio-013

Now open the serial monitor; you should see the correct output of your program:

pio-014

Conclusions

I found the use of PlatformIO really immediate: after a few minutes I was able to develop, compile, load and test a program. Try it and leave a comment with your impressions!

 

App note: Pulsed Over-Current Driving of LEDs

an_cree_pulsedcurrent

App note from CREE on driving LEDs over its specified current capability. Link here (PDF)

The Applications Engineering team at Cree is often asked whether it is safe to operate Cree XLamp® LEDs with pulsed currents above the maximum data-sheet rating. This question is usually asked in the context of legitimate product requirements such as those posed by emergency-vehicle applications, specialized stroboscopic illumination and even pulsed modulation for general-illumination dimming applications.

The short answer is “it depends.” Multiple variables affect both initial and long-term performance and reliability of an LED. These include thermal resistance, pulse duration, as well as current amplitude, frequency and duty cycle.

App note: Optimizing PCB Thermal Performance for LEDs

an_cree_xlamp_pcb_thermal

Application note from CREE on efficiently designing a conventional FR4 PCB to manage thermal heat and as a cheap alternative to metal core pcbs. Link here (PDF)

One of the most critical design parameters for an LED illumination system is the system’s ability to draw heat away from the LED junction. High operating temperatures at the LED junction adversely affect the performance of LEDs, resulting in decreased light output and lifetime. To properly manage this heat, specific practices should be followed in the design, assembly and operation of LEDs in lighting applications.

Rombus pinball – a LattePanda mini pinball machine

rombus-pinball

Matt Brailsford (aka Circuitbeard) has a nice write-up about building his mini pinball machine with a lattepanda core running dual monitors:

I generally start my projects by thinking about the hardware that I’m going to want to use as I’ll need to know sizes when it comes to the design phase. My first thought was to go with a Rasberry Pi as it’s what I’m familiar with and it’s what I’ve used for my other arcades, but after looking online, there really didn’t seem to be any good options for pinball emulation on Linux at all. It all seemed to be windows based. Thankfully I remembered reading about a single board Windows computer called a LattePanda so I thought why not give that a go and so this was the approach I ended up taking.

Build log at Circuitbeard blog and the GitHub repository here.

Check out the video after the break.

Mostly PIC16C57

IMG_20180415_111736-600

CAPS0ff team posted an article taking a closer look at 8 “PIC16C57s”:

We were recently sent 8 “PIC16C57s” from:

*High Seas Havoc (403/C013)
*Wargods (U69, C020)
*MACE (U96, C021)
*Carnevil (U96, C022)
*BioFreaks (C023)
*Gauntlet Dark Legacy (C024)
*Gauntlet (U37, C025)
*Blitz 99 (U96, C026)

More details at CAPS0ff blog.

Nickelbot – wooden nickel laser engraver

p-20180506_110125-600

bdring posted an update on NickelBot project we covered previously:

The NickelBot is complete and it works great. The goal of the project was to create an easily portable machine that creates low cost items that could be given away at events like Maker Faires. I think it has completely achieved that goal. The nickels are purchased from Amazon and cost about $0.08 each.

Project info at Buildlog.Net blog.

Check out the video after the break.

Makervilla 2.0

Makervilla

Makervilla is back!  It will be held on August 13th, 14th, 15th and 16th at Batam, Indonesia.

MAKERVILLA 2.0 is a 4-day creative learning retreat designed for local and international maker educators to gather under one roof for a time of learning, dreaming, hacking and sharing of ideas.

MAKERVILLA 2.0 is specially organized to address the needs of educators who are involved with maker education. Whether it is the need for peer support or understanding how to develop curriculum ideas, MAKERVILLA 2.0 will be able to facilitate the formation of learning network, professional learning community and special interest groups.

MAKERVILLA 2.0 is organized by Onemaker Group Singapore in collaboration with Ruang Kreasi Indonesia.

Find out more on their website at makervilla.com.

Mark your calendar!

PiggyFuse HVSP AVR fuse programmer

PiggyFuse2-600

Nerd Ralph published a new build:

Although I’ve been working with AVR MCUs for a number of years now, I had never made a high voltage programmer.  I’ve seen some HVSP fuse resetter projects I liked, but I don’t have a tiny2313.  I think I was also hesitant to hook up 12V to an AVR, since I had fried my first ATMega328 Pro Mini by accidentally connecting a 12V source to VCC.  However, if you want to be an expert AVR hacker, you’ll have to tackle high-voltage programming.  Harking back to my Piggy-Prog project, I realized I could do something similar for a fuse resetter, which would simplify the wiring and reduce the parts count.

See the full post on his blog here. Code is available at Github.

How not to build a semiconductor lapping machine

electronupdate writes:

One area of silicon reverse engineering which has interested me is the delayering of a chip to see each layer which allows superior visibility into the circuitry. I know of two ways: chemical etch and mechanical means.
In this video I try to make a mechanical grinder which can take micron levels of material away: a partial success. Parts are ground but I was not able to keep the silicon absolutely flat. More study of the commercial units is warranted!

See the full post on electronupdate blog.