Hello, i have spent hours on this problem over the past few days reading countless articles and came up with something, here is your original code that i altered...
#define LEM_LA_55_P A0
double current = 0;
int voltageinput_pin=A0;
int voltageinput;
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
delay(100);
lcd.begin(16, 2);
lcd.print(" Current =");
}
void loop() {
voltageinput=analogRead(voltageinput_pin);
lcd.setCursor(0, 1);
// print the number of primary current going through);LEM_LA_55_P:
lcd.print(voltageinput*0.0048828125/100);
lcd.print(" Amperes");
// put your main code here, to run repeatedly:
current = analogRead(LEM_LA_55_P) * 10.0 / 1023.0;
Serial.print(current);
Serial.println(" Amperes");
delay(1000);
}
- - - Updated - - -
here is my display at the moment
- - - Updated - - -
i havent tried it out, although i can tell you on your original serial coding i was getting whacky numbers, it was reading like.. 17 amps constant without any input, i tried to come out with an equation, i have voltageinput as analog pin 0, and the .0048828125 number i got from dividing 5volts(max input) / 1024 (2^10) and that / 100 because of the 100 ohm resistor.. i feel like this isnt going to work out, say i have 10 amps primary = 10 mA out x 100 ohms = 1 volt into A0, so it would be.. 1 volt x .0048828125 / 100 = ~.0000488281 ..... where the LCD to display 10 Amps