I don't see a 200A model listed so I think it'a 5A model with a scale that goes from 0 to 200A
So I just need another sensor, for example the ACS712 5A and a code like that:
const int analogInputPin = A0;
float voltage = 5.0;
float sensitivity = 0.185;
void setup() {
Serial.begin(9600);
}
void loop() {
int sensorValue = analogRead(analogInputPin);
float current = (sensorValue - 512) / 1024.0 * voltage / sensitivity;
Serial.print(current, 2);
Serial.println(" A");
delay(1000);
}
and it should work?
If the maximum current is actually 5A, then the ACS712 will work but that code will not.
I have a link to code that will work.
Install this library, there are plenty of examples
Thank you very much!!!
I modified one of the example programs for the 5A model
//
// FILE: ACS712_20_AC_average.ino
// PURPOSE: demo AC measurement with point to point + averaging
#include "ACS712.h"
// Arduino UNO has 5.0 volt with a max ADC value of 1023 steps
// ACS712 5A uses 185 mV per A
// ACS712 20A uses 100 mV per A
// ACS712 30A uses 66 mV per A
float frequency = 50.0; // 50Hz line frequency
ACS712 ACS(A0, 5.0, 1023, 185);
void setup()
{
Serial.begin(9600);
ACS.autoMidPoint();
Serial.print("MidPoint: ");
Serial.println(ACS.getMidPoint());
Serial.print("Noise mV: ");
Serial.println(ACS.getNoisemV());
}
void loop()
{
float average = 0;
uint32_t start = millis();
for (int i = 0; i < 100; i++)
{
// select sppropriate function
average += ACS.mA_AC_sampling(frequency, 1);
// average += ACS.mA_AC();
}
float mA = average / 100.0;
uint32_t duration = millis() - start;
Serial.print("Time: ");
Serial.print(duration);
Serial.print(" mA: ");
Serial.println(mA);
delay(3000);
}
Tank you very much!!! you helped me a lot!!!
Hi,
Please note when measuring the voltage from the current transformer, make sure the ammeter or the ACS758 is connected in circuit.
If you do not have a load, then the current transformer becomes a voltage transformer operating into a high impedance.
So if the current transformer has 20 turns on it, with one turn of the primary going through it, the voltage output, open circuit will be 20 times the primary voltage.
This can be very dangerous.
So do all your oscilloscope and DMM voltage measurements with a burden resistor of some sort, either the ammeter that is already in circuit or the ACS758 or a fixed resistor.
Google;
current transformers and burden resistors
Tom..
thank you didnt know that!! very important to know!
@el_cves
When you try it with the ACS712 and the ACS712 library report back and let us know how it worked.
Have a nice day!
I have tried it and it worked! :))
While the motor is starting the ACS712 goes up to 5200mah, do you think that could damage the sensor?
thank you very much!!
It's only 200mA higher and for short periods that's OK but remember the current reading are only accurate for the +/- 5000mA range
Glad you got it to work
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.