ESP32 mod

Moderators: rtenklooster, Voyager, BertB, Stuntteam

Forum rules
You have entered the experimental forum, beware!!!
Post Reply
Message
Author
martinus
Normal user
Posts: 129
Joined: 15 Feb 2020, 16:57

ESP32 mod

#1 Post by martinus » 22 Apr 2020, 14:14

While searching the forum for "Action store" (a store that i like to visit on a regular base to find new cheap mod stuff), i found this USB charger that already has been modded once by someone else:
https://www.letscontrolit.com/forum/vie ... 71&p=34420

Because i recently said goodbye to all my ESP8266 modules, i wanted to see if an ESP32 would also fit in there. I had my doubts first because the module is bigger than the original Wemos D1 Mini based on ESP8266.

I decided to purchase one and followed most of the instructions provided in the other post.

And indeed, as exptected, i had to use the dremel tool a bit more agressive on this gadget to make it fit. Also had to remove the LED board, so now it is effectively no longer a "nachtlampje". But that wasn't my goal anyway.

In the end, both the ESP32 module and a shield on top will fit the cabinet. And whitout the cap, i can also access the USB port when needed for troubleshooting:
Mod2.png
Mod2.png (363.66 KiB) Viewed 27929 times

I had to make me a custom angle header to power it because space is too limited for normal headers. I will replace it with a proto shield when things have proven stable:
Mod1.png
Mod1.png (258.68 KiB) Viewed 27929 times

And the cap still closes:
Final.png
Final.png (195.69 KiB) Viewed 27929 times
So now we have an ESP32 driven "nachtlampje" that has lost it's primary task. But maybe i can mount some Neopixels inside :ugeek:

When it's stable, i have to find a purpose for it... :lol: :lol: :lol:
(prototyping is fun, but what to do when it finally works???)

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP32 mod

#2 Post by TD-er » 22 Apr 2020, 20:30

Hmm, that looks like some mod that deserves some warnings about safety.
Still a nice and compact mod though, but not all readers may be familiar with the do's and dont's of switching power supplies like these.

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ESP32 mod

#3 Post by Ath » 22 Apr 2020, 21:39

martinus wrote: 22 Apr 2020, 14:14 (prototyping is fun, but what to do when it finally works???)
  • put it in the back of a cupboard
  • forget it for a couple of years :roll:
  • find it again while searching for something totally different
  • wonder yourself what the hack* it is, take it apart, and be amazed about the primitive parts found inside :lol: :lol: :lol:
/Ton (PayPal.me)

martinus
Normal user
Posts: 129
Joined: 15 Feb 2020, 16:57

Re: ESP32 mod

#4 Post by martinus » 23 Apr 2020, 13:06

TD-er wrote: 22 Apr 2020, 20:30Hmm, that looks like some mod that deserves some warnings about safety.
Agree. It counts for all mods to equipment where live mains is present. So also modding the Sonoff series and the like.

In this case, good isolation between the lower and upper half of the enclosure is important. For the prototype, i used a piece of plastic of 1.2 mm thickness like this, similar to the enclosure thickness itself. But i'm still looking for a piece of hard plastic that can be glued to the enclosure to avoid possible creepage between the edges.
Isolation.png
Isolation.png (439.17 KiB) Viewed 27881 times
TD-er wrote: 22 Apr 2020, 20:30but not all readers may be familiar with the do's and dont's of switching power supplies like these.
Could you elaborate specifically on the don'ts?

I'm not sure if i'll put it into production unless i'm convinced that it's safe enough to use.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP32 mod

#5 Post by TD-er » 23 Apr 2020, 13:40

If you like, I can also 3D print those parts for you to test. (Remco also has a number of 3D printers, he told me)

I don't know how deep your knowledge of switching power supplies is, so maybe I assume too basic :)

Basic functionality of such a power supply can be broken down into these steps:

- Turn mains into DC (230V~ => 400V=)
- Create block wave for primary coil (oscillator)
- Rectify voltage from secondary coil
- Provide feedback for oscillator, PWM depending on output voltage

Image

The dangerous parts:
- 400V DC (!!!), when touched, you cannot let go as it is DC.
- Feedback to the oscillator is not always isolated.

Especially on cheap units, the isolation of the feedback loop is sub optimal.
Also these power supplies depend on some minimal load, or else the voltage on the output can rise above the nominal value.
The feedback can only change the PWM signal over some range and often it cannot turn it to 0%.
This means the output capacitor will receive some pulses to charge it, but this will increase the voltage over the capacitor if there is no load.
Another implication of this is that on low loads the ripple will be quite big, especially on cheap units.
Some sensors (e.g. SenseAir S8) will be damaged if the supplied voltage is above 5.2V. With the ripple on some of these cheap USB power supplies, the ripple is over 200 mV.

martinus
Normal user
Posts: 129
Joined: 15 Feb 2020, 16:57

Re: ESP32 mod

#6 Post by martinus » 23 Apr 2020, 14:53

I'm familiar with the basics of modern PSU devices. And seen some tests of the very cheap ones.
The thing with Chinese Manufacturing is that it can be hard to distinguish between cheap and too cheap.
I definitely stay away from the no-brand 1 euro direct import from ebay versions that according to several reviews make funny noises and tend to go up in smoke during heavy charging.

About the cheap ones available in local dutch stores? Hard to tell without proper testing equipment. They do have CE marking but i guess that only means "China Export" in these cases. It looks like they at least have learned about the 5 mm distance on the PCB between the high and low voltage areas:
USBCharger.png
USBCharger.png (501.12 KiB) Viewed 27874 times
The load in my case will be very moderate compared to actually charging a tablet or powerbank.
And i'm feeding the 5 volts only into the onboard regulator on the ESP32 module. So at least there's a second regulator in place and that could help out with the ripple issue if any.

martinus
Normal user
Posts: 129
Joined: 15 Feb 2020, 16:57

Re: ESP32 mod

#7 Post by martinus » 29 Apr 2020, 16:47

Some more mechanical modding and I've found a possible purpose:
PIRMOD.png
PIRMOD.png (181.91 KiB) Viewed 27704 times
Running stable for several days, no false positives. No unexpected reboots.

martinus
Normal user
Posts: 129
Joined: 15 Feb 2020, 16:57

Re: ESP32 mod

#8 Post by martinus » 29 Apr 2020, 17:22

Second mod, using this standard IR shield:

IRMod3.png
IRMod3.png (98.75 KiB) Viewed 27698 times

Attached to the ESP32:

IRMod2.png
IRMod2.png (198.71 KiB) Viewed 27698 times

Final solution, wall socket is located opposite of the TV, distance 4 meters.

IRMod1.png
IRMod1.png (228.85 KiB) Viewed 27698 times

Using rules like this:

Code: Select all

on tv_on do irsend SAMSUNG,0xe0e09966
on tv_off do irsend SAMSUNG,0xe0e019e6
I can now turn on/off the bedroom TV using ESPEasy.

Of course, i could think of programming series of commands like turn on tv, wait a few seconds, select HDMI channel 1, etc
And using the other ESPEasy IRGateway sender in the mediaroom, i can turn on DVD, mediaplayer, PC, etc

When this is stable, it could add to the WAF in my home :D

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests