saobpc2:
hi ,
can you give me the code for the program AC712 current sensor?
I create this program but it still shows always in monitor serial =1023
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(A0);
Serial.println(sensorValue);
delay (1000);
}
saobpc2:
hi ,
can you give me the code for the program AC712 current sensor?
I create this program but it still shows always in monitor serial =1023
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(A0);
Serial.println(sensorValue);
delay (1000);
}
Did What is the current rating of the sensor, this should be on the data sheet
saobpc2:
hi ,
can you give me the code for the program AC712 current sensor?
I create this program but it still shows always in monitor serial =1023
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(A0);
Serial.println(sensorValue);
delay (1000);
}
Did you define the pin as analog.??
I have some test code to read a similar sensor but it does not use 'analogRead()',
it uses :#define AMPS 1
:(read_adc(AMPS)
You also have to scale the output to get the actual current, the info should be on the sensor sheet, depends on the current rating of the sensor.