ESP32-C3 based Smart Door/Window sensor | DEEP SLEEP 30nA? | Long battery life 5/10 years

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 ธ.ค. 2024
  • This project is sponsored by PCBWay, order your PCBs now for only $5: www.pcbway.com...
    The goal of this project is to design a smart door/window sensor reducing power consumption(in deep sleep/standby) with a custom power latch. Optimizing the deep sleep power consumption of battery-powered smart devices ensures a long battery life cycle.
    Github repo: github.com/sal...
    The current was measured with Nordic's power profiler kit, knowing that the current measured is less than the measurement range of this power profiler. I did several tests to verify the accuracy of the data. In any case the accuracy of the data, the consumption would be less than 200nA and this is a very good result considering that a similar device at a power consumption of 6-8uA.
    Do you like the projects I develop? Also visit: objexlabs.com/
    Interesting projects about the topic:
    esp8266-server...
    • ESP8266 as Window Sens...
    github.com/Mak...
    Topics/projects covered in this video:
    Power latch: www.mosaic-indu...
    TPL5110: www.adafruit.c...
    Magnetic sensor: www.ablic.com/...
    Reed switch: en.wikipedia.o...
    IoT power consumption:
    www.codemotion...
    www.thalesgrou...
    Links:
    • Shop: www.tindie.com...
    • Instagram: / salvatore.raccardi
    • Linkedin: / salvatore-raccardi-b36...
    • Twitter: / salvoraccardi
    • Github: github.com/sal...
    🎶 Tracks:
    "Punch Deck - Neon Underworld" is under a Creative Commons (CC BY 3.0) license.
    creativecommon....
    @punchdeck

