Testing Assembled PCB

A project log for ESP-NOW Weather Station

An ESP32 based weather station investigating ESP32's Deep Sleep and ESP-NOW

Kevin KesslerKevin Kessler 10/16/2020 at 02:220 Comments

I got the main board PCB back from China, and assembled it, and surprisingly, it worked.  The only mistake I found was I forgot to make a debug GPIO easily accessible, and I messed up the silk screen because I was in a hurry to get the board in before China's Golden week.

I was having a problem with the brownout detector often popping off, so I put a bunch of capacitors footprints in various locations. While I was waiting for the PCBs to ship, I realized my problem was the current shunt in the ammeter. When the ammeter was in the uA range measuring sleep current, there was a  large shunt in the power circuit, but as soon as the ESP32 woke up, the meter didn't auto-range quickly enough to put a smaller shunt in series, and there was a substantial voltage drop across the shut, and hence a brownout level of voltage on the uC. Long story short, I didn't populate any of the large electrolytic caps I put on the PCB when I thought my buck/boost converter might be having trouble supplying the instantaneous burst of current the ESP32 called for when it work from deep sleep.  

The other problem I have discovered is with ESP Now. Every time the the weather station sends a packet, the base station receives it, but the weather station's send callback function indicates every transmission is an error. While the actual communication works, the problem seems to be that the weather station sender expects an ACK message from the base station, which, apparently, isn't happening. There isn't a lot of information around this ACK except for some casual mention in the documentation and some ESP32 message board talk that the ACK happens automatically is not something you have to code. This error doesn't happen when the packet is sent to the broadcast address, because it wouldn't be expecting anyone to acknowledge it. I need to dig into this error, but for now, it doesn't seem to break anything.

I slapped everything into a waterproof box, and did some outdoor testing.

The 5V solar cells connect to an Aliexpress CN3065 solar charger, which powers a 2000 mAh Lipo and my PCB. The solar charging works better than I expected, with the Lipo getting fully charged in one hour of morning sunlight, after a day running on the battery. I could have probably gotten away with just one cell. instead of the 2 in parallel I'm using. 

Following the sage advice of john.r.sheahan, I implemented a watchdog timeout in the firmware, to recover from a system hang (which I have seen with I2C when something won't let go of the clock line). The code for the weather station proper is pretty much complete at this point, and is up on the github repo. The base station code just takes the ESP Now packets and drops them on MQTT, for Node Red, InfluxDB and Grafana to do their things, but I do have plans to put and LCD display in it as well. That code is up on github as well.

The next step is to 3D print some mounting hardware.