Introducing the next iteration of our sensor box

Reading Time: 7 minutes

Björn Haßler and Bernhard Bablok

This blogpost was amended on 2024-02-02, correcting the power consumption to 380 nA. The blogpost previous stated an incorrect higher power consumption of 30 uA.

For our climate-resilience programme for schools in Tanzania, we are developing custom sensors to measure the impact of retrofits. The sensors measure potential reductions in temperature and noise in the classroom that we achieve through low-cost retrofits; such improvements are expected to have significant impact on learning. The first version of the custom sensor is already in use in Tanzania. Building on the insights of the initial sensor developments throughout 2023, we have now developed a new sensor. The development, as with the previous sensor, was led by Bernhard Bablok (https://github.com/bablokb/pcb-pico-datalogger).

Overall, the purpose of the board is to improve some weaknesses of the Raspberry Pi Pico (and similar microcontrollers). Primarily, the board adds a very low-power sleep facility, together with a real-time clock to wake the Pico at specified times. Moreover, the board adds storage, as the internal storage of the Pico is insufficient. Additionally, convenient connectors were provided to interface with sensors.

In this blogpost, we detail the advantages of the new design. The first part of the new design is a revised main PCB, shown in the picture below.

For the new design, we have managed to further reduce the stand-by current significantly (from 80 µA to 380 nA). As we are primarily undertaking strobe measurements, this is a significant advantage: When measuring once every few minutes, reducing the stand-by current is critical. We believe that the current stand-by consumption is likely the lowest possible consumption in scenarios where a real-time clock is required.

Compared to our previous printed circuit board, we removed the SD cardholder, and included onboard memory (128 MB, made by XTX, model: XTSD01GLGEAG, approx $2.50, available up to 1 GB).  The manufacturer notes that “XTX SD NAND is an embedded storage solution designed in a LGA8 package form”. From a software development perspective, the operation of SD NAND is similar to an SD card, making it easy to utilise. The previous version had an SD-card slot, and required an SD card for data storage. 

The SD NAND is many times more expensive ($2.50 for 128 MB, about $4 for 1 GB) compared to an SD card (16 GB for $10). However, even a small SD card has a lot more memory than we need. Our storage need is low, and, e.g., given our current approach to measurements, 128 MB would last several years. Therefore, given the low storage requirements, utilising onboard memory is actually cheaper than adding an SD card. Additionally, this slightly simplifies setup, as no SD card needs to be purchased separately. 

It’s worth noting that one advantage of the SD card is that it can be simply removed to access the data stored. Instead, the data from the SD NAND internal memory will be available through an admin mode, that offers a Wi-Fi-based hotspot through which a user-interface can be accessed. Where the sensor box is used in a networked setting (via Wi-Fi or, more likely, LoRa to a base station), the data is transmitted via that network; in the scenario, the onboard storage serves as backup.

We have also replaced the power-selection jumper with a MOSFET to avoid user error (resulting in the battery destruction, due to – effectively –  attempting to charge a non-chargeable battery). The MOSFET does add a voltage drop, potentially leading to reduced run-time. However, with our current configuration, we believe that this will be insignificant. For applications where this is an issue, the MOSFET can be easily replaced by the original jumper.

The actual main PCB (with some standoffs) looks like this:

Overall, we have reduced the footprint of the PCB by optimising connectors and moving certain components to separate PCBs. A critical improvement was to add connectors for which ready-made cables can be purchases (JST SUR); these connectors connect to a sensor PCB. Previously, we had connected to sensors using so-called through-hole termination (THT), allowing us to connect a variety of sensors. We procured these as ready-made boards, e.g., Adafruit AHT20 Temperature & Humidity Sensor Breakout Board, which required headers to be soldered. This was useful in order to explore different sensors, but overall required a lot of assembly, including soldering. The overall time for assembly being of several hours (for the first round of assembly, approximately 8 hours per device), this added significantly to effort (and, ultimately, cost).  While we would have been able to improve these times for future rounds, the assembly with the SUR cables should only take minutes as no soldering is required. In other words, the connecting cables make the design more modular, while eliminating soldering.  This means that our new design, at least for the main components, can be assembled without soldering, just by using SUR cables

The next significant improvement is that there’s now a 2nd PCB – the ‘sensor PCB’. Previously, sensors were manually  soldered onto a breadboard-style PCB. Now, the ’sensor PCB’ (see below) includes various sensors on the PCB itself: a PDM MIC (sound/noise, labelled ‘Mic’, see top of PCB below), an AHT20 sensor (temperature, humidity, labelled ℃), and a BH1750 sensor (light, labelled Lx). The picture below shows the sensor PCB.

The PCB, also has dedicated slots for attaching a CO2 sensor (SCD40) and a sensor for volatile organic compounds (ENS160). A particulate matter sensors can be added via the I2C or UART (depending on the specific requirements for the particular matter sensor chosen); however, these particular matter sensors are larger, and would need to be mounted to the case. To attach these extra sensors, some soldering is needed (unless you use the Qwiic/STEMMA-QT connector). However, these sensors were not part of the original set of sensors; for now, we are still testing how many we would deploy in what scenarios. It was also difficult to procure the parts required; however, ultimately, these extra sensors will likely be part of a future version of the sensor PCB (assuming we can source the parts). 

The board also has switches: the ‘reset’ and ‘on’ switches (required for the Raspberry Pi Pico) have been placed on the sensor PCB. This provides convenient access to those functions from the top of the device. There are also three custom switches (labelled A, B, and C), that we will use to initiate various functions (such as an admin mode). There are also two LEDs to provide feedback to the user. Overall, while this only constitutes a very basic user interface, it does make operating the unit more user-friendly.

The sensor PCB, mounted ontop of the main PCB, looks like this:

For the sensor PCB, this isn’t the final version by any means, but it does already provide a lot of additional functionality and improvements in assembly that make our product more usable.

Another important change is that we have also removed the LoRa and display from the main board and (as with the sensor PCB) added SUR cable connections instead; those cables connect to breakout boards, which hold LoRa/sensors. LoRa and displays will not always be needed, and removing them from the main board saves space. The previous design with the Pico Inky Pack, using both sides of the PCB, was neat. While the new PCB could be used in the same way, we are going to take a different approach; to make better use of space, we are mounting the display on the side of the new enclosure. This should keep the unit smaller, enabling us to use a more compact enclosure. Through this new modular design, we aim for smaller boxes. The display is relatively large, and ideally, we would like to find a smaller, cheaper display. E.g., the Adafruit 1.54″ Tri-Color eInk is smaller, but not cheaper. Because of the cost, we might not use displays in the future, but connect a display only temporarily during setup and configuration.

Finally, we are considering changing the way the device is powered. We have used two AA batteries this far. However, we’ve experienced issues with battery imitations in Tanzania, which performed very poorly. Moreover, at least some schools where we work do have intermittent power. Another consideration is that we may wish to measure more intensively for certain periods of time, using up power more rapidly. We are therefore considering making a rechargeable version, by fitting the units with a LiPo charger (like the Primoroni Amigo Pro), and a lithium-ion battery.

With the LiPo charger, our full configuration looks as shown in the image below. However, as before, it’s also possible to use two AA batteries (or, connect Li-Ion or LiPo directly).

Finally, if you’re curious, the production cost for the main PCB is approximately $10. This is for a small production run of 5 units. For the sensor PCB the cost is approximately $20 – the sensor PCB has more components, and also requires double-sided assembly, increasing the costs. The cost for the sensor PCB ($20) should be compared to the cost for three dedicated breakouts (AHT20, PDM mic and BH1750), which would come to a slightly cheaper, but overall similar cost (around $15). Even for the smallest production run (5 units each), the sensor PCB costs the cost is almost competitive. (All costs calculated without shipping and without import duties / VAT.)

Finally, hot off the 3D printing press, here are some pictures of the first two sensors assembled in a case in Tanzania:

Attribution. Please cite this blogpost as: Haßler, B., & Bablok, B. (2024). Introducing the next iteration of our sensor box (Blog Post – Improving Learning Through Classroom Experience in East Africa 15). Open Development & Education. https://doi.org/10.53832/opendeved.1064

The PCBs are available at: https://github.com/bablokb/pcb-pico-datalogger. If you re-use the PCB pictures, please provide the same URL as image source.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.