Modding external I2C to SONOFF S20
Moderators: grovkillen, Stuntteam, TD-er
Modding external I2C to SONOFF S20
Hi,
playing around with the SONOFF S20 I wanted to access I2C on this device. Flashing the S20 with espeasy is a known procedure and widely documented. Ih you disable the serial port of the device in Advanced Settings, you will have access to GPIO 1 and GPIO 3 of the built in ESP. But:
To access the GPIO-ports 1 and 3 you have to open the case of the S20. For me thats not my preferred method of adding devices to my boards. So I modified the case to fit in a Molex plug as a power source 3.3V and a Dupont plug as SDA/SCL port.
I placed the hole in the lower part of the case right above the PCB and glued the plugs with epoxy for stability.
I used these components for the plugs:
The wiring inside looks like this (be sure to loop the cables to avoid contact with the switch of the upper case part):
How the mounted case looks from outside:
I2C cable with BMP280 attached:
The plugs are held by a shrink tube:
playing around with the SONOFF S20 I wanted to access I2C on this device. Flashing the S20 with espeasy is a known procedure and widely documented. Ih you disable the serial port of the device in Advanced Settings, you will have access to GPIO 1 and GPIO 3 of the built in ESP. But:
To access the GPIO-ports 1 and 3 you have to open the case of the S20. For me thats not my preferred method of adding devices to my boards. So I modified the case to fit in a Molex plug as a power source 3.3V and a Dupont plug as SDA/SCL port.
I placed the hole in the lower part of the case right above the PCB and glued the plugs with epoxy for stability.
I used these components for the plugs:
The wiring inside looks like this (be sure to loop the cables to avoid contact with the switch of the upper case part):
How the mounted case looks from outside:
I2C cable with BMP280 attached:
The plugs are held by a shrink tube:
Last edited by Wiki on 13 Oct 2018, 16:14, edited 1 time in total.
Code: Select all
pi@raspberrypi:~ $ man woman
No manual entry for woman
pi@raspberrypi:~ $
Re: Modding external I2C to SONOFF S29
My next action will be the construction of a 3D-printed 90° plug housing.
Code: Select all
pi@raspberrypi:~ $ man woman
No manual entry for woman
pi@raspberrypi:~ $
Re: Modding external I2C to SONOFF S20
Have you made sure that none of these are connected to mains when the S20 is powered on? Think I've read that there's no insulation between LIVE and 3.3V/GND
Re: Modding external I2C to SONOFF S20
Hi,
the four pins onboard the S20 are directly connected to the ESP8266. So if there would be any connection to LIVE the ESP has to be able to run by 230V - sounds new to me.
So I think, there is no connection. But NEVER OPEN THE CASE IF THE S20 IS CONNECTED TO LIVE. But: I will not be responsible for any harm, following my post. Do it on your own risk and do it only, if you know, what you are doing.
the four pins onboard the S20 are directly connected to the ESP8266. So if there would be any connection to LIVE the ESP has to be able to run by 230V - sounds new to me.
So I think, there is no connection. But NEVER OPEN THE CASE IF THE S20 IS CONNECTED TO LIVE. But: I will not be responsible for any harm, following my post. Do it on your own risk and do it only, if you know, what you are doing.
Code: Select all
pi@raspberrypi:~ $ man woman
No manual entry for woman
pi@raspberrypi:~ $
Re: Modding external I2C to SONOFF S20
It is still very well possible the pins are not isolated from the mains.
The ESP8266 is normally not connected to anything accessible to users. But that doesn't mean the "GND" of the ESP is isolated from the mains.
So indeed be warned about the possible dangers when touching these pins with your hands.
Please test with a voltage finder or test with your multimeter if there is an electrical connection between GND of the low voltage part and one of the mains pins.
The ESP8266 is normally not connected to anything accessible to users. But that doesn't mean the "GND" of the ESP is isolated from the mains.
So indeed be warned about the possible dangers when touching these pins with your hands.
Please test with a voltage finder or test with your multimeter if there is an electrical connection between GND of the low voltage part and one of the mains pins.
Re: Modding external I2C to SONOFF S20
At first, @both: thank you for your hints. You are right, messing around with 230V is not a game.
I checked with my multimeter and there is no electrical connection between the mains and the pins.
Does anyone have a source where these concerns are coming from? I would be really interested. I could imagine, that in the past someone has tested a noninsulated low voltage version of the S20. The revision of my board is 1.3. That means that there were other revisions before.
If there are serious concerns about the safety of this mod this thread should be deleted before someone gets harmed.
I checked with my multimeter and there is no electrical connection between the mains and the pins.
Does anyone have a source where these concerns are coming from? I would be really interested. I could imagine, that in the past someone has tested a noninsulated low voltage version of the S20. The revision of my board is 1.3. That means that there were other revisions before.
If there are serious concerns about the safety of this mod this thread should be deleted before someone gets harmed.
Code: Select all
pi@raspberrypi:~ $ man woman
No manual entry for woman
pi@raspberrypi:~ $
Re: Modding external I2C to SONOFF S20
I can't remember if it was Tinkerman or if it was noted on the Tasmota / Espurna websites. As you state, it might have been an early version. But good that it's no longer the case
Re: Modding external I2C to SONOFF S20
The device on the picture red surrounded, the transformer, is the device for galvanically seperating high and low voltage circuits as it does in every charging device for smartphones e.a. So from the moment of opening the case it was a standard switching power supply for me and therefore a "safe" low voltage circuit. May be I should spend a little bit more time to avoid this routine and ask at first my multimeter if my instinct is working correctly. Could be the healthy way. Nevertheless, thanks again for the hints.
Once again: Follow this idea at yout own risc and only if you know, what you are doing. I am far away from being perfect.
Once again: Follow this idea at yout own risc and only if you know, what you are doing. I am far away from being perfect.
Code: Select all
pi@raspberrypi:~ $ man woman
No manual entry for woman
pi@raspberrypi:~ $
Re: Modding external I2C to SONOFF S20
The modules that also measure current and voltage are for sure not isolated from mains.
For example the Sonoff POW versions, but there may be others too.
For example the Sonoff POW versions, but there may be others too.
Re: Modding external I2C to SONOFF S20
Yes, maybe. But before writing down a statement I have to take in mind, that e.g. AC current can be measured using the hall effect - and galvanically seperated though. We'll see.
Code: Select all
pi@raspberrypi:~ $ man woman
No manual entry for woman
pi@raspberrypi:~ $
Re: Modding external I2C to SONOFF S20
True, but for proper energy monitoring you should also measure the voltage.
And that's a lot more difficult to do without a direct connection.
For these purposes, I have a contact less high voltage sensor, just to make sure there isn't any spot which carries high voltage.
I have the "Uni-T UT-12A" I use for first inspections.
Re: Modding external I2C to SONOFF S20
Oh yes, I think I know what you are talking about, P=UxI
Btw I am using the VC840 for years.
Btw I am using the VC840 for years.
Code: Select all
pi@raspberrypi:~ $ man woman
No manual entry for woman
pi@raspberrypi:~ $
Re: Modding external I2C to SONOFF S20
Why don't you use a 4 pole jackplug and socket? The Sonoff TH also uses this connection. It is a much cleaner solution.
Re: Modding external I2C to SONOFF S20
Hi,
because I didn't know this kind of plug. Thanks for the tip.
I have had a glance on the pages of Tinkerman. For the SONOFF POW he figuered out, that the chip for current/voltage measurement has to have a connection between GND ans one of the mains. So its really no good idea to do a mod like this using a SONOFF POW.
because I didn't know this kind of plug. Thanks for the tip.
I have had a glance on the pages of Tinkerman. For the SONOFF POW he figuered out, that the chip for current/voltage measurement has to have a connection between GND ans one of the mains. So its really no good idea to do a mod like this using a SONOFF POW.
Code: Select all
pi@raspberrypi:~ $ man woman
No manual entry for woman
pi@raspberrypi:~ $
Who is online
Users browsing this forum: Google [Bot] and 36 guests