Hey i'm building something just wanted to make sure i understood the design .....
On J1, J2 and J3 the arduino will read the "voltage" once one of the junctions have a complete circuit? ( not that good of a design what happens if you hook up more than one junction?? )
is a 1k and a 220 r going to work as protection for the 0-5v pin?
This is the guys code
void setup()
{
Serial.begin(9600);
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.setCursor(0, 0);
lcd.print("RPS");
lcd.setCursor(0, 1);
lcd.print("-Circuit Digest");
delay(2000);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Voltage = ");
}
int voltage;
void loop()
{
int A1 = analogRead(A0);
voltage = map(A1,0,1024,0,22);
Serial.println(voltage);
lcd.setCursor(10,0);
lcd.print(voltage);
delay(1000);
}
it does not like int voltage; .... but thats not my issue what is my issue is
int analogPin = A3; // potentiometer wiper (middle terminal) connected to analog pin 3
// outside leads to ground and +5V
int val = 0; // variable to store the value read
void setup() {
Serial.begin(9600); // setup serial
}
void loop() {
val = analogRead(analogPin); // read the input pin
Serial.println(val); // debug value
}
this code works for 0-5 v ..... and turns it into 0 to 1023 ......
uhhh im getting confusing i think..... I, assuming that i would have to use some protection if i want to get larger than 5v say i wanna get to 20v .... I can assume that i also have to make up some code to account for the difference
Im new to the lcd stuff but i pick up things fast
Schematic 2 seems to be a better job ( cant seem to get it working right i only have a 1x16 lcd .... only tryed to get it to work once but thats beside the point....
Ok well i know i yammed on alot ...... but i think you know what im talking about....