improvise current sensor

can some one help for improvise current sensor that can attach to arduino. thank you in advance.

For the mains AC voltage ? Or to measure the current for something that runs at 5V ? There are shunt resistors, hall-effect current sensors, and current transformers. Do you want a very accurate value, or just an indication of the current ?

the indication only.:)

Please tell what kind of what device you want to measure the current. Tell us about your project.


That is AC current, you have to take a number of samples and calculate what the actual current is (the RMS value of the current).

The ACS712 sensor modules can be unsafe.

A current transformer is safe. It is sometimes called a 'CT'.

The OpenEnergyMonitor website has a lot of explanation, start here :

Perhaps this is easier to understand : It measures the current during some time, and finds the peak values, and with the peak values the actual (RMS) current is calculated. It measures the current in one direction and it does not protect A0 for a high peak, I would add a resistor between the output of the module and A0.

help me for this…this sensor didnt read current -.-

float val=0;
void setup()
void loop
val = analogRead(A0);

this code display 300.00 something when the lights on same as lights off -.-

Do you know that the mains voltage is a AC voltage ? Did you read the links in my Reply #5 ? Did you understand it ?

You have to tell us what you have and what you are doing. It should be as we almost look over your shoulder. Tell us which sensor you have (or which sensor module), and perhaps you can make a photo of the wiring.

post the make and model of your sensor post a link to the data sheet for it.

read how to use this forum, it is a sticky post on top of every forum. read item #7 carefully.