Environmental measurement - solar-powered Pi/Arduino/etc.

Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Locked
User avatar
bjohas
 
Posts: 27
Joined: Sun Nov 30, 2014 7:58 am

Environmental measurement - solar-powered Pi/Arduino/etc.

Post by bjohas »

Hello all,

We're hoping to improve the classroom environment in Tanzanian schools. As you can imagine, classrooms can get very hot. We first want to measure to assess the situation; then we'll see how this can be improved.

We'll need to measure over a period of time, with measurements being transmitted back via the internet to a server. As electricity isn't readily available, we'll need a solar-powered unit. The Pi Hut has PiJuice for Raspberry Pi, which is exactly what we need: A solar-powered battery backup / UPS; however, it's no longer available.

The specifications are:
- Enough power to drive a Raspberry Pi Zero (we'll try for a lower power device as well, but we're not sure how difficult integration e.g. with sensors and gsm will be) which will have a gsm unit attached for internet/sms
- Solar power input
- Battery (solar power needs to be able to charge battery while battery supplied power to Pi)
- Safe shutdown when battery is low; startup when battery has reasonable charge

What would you recommend?

I've looked at the PowerBoost 1000 Charger - it's not available from Adafruit, but there is some stock elsewhere. It does fit the bill, but it's not clear that it could power down a device when power is low (and then start it again).

Many thanks for your insights!

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Environmental measurement - solar-powered Pi/Arduino/etc.

Post by adafruit_support_mike »

A RasPi can run from battery power, but doesn't know how to shut down gracefully when the battery runs low.

There is a software utility that watches a GPIO pin and does a graceful shutdown when the pin is pulled low:

https://github.com/adafruit/Adafruit-GPIO-Halt

and it's easy to add a small microcontroller that watches the battery and tells the RasPi when to shut down. A Trinket M0 or a QT Py could handle the job easily:

https://www.adafruit.com/product/3500
https://www.adafruit.com/product/4600

Having said that, you may find it easier to build data collection units using a microcontroller that writes information to an SD card.. even if it also has a radio/Wifi/GSM connection, a backup copy is always handy.

Our Adalogger boards were designed for that kind of job:

https://www.adafruit.com/product/2795
https://www.adafruit.com/product/2796

In general, microcontrollers are easier to connect to sensors than a RasPi.. they give you more direct control of the hardware, which is useful when using signal protocols like I2C or SPI. We've worked to make things even easier with our STEMMA boards, which bring I2C connections close to the plug-and-play level of simplicity.

Microcontrollers also use much less power than a RasPi: 11mA for an Adalogger versus 150mA for a RasPi Zero, or close to 1A for a Pi4. The same solar powered battery will last much longer with a microcontroller.

We also have solar battery chargers and battery state-of-charge monitors to help on that end:

https://www.adafruit.com/product/4755
https://www.adafruit.com/product/390
https://www.adafruit.com/product/5580

The Adaloggers can run directly from a 3.7V LiPo, which eliminates the need for a boost circuit like the PowerBoost.

To get even more life out of your battery, we also have the TCL5110 low-power timer:

https://www.adafruit.com/product/3435

It controls power to a load like a microcontroller, waking up periodically and connecting power, then disconnecting power and going to sleep again. When sleeping, it uses less than 100nA, or about 1mAh of battery power per year.

The wake-up interval can be set by the potentiometer on the board, and ranges from 100ms to about 2 hours. Left to itself the TLC5110 will stay awake until 50ms before the next wake-up time, sleep for 50ms, then wake up again. It has a DONE pin that can tell it to sleep immediately, at any point in its waking period though.

The idea is that the TCL5110 can start up a microcontroller, the microcontroller can do its job, and then the microcontroller can toggle the TCL5110's DONE pin when its work is finished. That way the TCL5110 can wake up every 10 minutes or so, but the microcontroller will only use power for a few seconds.

User avatar
bjohas
 
Posts: 27
Joined: Sun Nov 30, 2014 7:58 am

Re: Environmental measurement - solar-powered Pi/Arduino/etc.

Post by bjohas »

Thank you - that's amazing!

