Programming Tools

Things don’t always go as planned.  The firmware upload tools did not work.  The recommended one for Linux is a python script called  I hacked on it to get it working, I bypassed some error checking to get it to work.  I don’t like this but it works for now.  I have tools that proved that the USB Serial port driver was receiving the correct values but was not.

Disabling the error checking allowed me to get pre-compiled bin files loaded onto a NodeMCU Devkit Version 0.9 and then onto my circuit.  I downloaded the AT command set firmware as well as the NodeMCU Lua firmware and tested them with ESPlorer.  With the AT command set I was able to connect to my local network, open a webserver port and see a connect attempt from a browser on my Phone.  With the Lua firmware, I was able to turn on an LED on the Devkit PCB(GPIO0) and send some interrogation commands to my circuit.

With both firmwares, the software defaulted to 9600 baud.  This worked fine for my testing.  I have not yet figured out how to get software I create into the ESP-12E. I will be starting with the IOT demo to get a “hello world” project working. A key point will be to get software of my own design working and uploaded into the circuit.  At this point it doesn’t have to have any real functionality.

I also want to figure out why did not work, and how I can make it more robust.  If I can solve this problem, I will submit my fixes to the github repository in hopes that it will help others.

There are some things that I discovered that will change the design.  I found a USB to UART bridge that costs less than a Dollar US; the CH340G.  The programming software controls the DTR and RTS lines to automate the re-boot and flash buttons, so I can get rid of the flash pushbutton and minimize the Reset into a couple of pads I can touch with a screwdriver.  Also, on the layout, I didn’t notice that OSHpark doesn’t do plated slots.  The USB micro connector layout has slots.  OSHpark drilled single small holes in place of the slots.  I had to modify the connector to make it fit in the holes.  I will change the connector layout to round holes that will fit the shell pins of the connector to solve this issue in future runs of the PCB.  There is a flare at the end of the connector that keeps it from laying flat, I will move the flare past the edge of the PCB so the connector can lay flat against the PCB. For strength I want to add a pad under the shell that will also be soldered to the shell. I broke the connector off during my testing.



Programming Environment

While I wait for parts to arrive, I am setting up the programming environment for the ESP8266 API.

I started by downloading the recommended virtual machine for VirtualBox.  I got it running and had to do some reconfiguring for my linux system.  It was configured for running under Windows.  I want one folder that will be shared between my main system and the virtual machine.  I ran into several issues getting this to work, but it is finally working. I think most of my problems came from my poor understanding of VirtualBox.

I did have one issue where the VirtualBoxAdditions did not install where it was expected.  I found it under /opt/VBoxGuestAdditions-4.3.10/ using the locate utility in linux. I was specifically having trouble using the mount.vboxsf utility.

I found a “getting started” guide on Espressif’s bbs website here.  It was mostly correct but had a few missing details, I will probably understand those details as I start digging into the API.

I want Eclipse as my software development environment.  In the Lubuntu software center, the latest version of Eclipse available is 3.8. This is a little old but should be good for my development process. I tried getting a newer version but it wouldn’t install.

After I got Eclipse installed, I tried to program a NodeMCU devkit V0.9 and it failed and now I can’t get it to update at all.  I received the PCBs from OSH Park today as well as the parts to build up a system, so I am going to set aside the devkit and start building the minimum on the PCB I designed.  That should be the ESP-12E, the USB serial bridge, USB connector, and Voltage regulator plus a few passive components. My programming environment is configured but not tested.


Pulling it together

Now that the PCB layout is finished, I need to get it fabricated as well as get components for the first build. This means I need a bill of materials(BOM).  In PCBnew, I selected the fabrication outputs from the file menu then BOM file.  This creates a CSV file that I can import into LibreOffice Calc.  Once imported I saw that several capacitors were assigned a value of C…I forgot to change them to actual values.  I went back to eescheema fixed all those values, ran a new netlist, then back into PCBnew and imported the netlist again.

This time when I imported the file, everything looked great except C16 wasn’t sorted in it’s line properly.  I don’t know if this is a bug in PCBnew, or if I somehow typed a bad(nonprintable) character into the reference designator.

I will use this BOM to order the parts for the first build.  I want to verify I can get the correct footprint components before I order the PCBs.  I will use Digikey, Newark, and or Mouser to get the parts I need to build these PCBs.  As I put the parts into my shopping cart I back filled the price and supplier into the spreadsheet. At D1 I discovered I had to change the footprint to SOD-323.

The connector P3 was going to cost $2.57 a piece in low quantities, so I went looking for a lower cost alternative.  I found a 2mm pitch header for $0.27 a piece.  A much better price.  So I chose to go back to the PCB design to change it. I created a new 2mm header footprint and replaced the footprint in my layout. The low quantity cost is now 29.13 per board. I managed to get all the parts except the radio and PCB from one supplier — Digikey.  This simplifies tracking of expenses. I ran the fabrication outputs from PCBnew, and ordered the PCB and electronic components.

BOMRev0A LayoutRev0A

Check Plots

Check plots are printouts of the design so that they can be verified.

I printed out the schematic and both layers of the PCB layout as large as would fit on one letter sized page. Then I aligned and stapled the PCB layer plots together. I used colored pens to trace each circuit on the schematic and on the PCB layout.

In the first few minutes I found some problems. A bunch of references were not placed well, I found a section of the 3.3v net that did not get connected, and I had made a change that affected the ground plane fill that required me to redo the fill. I found these in the first half hour of verifying the check plots.  I continued to make adjustments as I checked the layout.

I printed a 1:1 scale to verify the ESP-12E would fit the pads correctly and it did fit. I generated the fabrication files by clicking on plot and clicked the plot button on that dialog, then I clicked on Generate drill file and made a drill file as well.  All these generated files were placed in a folder named “Fabrication” under the project directory.

Check Plots with Pens

1:1 Check Plot