Self-powered wireless ambient light sensor


Since some time, the window blinds in our home are automatically controlled. When the sun rises they go up, at sunset they are closed.

To determine the correct time for the blind commands, I’ve written a mix of Perl scripts. There exists a handy Perl module to calculate sunrise/sunset based on the date and your location on earth. After some fiddling with the parameters, I have a setup that works rather good. However, the Perl module does not take into account the weather. On bright and cloudless days, the blinds can stay open a bit longer. When we’re on the other hand experiencing our typical North Sea autumn weather, they can safely be closed a bit earlier.

Enter some electronics 😉

I needed a system that:

  • can be located where the ambient light can be measured without disturbance from home lighting
  • is maintenance free

So I built a circuit that is self-powered from a solar panel, that sends its data wirelessly to my home network, and that uses ultracaps for energy storage (no rechargeable batteries, thanks!)

The device is built into a water/weatherproof box, with the solar panel as only external component. The solar panel is used both as energy provider for the system, and as sensor of the ambient light level.

Before we get into the details, this is the end result:

wireless_light_sensor

System components

The system is built around the following components:

  • 1 x Small solar cell (Sparkfun)
  • 2 x Maxwell PC5-5 ultracapacitor
  • 1 x EasyRadio TX module
  • LM61 temperature sensor
  • PIC microcontroller

Circuit details

The schematic is designed in Eagle.

The solar panel both takes care of providing the system with power (with the ultracapacitor as energy store) and serves as the sensor of the system (the output voltage of the solar panel is an indication of the ambient light level).

The solar panel open-circuit output voltage under ideal conditions is around 5 V. To be on the safe side, a zener diode clips the output voltage to around 4.7V (I happened to have a beefy 4.7V zener in my junk box).

The Schottky diode between the solar panel and the rest of the circuit allows the panel voltage to float freely below the circuit VCC. This is required to be able to measure the panel voltage in the evening.

The 2 resistors divide the solar panel output by 2 so that this voltage can be safely connected to the controller.

Measurement strategy

I wanted to be able to measure both the solar panel output voltage and the system Vcc. This way, I can use the system to detect sunrise/sunset, and also to evaluate the ultracapacitor as an energy store.

Firstly, to be able to measure, we need a reference. To this purpose, a 2.5V voltage reference is added to the system. This reference is only switched on when required, to conserve power.

To measure the solar panel voltage, the reference is used as Vref+ for the internal ADC. Since the panel Vout is 5V max and this value is divided by two before is is presented to the ADC, this is OK.

To measure the system Vcc, the ADC is configured differently: the voltage reference is used as input to the ADC, while vref+ for the ADC is in this case Vcc. This allows measuring the VCC (which should be above 2.5V for the circuit to work correctly).

Result

This circuit is in active use since begin 2009 in our home.

The measurement results of the last 2 days are displayed in the figure below.

Additionaly, the output of this sensor node is used as input for the blind control circuitry. Blinds go up at sunrise and go down at sunset.

An overview of minimum, average and maximum system voltage, and of the temperature and the averag solar panel output voltage of the last year is displayed below.

Note that in the summer months, the minimum system voltage regularly drops below 2,5 V. I’m curious if this is due to a less optimal inclination of the solar panel, or due to the ultracaps (either reduction of the capacity or increased leakage due to higher ambient temperature). We’ll see how the systems behaves in autumn.

Resources

The system schematic and the firmware is available in my googlecode repository (SVN read acces at http://hasy.googlecode.com/svn/trunk/various/solarnode).

I have no PCB layout for this circuit, as I’m reusing a PCB from another project that is not open source.

Thanks to

  • IMEC, my employer, for sponsoring the hardware to build and test this circuit.
  • Steven Sanders, a former colleague, who designed the PCB.