Newbie solar flap project...

I need guidance in controlling a flap on a home built solar furnace. I want to have the Arduino control the TowerPro SG 5010 servo to open the flap when there is 12v present (the fan kicks on via thermostat hooked up to a solar cell) but the tricky part is I want it to close when 12v is not present. All of the mechanical work (on the flap) is up and ready to go... Any help or guidance would be mucho appreciated! Obviously I need an outside power source to close it when the fan kicks off... right now it just opens and I have to close it by hand!

wildatnite:
I need guidance in controlling a flap on a home built solar furnace. I want to have the Arduino control the TowerPro SG 5010 servo to open the flap when there is 12v present (the fan kicks on via thermostat hooked up to a solar cell) but the tricky part is I want it to close when 12v is not present. All of the mechanical work (on the flap) is up and ready to go... Any help or guidance would be mucho appreciated! Obviously I need an outside power source to close it when the fan kicks off... right now it just opens and I have to close it by hand!

Does the 12 volts come from the solar cell? If so, why not use a small lead/acid battery, charged up by the solar cell, to run the flap controller when there is no solar power?

Maybe even an ultra-cap: http://www.maxwell.com/products/ultracapacitors/products/16v-small-modules

....would work (although it will cost a LOT more than a lead/acid battery).

Hope this helps.

As of now, yes, the power is provided when the thermostat kicks in. But I am mostly worried about the programming the Arduino to reverse the servo when 12v isn't present. I have a 9v DC dart board right next to it I can tap into for a power supply to open and close it...

It is not clear from your description whether your problem is how to have energy available to move the servo "when 12v is not present" or whether you want the absence of 12v to be a trigger that causes the Arduino to move the servo (or both)?

The lead-acid battery suggestion from @Krupski is the best solution if energy is the problem.

If you need to detect the absence of 12v you could feed the battery through a diode so that the battery can't back-feed into the solar panel. Then you can compare the battery voltage with the solar panel voltage.

...R

wildatnite:
As of now, yes, the power is provided when the thermostat kicks in. But I am mostly worried about the programming the Arduino to reverse the servo when 12v isn't present. I have a 9v DC dart board right next to it I can tap into for a power supply to open and close it...

Well, as you probably know, you need a diode between the solar cell and the battery to prevent reverse current flow (i.e. battery -> solar cell).

So, when there is light, there will be approximately 12.7 volts on the solar cell side of the diode and approximately 12.0 volts on the battery side.

When there is no light (or the light falls below a certain value), the solar cell side of the diode will have a lot less than 12 volts on it while the battery will still have 12 volts or more on it. Therefore, monitor the solar cell side.

So, simply make a resistor voltage divider to convert "maximum voltage you expect from the solar cell" into a maximum of 5 volts.

For example, a 2200 ohm resistor in series with a 1000 ohm resistor will give you 5 volts out when you have 16 volts input.

SOLAR CELL-----//[2.2K]//-----TO ARDUINO-----//[1K]//------GND

Then connect the 0-5 output from the resistor divider to an Arduino analog input pin.

Your code can read the analog value and reverse the motor whenever the solar cell output drops below the setpoint you choose.

Make sense?

Robin2:
It is not clear from your description whether your problem is how to have energy available to move the servo "when 12v is not present" or whether you want the absence of 12v to be a trigger that causes the Arduino to move the servo (or both)?

The lead-acid battery suggestion from @Krupski is the best solution if energy is the problem.

If you need to detect the absence of 12v you could feed the battery through a diode so that the battery can't back-feed into the solar panel. Then you can compare the battery voltage with the solar panel voltage.

...R

Correct. And he NEEDS a diode anyway... for exactly the reason you stated.

Krupski:

wildatnite:
As of now, yes, the power is provided when the thermostat kicks in. But I am mostly worried about the programming the Arduino to reverse the servo when 12v isn't present. I have a 9v DC dart board right next to it I can tap into for a power supply to open and close it...

Well, as you probably know, you need a diode between the solar cell and the battery to prevent reverse current flow (i.e. battery -> solar cell).

So, when there is light, there will be approximately 12.7 volts on the solar cell side of the diode and approximately 12.0 volts on the battery side.

When there is no light (or the light falls below a certain value), the solar cell side of the diode will have a lot less than 12 volts on it while the battery will still have 12 volts or more on it. Therefore, monitor the solar cell side.

So, simply make a resistor voltage divider to convert "maximum voltage you expect from the solar cell" into a maximum of 5 volts.

For example, a 2200 ohm resistor in series with a 1000 ohm resistor will give you 5 volts out when you have 16 volts input.

SOLAR CELL-----//[2.2K]//-----TO ARDUINO-----//[1K]//------GND

Then connect the 0-5 output from the resistor divider to an Arduino analog input pin.

Your code can read the analog value and reverse the motor whenever the solar cell output drops below the setpoint you choose.

Make sense?

Ok, this is getting closer to what I am after!!... thanx. There is a diode built into the solar cell. When I said I was a newbie with Arduino, I mean I haven't had any programming since a Basic class (I hated) in 1980. lol I think I can copy the code from a video on Youtube to control the servo to open the flap.. I don't know where to look to reverse it in the absence of 12 volts, is my main point...

wildatnite:
I don’t know where to look to reverse it in the absence of 12 volts, is my main point…

Something like this pseudo code

batteryVolts = analogRead(battVoltPin);
solarVolts = analogRead(solarVoltPin);

if (batteryVolts > solarVolts) {
   flapServo.write(100);
}
else {
  flapServo.write(20);
}

Just remember that you need voltage dividers to ensure the battery and solar voltages reaching the Arduino analog pins are divided to a suitable level - below 5 volts.

…R

Robin2:

wildatnite:
I don't know where to look to reverse it in the absence of 12 volts, is my main point...

Something like this pseudo code

batteryVolts = analogRead(battVoltPin);

solarVolts = analogRead(solarVoltPin);

if (batteryVolts > solarVolts) {
   flapServo.write(100);
}
else {
  flapServo.write(20);
}




Just remember that you need voltage dividers to ensure the battery and solar voltages reaching the Arduino analog pins are divided to a suitable level - below 5 volts.

...R

Now this looks great! thanx!