ความคิดเห็น • 116

  • @geekmystique
    @geekmystique ปีที่แล้ว +21

    Super impressive; this is a rare example where DiY is better than any commercially available product.

  • @hudsonreynolds4349
    @hudsonreynolds4349 ปีที่แล้ว +3

    Love this project, super impressive and inspiring. I am creating a fitibit with an esp32c3 and have been diving deeper and deeper into power consumption research. Keep it up!

  • @chasemartin4450
    @chasemartin4450 ปีที่แล้ว +3

    Impressive! The ESP32 isn't exactly known for being particularly energy efficient (especially when compared to alternatives like nRF52) but its low cost and wide availability make it tempting to implement in smart devices.

    • @SalvatoreRaccardi
      @SalvatoreRaccardi  ปีที่แล้ว +2

      Next week I will upload a very interesting video about it(power consumption and ESP32), I suggest you stay tuned :)

  • @WinterCircuits
    @WinterCircuits ปีที่แล้ว +3

    Very well thought out project! Nice one

  • @IshanKarve
    @IshanKarve ปีที่แล้ว +3

    Very nicely designed. Helpful for smart homes. Cheers

  • @warperone
    @warperone 7 หลายเดือนก่อน +2

    amazing design and attention to detail - love it

  • @mmenjic
    @mmenjic ปีที่แล้ว +1

    9:28 you could, if you wanted, to make that part of the plastic behind the battery terminals separatable from the rest of the plastic which supports the board so you can remove everything if needed. It is not much more complex if at all and it should be sturdy enough because all goes into bigger case which would hold it together.

  • @shakhizatnurgaliyev9355
    @shakhizatnurgaliyev9355 ปีที่แล้ว +3

    Well done, man!

  • @gripperrod
    @gripperrod ปีที่แล้ว +2

    Excellent piece of work.

  • @boim9312
    @boim9312 ปีที่แล้ว +2

    So Genius 🎉
    Amazing project

  • @TheDutchGuyOnYT
    @TheDutchGuyOnYT ปีที่แล้ว +2

    Very nice done. I like it that you grab yourself the target and keep on improving it. It’s a nice combination of mechanical and electric engineering, like the details on the battery bay and the lid. Details.
    Although I also very much like the versatile and addictive ESP-32, could you imagine using a more power friendly chip?

    • @SalvatoreRaccardi
      @SalvatoreRaccardi  ปีที่แล้ว +1

      Thank you! The next step is to use the nRF52840 and try ESP32-C6.

  • @gsge
    @gsge ปีที่แล้ว

    Thank you for your efforts searching for low power solutions. I have gone through this few years ago. But after all my experiments, I have a Window/door sensor and water level sensor which is lot simpler. It does not require reed switch or any special power circuit.It just power down the whole esp32 when door is closed.When door is open it wakes up and send message to gateway.

    • @SalvatoreRaccardi
      @SalvatoreRaccardi  ปีที่แล้ว

      The reed switch/ hall effect sensor is present in all door and window sensors, it is not an extra element but essential. My circuit is not complex, I use very simple and inexpensive components, you only need to take an engineering class to understand the simplicity of the design.

    • @gsge
      @gsge ปีที่แล้ว

      @@SalvatoreRaccardi I am glad I am not engineer. Engineers tends to over engineer things. I wanted to show you simplest door/window sensor which requires only bare ESP8266 module, few metal short wires and a battery supplying 3 to 3.6 volts with special software and it can do everything you do with your circuit here but with better energy efficiency. And it will be 1/3rd in cost and size of your design here. But I will do it when you come out of your engineer mindset. I have spent 40 years tearing apart electronics to understand them.

    • @deslomeslager
      @deslomeslager ปีที่แล้ว

      @@gsgeSometimes a door is not closed properly, and wind pushes it open. So you push harder to close it. But oops. The read switch has woken up the circuit, but misses the closing of the door. Your version, using wires, will always see the current state. No need to remember the previous state, either your gateway does this, or you can make the circuit smarter. I know 40 years of experience still can beat smart designs. KISS. On the other hand, Salvatore is making a very nice project of this, and if he uses out of the box materials (not PCB way stuff or 3D stuff), it would be for more people. However he has his own subscribers which seem to like his approach. Note: I just came here because YT promoted this video and can say Salvatore is on the right track. But (all) our tracks do not need to be the same.

  • @xThirdOpsx
    @xThirdOpsx ปีที่แล้ว +3

    Good engineering, well done. I like all the simulations and research you did before diving into the PCB design. That circuit is complex though, are you trying to simplify it or are you ok with it?

    • @SalvatoreRaccardi
      @SalvatoreRaccardi  ปีที่แล้ว +1

      It can be simplified, depending a lot on the result you want to achieve.

  • @MR_Rabeel
    @MR_Rabeel ปีที่แล้ว +1

    That so cool 👍 Can we have a video from you explaining how to design pcb for low power device because you are so good at it

    • @SalvatoreRaccardi
      @SalvatoreRaccardi  ปีที่แล้ว

      I'll, I want to look into this topic because in my opinion it is fundamental to the development of many iot devices👍

    • @MR_Rabeel
      @MR_Rabeel ปีที่แล้ว +2

      @@SalvatoreRaccardi yeah sure! Thanks

  • @wjn777
    @wjn777 ปีที่แล้ว

    Very nice, thanks for sharing. I was struggling with the same idea on remembering the previous state. Interested to see your github

    • @SalvatoreRaccardi
      @SalvatoreRaccardi  ปีที่แล้ว

      I think the solution I developed is great for several applications!

  • @kayaker2k
    @kayaker2k 4 หลายเดือนก่อน

    Very nice idea. I was checking the Kicad schematics today. Very nice schematic layout as well.
    Some question remains for me:
    Why did you change the Mosfet from NTNS... to the DMG3415?
    And why did you include a LDO for the BME680 at all? It runs fine with 3V and is also internally compensated so no drift with a depleading battery.
    For Low power it doesnt really matter but its one more part.
    Thanks for making it open source!

    • @SalvatoreRaccardi
      @SalvatoreRaccardi  4 หลายเดือนก่อน +1

      Hi! I changed the mosfet only because of availability. I added the LDO to the BME680 because I wanted to do some additional tests.

    • @kayaker2k
      @kayaker2k 4 หลายเดือนก่อน

      @@SalvatoreRaccardi thanks you for the answer! Did you ever get to incorporate the BME and used the door sensor as a environmental sensor as welll?

  • @freman
    @freman ปีที่แล้ว +1

    how sexy are those 0.8mm boards! I love them in my projects.
    Man, how much simpler would home automation be if you could just project an rf field around a house and tap that for energy? I'm working on weight sensors for my gas storage to detect leaks and warn me when one of the two bottles gets low... it's got a pair of 16550's and a solar panel...

    • @SalvatoreRaccardi
      @SalvatoreRaccardi  ปีที่แล้ว

      Thank you for your comment. Very interesting your project!

  • @marcuscps
    @marcuscps 10 หลายเดือนก่อน

    Why not using a ultra low power microcontroller to offload simpler tasks from the main system?
    You could do a lot more, including smarter pin monitoring, use wake up interruptions on pin edges, timer, etc. This is possible using the sleep mode that would bring power consumption down to around 100nA.
    I know that's more power than your circuit is draining, but it does a lot more. It is an interesting tradeoff.

    • @SalvatoreRaccardi
      @SalvatoreRaccardi  10 หลายเดือนก่อน +1

      Your point is right, but the goal was to develop as simple a solution as possible with the ESP32C3. I also developed a version with a microcontroller that does the supervisor work, but from my point of view it is a solution(supervisor microcontroller + ESP32C3) not suitable for mass production.
      Surely ,it would make sense to use an Ultra low power micrcontroller + RF(BLE/zigbee etc).
      When developing a product you have to simplify the design as much as possible, in my point of view.

    • @marcuscps
      @marcuscps 10 หลายเดือนก่อน +1

      @@SalvatoreRaccardi I understand your angle. IMHO the supervisor is superior, especially because it is a general and flexible solution, extensible for other applications, and you can even update the supervisor firmware from the ESP.
      In the end the scale could make it worth the extra complexity. Some microcontroller are less than 50p.

  • @tuiastro
    @tuiastro ปีที่แล้ว +1

    Thanks for sharing. It's very inspiring. ❤

  • @jeffking3693
    @jeffking3693 9 หลายเดือนก่อน

    This is very professional and I enjoyed your video.
    May I ask about your tool set? The ecad/pcb and 3D design tools you are using?

    • @SalvatoreRaccardi
      @SalvatoreRaccardi  9 หลายเดือนก่อน

      Thank you for your comment. I use KiCad and Altium for PCBs design. For 3D part design I use Fusion360.

  • @aaronmathewson5522
    @aaronmathewson5522 ปีที่แล้ว

    What off the shelf components could I buy to get close to this? I don’t have the machines or experience to put this together. It’s a great project and would love to be able to buy an add on module to use an existing ESP32 board…

    • @SalvatoreRaccardi
      @SalvatoreRaccardi  ปีที่แล้ว +1

      Hi! Next week I will upload a video where I show a new project of mine, which does just what you describe. I suggest you stay tuned :)

  • @brijeshkhokhar
    @brijeshkhokhar ปีที่แล้ว

    I will try to implement this. looks good

  • @the_rafa0398
    @the_rafa0398 ปีที่แล้ว

    Very nice project, i like it. I see is not so easy to reflash once the module is assembled. Have you thought using the over the air reflashing? Well to implement that may help you, but it will also depend how often you think you need reflashing the modules

    • @SalvatoreRaccardi
      @SalvatoreRaccardi  ปีที่แล้ว

      Good point, with the power latch I developed you could use OTA but under the condition that you trigger the sensor first. I'll add this feature to the Todo list for the next version.

  • @NicksStuff
    @NicksStuff 11 หลายเดือนก่อน +1

    Sadly I didn't understand.
    Here's what I thought you would do: Use a normally closed reed switch (that will be open when the window is closed) directly on the power line. When the window is opened, the ESP32 is powered up and the first thing it does, is turn on a transistor that's in parallel with the switch, sends its state to the MQTT broker or whatever and goes to deep sleep. When the windows is closed, the bounce of the reed switch means the ESP32 will be woken up, turn on that same transistor, sends its new state to the MQTT broker and turn off the transistor, so cutting all power. Could you explain why my solution isn't good and how yours work in greater details?

    • @SalvatoreRaccardi
      @SalvatoreRaccardi  9 หลายเดือนก่อน

      First of all thank you for your comment, I am just seeing it now. I explain in detail how the circuit works from minute 4:10.
      I don't really understand your idea, I would need a schematic to understand better. In any case, have you tested your solution?

    • @NicksStuff
      @NicksStuff 9 หลายเดือนก่อน

      @@SalvatoreRaccardi I didn't understand your idea, you don't understand mine....maybe it's not worth the hassle. Thanks for sharing, anyway!

  • @fatih_basaris
    @fatih_basaris 5 หลายเดือนก่อน +1

    Hi Salvatore. I did power latch rising&falling edge dedector schematic. When i test the circuit, current measurement is almost 200 mikroamper. I could not see nA levels. I used SN74LVC1G86DBVRG4 too like schematics. Do you have any opinion or suggestion for me? By the way i really like your design...Best regards..

    • @SalvatoreRaccardi
      @SalvatoreRaccardi  5 หลายเดือนก่อน

      Hi, the first question that comes to my mind to ask you is how did you measure the current?

  • @_adamalfath
    @_adamalfath ปีที่แล้ว

    Impressive result
    If I understand correctly, the RC delay (R10, C8, C12) is basically the time for MCU to respond and latch on the main MOSFET to prevent the circuit from switching off again?
    Toggling AUTO_TURN_OFF must be the first operation after the MCU wakes up?

    • @SalvatoreRaccardi
      @SalvatoreRaccardi  ปีที่แล้ว +1

      exactly

    • @_adamalfath
      @_adamalfath ปีที่แล้ว

      @SalvatoreRaccardi any potential issue when using a "fresh" assembled module? Since the module has no program to keep to toggle the IO at the first time. Or when reprogramming and forgot to add that line of code

    • @SalvatoreRaccardi
      @SalvatoreRaccardi  ปีที่แล้ว

      No there is a procedure for programming the board to bypass the power latch.

  • @mt-qc2qh
    @mt-qc2qh 5 หลายเดือนก่อน +1

    I used the C3 for my leak detectors as well. Great deep sleep capability and

    • @SalvatoreRaccardi
      @SalvatoreRaccardi  5 หลายเดือนก่อน

      I developed a module(ELPM-S3LW) just for this kind of application: objexlabs.com/products/ELPM-S3LW

    • @mt-qc2qh
      @mt-qc2qh 5 หลายเดือนก่อน +1

      @@SalvatoreRaccardi Your design is good, but I'm not a fan of Lora. For inside applications I prefer espnow. Single module and lower power.

  • @adfjasjhf
    @adfjasjhf 11 หลายเดือนก่อน

    Could it be flashed with ESPHome for example? Having compatibility with home assistant would be perfect

  • @manousosmath
    @manousosmath 6 หลายเดือนก่อน

    I am very impresive! Is it possible to connect this sensor to HomeAssistance?

    • @SalvatoreRaccardi
      @SalvatoreRaccardi  6 หลายเดือนก่อน +1

      yep you can use it with Home Assistance!

  • @mashish88
    @mashish88 ปีที่แล้ว +1

    Salvator, Can you pls post link to buy Frogo pins programmer?

    • @SalvatoreRaccardi
      @SalvatoreRaccardi  ปีที่แล้ว

      it.aliexpress.com/item/1005004258921308.html?spm=a2g0o.order_list.order_list_main.72.2daa3696PLp6vQ&gatewayAdapt=glo2ita

  • @yazanajaj3389
    @yazanajaj3389 ปีที่แล้ว

    You are a creative man..always waiting for videos of your beautiful projects...how much will you set a suitable price for them??

    • @SalvatoreRaccardi
      @SalvatoreRaccardi  ปีที่แล้ว +1

      Thanks! My intention is to sell a set of IoT devices for the home and beyond. Maybe sell a few units of this device.

  • @ferranserra4694
    @ferranserra4694 3 หลายเดือนก่อน

    Good afternoon Salvatore, I really liked your video, and with my brother we decided to make the same PCB for our house. But we have a problem, all the programs work except those that are related to WIfi. The only wifi function that works is the Wifi status. For example if we do a wifi scan it runs all the code until it reaches one of the WIfi functions and then it stops running.
    It would help us a lot if you or someone from the community could give us a hand.
    Thank you very much for your help.

    • @SalvatoreRaccardi
      @SalvatoreRaccardi  3 หลายเดือนก่อน

      Have you tried to see if other people online have experienced a similar problem?

    • @ferranserra4694
      @ferranserra4694 3 หลายเดือนก่อน

      @@SalvatoreRaccardi Thank you very much for your response. Yes, I have asked on several forums, but so far they have not been able to give me an answer.

    • @ferranserra4694
      @ferranserra4694 3 หลายเดือนก่อน

      We are not sure if the problem is a configuration, library or PCB communication system issue.

    • @SalvatoreRaccardi
      @SalvatoreRaccardi  3 หลายเดือนก่อน

      what antenna are you using?

    • @ferranserra4694
      @ferranserra4694 3 หลายเดือนก่อน

      @@SalvatoreRaccardi I'm using an ESP32-C3-Mini-1

  • @alenninan5524
    @alenninan5524 8 หลายเดือนก่อน

    Hi have you worked with esp32C3 and mpu6050 . Can you tell me how you could connect the esp32 c3 with mpu6050 pins if you had done it ?

    • @SalvatoreRaccardi
      @SalvatoreRaccardi  8 หลายเดือนก่อน

      Via I2C?

    • @alenninan5524
      @alenninan5524 8 หลายเดือนก่อน

      @@SalvatoreRaccardi I solved the issue . I need to know the max current and voltage that esp32c3 normally consumes . I saw it consumes 40 mA for esp32c6(active state) . So wt will be the same with esp32c3 ? Secondly , my device might be in active state for 12 hrs(max) , so just to calculate the maH of the battery .So which battery is preferable .The size of the device would be 25 mm*35*20 mm . are there such batteries available ?

  • @superbikeengineer
    @superbikeengineer ปีที่แล้ว +1

    I tried makermeik project and the logic circuit to enable ldo does not work as desired. On one pcb it worked i dont know how but on all others it failed

    • @SalvatoreRaccardi
      @SalvatoreRaccardi  ปีที่แล้ว

      The design I developed works very well, I have done several tests, and so far I have not found any issues with the design.

    • @superbikeengineer
      @superbikeengineer ปีที่แล้ว

      @@SalvatoreRaccardi will u make the code n ckt public?

    • @SalvatoreRaccardi
      @SalvatoreRaccardi  ปีที่แล้ว

      @@superbikeengineer The basic code is public

    • @superbikeengineer
      @superbikeengineer ปีที่แล้ว

      @@SalvatoreRaccardi and hardware project is complete?

  • @ToTo-od9wz
    @ToTo-od9wz 11 หลายเดือนก่อน

    You can fool the sensor with any magnet. Is it possible to use something coded, specific to each sensor?

    • @SalvatoreRaccardi
      @SalvatoreRaccardi  11 หลายเดือนก่อน

      All smart door sensors are designed in this way. It is possible to make this device more secure by making the unit containing the magnet smarter.

  • @begonamarkina9658
    @begonamarkina9658 ปีที่แล้ว +1

    Would it be possible to do this with an accelerometer interrupt instead of reed sensor?

    • @SalvatoreRaccardi
      @SalvatoreRaccardi  ปีที่แล้ว

      Yes sure.

    • @begonamarkina9658
      @begonamarkina9658 ปีที่แล้ว

      @@SalvatoreRaccardi How should I connect the accelerometer?

    • @SalvatoreRaccardi
      @SalvatoreRaccardi  ปีที่แล้ว

      @@begonamarkina9658 It all depends on the sensor model and project specifications.

  • @TecSanento
    @TecSanento ปีที่แล้ว

    Could you share it as a public project on easy eda? Because them Users Can directly order it :)?

  • @Techn0man1ac
    @Techn0man1ac ปีที่แล้ว +1

    Link to simulator, please

  • @robmc3338
    @robmc3338 9 หลายเดือนก่อน +2

    At 30nA, a Supercap and tiny solar panel will give infinite runtime in a tiny package 👍

    • @SalvatoreRaccardi
      @SalvatoreRaccardi  9 หลายเดือนก่อน +1

      Right, theoretically it is possible.

  • @ToTo-od9wz
    @ToTo-od9wz 11 หลายเดือนก่อน

    Batteries Salvatore!

  • @AG34273
    @AG34273 ปีที่แล้ว

    Great video, two questions for you. 1. If you only transmit when the sensor state changes, how does the controller know if this sensor is "online" if the sensor state hasn't changed for days? (like ring, zwave, etc controllers know that their sensors are "online"). 2. If you changed to wake up from deep sleep and transmit the state every 5 seconds, how long do you think the batteries will last?

    • @SalvatoreRaccardi
      @SalvatoreRaccardi  ปีที่แล้ว

      Note that all WiFi smart sensors have the following problem, which can be solved by scheduling wake-up every hour. Every 5 seconds is inefficient. In some applications it is not necessary to know whether the sensors are online. If they are sensors for apartment security, yes, but if they are for turning on a light or making a simple measurement, it is not necessary to know if the sensor is online. It all depends on the application.

  • @divingernie6947
    @divingernie6947 3 วันที่ผ่านมา

    @SalvatoreRaccardi
    is there a way to order a full assembled device ?

  • @Fixaj
    @Fixaj 10 หลายเดือนก่อน +2

    nice video thanks

  • @Sir-Dexter
    @Sir-Dexter 11 หลายเดือนก่อน

    nice work

  • @akauppi2
    @akauppi2 ปีที่แล้ว

    Subscribed!

  • @santopino756
    @santopino756 ปีที่แล้ว +1

    Bravo, anche per il video editing.
    l'inglese é un po' da migliorare.

    • @SalvatoreRaccardi
      @SalvatoreRaccardi  ปีที่แล้ว

      Grazie per il commento, sono consapevole che l'inglese è da migliorare. Infatti sto lavorando molto per migliorare la pronuncia e non solo.

    • @TheDutchGuyOnYT
      @TheDutchGuyOnYT ปีที่แล้ว +2

      It is very understandable and the Italian accent constantly reminds me of the beautiful language, nice wines and food -> positive 😄🇮🇹

  • @dartfrogdk
    @dartfrogdk ปีที่แล้ว

    Very Very Nice

  • @amirzendehdel8876
    @amirzendehdel8876 ปีที่แล้ว +1

    👏👏👏👏👏

  • @SayWhaaaaaaaaaaaaaaaaaaaaaaat
    @SayWhaaaaaaaaaaaaaaaaaaaaaaat 2 วันที่ผ่านมา

    Nice but it's WAYYYYYY too big for such product.

  • @D9ID9I
    @D9ID9I 5 หลายเดือนก่อน

    The main question is why build something new based on traditional batteries. It makes no sense to me.

    • @SalvatoreRaccardi
      @SalvatoreRaccardi  5 หลายเดือนก่อน +2

      Why doesn't it make sense? The goal of this project was to increase the life cycle of the device to 10 years of use by keeping the same batteries(which are easy to buy and cheap).

  • @sm94126
    @sm94126 ปีที่แล้ว +1

    Buongiorno Salvatore, anche io mi sto cimentando con un progetto come questo e ti faccio i complimenti, mi sembra molto interessante. Un paio di domande. Ma questo progetto e' un hardware open source? E' possibile avere lo schema elettronico per capire come modificarlo? Grazie per l'attenzione . Ti segnalo inoltre questo link da dove ho preso alcuni spunti che potrebbero essere utili: th-cam.com/video/-oMSD9I4RSo/w-d-xo.html

    • @SalvatoreRaccardi
      @SalvatoreRaccardi  ปีที่แล้ว

      Buongiorno, il progetto è open source (puoi trovare lo schema elettrico su github). Conosco il progetto "trigboard", purtroppo ha dei consumi molto alti in "deep sleep" ~1.5uA, io per adesso sono arriviato fino a ~20nA. Attualmente sto lavorando a una board (devkit) per sviluppare nodi IoT extreme low power.

    • @sm94126
      @sm94126 ปีที่แล้ว

      @@SalvatoreRaccardi Grazie per la risposta. Conto di seguire il canale per vedere le novità che stai sviluppando. Complimenti e Buon lavoro

  • @JeanPhilippeEncausse
    @JeanPhilippeEncausse 9 หลายเดือนก่อน

    Too bad it's not on Tindies I would bought some