This Pico-based Data Logger is a low-power, autonomous environmental monitoring system. It features a Raspberry Pi Pico WH alongside multiple sensors, power management circuits, and data storage components to ensure efficient and reliable data collection. Below is a comprehensive breakdown of the hardware components, followed by step-by-step assembly instructions.
- Raspberry Pi Pico WH – Handles data acquisition, processing, and storage.
- Temperature Sensors:
- 3 × DS18B20 (1-Wire protocol) for temperature measurements.
- Temperature & Humidity Sensors:
- 3 × SHT30 (I2C protocol) for dual temperature and humidity readings.
- 2 × SD Card Breakout Boards – Connected via SPI for data storage.
- Waveshare Solar Power Manager Module – Manages solar charging and battery output.
- 14500 LiPo Battery – Provides backup power for continuous operation.
- DS3231 Real-Time Clock (RTC) – Controls power cycles to optimize energy consumption.
- MOSFETs:
- P-Channel: 2 × IRF4905
- N-Channel: 1 × IRFZ44N
- Resistors:
- 2 × 4.7KΩ
- 1 × 220KΩ
- 1 × 1KΩ
- 1 × 2.2KΩ
- 1 × 100KΩ
- PCA9546A I2C Multiplexer – Expands the I2C bus for multiple sensors.
- Adafruit Proto Underplate – A prototyping board for mounting and connecting components.
- Jumper Wires – For flexible connections.
- Perf-board – 6 × 4 cm prototyping board.
- Waterproof Housing – Amazon Link
- RJ45 Patch Cables – Amazon Link
- RJ45 Waterproof Couplings – Amazon Link
The Raspberry Pi Pico WH comes pre-soldered with headers, making it easier to connect components. However, if you are using a standard Raspberry Pi Pico (without pre-soldered headers), you will need to solder them manually before proceeding.
Required Materials:
- 40-pin male headers (included with most Pico kits)
- Soldering iron (set to ~350°C or a fixed-temperature iron over 40W)
- Solder
- Breadboard (optional but recommended)
Steps:
- Insert the male headers into a breadboard to hold them steady.
- Place the Pico board onto the headers with the component side facing up.
- Heat one corner pin and apply a small amount of solder to hold the header in place.
- Repeat for the opposite corner to level the board.
- Solder the remaining pins.
- Inspect the joints and remove any solder bridges if necessary.
Before the Pico WH can run your data logging program, install MicroPython.
- Visit Thonny’s official website and download the appropriate version.
- Install Thonny by following the on-screen instructions.
- Hold down the BOOTSEL button.
- While holding the button, connect the Pico WH to your computer via USB.
- Release the BOOTSEL button once a drive named RPI-RP2 appears.
- Open Thonny.
- Go to Run → Select Interpreter.
- Select:
- Interpreter: MicroPython (Raspberry Pi Pico)
- Port: The one where the Pico is connected.
- If prompted, click Install to install MicroPython firmware.
In the Python shell (REPL) at the bottom of Thonny, type:
- After installation, a Python shell (REPL) will appear at the bottom of Thonny.
- Type:
and press Enter. If the message prints successfully, MicroPython is installed correctly.
print("Hello, Pico!")
Articles I have read, including this blog, highlight the need for modifications to the DS3231 to ensure proper functionality when using its alarm as a trigger for the P-channel MOSFET.
The DS3231 includes pull-up resistors on the SQW (alarm) line, which must be removed. However, these resistors are part of a resistor block that also contains the necessary I2C lines (SCL, SDA). To compensate for their removal, external 4.7KΩ pull-up resistors must be reintroduced into the circuit to maintain proper operation. This modification provides greater control over the pull-up resistance for the SQW (alarm) line, ensuring reliable triggering.
The other necessary modification is the removal of the charging circuit for the coin battery. The same blog mentioned earlier, along with other sources, recommends disabling this feature for safety reasons.
To achieve this, the charging resistor can be removed.
The image below highlights both resistors that should be removed. Applying heat and gentle pressure will quickly dislodge them. However, be careful not to apply excessive force, as this could damage the DS3231 or cause injury.
The auto power-off and voltage measurement circuit was built on a 6 × 4 cm section of double-sided perfboard. Before transitioning to the more permanent perfboard, the circuit was first assembled and tested on a breadboard.
All soldering was done on the underside at a temperature of 350 °C. The resistors used in the voltage divider were 1 kΩ and 2.2 kΩ. External pull-ups for the RTC were 4.7 kΩ, while the pull-ups for the transistor in the voltage divider were 100 kΩ, and for the auto power-off, 220 kΩ.
The voltage divider was powered directly from the battery, with leads soldered to the positive and negative terminals. This approach was necessary because the main output of the Waveshare power unit is boosted to 5V.
Below are some images to assist in its reconstruction. I plan to make this into a PCB hat for the Pico in the future.
I decided to use RJ45 couplers (link) to connect the sensors through the waterproof case. This choice was mainly driven by cost. While there are likely more robust and better-form-factor waterproof through couplers available, these were much more affordable at the time.
I drilled 23mm holes using a Forstner drill bit (link) through the bottom of the case. Care must be taken when measuring the holes, as there is little tolerance. I ensured that the long side of the coupler was oriented on the outside of the box to provide more space for cabling later on.
A waterproof gland also needs to be added to the right side of the case for the solar input. I installed this after mounting the hardware and positioning it inside the case to ensure proper placement. I used a PG7 Waterproof Gland for this purpose.
Using RJ45 couplers required modifying the ends of each sensor to allow them to connect properly. To achieve this, I purchased some short Cat7 patch cables. I cut a 10 cm length, removed the shielding to expose the four wire pairs, then stripped and twisted the pairs together.
For the temperature sensors, which have three wires, one pair could be discarded. The connector and the sensor wire were then soldered together and insulated. The humidity/temperature sensors, however, use a digital protocol that requires four wires, meaning all pairs from the Cat7 cable are needed.
Be sure to note where each wire is connected to the RJ45 plug, as you'll need to replicate this inside the box and route each wire correctly to the Pico.
I chose to merge the three wires from each temperature sensor inside the case before routing them to the Pico. Since they use the digital "1-wire" protocol, this connection needed to be made somewhere, and doing it inside the case kept the wiring clean.
This involved soldering all power wires together, all ground wires together, and all signal wires together using three pairs from another set of RJ45 connectors. Three wires (Power, Ground, and Signal) then emerged from the connectors and were routed to the Pico.
The humidity/temperature sensors, which use the I2C protocol, needed to pass through a multiplexer since they all shared the same digital address. The multiplexer I used had four STEMMA QT connectors as inputs, so I soldered these to the ends of each RJ45 connector inside the box.
The output of the multiplexer (another STEMMA QT) was then routed into the provided input on the proto underplate, reducing cable clutter and avoiding the need for an additional four wires running directly into the Pico's GPIOs.
My plan was to design a plate that sits atop the Waveshare power manager, providing a mounting surface for both SD card readers and the proto underplate with the Pico on top. The auto power-off circuit is mounted directly onto a backing plate that spans the width of the case.
Files for printing both mounting plates can be found in the repository:
Note: The prints may require some re-drilling and adjustments to align the holes properly.








