sonoff wifi / analog input

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
data
Normal user
Posts: 93
Joined: 10 Dec 2016, 11:26

sonoff wifi / analog input

#1 Post by data » 01 May 2017, 23:48

Hardware: Sonoff WIFI (without 433MHz module)
Software: ESP Easy Version v2.0.0-dev7

I have configured a device as 'Analog Input' and it gives me readings between 31 and 38 throughout the day.
Since the device is supposed to run on 3.3V, my guess is, that this is Vcc * 10? As the device is in use, I can not
check if there is anything wired to pin A0. According to the official schematics, the pin is not connected?!

Just in case someone on here has also installed v2 on this hardware, please create an 'Analog Input' device
and let me know what - if any - your acquired values are.

Tnx,

data

I have been feeding [%value%/10] to domoticz:
Attachments
sonoff-Wifi-Analog_Input-Vcc.jpeg
sonoff-Wifi-Analog_Input-Vcc.jpeg (37.76 KiB) Viewed 12082 times

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: sonoff wifi / analog input

#2 Post by toffel969 » 02 May 2017, 21:16

data wrote: 01 May 2017, 23:48 Hardware: Sonoff WIFI (without 433MHz module)
Software: ESP Easy Version v2.0.0-dev7

I have configured a device as 'Analog Input' and it gives me readings between 31 and 38 throughout the day.
Since the device is supposed to run on 3.3V, my guess is, that this is Vcc * 10? As the device is in use, I can not
check if there is anything wired to pin A0. According to the official schematics, the pin is not connected?!

Just in case someone on here has also installed v2 on this hardware, please create an 'Analog Input' device
and let me know what - if any - your acquired values are.

Tnx,

data

I have been feeding [%value%/10] to domoticz:
Yes, I pin is floating, you are not measuring an sensor but EM noise. If you need to measure analog with sonoff you need to use i2c analog expander
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

data
Normal user
Posts: 93
Joined: 10 Dec 2016, 11:26

Re: sonoff wifi / analog input

#3 Post by data » 02 May 2017, 22:04

So, this means it is 'receiving' approx. 0.1V noise?!

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: sonoff wifi / analog input

#4 Post by toffel969 » 02 May 2017, 22:41

data wrote: 02 May 2017, 22:04 So, this means it is 'receiving' approx. 0.1V noise?!
Yes, the pin is definitely not connected, I opened it. There are no traces going to the a0 of esp chip. If you need analog on sonoff u need to be either be a soldering guru (soldering to chip) or use the i2c analog expander (see wiki). You can switch off serial and use rx tx pins (gpio 1+3) a i2c ports
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: sonoff wifi / analog input

#5 Post by toffel969 » 02 May 2017, 22:44

data wrote: 02 May 2017, 22:04 So, this means it is 'receiving' approx. 0.1V noise?!
No according to your post it is rather 0.05v as a0 of esp is 0-1V only. Wemos and nodemcu have voltage deviders to reduce 3.3v to 1v
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

data
Normal user
Posts: 93
Joined: 10 Dec 2016, 11:26

Re: sonoff wifi / analog input

#6 Post by data » 02 May 2017, 23:24

Thank you, I know how to use i2c.
I was just curious since I got values > 0 on the sonoff.

User avatar
costo
Normal user
Posts: 500
Joined: 21 Nov 2015, 15:03
Location: NL, zw-NB

Re: sonoff wifi / analog input

#7 Post by costo » 03 May 2017, 16:06

data wrote: 02 May 2017, 23:24 Thank you, I know how to use i2c.
I was just curious since I got values > 0 on the sonoff.
If you want to use the ADC of a Sonoff switch you have to modify the source and compile it yourself.
Look for this line in the main program module:
#define FEATURE_ADC_VCC false
and change false to true.

That wil enable the internal connection so you can measure Vcc of the ESP.
Device is of type System Info and Indicator is Input Vcc.

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: sonoff wifi / analog input

#8 Post by toffel969 » 03 May 2017, 16:49

costo wrote: 03 May 2017, 16:06
data wrote: 02 May 2017, 23:24 Thank you, I know how to use i2c.
I was just curious since I got values > 0 on the sonoff.
If you want to use the ADC of a Sonoff switch you have to modify the source and compile it yourself.
Look for this line in the main program module:
#define FEATURE_ADC_VCC false
and change false to true.

That wil enable the internal connection so you can measure Vcc of the ESP.
Device is of type System Info and Indicator is Input Vcc.
Just an addition, you can then only use ADC to monitor Vcc. You still can NOT connect an external Analog device
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests