# Calculate amplitude current (mA)
amplitude_current = (float)(sensor_value / 1024 * grove_vcc / 800 * 2000000)
# Calculate effective value (mA)
effective_value = amplitude_current / 1.414
# minimum_current = 1 / 1024 * grove_vcc / 800 * 2000000 / 1.414 = 8.6(mA)
# Only for sinusoidal alternating current
print "sensor_value", sensor_value
print "The amplitude of the current is", amplitude_current, "mA"
print "The effective value of the current is", effective_value, "mA"
time.sleep(1)
except IOError:
print "Error"
5. Run the demo.
sudo python grove_electricity_sensor.py
9
Need help?
Do you have a question about the Grove TA12-200 and is the answer not in the manual?