MySensors Solar Powered Node – Part 3

There’s been a bit of gap since my last post. Two items have been particularly problematic. Firstly, accurately determining the battery voltage and secondly getting around the low power startup failure.

I got a bit sidetracked. I tried to use a Thyrsitor to switch current on/off to the MCP1703. This was triggered by the voltage from the Supercapacitor. This doesn’t work!

A Supercapacitor doesn’t behave like a battery. Once current is drawn, there is an immediate voltage drop. My Thyristor testing showed that this simply caused a on/off/on/off…. sequence to occur. As soon as the thyristor switched on the voltage dropped, the gate on the thyristor closed and power was cut. At low light levels the power from the solar panel just isn’t enough to stop the voltage from dropping.

I managed to get around the Thyristor problem by using the Arduino to determine when to draw power. More on this later on.

Getting the Maximum Solar Voltage

I want the supercapacitor to charge as quickly as possible. In order to do this the open supply voltage from the solar panel needs to be as close to 5.5v as possible. It occurred to me that the diode that I first chose was not very clever. It has a 0.7v voltage drop for most of the time. A 0.7v drop at low light levels is significant. It can be the difference between the circuit switching on or off.

I replaced the existing diode with a STMicroelectronics BAT43, Schottky Diode, 30V 200mA. This has a peak forward voltage drop of 450mV.

This will be obvious to a lot of fokes. Not to me!

Protecting the Supercapacitor

As the voltage drop with the above diode is now much smaller it is possible the solar voltage could rise above 5.5v. I used a zener diode to clamp the voltage across the Supercapacitor to 5.6v. This should be 5.5v but I couldn’t source a component. Zener diodes do nothing until the voltage rises above their rated value and then they start conducting (backwards…).

Low Voltage Start

This was a big, big problem. I’ve explained how my thyristor solution didn’t work. I went back to trying without the thyristor. It still didn’t work! As soon as there is enough power for the Arduino to start, the MySensors library switches on the radio and tries to ‘present’ the node. This is power hungry, too much current is drawn and the radio initiation fails. The MySensors library then goes into startup loop until the supercapacitor is dead.

I got around this by modifying my sketch. In the event that the start voltage is too low I power down the radio and then sleep. This works!

Here’s an example of the hackery I added to the MySensors before statement to power down the radio if the voltage isn’t high enough.

void before()
{ 
  analogReference(INTERNAL) ;
  
  for (;;) {  
   int sensorValue = analogRead(BATTERY_SENSE_PIN);
   sensorValue = analogRead(BATTERY_SENSE_PIN);
   float batteryPcnt = static_cast<float>(static_cast<int>(sensorValue*10.0 / 10.23))/10.0;
   int batteryV = static_cast<int> ( batteryPcnt*55);

   if (batteryV> ON_BATTERY_VOLTAGE) 
    break;
           
    transportInit();
    transportPowerDown();
    hwSleep(CHARGE_SLEEP_TIME);
   
    if (preHwInit) {
      preHwInit();
    }
    hwInit();
   }
}

Measuring Voltage using Arduino

Should be easy right? All we have to do is attach a voltage divider to one of the analogue pins. We know that the maximum input voltage should be 5.5v. all  we need to do is select the resistances so that the tax point is 1.1 volts. We’ll obviously use the Arduino internal reference as we can’t rely on the VCC voltage on the Arduino.

I’ve had some odd results. I chose R1 = 1.5M and R2 = 0.377M (47K + 330K). One of my test Arduinos works fine the other systematically reports lower than expected voltages at the tap point. I have no idea why.




No Comments


You can leave the first : )



Leave a Reply

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