-->
Page 2 of 3

Re: ADC read issues

PostPosted: Fri Nov 13, 2015 7:10 am
by DAFlippers
You have a potentiometer ratio of:

4.7/(1000+4.7) = 0.004678.. with 220v AC the voltage feeding into the ESP8266 is -220*1.414*0.004678 to +220*1.414*0.004678v. That is -1.455 to +1.455v.

As others have said, you also have no isolation of the mains power.

This means you are very likely to take both the ESP8266 and yourself out of the gene pool.

If you are trying to determine the fan speed then why not use a proximity detector and mount the circuit on the ceiling so you can detect the fan blades passing the detector?

David

Re: ADC read issues

PostPosted: Fri Nov 13, 2015 10:55 am
by Ashutosh choudhary
Each and every reply provided me with some additional knowledge.
So thanks a lot everyone for the support.

I think I will try out ACS 712 current sensor posted by trackerj, as I want my project to be as small as possible any also want everything on the same board, so I guess that will be better :)

Re: ADC read issues

PostPosted: Fri Nov 13, 2015 12:09 pm
by vikingfr
Hi,

you can't sense AC voltage with DC pin !
AC mean no ground, and sine signal.
What you want is peek to peek voltage. You need more than resistors to get AC voltage.
First you need AC/AC converter to reduce voltage 220 to 1V. Then you need diode bridge and capacitors to convert AC to DC.
Search on ebay "single phase voltage sensor". It cost less than 4$ ("chipworld" is a good seller for this), it's easy to use and most important, it's safer (if you don't touch AC pins) !

Plug it to AC and using multimeter, adjust the output to 0-1V. Then connect to your ESP.

And ACS712 is current sensor, not voltage sensor.

(sorry if bad english, not my natural language)

Re: ADC read issues

PostPosted: Fri Nov 13, 2015 4:05 pm
by trackerj
vikingfr wrote:Hi,

you can't sense AC voltage with DC pin !
AC mean no ground, and sine signal.
What you want is peek to peek voltage. You need more than resistors to get AC voltage.
First you need AC/AC converter to reduce voltage 220 to 1V. Then you need diode bridge and capacitors to convert AC to DC.
Search on ebay "single phase voltage sensor". It cost less than 4$ ("chipworld" is a good seller for this), it's easy to use and most important, it's safer (if you don't touch AC pins) !

Plug it to AC and using multimeter, adjust the output to 0-1V. Then connect to your ESP.

And ACS712 is current sensor, not voltage sensor.

(sorry if bad english, not my natural language)


The safest and most foolproof way to measure MAINS AC Voltage will be with a transformer with a known turns ratio and a RMS to DC converter chip.

A little bit of reading some basics of RMS might help: https://en.wikipedia.org/wiki/Root_mean_square

But I still think that for that Fan unit he needs to read the Current, not the Voltage.

And of course, if he wants Power consumption calculations, both of them, I and U. In this case, I remember a good hint from such a MAINS power monitor designed a while ago: HCPL-7520 (linear optoisolator).