I should have maybe added the following info. Basically, we're thinking of a sensor/base station layout like this:
sensors.jpg
sensors.jpg (57.74 KiB) Viewed 148 times
I.e., several sensors (8 shown, but could be up to say 20) plus one base station. For sensors, subject to testing accuracy, we were thinking of using RF-based home automation sensors. E.g. zigbee sensors are readily available off the shelf, measure all we need, and cost about $10-20 a sensor. Battery life is typically 2 years. I.e., even if (e.g.) the temperature is not super-accurate, that will be hard to beat in terms of ease of deployment. Part of the project is to shoot for replicability at various scales; we are therefore avoiding industrial sensors (which e.g. are used in server rooms etc). Of course, we don't know how often zigbee sensors will disconnect from the base station, etc etc, but if we build our own electronics, we may run into similar problems.

However, we have looked at the Adafruit range (as well as some of the Pimoroni integrations). However, I should also add that, while we have some basic electronics skills, we are not electronics engineers, but education researchers. Ultimately, the goal is to determine how learning outcomes vary with environmental conditions. In temperate regions, previous research has established a clear relationship: Everybody has a different thermal comfort zone, but everybody also learns better at the bottom end of that zone. We suspect that this will be similar in hotter regions, but no research exists. Anyway - given that we're education researchers, going for a zigbee-based system seems to have some advantages. (Happy to be convinced otherwise!)

If we use zigbee, we do need a 'base station'. The above requirements were for the base station, rather than each sensor. The base station could/should turn off during the night, but needs to be on during daytime (to read sensor data). As we are looking at schools, which are only used while there's daylight, that's not a problem. Also, we do not need 100% continuous measurements. If we miss the occasional day, that's not great, but ultimately, not a problem either. We also figure that in Tanzania, we'll have enough sun (even during rainy seasons).

So the plan would be to get enough power to drive a Raspberry Pi Zero. We can use something lower power, but it needs to be able to run a zigbee hub, have an sd card for logging, and needs to a gsm unit attached for internet/sms. To power it, as above: Solar power input, battery (solar power needs to be able to charge battery while battery supplied power to Pi), safe shutdown when battery is low; startup when battery has reasonable charge.

Hope this provides some more context. Does that modify your suggestions?

(PS - our inception report, outlining the programme of work over the next year or so, will be available in about 2 weeks.)

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Environmental measurement - solar-powered Pi/Arduino/etc.

Post by adafruit_support_mike »

The Zigbee platform is well known and supported, making it a good choice as long as you have a reliable off-the-shelf supply for the devices.

There are USB interfaces for Zigbee devices, meaning your base station would need another Zigbee device but wouldn't need its own Wifi interface. That's good because standard Wifi is kind of power hungry.

A RasPi zero would be a reasonable choice for the base station data collection device, if you could get one. Unfortunately, as of 1 Jan 2023, you probably can't.

The global supply chain mess and chip shortage have hit the RasPi Foundation hard enough that they can't produce boards in the volume they (and the market) want.

That means two things. First, there are scalpers who'll try to corner the market by buying out any seller's supply, creating an artificial shortage. Then they'll turn around and sell the same boards through other channels at a 500% markup. We deal with that by imposing a limit of one board per customer for a given time period (which I won't disclose because that makes it easier for scalpers to game the system). Second, even with those limits, there are enough legitimate buyers to clear the shelves almost immediately. From reports I've seen in the forums, our last shipment of RasPis sold out in less than 30 minutes.

The RasPi Foundation has defined 2023 as a recovery year: instead of bringing out new models, they'll focus on their supply chain and try to get production up to the level of demand. They're good at what they do, but aren't guaranteed to succeed even if there are no more surprises in the next 12 months.

Because of all that, any plan that includes a 'buying a RasPi' will probably fail right now.

At minimum, it would be a good idea to have an alternative to the RasPi in mind.

An Adalogger could be a minimal replacement for the RasPi. Zigbee devices have Serial interfaces, and can talk to a microcontroller that way. The Adalogger can then write data to an SD card as a simple text file that you'll be able to use with any computer.

Locked
Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.

Return to “Internet of Things: Adafruit IO and Wippersnapper”