Voltage controller vith "Arduino Duemilanove"

Hi there, i need help! :)

i have one project where i need to make a voltage controller where arduino switch transistor on at 70 voltsd and switch off at 20 volts.

There is any posibility to do that and how?

If somebody can help with some script and help i will be more than happy :) :roll_eyes: :blush:

Have somebody any ideas? :drooling_face: :roll_eyes:

Sure. Make a voltage divider so that you analog pins see 1/20th of that, and no more than 5V total.

Then write code to read the analog inputs, and make a decison when the voltage is in the range you want.

//
// add the pin assignments, pinMode declarations, etc
//
void loop(){

if (analogRead(A0) >= 896) {
digitalWrite(transistorPin, HIGH);}

if (analogRead (A0) <= 256){
digitalWrite(transistorPin, LOW);}

}