Go Down

Topic: Voltage controller vith "Arduino Duemilanove" (Read 1 time) previous topic - next topic

cosmoLV

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 :)  :smiley-roll-blue: :smiley-red:


CrossRoads

Sure. Make a voltage divider so that you analog pins see 1/20th of that, and no more than 5V total.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

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

Code: [Select]

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

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

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

}
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up