Fixing my IoT sensor

Much quicker than I anticipated, I was able to fix the design of my PCB. I still don't have a good explanation for why works now, but it does!

As I described last time, the problem I had was that the power consumption spiked during WiFi transmission, causing the voltage to drop and then a reset of the whole chip. According to the specification and the measurements of the dev board, it should not have used as much power as it did.

The updated PCB design with the antenna hanging over the edge.
The updated PCB design with the antenna hanging over the edge.

I had two things remaining that I could try, so I did both. The first was to add even bigger capacitors before and after the linear voltage regulator. Especially the one after the regulator should have fixed it, if it was big enough. The capacitor I used was not big enough to compensate the spikes I saw before, so I can't attribute the success solely to this change. The second change was to not have the PCB antenna of the ESP32-C6-Mini board laying on my own PCB. Instead, it is now hanging over the edge, like it does on all dev boards I've seen. Somewhere online I read that this might be a problem, so I tried it. Since the capacitor alone can't be the reason for the success, this must play a bigger part than I thought!

The hand-wavy explanation for why this makes a difference is probably induction. I would have expected this to be a serious problem if the not-working design had a copper filling for ground beneath the antenna, but I was already careful to avoid this. So I guess even copper close to the antenna, or the insulating layer itself must have a strong influence.

The power consumption now is what I expect it to be!
The power consumption now is what I expect it to be!

As you can see, the new measurement of my board shows the same current as the dev board 🙂

The next step is optimizing the firmware to lower the power consumption. For that I hope to reduce the time the high power core needs to be awake to send the data, for example by avoiding a full recalibration of the WiFi interface. Also, I'll try to put even the low power core to sleep while it's not measuring anything. Last but not least, if a Zigbee or maybe even a Matter implementation becomes available, I'd like to try and use that instead of Bluetooth Low Energy.