logo elektroda
logo elektroda
X
logo elektroda

WiFi switch with low power consumption (0.03W) by piotr_go

piotr_go 3105 17
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
📢 Listen (AI):
  • White electronics enclosure with schematic symbol and screw terminal connector

    Recently, when building a controller for my cooker, I decided to experiment with something simpler. Admittedly, I'm not keen on Wi-Fi control, but I was curious to see how low the current consumption could currently be. In the off-the-shelf solutions I tested, the consumption ranged from 0.3 W to 1 W. So I bought some Zigbee modules, a couple of Wi-Fi modules, a couple of different transformerless inverter ICs and bistable relays. A bit of coding and. A pleasant surprise. 0.1 W in the first tests, and after a couple of changes in the software + enabling power saving less than 0.05 W.... With WiFi... Eeeeee? It didn't stop there. By modifying the power supply slightly, I managed to get down to around 30 mW. I even assembled my own meter to confirm the results. I was expecting something in the region of 0.1 W. I decided not to use the Zigbee version.

    I wrote the softwares using ESP-IDF 5.5, without any bytes, apps or clouds. Control from a browser on/off + simple configuration. There is also the possibility of updating the FW.

    To make things less rosy, the whole thing took a while. I am completely unfamiliar with web development, some 90% of my programming time was taken up with it.
    There was also a bug that was causing all sorts of things to happen, I got stuck until I found it. Reset! Apparently the capacitor + resistor in the module wasn't enough and ESP was able to crash at odd times. I connected a reset to the GPIO and set it to high after startup, helped.

    Used Wi-Fi module ESPC2-02 from DOIT, 230 V-->5 V inverter BP2525D, 5 V-->3.3 V inverter M3406, bistable relay control GM8023B.





    Schedule:

    Schematic of a bistable WiFi switch using ESPC2-02 and GM8023B relay

    Building: Building:

    White electronics enclosure with L and N markings and relay circuit symbol
    White plastic device enclosure with four corner screws

    Dimensions: 44x44x22 mm



    Close-up of the bottom side of a PCB with soldered components and screw terminals
    Bottom view of a PCB in a white plastic enclosure with mounted SMD components

    Electronic module with bistable relay, screw terminals, and ESPC2-02 chip
    Electronic module with relay next to a white 3D-printed plastic enclosure

    Current consumption:

    XL-011 stopwatch and ATORCH meter showing 0.06W power usage at 231.65V
    Power consumption meter with LCD screen showing 27.9 mW and a case connected by a wire.

    Measured with a plug-in meter and an average hourly measurement when powered from 5 V.
    Consumption measured with the control side running.

    Control: Control:

    Light bulb icon on dark background in browser interface at 192.168.1.216

    WiFi Configuration:

    WiFi setup screen for ESP module with SSID, password, and hostname fields

    Updating FW:

    “Update Firmware” button on page at IP address 192.168.1.216/update

    You can either press and select the file, or drag the file onto the button.

    Info:

    Debug interface screenshot of ESP via browser with IP address and system stats

    Various helpful information.

    Commercial use prohibited.
    Attachments:

    Cool? Ranking DIY
    About Author
    piotr_go
    DIY electronics designer
    Offline 
    piotr_go wrote 2903 posts with rating 3330, helped 94 times. Been with us since 2003 year.
  • ADVERTISEMENT
  • #2 21778234
    Jawi_P
    Level 36  
    Nice one. ;) The case is PLA and the black jumper is a pen?

    Moderated By Felini:

    3.1.13. Publish posts that violate Polish language spelling rules, are careless and unintelligible.

  • ADVERTISEMENT
  • #3 21778243
    piotr_go
    DIY electronics designer
    Jawi_P wrote:
    Body is of PLA

    PETG, higher softening temperature. Although the chip is unlikely to heat up.

    Jawi_P wrote:
    the black jumper is a pen?

    ??? aaaa WZorek, printed in black (on grey film) PETG on the first layer.
  • #4 21778398
    krzbor
    Level 28  
    piotr_go wrote:
    Modifying the power supply a little, I was able to get down to around 30 mW.

    Could you write a bit more - how did you manage this? 30 mW is usually what the ESP alone draws and without a radio, and you have a radio (quite responsive) and an inverter.
  • #5 21778405
    chemik_16
    Level 26  
    >>21778398
    Inaccurate meter. :)
  • #6 21778419
    piotr_go
    DIY electronics designer
    krzbor wrote:
    Could you write something more - how did you get it to work? 30mW is usually what the ESP alone draws and without a radio, and you have a radio (quite responsive) and an inverter.

    I initially tested on an ESP32-C3 (I was making a cooker controller on it so it was handy), C2 performed slightly better (can't remember the exact numbers).
    R10 I changed to a zener. The original manufacturer of the BP2525D recommended a 1.5k...2k resistor (the voltage at the output increases at low load).
    I also tested several 5 V--->3.3 V inverters, the M3406 performed best at low load.

    Upload the binary to the ESP32-C2 if you have one and test.

    chemik_16 wrote:
    inaccurate meter

    While the measurement on the 230 V side may be inaccurate (too little current), it should be OK at 5 V.
    I checked with several USB meters, it came out similar.

    =========== update ===========

    Aaaaaa, I completely forgot, in AP mode the current consumption is quite a lot higher.
    You can't set it up normally, it's only for the first setup, or after a reset to default settings.
    Reset to default settings after holding SW1 for more than a second.
    Address: 192.168.2.1
  • #7 21778587
    gulson
    System Administrator
    Great respect! "The Chinese don't like it, see why".
    All in all, Zigbee also consumes 30 mW during transmission.
    There the standby is implemented a bit better and I think it closes in 1 mW ?

    But I guess you don't plan on battery power, because it's connected to the mains anyway ?
    The idea was simply to reduce the electricity bill ? :)

    I was wondering about Wi-Fi switches/pilots with rechargeable batteries.
    I heard somewhere about some microWi-Fi's being made by a Polish company: https://blebox.eu/
    I wonder how they are with the consumption, I had a rechargeable remote control that worked for over a year.
    Until the cell died. ;)
  • ADVERTISEMENT
  • #8 21778723
    p.kaczmarek2
    Moderator Smart Home
    I was already waiting for you to post this. Congratulations, it came out great.

    Just one thing puzzles me - wouldn't it be possible to optimise the circuit even more? Are there bistable relays on 3 volts?

    I ask because although most of the IoT products I review ( list here ) always have a mains voltage inverter -> 5 V and then a separate LDO of 3.3 V, then recently I saw that the Chinese have gone one step further and in the plug with the LN882H , from what I understand, they have omitted the LDO altogether and will power the Wi-Fi chip directly from the main inverter - they have also put a relay there for 3 V, albeit a regular one.
    Helpful post? Buy me a coffee.
  • #9 21778840
    piotr_go
    DIY electronics designer
    gulson wrote:
    But I don't think you're planning battery power

    Battery testing will happen, although I don't know when yet.

    gulson wrote:
    It was simply a matter of reducing electricity bills?

    Well baaa, 10 pcs instead of one. :)

    p.kaczmarek2 wrote:
    Wouldn't it be possible to optimise the circuit even further? Are there bistable relays for 3 volts?

    I suspect I would have to pay quite a bit more for the relay than the inverter cost.
    Other than that 5 volts + inverter is more stable though.
  • #10 21778943
    Karol966
    Level 31  
    Seemingly a device like many (from majfriends), yet awe-inspiring, hats off to you for the beautiful, complex workmanship. :)
    I am impressed with the ease with which you use Chinese, not necessarily popular electronic components. ;)
  • #11 21779070
    piotr_go
    DIY electronics designer
    Karol966 wrote:
    with what ease you use Chinese, not necessarily popular electronic components

    The low price is tempting to try.
    I remember when I had to pay almost £10 for a similar 5 V-->3.3 V inverter at our place, and I could only dream about inductors in 0603/0805. Today at the Chinese ... 2 cents.
    Too bad they don't have bp2525d at LCSC, I had to buy on aliexpress (aliexpress has gone completely to the dogs, I put one item in the basket, it shows a rating of 4.9, after paying it turns out to be something else with a rating of 3.2 and comments about fraud).
  • #12 21781311
    piotr_go
    DIY electronics designer
    I tested the power supply from a LiIon cell.
    A 14500 cell plucked from a Chinese torch due to insufficient capacity.
    I charged it to full, plugged it in. After 26h, the voltage dropped below 3.3V and the circuit stopped working (I occasionally "pinched"). At 25h50m the relay was still switching.
    After discharging, I charged the cell again with a charger on a TP4054 connected to a USB meter. ~220mAh
    Generously assuming 100% charge/discharge efficiency:
    0.22Ah*3.8V = 0.836Wh
    0.836Wh/26h = 0.032W
  • #13 21785410
    tomek3232
    Level 16  
    It's cool that in the age of aliexpress and this someone wants to do such projects.
  • #14 21790519
    manski
    Level 23  
    Shouldn't diode D2 in the diagram be the other way around ?
  • ADVERTISEMENT
  • #15 21790543
    maurycy123
    Conditionally unlocked
    manski wrote:
    Shouldn't diode D2 on the schematic be the other way around ?

    No. Look up the datasheet BP2525D for yourself.
  • #16 21790828
    excray
    Level 41  
    Hmmm, and why did you make the relay control so complicated?
  • #17 21790920
    piotr_go
    DIY electronics designer
    Bistable relay. It is energised only during a state change (for 0.01...0.1s).
📢 Listen (AI):
ADVERTISEMENT