picoboard ii
I recently made some updates to a circuit board I had designed to facilitate environment monitoring in my flat. Having used the previous version for a few months I’d made a list of quality-of-life (QOL) hardware improvements which are summarized below:
- Replace the ‘CONFIG’ pin with a switch
- Finding a jumper or a cable to short the pin was annoying, so replaced with a single-pole-single-throw (SPST)1 switch.
- Add 3.3v reference to the screw terminal
- Allows the board to power an external sensor such as a PIR sensor; the output of which is connected back to the custom GPIO inputs
- Add screw terminal for external 5v powering.
- Originally everything was powered from the inserted Raspberry Pi Pico W (which itself is powered via micro USB). I struggled to fit the board and micro USB cable inside various enclosures, so decided to add support for powering with an external supply. The Pico W data-sheet recommends adding a DMG2305UX P-MOSFET2 so that the board can be powered either externally or via micro USB.3
- Terminal pins for UART connection
- Previously I thought that using crocodile clip jumpers would be fine for the rare UART usage to debug the firmware and program the EEPROM. In reality it was always awkward and unreliable so I have acquiesced and added external pins for easy connection to UART.
The image below shows the updated board. I also added some more labels for external pins so that I didn’t have to check the schematic when connecting things.

Revision 1.2 of the board with the aforementioned changes.
Does it work? (Part III)
I extended the previous test procedure to ensure everything worked as expected on the latest revision. The additions are highlighted in bold. Everything worked out of the box which is always a great relief.
| Functionality | Pass/Fail |
|---|---|
| BME280 Environment Sensor R/W | PASS |
| Accelerometer R/W and GPIO | PASS |
| EEPROM R/W | PASS |
| GPIO A | PASS |
| GPIO B | PASS |
| CONFIG Switch | PASS |
| 3.3v Rail | PASS |
| External 5v Power | PASS |
| External 5v Power and USB | PASS |
| UART Connection | PASS |
Firmware changes
Previously, at five minute intervals (driven by the on-chip real time clock) the Pico would read environment data and transmit it to the MQTT broker along with the up-time of the device in milliseconds. I’ve changed this instead to transmit the timestamp when the measurement was taken in UNIX time:

JSON encapsulated environment data digest with timestamp
I’ve renamed the topic as digest to reflect that it is a snapshot of the environment data at the given timestamp.
The live environment data has been reduced from 200ms to a 1s interval and only transmits the environment data. The quality of service (QOS) has also been downgraded from 1 (at least once delivery)4 to 0 (fire and forget)4 as this data is not stored by the system. I envisioned making a live data tool at some point which would use this data.
I’ve created a new root topic called event, shortened to evnt, which precedes messages triggered from accelerometer and GPIO inputs. These now transmit a UNIX timestamp from when the event occurred:

Event messages triggered from accelerometer measurements. A UNIX timestamp is contained in the JSON payload
I’ve also created a new meta topic, which contains the up-time of the device (in milliseconds) as well as the Git hash used to build the firmware. This is useful to pinpoint which version of code is on a given device. The Pico will transmit this message in response to a message sent on the reqmeta topic.

Meta data from a given board containing the up-time and Git hash
Updated Schematic
The updated schematic is detailed below along with a PDF version here.

Updated schematic