Battery powered weather station with solar charging

Several months ago, I want to have a weather station in my backyard. It should be battery powered and recharged with solar cells. The sensors data should be sent over Wifi to a Raspberry Pi server for collecting and displaying graphs on a simple web page.

I started with some Arduino boards and Wifi shields/adapters. The frustration level was high, because all combinations of boards/wifi had some project killing drawbacks like power consuming, brownout issues, PCB design complexity. Fortunately, I remembered that I backed the spark.core at kickstarter and I gave this device a try.

The learning curve was steep and during my project, I realised that spark continuously enhanced the performance and functionality. Still any Problems? The forum is a real live saver.

The weather station uses a few sensor boards from Adafruit and Sparkfun. The temperature / humidity sensor is a DHT22. Solar panel voltage and charging current is measured with sensor INA219. Barometric pressure data come from BMP085 sensor. Brightness and color data comes from TCS34735. I was surprised that all libraries for these sensor are available in the Libraries section of the Spark IDE. A first test was up and running in just a few minutes. Most sensors uses I2C except the RHT22 which has its own protocol.

In normal mode, the device awakes from deep_sleep, get data from sensor, send data to Raspberry Pi and then goes sleeping again. To flash new software to the core, it should not go to sleep again. For flashing new software the Raspberry Pi responses with char (I manually edit the data.php file). If the core receive any response containing char , the core does not sleep for the next waiting period.

Today, the code now checks power situation and does a long deep_sleep if the battery is at very low voltage. If the solar panel charges the battery and the voltage gets too high, the core does not sleep and help to minimize overcharging.

If there is any interest in code, just ask me.

Technical data:

Spark.Core:   UL version
Batteries:    4 x NiCad 4000 mAh, industrial type
Solar panel:  4 x 2V Panels ~350mA
Sensors:      DHT22:    Temperature / Humidity
              BMP085:   Air pressure
              TCS34735: Light sensor => intensity, RGB data
              INA219:   Voltage of battery, charging load from solar panels



Wow that’s super sleek stuff! :slight_smile:

Some more photos

Milling the holder for the solar cells

3D printed base

3D printed vent caps

wooden housing

bottom side of the PCB (find the unsoldered pin :wink: )


Very cool, thanks for sharing! :slight_smile:


Awesome project and looks really cool.

Could you please explain a little bit more about the batteries and how you charge them with solar cells, I mean the circuitry and the considerations around it? I couldn’t find any information on the INU219 on the internet.

Best Regards

Hi Carlos,

It has 4 serial connected solar cells protected with diodes, when not all cells are equaly illuminated.
The power passes another schottky diode to prevent backward current and discharge of the battery. As you can see there is no charging circuit. This is not necessary here.

A solar cell has a so called MPP (maximum power point). This is about 85% of the free running voltage the cell produce. More explanation can be found here

My calculation:
Solar cells 4 x 2V (free running voltage)
Battery is a 4Ah industrial type NiCd
Schottky diode 3A / 0.4V

4 x 2V = 8V => MPP = 85% => 6.8V
Protecting schottky diode = 6.8V - 0.4V = 6.4V

The maximum solar cell current is ~350mA which is about 0.1C for this type of battery. The datasheet recommends for 0.1C a max.charging time of 14-16h. Because 350mA is never available during the whole day, no charging circuit is needed. The software disables sleeping when the battery exceeds 6V

The board is powered with this Pololu Step-Up/Step-down Voltage controller


Sorry, INU219 has a typo. The correct name is INA219 and is made by adafruit

Voltage curve (today)

Current curve (today)


In case of interest. The software can be found here

1 Like