ESP8266 as Window Sensor with years of battery life

  Рет қаралды 181,231

MakerMeik

MakerMeik

Күн бұрын

Пікірлер: 227
@MakerMeik
@MakerMeik 3 жыл бұрын
Meanwhile the viewer "gadjet" has optimized and minimized the PCB. His impressive optimization has meanwhile gone through 5 phases of "evolution". But more importantly, he has reworked the code to ESP-Now, reducing the wake time of the ESP to 0.25 seconds. This extends the battery life immensely. Check out his great website and project on Github: gadjetsblog.blogspot.com/2022/03/the-many-versions-of-wireles-door.html github.com/gadjet/Window-Door-sensor-Version-5 @gadjetsvideo Thanks for sharing your ideas and additions. I do my videos for people like you: Knowledge doubles when you share it.
@mirino75
@mirino75 3 жыл бұрын
I just ordered boards on the JLCPCB. Everything is OK. I liked it and immediately subscribed too ! Looking forward to see more of your videos.
@stupossibleify
@stupossibleify 3 жыл бұрын
So much learning value in a single video, pure gold! Thanks for making this, really high quality project, supporting links and video production. Subscribed!
@SmithyScotland
@SmithyScotland 3 жыл бұрын
I've recently been working on a similar project with a wemos and tasmota, using tasmota deep sleep. Now I know why the battery wasn't lasting as long as expected. Your vid gives me good ideas. Thanks 😁
@MakerMeik
@MakerMeik 3 жыл бұрын
That's true, the thing with the unusable Deep Sleep also drove me crazy in the beginning. Andreas Spiess explained in one of his videos in more detail how to get it working on a D1 mini. So if you still want to stick with the D1 mini, you can see how to do that here: kzbin.info/www/bejne/qJezqIKqpKyCaqc By the way, there is even a solution how to do this with a NodeMCU. But that is even more tinkering. If someone should be interested in it, it will be found here: tinker.yeoman.com.au/2016/05/29/running-nodemcu-on-a-battery-esp8266-low-power-consumption-revisited/
@enlacdmx4379
@enlacdmx4379 3 жыл бұрын
I have never tried to solder smds, until now... What a great project! I rent a space that has a window that cant be left opened for long periods of time, this project fits my needs !!!
@illygah
@illygah 3 жыл бұрын
that intro music was not expected. You just blew my mind. 10/10.
@illygah
@illygah 3 жыл бұрын
Nicely done. Kicad is the gift that keeps on giving.
@MakerMeik
@MakerMeik 3 жыл бұрын
Thank you, I'm glad to hear that. The intro is based on a song about retro computing that I made with a friend: kzbin.info/www/bejne/b4WsmnxojrNrZ7c (Unfortunately, it is only available in German)
@ilducedimas
@ilducedimas 3 жыл бұрын
A true Renaissance man. Hats off to you my dear.
@edwardsoares3838
@edwardsoares3838 3 жыл бұрын
Great video! Just trying to learn all I can about the ESP8266 and ESP32, hardest part is figuring out what I actually want to build!
@MakerMeik
@MakerMeik 3 жыл бұрын
Hehe ... When I started with the whole topic two or three years ago, the question was rather what I wanted to build *first*. ;-)
@jirihala8684
@jirihala8684 3 жыл бұрын
Realy cool project! Was looking to make something similar but from "modules" and it will take too much space. Your solution is really pretty! One stuff I will update there and it will be that every time it send information about "On/Off" switch, it could send capacity/voltage information about battery. That you will be able to see when you should prepare for battery change. But I understand that if I will put 4000mAh LiIon, that I will dont need to change it for few years :D
@MakerMeik
@MakerMeik 3 жыл бұрын
As I wrote elsewhere in the comments, I already request the voltage at the cpu via ESP.getVcc() in the code. Of course it would have been better with a voltage divider behind the Li-Ion battery, but I think it should be enough to detect when the battery needs to be charged soon. If you revise the PCB and add the mentioned functionality, I would be pleased if you would share this improvement with me and the community on Github. :-)
@repje2010
@repje2010 2 жыл бұрын
Awesome things you make!! and im also started to make a IoT-stack on my Synology NAS 920+ and docker, i have now installed all the packets, and expermiment with node-red with your video's im learning how that works.. very good videos!! (also with the help from the guy with swiss accent hihi)
@oliverhihn8505
@oliverhihn8505 11 ай бұрын
Very well done video, subscribed instantly! Keep it up!
@istvanzilizi6194
@istvanzilizi6194 3 жыл бұрын
IF you forget the Wifi connection and use the ESP-NOW protocol you are able to shorten wake up time by 10 times with the same circuit. If you use on a high side a PMOS FET - controlled by ESP GPIO you are able to use as a switch before a resistor divider and you are able to measure the battery voltage.....
@MakerMeik
@MakerMeik 3 жыл бұрын
Thanks for your suggestions for improvements. I had actually already thought about ESP-now, because the duration of the wake-up phase essentially depends on the connection establishment. And yes, I should have added a voltage divider to my circuit. At least I let my code read out the voltage at the ESP by using ESP.getVcc(). This is at least enough to notice when the voltage is getting low. But the next revision of my circuit should definitely include a voltage divider. Maybe you or someone else would like to update the board accordingly.
@AntonioDellaRovere
@AntonioDellaRovere 3 жыл бұрын
You could further improve your pcb: Below the antenna area of the esp you could spare out the carrier pcb. The pcb material slightly "detunes" the antenna because of its dielectric properties..
@gmag11
@gmag11 3 жыл бұрын
Same could happen because of placing magnet sensor so close to antenna
@AntonioDellaRovere
@AntonioDellaRovere 3 жыл бұрын
@@gmag11 Your point is actually even more important. Great!
@MakerMeik
@MakerMeik 3 жыл бұрын
@Germán Martín and @Antonio Della Rovere: You are absolutely right. Maybe there is someone here who would like to optimize my design accordingly. On the other hand, I now have six of my boards running and fortunately no problems with the wifi signal. In my house, however, there are almost no areas with bad wifi coverage. But I knew that there would be many great ideas coming from you guys. Thanks for the valuable tips.
@ThePlazmaBeast
@ThePlazmaBeast 3 жыл бұрын
A LoRa modual is pretty common in lowpower IoT devices, they can also transmit quite a lot of reliable data. But this is definitly a dope project.
@ivolol
@ivolol 3 жыл бұрын
LoRa is very expensive for this application
@jagannathkulkarni
@jagannathkulkarni Жыл бұрын
Thanks for this nice video. May I suggest - The XOR ic can be replaced with only 2 10k resistors and a 1uf capacitor which can give you a nice negative pulse and save a lot of space. ( pull up both legs of capacitor to vcc with 10k, set the reed switch to GND and one leg of capacitor , get the negative pulse from other leg)
@MakerMeik
@MakerMeik Жыл бұрын
Sounds like a very exciting approach. Thanks for your inspiration. I'm in the middle of another project, but I'll try it out in due course.
@manmeetk3939
@manmeetk3939 Жыл бұрын
Hi bro, I have tried your setup idea but it gives a low pulse only while closing the reed switch contacts. But while opening, it does nothing. We need a low pulse both while opening and while closing the reed switch contacts. How can this be achieved ?
@manmeetk3939
@manmeetk3939 Жыл бұрын
The guy in the following video is amazing. kzbin.info/www/bejne/bpW3amiwd8qVZ7c He just used ATtiny85 chip and programmed it to do all kind of stuff like sending Door open/close code, sending battery low/high codes. And his circuit idea uses only 4mA just for a second while sending code and than at 0.5uA in standby mode. Seems battery would last much much longer.
@smartifi_egypt
@smartifi_egypt 3 жыл бұрын
AWESOME 👍 I was searching for it for awhile, hungry ESP ruined my real wireless battery powered projects, I will try it as soon as possible
@MakerMeik
@MakerMeik 3 жыл бұрын
If you still want to stick with Wemos D1 minis instead of your own PCBs, you can see how to do that here: kzbin.info/www/bejne/qJezqIKqpKyCaqc
@alff3461
@alff3461 3 жыл бұрын
Ein wirklich angenehmes Video 👍😊 Mein Abo hast du 😉
@aba-nascu
@aba-nascu 3 жыл бұрын
You are a genius. Subscribed!
@the_smart_home_maker
@the_smart_home_maker Жыл бұрын
Awesome tutorial 🔥
@ReneKnuvers74rk
@ReneKnuvers74rk 3 жыл бұрын
I was thinking about building me a couple of these, when I ran into the Aqara window sensors. At around €12 you get a tiny zigbee device that has a battery life of over a year (single small lithium coin cell) Don’t get me wrong: your project is awesome and you did a great job. If one is looking for the experience and joy of building this, great. But if the goal is to reach the most practical solution in the shortest time, the Xiaomi Aqara is the fastest route to success.
@MakerMeik
@MakerMeik 2 жыл бұрын
True, but I already explained that in my video. As well as the reasons why I still chose my own design. Besides, I learned a lot in the process ;-)
@patricf209
@patricf209 3 жыл бұрын
Gute Arbeit. Einige deiner Projekte (Tür offen gelassen, Briefkasten, stromzähler, etc) habe ich auch ähnlich umgesetzt. Wenn auch nicht mittels smd oder pcb
@MakerMeik
@MakerMeik 3 жыл бұрын
Normally I have no patience for SMD and PCB designs too. In the end, you have to order them after the design and wait a long time. If you then need the circuit for a single thing, it's hardly worth it. With this circuit, however, I knew that it can be used in many different ways. And for the window-/door sensors alone, it was worth it.
@marcguillamon5998
@marcguillamon5998 3 жыл бұрын
Awesome video! Where do you usually buy the components?
@MakerMeik
@MakerMeik 3 жыл бұрын
The PCBs shown are from PCBway. But you can also find KZbin videos comparing PCBs from the "usual suspects" and they don't seem to be much different in quality. In any case, my boards from PCBway were the cheapest at the time and are absolutely high quality, as far as I can tell.
@brandonvanderryst176
@brandonvanderryst176 3 жыл бұрын
Great video! I would love to see more details about the programming side of things though.
@MakerMeik
@MakerMeik 3 жыл бұрын
I intended the video to be as short and entertaining as possible. If you get as far as to build the circuit or order and solder the PCB, the code really shouldn't be a problem. It is very simple. But if you still need to catch up, I recommend you to watch other videos first, which show you how to let ESPs communicate with a MQTT broker. Andreas Spiess (the guy with the swiss accent) explains here, for example, how you have to program an ESP so that information can be sent via MQTT: kzbin.info/www/bejne/b3iQn4B9mKp_fZo And in this video he shows how you can install your own MQTT broker including iot-stack. kzbin.info/www/bejne/l2fQm6duqbyIrdU
@brandonvanderryst176
@brandonvanderryst176 3 жыл бұрын
@@MakerMeik This really helps, thank you
@keshav2136
@keshav2136 3 жыл бұрын
Great! I've an ESP8266 and I use it for IoT WiFi
@b5a5m5
@b5a5m5 3 жыл бұрын
8:13 wouldn't those caps draw way more current from the regulator than the esp booting from inrush current? Thus making the current spikes worse?
@tonystephens1215
@tonystephens1215 3 жыл бұрын
Great video! 👍👍
@sapuseven6119
@sapuseven6119 3 жыл бұрын
Amazing design! I've thought about starting a similar project recently, so this video came at just the right time. Is there a specific reason why you chose to pulse the EN pin instead of the RST pin?
@MakerMeik
@MakerMeik 3 жыл бұрын
If the logic circuit had been built differently, it would certainly have been possible via the RST pin. Basically, you could also take a smaller ESP, as long as you get the deep-sleep issue under control, and they have only a CH-EN pin. But of course, there would certainly be more options.
@mauriciobaum
@mauriciobaum 2 жыл бұрын
@@MakerMeik Hi! Wonderful project! It is still not clear to me why this logic can't be applied to RST pin without any modification. A LOW state for a brief period of time on RST pin would reset de Esp and wake it up. Wouldn't it?
@PhG1961
@PhG1961 3 жыл бұрын
Nice and interesting video. I liked it and immediately subscribed too ! Looking forward to see more of your videos.
@antmck33
@antmck33 3 жыл бұрын
Subscribed instantly 😀
@gadjetsvideo
@gadjetsvideo 3 жыл бұрын
I'm going to try ESP-NOW with this sensor, it doesn't require a connection to the router or IP address, it connects to another ESP device (Gateway) and can connect, send data in less than 500mS also it will probably have a better range. I t does mean having another ESP permenantley powered up to transfer the data to MQTT but that's no problem and if your router goes down they will continue to talk to each other.
@MakerMeik
@MakerMeik 3 жыл бұрын
I love the idea, and I've mentioned elsewhere in the comments that this would significantly improve battery life. If you get this working I would be very happy if you would share the concept and your code with us.
@rakeshc2723
@rakeshc2723 10 ай бұрын
Please share steps to flash it using esphome for home assistant
@jayytee8062
@jayytee8062 3 жыл бұрын
What if you have a second reed switch that switches the battery on/off so there is no current draw at all....??
@MakerMeik
@MakerMeik 3 жыл бұрын
In my first circuits I actually had a second reed-switch. But that only complicated things and was not really reliable in the end. Maybe you have a better idea and show us how you would solve this.
@wjn777
@wjn777 3 жыл бұрын
Great video, thanks for sharing. I went with a different design, te ESP8266 is powered down, and there is a "power latch" circuit using a P and N channel mosfet (IRF3717) to turn it on when a switch closes. Your video has given me new ideas to think about
@wjn777
@wjn777 3 жыл бұрын
@@2000jago I don't have a link, but it is based on Ralph Bacon's video. I just substituted the IRF3717 as its a convenient SMD package with both a N and P channel MOSFET kzbin.info/www/bejne/nWLVk3x9Z6eCZrc
@myounges
@myounges 3 жыл бұрын
Same here, i feel that switching on and off completely the esp with a latch switch is a little easier on the soldering side. Check for latch switch at random tutorials Rui has nice schematic there. Great video!
@kalvinpearce
@kalvinpearce 3 жыл бұрын
would be super keen to see a zigbee version and how you go about making that!
@MakerMeik
@MakerMeik 3 жыл бұрын
Since I don't use Zigbee here, I'm very happy with my circuit and will now focus on other projects. But maybe you want to deal with the topic and revise my circuit? Zigbee has, as far as I know, also its pitfalls and there are also often problems with the connection strength.
@kalvinpearce
@kalvinpearce 3 жыл бұрын
@@ruakij6452 yooo thats awesome news! thanks for letting me know!!
@tornadokat
@tornadokat 3 жыл бұрын
It would be good to add a watchdog feature so the ESP can wake up once in a while, say every 10 minutes, or every hour, to report in with a battery check, and the receiving side alert you if a sensor has missed a check-in.
@MakerMeik
@MakerMeik 3 жыл бұрын
I now have six of these boards in use and can tell you that if the magnet is placed properly and the Wi-Fi coverage is OK, they work absolutely reliably. By the way, the current voltage at the ESP is sent via MQTT with every wake-up. I let Node-RED send me a notification when the voltage drops below 2.7 V. If it's a window that you open at least every few days, that should be enough without forcing the ESP to wake up every day. But sure, if you want to have that as a fixed heartbeat just to be on the safe side, go ahead. That's exactly why I put my code on Github, so you can adapt it to your needs.
@erjonameti
@erjonameti 3 жыл бұрын
Hi, first of all great tutorial. I have a question about the excel sheet. In your excel, when for example you put AAA batteries the mAh is 600mAh per battery. When you put a number of batteries two, the result is 1200. The AAA battery voltage is 1.5V and you have to use it in series to get around 3V. Does this mean that you have still 600mAh, not 1200mhA?
@MakerMeik
@MakerMeik 3 жыл бұрын
If you connect the batteries in series, the voltage increases, e.g. to 2x 1.5 V = 3.0 V and you still have twice the capacity, so in your example 2x 600 mAh = 1200 mAh. However, you also have to consider the characterisics, how the voltage changes over time during discharging. Depending on when the ESP8266 stops working, you may not get your batteries completely empty, depending on the type of battery you are using. Andreas Spiess has, as so often, made an excellent video about this: kzbin.info/www/bejne/npanYq2taMeAntk
@erjonameti
@erjonameti 3 жыл бұрын
@@MakerMeik Thank you. I appreciate it.
@edwardsoares3838
@edwardsoares3838 3 жыл бұрын
@@MakerMeik This sounds highly inaccurate.
@MakerMeik
@MakerMeik 3 жыл бұрын
@Edward Soares: Hehe ... you seem to be an expert on this subject. Please explain it from your point of view.
@edwardsoares3838
@edwardsoares3838 3 жыл бұрын
@@MakerMeik Rather than from my point of view, I'll explain it from my engineering background based on science and facts. In series your voltage increases and amp-hours stay the same. In parallel the voltage stays the same and the amp-hours increase. So in this scenario @Erjon Ameti is correct to assume as he did. I will agree watt hours energy does stay the same in series or parallel based on volts x amp-hours. So 2x1.5v@600mAh in series is 3v@600mAh and 1.5@1200mAh in parallel both providing 1.8 watt hours of energy consumed differently, one at higher voltage capacity and one at a higher amperage capacity depending on the circuits need. Both ways providing the same watt hours output due to math does not negate the outcome of series vs parallel. This is basic electrical engineering and applies also to resistors, capacitors etc.
@vinceandcreeperlp
@vinceandcreeperlp 3 жыл бұрын
Great Video! I learned a lot :) Any chance to tell me where you ordered your SMD 0805 switch buttons? I dont find them...
@MakerMeik
@MakerMeik 3 жыл бұрын
I have these ones: www.ebay.de/itm/303252945239 50x SMD DIP Mikrotaster ... 2-polig 3x4x2 mm However, they only fit very narrowly on the pads. Minimally smaller buttons or slightly wider pads would make things easier. But it works ;-)
@vinceandcreeperlp
@vinceandcreeperlp 3 жыл бұрын
@@MakerMeik Thank you verry much! I will then update the pads on the PCB to larger ones :)
@quaninhphamhong7130
@quaninhphamhong7130 11 ай бұрын
Sir can i have your gerber file sir? Or at least a picture where you design TP4056 and HT7333. I'm doing a little project but wondering the power source using TP4056 and HT7333 for Li-ion battery. Thank you sir!
@CranckRa1n
@CranckRa1n 2 жыл бұрын
When i use a ESP32 i can use the DeepSleep Pin set to low using a GPIO Pin insted of Reset EN like you on the ESP8266 ? Ore could i send you my Schematic?
@nonameiskickass1319
@nonameiskickass1319 3 жыл бұрын
Sehr toll
@schweizergeizer8028
@schweizergeizer8028 3 жыл бұрын
Kudos for this amazing setup. Finally something easily reusable! You are also probably the first person who actually does data transmission efficiently and securely. The alternatives to wifi like bluetooth are a disaster from security perspective. What I'm really curious in this setup: How big was your total latency with and without DHCP from triggering the sensor until the message arrived?
@MakerMeik
@MakerMeik 3 жыл бұрын
With the fixed IP address, it takes about 3 seconds for the message to be transmitted, as explained in the video. If the IP address must first be negotiated via DHCP, the time increases to about 5 seconds. The actual transmission of the MQTT message works almost without any significant time delay, or at least in much less than a second. This can easily be tested by letting an ESP8266 send MQTT messages e.g. with a permanent power connection. So what costs time is actually just the boot process and the establishment of the Wifi connection. That's why it's worth optimizing this. If you have a more time-critical application somewhere where the 3 seconds to message is too long for you, you won't get around a permanently awake ESP and thus need a permanent power supply.
@Gooloso98
@Gooloso98 3 жыл бұрын
Which alternatives are you referring to, I'm trying to make something more efficient than WiFi. Does using zigbee for instance could improve battery life?
@MakerMeik
@MakerMeik 3 жыл бұрын
As I have just written elsewhere in these comments, I think a solution with ESP-now should increase the efficiency significantly. The user @Aaron Zhang has kindly provided a link to the video of @Anreas Spiess, where he discusses exactly this topic: kzbin.info/www/bejne/bH_Wc4FqZ6drZrM
@asdomega
@asdomega 3 жыл бұрын
Nice video, but did I miss the Part with the Windsensor?
@MakerMeik
@MakerMeik 3 жыл бұрын
Hehe ... I think there are already enough tutorials about wind sensors and weather stations. I try to focus my videos (mostly) on showing things that you can't find (completely) on KZbin yet. Whereby, the longer I think about it, the more I have aspects to weather stations in mind, which are not yet really covered on KZbin ... let's see, maybe there will be something about this topic some day 😂
@sandeshshakya5900
@sandeshshakya5900 3 жыл бұрын
I'm new to PCB design. At 8:15, is there a reason why you chose those types and values of capacitors?
@MakerMeik
@MakerMeik 3 жыл бұрын
This is a recommendation I have from several other tutorials. What is clear is that if you do not use the capacitors, the peaks may cause the boot process to fail. The electrolytic capacitor has the larger capacity and therefore lasts a little longer, the ceramic capacitor is much smaller, but reacts much faster. With this combination you are well prepared. If you build your own circuits, you should make sure that the capacitors are as close as possible to your microcontroller. This is especially important for long cable lengths between power supply and ESP.
@steffenuhlig1970
@steffenuhlig1970 3 жыл бұрын
This looks terrific! Any chance you selling the PCB; perhaps with the SMD components pre-assembled?
@MakerMeik
@MakerMeik 3 жыл бұрын
Hehe ... thanks, but the assembly is the biggest fun factor of that ;-) Nevertheless, I didn't intend to open a business model with the boards. And since you can order them extremely cheap in China, it makes no sense to sell the boards by myself.
@superbikeengineer
@superbikeengineer Жыл бұрын
I tried building one. 5 pcbs actually. Had gpio13 connected to the reed switch. Out of 5 pcbs one was working as expected after some modifications. I made some more modifications and forgot to save the one that worked . And now i have 5 pcbs, none of which are working as expected. Can you help?
@nkronert
@nkronert 3 жыл бұрын
1st comment for once 🙂. I bet that the battery lasts longer than the double sided tape. Thanks Meik! 👍
@sheminasalam
@sheminasalam 2 жыл бұрын
Hi there I have an issue with version 1 of this sensor. It would be good if you could help me out with it. My sensor can detect when the window is open without any issues. But when it comes to closing, it wont work all the time. I tried to diagnose the issue with serial monitor and found that when the window is being closed, the esp8266 starts to wake but before executing any functions, it hangs up. One more thing I noticed is that when this problem occurs the onboard led won't even blink like when the board boots up. But when we push the reset button(GPIO16) in closed state, the device boots fine and completes action and sleeps. Is this a code issue or some hardware issue? what can be the issue? I am confused because majority of the time this works fine.
@NorthcodeNoCh
@NorthcodeNoCh 3 жыл бұрын
Cool Project! Not sure about the capabilities of the esp but when I worked with microcontrollers you usually can register an interrupt on a gpio pin to trigger a wakeup. I wonder if it's possible to register such an interrupt on both edges of the reed switch which would then eliminate most of the custom circuitry and might even save power because the boot sequence can be skipped. Edit: nvm, seems that the esp doesn't support gpio interrupt wakeup, so your solution seems to be one of the ways to go.
@MakerMeik
@MakerMeik 3 жыл бұрын
Thanks for the cool idea. And that you also researched the answer to your question right away. I found the approach fascinating and was already about to start looking for it too.
@FrancoisvanderMerwe
@FrancoisvanderMerwe 2 жыл бұрын
Ahh man, I blindly started exactly the same kind of project and did so much head scratching I am now bold! This video helped me A LOT! I am quite curious about the minimal circuit of the ESP-12 module. I am only pulling Enabled Pin high with a 10k resistor and my ESP's run perfectly, I only use the GPIO0 and 15 for programming the module. Another thing that I am wondering about is the Reed switch. Is there a SMD alternative?
@MakerMeik
@MakerMeik 2 жыл бұрын
There are numerous subtypes of ESP12 modules (12S, 12N, 12F, 12E, ...). Some of them have the pullup resistors already built in, others not. This video explains the differences well: kzbin.info/www/bejne/pJCkkGuPad2Brpo However, I didn't really realize this until after my project and video. For the reed switches, there are definitely alternatives with plastic housings. A general alternative to reed switches are hall-effect sensors. But these always need a power supply and therefore they consume a little bit of current even in idle state. That's why I decided against them. I didn't investigate this further though, maybe there are models that draw so little power that it doesn't really matter. As mentioned in my pinned comment, I am a fan of my viewer, named Gadjet. He has developed the project a lot further. His focus has been on minimizing the circuit and extending the battery life. He achieves this by using ESP-now instead of the WiFi connection: github.com/gadjet/Window-Door-Sensor-V3/ So this project is definitely worth a look.
@FrancoisvanderMerwe
@FrancoisvanderMerwe 2 жыл бұрын
@@MakerMeik thank you sooo much for the reply and making things clear for me! Really much appreciatd! I am going to do some experimentation of my own :D Wish me luck! Keep up the good work!
2 жыл бұрын
Hi, I hope someone can help. The first 5 window opening sensors I put together are working perfectly, but the last 3 are suffering from the same problem that I can't figure out what is causing it. When I apply voltage to the board from the battery, it works, wakes up and signals, and as long as it is awake the esp detects and signals the change in the magnet. Once the esp goes to sleep the voltage on the enable leg disappears and can no longer be woken up by moving the magnet. To the best of my knowledge all soldering is ok. Anyone have any idea where I can look for the fault?
@scream221
@scream221 3 жыл бұрын
Since the module has to wake up first I assume the signal is not instand. What is the delay from opening the window to a signal in node red?
@MakerMeik
@MakerMeik 3 жыл бұрын
The module needs about 3 seconds for the Node-RED signal. The majority of the time is needed to establish the connection. With a permanent connection, the MQTT signal arrives almost without a noticeable time delay. So if you need a faster connection, you either need a permanent Wifi connection, which prevents the feasibility with a battery, or you have to switch to another wireless technology. ESP-Now could then be a compromise.
@RixtronixLAB
@RixtronixLAB 3 жыл бұрын
Cool video, thanks :)
@manmeetk3939
@manmeetk3939 Жыл бұрын
I've built the XOR gate circuit as shown in the video, but I'm only getting a low pulse while closing the door ( reed switch ) and while opening the door, it doesn't provide a low pulse to wake the esp chip. I have rebuilt the circuit on a breadboard but same results. Can anyone tell, What could be the reason ?
@manmeetk3939
@manmeetk3939 Жыл бұрын
The guy in the following video is amazing. kzbin.info/www/bejne/bpW3amiwd8qVZ7c He just used ATtiny85 chip and programmed it to do all kind of stuff like sending Door open/close code, sending battery low/high codes. And his circuit idea uses only 4mA just for a second while sending code and than at 0.5uA in standby mode. Seems battery would last much much longer.
@teuluPaul
@teuluPaul 3 жыл бұрын
This excellent video just popped up in my feed - many thanks! I have liked & subscribed, and I will have a look through your other videos. I like the look of your radiator thermostats - I have so far struggled to find a suitable unit to use here, but I am still looking. Which did you go for? For this video, the only tiny change I would make - a small case for the magnets rather than tape on the window frame!
@MakerMeik
@MakerMeik 3 жыл бұрын
I have thermostats from Eqiva. Mine are quite old and do not even have Bluetooth ... so I myself have not yet implemented the suggestion from my own video to turn down the thermostats when the window opens. In fact, I would buy "smart" thermostats also only for this purpose and only where it makes sense. So for the bathroom and the toilet. I don't think you can save money with these things. It makes much more to optimize your central heating. I plan for the next few weeks to make a video about it. The keyword here is "hydraulic balancing". By the way, the Eqiva thermostats *without* Bluetooth have an amazingly long battery life. Unfortunately, I can't tell you which thermostats *with* Bluetooth also have such a long battery life, so you should definitely check beforehand. Nothing is more annoying than having to replace the batteries every half year.
@teuluPaul
@teuluPaul 3 жыл бұрын
@@MakerMeik Thanks for the reply! I tried the Schneider Electric thermostatic valves, but found that they would reset their state to open after I had closed them. This proved very frustrating, so in the end after trying to discuss with their support team I sent them back. The heating in our house is well balanced, but the problem is that I don't want to have to remember to turn the thermostatic valves down when leaving a room. For example, the bedroom heating doesn't need to be on during the day, but I would like it to warm the room up before we go to bed. Last night, the thermometer on the wall showed 15C when I went to bed, because I had turned the valve down in the morning, and hadn't gone and turned it back up before going to bed. Of course, 15C is not too bad, but also winter isn't here yet!! The Schneider Electric valves are (IIRC) zigbee protocol, and have a reported battery life of about 1 year. Like you, I wouldn't install them in every room, but only those which matter - probably the living room and the bedrooms. As long as I can set the valve state, ideally from (say) 0 to 100, and can read the battery state, that is all I need. I would use different temperature monitors to gauge the room temperature. When I looked last time and decided on the Schneider Electric thermostats, it seemed that everyone wanted to tie you into their ecosystems for control. This is a big no-no for me! I guess I will have to keep looking...!
@MakerMeik
@MakerMeik 3 жыл бұрын
The thing with the manufacturer clouds is the same for me. That's why my smarthome currently consists of 100% own circuits or at least smart devices with ESP8266, which I have reflashed to Tasmota. And that's also the reason why I've been hesitant about thermostats so far. But I plan to take the time to take a closer look at this topic. I'm not sure if there are reasonable thermostats that can be reflashed to Tasmota and have enough battery life. Recently I discovered a project that looks promising: github.com/proemtech/Model-N-Thermostat But I don't know if it's any good. I had also considered making my simple thermostats smart. Today I really think I can do it with a reasonable battery life. But whether the tinkering is really worth it and how nice it looks in the end is another question. In this case, I would tap the pulse generator, as someone has already done here: kzbin.info/www/bejne/oZ6vXouwfc92bNU And beyond that, I would try a JDY-23. That's a Bluetooth LE chip that consumes only 1µA when in receive mode, thanks to Bluetooth 5.0. But maybe I'll just buy a ready-made solution. If you have found something good in this regard, then I would be happy about a recommendation.
@MakerMeik
@MakerMeik 3 жыл бұрын
Oh, and one more addition on the subject of temperatures. What many people forget is that it is not only the simple radiator that gives the pleasant feeling of warmth. Instead, at least in massive houses, the walls and ceilings warm up and then quickly return the heat evenly to the room, for example after cold airing. So if you cool the whole room down during the day and warm it up again in the evening, the radiator is very busy bringing the walls and slabs back up to temperature. So the savings should be much smaller than expected. Modern buildings take advantage of this and build the heating hoses directly into the concrete slabs. The keyword is "Concrete Core Thermal Activation". At the latest then you will realize the inertia of the system. If you try to simulate this with thermostats on a normal radiator, you should at least take this inertia into account and bring forward the switch-on and switch-off process by a few hours.
@f.g.4309
@f.g.4309 2 жыл бұрын
Hi, Can I ask once question why GPIO 15 have to pull down to ground?
@MakerMeik
@MakerMeik 2 жыл бұрын
Hi, your ESP will not boot if you don't pull it to GND.
@f.g.4309
@f.g.4309 2 жыл бұрын
Oh wow, thank you I am very new in here.
@shekharnandkoemarsing158
@shekharnandkoemarsing158 3 жыл бұрын
You glossed over it in the video, but how did you end up actually flashing the bare esp module? Is there a guide you followed for this or did you figure it out on your own. I read the esp module documentation from espressif myself, but I somehow still did not manage to get it working, any help?
@MakerMeik
@MakerMeik 3 жыл бұрын
You're right, I've only touched on many topics to keep the video as compact and entertaining as possible. That's why it's not necessarily aimed at absolute beginners. But the software side is not very complicated. You connect the pins RX and TX crosswise to the RX and TX pins of a USB-to-TTL converter. In addition you connect 3.3v and GND of the converter, and then you can upload the ino file via the Arduino IDE or PlatformIO, if you have installed the necessary libraries there. I have already shown the basic principle of using the USB-to-TTL converter in my ESP32-cam-basics-video. With the window sensor you just do the same. kzbin.info/www/bejne/hZbSmIawgc2Fgs0
@sheminasalam
@sheminasalam 3 жыл бұрын
Hi there, really I appreciate the good work. I was wondering if it would be possible to use the analog pin in ESP to measure the voltage of the battery and pass it on as a mqtt message so that we can recharge the battery at the correct time.
@MakerMeik
@MakerMeik 3 жыл бұрын
Yes, I should have added a voltage divider to my circuit. At least I let my code read out the voltage at the ESP by using ESP.getVcc(). This is at least enough to notice when the voltage is getting low. But the next revision of my circuit should definitely include a voltage divider. Maybe you or someone else would like to update the board accordingly.
@sheminasalam
@sheminasalam 3 жыл бұрын
@@MakerMeik Thanks mate for the reply. I was thinking about how to reduce the update time for this without compromising the battery and then I found the esp-now hub and spoke model. In that the sensor module uses esp--now to communicate which an esp-now mqtt gateway, both being esp modules. The advantage of this is that data transfer takes places in the range of milliseconds also battery usage is reduced. With my limited knowledge I wont be able to adapt this to your system but I think this firmware system can be adapted to your hardware. In your next upgrade I wish you could look into this also.
@sheminasalam
@sheminasalam 3 жыл бұрын
I have upgraded this sensor with ESPnow, making the update interval less than 1 second. Also have added the voltage divider. Thanks
@Fake_kitchen
@Fake_kitchen 3 жыл бұрын
Nicht schlecht 💪
@jojoii7287
@jojoii7287 2 жыл бұрын
Ist es möglich auch mehrere Reed-Kontakte anzubringen und wenn ja, wie?
@MakerMeik
@MakerMeik 2 жыл бұрын
Klingt nach einer interessanten Erweiterung der Schaltung. Ich denke, das sollte machbar sein. Du musst nur dafür sorgen, dass auch der zweite Kontakt den ESP "aufwecken" kann und dann den Status beider Reeds überprüft. Vielleicht findest du ja eine Lösung für dieses Problem. Falls ja, würde ich mich freuen, wenn du mein Github-Projekt forkst und deine Lösung mit der Community teilst. Ich würde den Link auch in die Video-Beschreibung packen.
@CranckRa1n
@CranckRa1n 2 жыл бұрын
Where do you order original parts ?
@MakerMeik
@MakerMeik 2 жыл бұрын
For the PCBs, I don't think it matters where you order, at least the well-known manufacturers all deliver good quality. So it's more of a trade-off between price and patience, since deliveries from China take a long time. The other components I have ordered mainly on Aliexpress and ebay from various suppliers.
@maxcoff2
@maxcoff2 3 жыл бұрын
Hi. How long does it take from the actuation of the reed switch to the arrival of the MQTT message?
@MakerMeik
@MakerMeik 3 жыл бұрын
This mainly depends on how fast the ESP can connect to the wifi. The fixed IP address helps a lot and with that you are at about 3 seconds.
@maxcoff2
@maxcoff2 3 жыл бұрын
@@MakerMeik If use this to turn on the light on the motion sensor, then the time delay may be so long. But in other cases it's very cool. Sorry for my english
@MakerMeik
@MakerMeik 3 жыл бұрын
That's right, it is not suitable for that purpose. I just stumbled across the extremely exciting JDY-23 Bluetooth module. This is capable of Bluetooth LE and consumes only 1 µA of power in "listening mode". This would certainly allow you to build a more responsive circuit, if Bluetooth is a solution for you. The range without walls is supposed to be 60m. Maybe you want to think about a circuit based on this ;-)
@robinbinder8658
@robinbinder8658 3 жыл бұрын
Nochn deutscher kleinelektronik Kanal nice subbed
@shayl2x
@shayl2x Жыл бұрын
This is truly brilliant! Although I know nothing about electronics, you inspired me to want to try this. I'm a complete beginner and looking at how to run a Servo (MG995) with ESP8266 and it seems impossible to share the same output charge for them both as one requires 3.3v while the other requires 5v-9v, yet I see some tutorials that show it IS possible - but NOBODY explains the electricity side of it... isn't it wrong to use the same output charge for both ESP8266 and a Servo?? do I need separate batteries for each of them? why some people get it to work?
@liambiddle4155
@liambiddle4155 Жыл бұрын
There are two ways of doing this. First is to step down to the ESP8266 by supplying an input voltage of 4.8-7.2 V to the servo motors and use a Low Dropout voltage regulator down to 3.3v for the ESP8266. The second way is to step up the 3.3V to 4.8-7.2 V with a boost converter. Your servo motor takes in a driving voltage (VIN), which will need to be between 4.8-7.2 V. It'll also take in ground (GND). Finally, it'll take in a control wire. It's very likely the logic level circuit for the servo will accept 3.3V. If it doesn't work, you need a logical level translator chip which will take in a 3.3V PWM signal, and output a 5V PWM signal. The alternative is to use a microprocessor that operates at 5V like an Arduino.
@shayl2x
@shayl2x Жыл бұрын
@@liambiddle4155 thanks! I found most of what you said to be true in a painful way but I solved it simply by using an ESP32
@MoritzvonSchweinitz
@MoritzvonSchweinitz 3 жыл бұрын
Great! Do you know if there is a (cheap) generic board like this available which ideally runs on AA batteries (or similar)? I dream of a generic battery ESP8266 board that wakes up based on some state-change (exctly like yours does), and maybe then powers up an attached sensor and reads it (e.g. via I2C), transmits the data and then goes to sleep again.
@MakerMeik
@MakerMeik 3 жыл бұрын
Unfortunately no. I recently heard of an ESP32 that is optimized for this purpose, but I can't come up with the name right now. The price was also quite high though. But as I have shown in the video, it is quite easy to design yourself an appropriate board. And I can tell you, it's a lot of fun to design your own board and hold it in your hands later. If you want to use AA batteries, however, you should pay attention to the discharge characteristics, which are very different depending on the technology. Andreas Spiess has once again made a very good video about this: kzbin.info/www/bejne/npanYq2taMeAntk
@sebastien4116
@sebastien4116 2 жыл бұрын
Things on Edge Cricket may do what you want
@MoritzvonSchweinitz
@MoritzvonSchweinitz 2 жыл бұрын
@@sebastien4116 cool! Thanks! Sounds almost ideal!
@MoritzvonSchweinitz
@MoritzvonSchweinitz 2 жыл бұрын
@@sebastien4116 you meant "OKdo CRICKET V1.0" by "things on edge", I think.
@sebastien4116
@sebastien4116 2 жыл бұрын
@@MoritzvonSchweinitz no, "Things on Edge" is the manufacturer, and board is called "IoT Cricket module". OKdo is just one of the resellers.
@gadjetsvideo
@gadjetsvideo 3 жыл бұрын
A great video and I've tried Kicad for the second time and it's a lot better than when I last tried it out a few years ago. In your schematic you have R3 - 10k between 3V3 and GPIO2 shouldn't it be connected between 3V3 and GPIO0?
@MakerMeik
@MakerMeik 3 жыл бұрын
Oh no, you're absolutely right. I just couldn't believe my own eyes. Yes, the pullup should be connected to GPIO0. I have six of these circuits running here now, some of them for about a year. And I can fortunately say that they work reliably even despite the error. The layman is amazed and the expert wonders. 😂 Nevertheless, I have of course immediately corrected my KiCAD and Gerber files on Github and have already verified this by manually modifying a PCB. So if someone runs into the problem, it can be fixed with a small piece of enamelled copper wire and a scalpel. But it is best to do this before soldering the ESP-12 module. Thank you, @gadjetsvideo, for thinking along and sharing your findings 👍
@gadjetsvideo
@gadjetsvideo 3 жыл бұрын
@@MakerMeik We've all done it! I designed a PCB for work a few years ago and when they came back (much more expensive than $10 :-) ) there were two surface mount port expanders that had the wrong footprint and I spent ages sticking them on upside down and using wire wrap wire to connect each pin to the PCB.
@Ramdaron
@Ramdaron 3 жыл бұрын
Hi. What kind of soldering iron are you using here? 11:54
@MakerMeik
@MakerMeik 3 жыл бұрын
I have built the soldering iron according to the construction proposal "Maiskolben". There is an article about this in the German "Make" (unfortunately only in German) www.heise.de/make/artikel/Platine-fuer-DIY-Loetstation-Maiskolben-3569923.html The developer also has a store where you can order the PCB. But these are often not in stock. hannio.org/en/produkt/maiskolben/ The soldering station uses the professional soldering tips from Weller, I use e.g. the Weller RT 1, and it controls them via an Arduino. The total sum of the components is about 80 EUR. However, in the meanwhile I also bought a Miniware TS80P, which has a similarly good handling and costs similarly much, but without the tinkering effort.
@Ramdaron
@Ramdaron 3 жыл бұрын
​@@MakerMeik It seems to be more expensive than a diy kit from aliexpress for hakko t12 soldering tips. Thanks!
@zzizzimizzi6028
@zzizzimizzi6028 3 жыл бұрын
What trippp you usinng,your voice ....
@brianramirez6794
@brianramirez6794 2 жыл бұрын
How much your circuit will change if you use ES32 module ?
@MakerMeik
@MakerMeik 2 жыл бұрын
I don't think this would make much difference in the circuit. After all, you are putting the ESP to deep sleep, which the ESP32 can do just as well. But since the ESP8266 is already being bored, the question is why you would want to switch to an ESP32. An of course the ESP32 has a different footprint. This is not only a bit bigger, it also has a different pinout and a different grid size of the pads. So a redesign of the PCB would be necessary. But from my point of view the basic principles would remain the same as before.
@hanssprungfeld4110
@hanssprungfeld4110 3 жыл бұрын
Wie hast du die platine von der Größe begrenzt?
@MakerMeik
@MakerMeik 3 жыл бұрын
That's true, I left that out for time reasons to keep the video compact. In KiCAD Pcbnew you switch to the "Edge.Cuts" layer in the top menu and simply draw the contours as lines (sidebar: Add graphic line).
@mohammedbenhadine
@mohammedbenhadine 3 жыл бұрын
A Masterpiece
@noonecz5201
@noonecz5201 3 жыл бұрын
Can't you make it recharge it self by adding a string and some smaller energy generator?
@MakerMeik
@MakerMeik 3 жыл бұрын
As I have already said elsewhere in the comments, the only thing I can think of on this subject is solar panels. And they would have to be of a proper size for the system to run autonomously. In terms of saving money or environmental aspects, however, this is unlikely to make much sense.
@noonecz5201
@noonecz5201 3 жыл бұрын
@@MakerMeik Oh.. I guess I missed that, still thx for the answer :D
@danielkoenen859
@danielkoenen859 3 жыл бұрын
Why is WiFi overkill when using mqqt
@MakerMeik
@MakerMeik 3 жыл бұрын
Wifi was never designed to save energy. It would therefore already be possible to save energy by using other communication standards. Keywords here would be Bluetooth LE, LoRa or at least ESP-now. However, each of these connection types has different challenges. For example, low range, higher device costs or the need for additional hardware. That's why I have chosen to stick with Wifi. But in a few years, of course, it could all look different again.
@KrnlKlink1
@KrnlKlink1 3 жыл бұрын
Does this report battery voltages?
@MakerMeik
@MakerMeik 3 жыл бұрын
Yes, but only the voltage behind the voltage regulator. I think it is also possible to read the battery voltage directly, but I did not realize that here. On the other hand, it is not necessary. The voltage stays at 3.3 V for a long time and everything is OK. If the voltage slowly drops to 2.5 V before the ESP does not boot anymore, there is enough time to react. If you want you can set up a message in Node-RED, for example from 2.7 V on.
@chrischris2799
@chrischris2799 2 жыл бұрын
Moin, würdest du das auch als fertiges Kit verkaufen?
@MakerMeik
@MakerMeik 2 жыл бұрын
Tut mir leid, ich teile hier zwar mein Wissen, aber hatte nicht vor ein Geschäftsmodell daraus zu machen. Wie im Video beschrieben sind Bauteile aber äußerst billig. Und es ist ohnehin eine gute Idee, sich mit den Standardbauteilen auszustatten.
@chrischris2799
@chrischris2799 2 жыл бұрын
@@MakerMeik das wohl wahr, leider fehlt mir persönlich die Zeit. und die Alternativen mit tuya sind auch immer ein Glücksspiel ob's noch ESP oder schon Arm ist. Wenn du einen Service kennst der die Platinen herstellen und bestücken kann, wäre ich sehr dankbar :-)
@MakerMeik
@MakerMeik 2 жыл бұрын
Ach, eine Sache noch: Einer meiner Zuschauer namens Gadjet hat meine Platine weiterentwickelt, deutlich verkleinert und ESP-now-fähig gemacht. github.com/gadjet/Window-Door-Sensor-V3 Wenn ich das richtig sehe, denkt er darüber nach das Set künftig über einen Tindie-Store zu vertreiben. Vielleicht ist das ja interessant für dich.
@M4XD4B0ZZ
@M4XD4B0ZZ Жыл бұрын
Wow crazy intro 😅
@browaruspierogus2182
@browaruspierogus2182 3 жыл бұрын
but.. why would you use bloated Arduino and slow protocols like mqtt...
@MakerMeik
@MakerMeik 3 жыл бұрын
MQTT transfers the data in fractions of a second, I don't see why that should be a problem. Since all my smart home/IOT components are based on it, there is no reason to choose anything else. The only time waster is the WiFi connection setup, which you could speed up with ESPnow for example. But just tell us how you solved this. Do you already have a finished project or even a youtube video that we can watch as a tutorial.
@kingundfaker
@kingundfaker 3 жыл бұрын
Hi meik wie hast du dir das ganze Wissen dafür angeeignet? Oder wie sollte ich mir das Wissen dafür aneignen?
@MakerMeik
@MakerMeik 3 жыл бұрын
Hi Nudel, als Grundlage hatte ich mir ursprünglich den "ELEGOO UNO R3 Ultimate Starter Kit"-Baukasten mit Arduino gekauft. Da sind schon einige Tutorials dabei und vor allem hast du dann schon mal eine ganz gute Grundausstattung an Elektronikbauteilen. Beim Stichwort "Arduino" findest du auf KZbin jede Menge Tutorials. Und dann kommen einem schnell Projektideen und man hangelt sich so langsam von einem Tutorial zum nächsten, um Antworten auf die aufpoppenden Fragen zu bekommen. Gerade am Anfang wirst du das meiste auf KZbin finden. Empfehlenswert sind vor allem die Kanäle von Andreas Spiess und Great Scott. Bitbasteleien finde ich auch grandios, auch wenn die Machart der Videos ein bisschen scheppig ist ;-). Aber es gibt noch viele weitere gute Kanäle ... auf meiner Kanal-Hauptseite habe ich sie als "Hot Channels" verlinkt. Mein erstes richtiges Projekt war dann eine einfache Wetterstation. Damit das per WLAN klappt, war bin ich dann schnell vom Arduino zum ESP8266 (in Form von Wemos D1 mini's) gewechselt. Der Code (per Arduino IDE) bzw. die Bibliotheken sind meistens identisch, aber der ESP hat eben zusätzlich WLAN. ESP32 haben darüber hinaus noch Bluetooth und sind noch leistungsfähiger. Dann brauchst du etwas, um die Daten entgegenzunehmen, also bist du schnell bei einem Raspi oder altem Notebook, auf das du ein Linux installierst, zusammen mit dem "IOT-Stack". Und für Gehäuse, etc. willst du schnell einen 3D-Drucker. Ich sage dir, da kommt das eine ganz automatisch zu anderen ... da musste ich gar nicht so viel nachdenken ;-) Mich lässt das Thema jedenfalls nicht mehr los und die Möglichkeiten scheinen unbegrenzt.
@kingundfaker
@kingundfaker 3 жыл бұрын
@@MakerMeik also erstmal wow danke für die schnelle ausführliche Anleitung :) Ich begeistere mich auch schon länger für das Thema und hab auch schon ein paar Ideen jedoch hab ich immer das Gefühl das die Grundlagen auf KZbin leider nicht so erläutert werden, warum man etwas macht 😅 aber dein Kommentar ist gescreenshoted Vielen Dank nochmal für die Info :)
@Spelter
@Spelter 2 жыл бұрын
You are right, it would be better to send out a few easy 433mhz signals, no mqtt needed, just the Id and the receiver creates the Mqtt message. But cool idea, keep on hacking. If it is too much of and overkill, it's just 2 or 3 euros, so why not.
@BlueyMcPhluey
@BlueyMcPhluey 3 жыл бұрын
what would you use if you weren't using WiFi?
@MakerMeik
@MakerMeik 3 жыл бұрын
So far I only use WiFi, otherwise I would not have built it that way. But it is clear that there are other communication standards, where the energy saving was more in focus during the development (Bluetooth LE, Lorawan, DECT ULE, Zigbee, ...). Also based on Wifi, but with much faster connection establishment is ESPnow, by the way. But I currently lack experience with all these standards myself. Maybe another viewer knows more about that.
@ardhi1269
@ardhi1269 3 жыл бұрын
I like the intro so i subscribe
@MakerMeik
@MakerMeik 3 жыл бұрын
Thank you, I'm glad to hear that. The intro is based on a song about retro computing that I made with a friend: kzbin.info/www/bejne/b4WsmnxojrNrZ7c (Unfortunately, it is only available in German)
@MrMohab0
@MrMohab0 3 жыл бұрын
How much did it cost you in total?
@MakerMeik
@MakerMeik 3 жыл бұрын
Since the prices are currently varying due to the corona-related supply bottlenecks, I had intentionally avoided to name a final price in my video. Besides, you buy a small stock of SMD components, so it is difficult to limit this to the price of a single board. And it is hardly reasonable to order less than 10 boards. But I can tell you that the 10 boards will find a place in your house faster than you like ;-) My order (before Corona) was at approx: 1.40 EIR ESP-12F 1.00 EUR PCB 0.30 EUR XOR-IC (74HC86N) 0.50 EUR TP4056 0.20 EUR SMD-Capacitors and resistors 0.30 EUR 1000uF Capacitor 0.10 EUR HT7333 0.10 EUR N/O-Reed switch 1.00 EUR Cheapo Li-Ion (not recommended ;-) _________ sum: just below 5.00 EUR In the meantime, however, many components have become more expensive, as I said, so that it will probably be closer to 10 EUR today.
@Nickle314
@Nickle314 3 жыл бұрын
a battery monitor to send a message when the battery needs to be changed. Once a day would be sufficient.
@MakerMeik
@MakerMeik 3 жыл бұрын
As I wrote elsewhere in the comments, I already request the voltage at the cpu via ESP.getVcc() in the code. Of course it would have been better with a voltage divider behind the Li-Ion battery, but I think it should be enough to detect when the battery needs to be charged soon. If you revise the PCB and add the mentioned functionality, I would be pleased if you would share this improvement with me and the community on Github. :-)
@Nickle314
@Nickle314 3 жыл бұрын
@@MakerMeik I'm not that much of an expert. I've just started down the Home Assistant route and have been making a todo list. The low powered battery route is certiainly attractive. Humidity, temperature, light. noise, etc all fit the same mold.
@MaxtanStarack1209
@MaxtanStarack1209 3 жыл бұрын
Amzing
@svenkicherer
@svenkicherer 3 жыл бұрын
your 100 nF capacitor has the wrong symbol - it should be unpolarized. but besides this: nice project!
@morsine
@morsine 3 жыл бұрын
Cool intro!
@MakerMeik
@MakerMeik 3 жыл бұрын
The intro is based on a song about retro computing that I made with a friend: kzbin.info/www/bejne/b4WsmnxojrNrZ7c (Unfortunately, it is only available in German)
@morsine
@morsine 3 жыл бұрын
@@MakerMeik thanks mate. i like your version more
@kocherovkn
@kocherovkn 3 жыл бұрын
Looool. Man just use a reed switch with million years of life without all this boards xD
@alexgavr6084
@alexgavr6084 3 жыл бұрын
Hi. Very good project! Trying to order boards on the PCB, but I got the answer that no drill in your file. Could you please add a file. Thank you!
@MakerMeik
@MakerMeik 3 жыл бұрын
That's right, I had forgotten the file when exporting from KiCAD. I just added the file and updated the Gerber.zip on Github ;-)
@alexgavr6084
@alexgavr6084 3 жыл бұрын
@@MakerMeik thank you
@abdoun8214
@abdoun8214 Жыл бұрын
More videos.. please!
@burhanuddinbhiwaniwala618
@burhanuddinbhiwaniwala618 3 жыл бұрын
sir great video but you circuit would be much smaller if instead of using XOR gate you could simply connect a pnp transistor to the EN pin and connect any available Gpio pin to En pin so when switch truns on it would start esp send the mqtt msg and gpio pin would keep the En pin high for certain milliseconds to give enough time for the MCU to do its stuff and then pulls low turning the esp off again.....
@MakerMeik
@MakerMeik 3 жыл бұрын
Sounds very interesting. But I don't quite understand how this can work if the reed switch is not switched on but switched off while opening the window.
@burhanuddinbhiwaniwala618
@burhanuddinbhiwaniwala618 3 жыл бұрын
@@MakerMeik yeah i myself realised it after i posted my comment that in this situation you need a physical input also after starting the MCU..... OR we can simply have it in the code that as soon as the MCU restarts it would send the msg but only If you just have one task to execute... But with your design we could have multiple inputs and multiple task too....
@yourpersonaldatadealer2239
@yourpersonaldatadealer2239 3 жыл бұрын
(GPIO_SENSOR=window) ? 1 : 0 We got a one Larry, yeh. That’s a window.
@garymccrohan7247
@garymccrohan7247 2 жыл бұрын
What is the code?
@MakerMeik
@MakerMeik 2 жыл бұрын
You can find the links in the video description. The code from my video is here: github.com/MakerMeik/Window-Sensor But maybe you would like to try the ESP-now-alternative, than you should check the Github-site, PCB and code from gadjet (see video description)
@NoProblem76
@NoProblem76 3 жыл бұрын
Is it possible to power the circuit with some kind of magnet and coil setup? If we use the mechanical energy of opening/closing the door/window, then we can ditch the battery.
@MakerMeik
@MakerMeik 3 жыл бұрын
That sounds very interesting. Unfortunately, I am not (yet) familiar with the topic of energy harvesting. In my video you have seen how I calculate the power consumption with the spreadsheet (during the wake phase about 80 mA - for about 3 seconds and during the deep sleep about 0.03 mA). So if I haven't miscalculated and the battery is supposed to last a month even without window movement, you would have to harvest about 5 mAh per movement. My brief research tells me that this will be hard to achieve. Maybe I'm wrong, though. But a solar panel would certainly be an alternative. Here about 150 uWh/d should be sufficient. If you manage to have the solar panel occasionally in the sunlight area, this could work with a small panel (50*100 mm). However, as I said, I do not know much about this topic. Maybe you or someone else has more experience and can tell us something about it.
@NoProblem76
@NoProblem76 3 жыл бұрын
@@MakerMeik Maybe we could consider using ESP-Now and ditch WiFi here, as discussed by Andreas here, kzbin.info/www/bejne/bH_Wc4FqZ6drZrM, each transmission will only take 220ms rather than 3 seconds. I'm no expert either, I hope someone else can give us some advice here :D
@MakerMeik
@MakerMeik 3 жыл бұрын
Indeed, that would also be my approach to extend the battery life significantly. On the other hand, you then need an additional ESP, which I wanted to save. And a runtime of several years is actually OK. And after all, at least rechargeable batteries discharge themselves over time.
@gabiold
@gabiold 3 жыл бұрын
@@MakerMeik I think a small solar cell, like those in calculators, would be easier than a mechanical think. I actually thought about this windows sensor for the workplace, not because of the cold, but because of security: displaying the status of all buildings near the alarm panel, so we know that everything is closed when we leaving. But there were occasions, when a window is just pushed shut, but not locked, so I imagoned a small board stripe, which fits into the slot in typical platic window frame, and also senses the locking pin position, not just the "closedness" state. I originally thought about a wired solution though, CAN bus + power, or something like that, but low powered radio + solar would make it much easier to install.
@JobPWN
@JobPWN 3 жыл бұрын
A TP4056 for 2 euros! You're being ripped off at those prices 😜
@MakerMeik
@MakerMeik 3 жыл бұрын
You're right, I actually only paid 0.50 EUR for it. I think when I edited the video, the prices were higher because of the Corona shortages. But maybe I just got it wrong. ;-)
@JobPWN
@JobPWN 3 жыл бұрын
@@MakerMeik I still remember the time when you could order just a single one from China for 0,28 euro including shipping. But that was a couple of years ago before postage from China wasn't considered 'Third world' anymore
@ololh4xx
@ololh4xx 3 жыл бұрын
der µC ist ne eher schlechte Wahl - das Ding frisst riesige Energien im Schlafmodus. Mit einem ATmega 16A zum Beispiel kommt man locker auf WENIGER ALS (!) 1µA; mit so einem Teil würdest du deine Batterie-Laufzeit ganz leicht VERZEHNFACHEN. Tatsächlich geht sogar noch mehr - es gibt spezialisierte µCs für beispielsweise Durchflussmessungen in Rohren die nochmal (!) 1/10 des ATmega im Schlafmodus ziehen und ebenso mindestens einige interrupts, vereinzelt sogar laufende Zähler in Jenem anbieten. Ich frag mich immer wieder warum die ganze Welt generell die großen Energiefresser für den Batteriebetrieb wählt ... scheint irgendeine Pandemie der Ineffizienz zu sein ;-) Natürlich hat man mit diesen controllern auch deutlich weniger Funktionen, muss dann ggf. seperate WLAN-chips auflöten aber ehrlich gesagt ist WLAN ebenso eine eher schlechte Wahl; heutzutage gibt es supertolle, stromsparende LORA chips die sich ebenso binnen Mikrosekunden reaktivieren lassen und einen winzigen Bruchteil von WLAN ziehen
@MakerMeik
@MakerMeik 3 жыл бұрын
Ich gebe dir recht, ESP8266' sind wirklich keine guten Energiesparer. Und WLAN war natürlich auch nie für diesen Zweck konzipiert. Aber die ESPs sind äußerst günstig und leicht zugänglich, weil es eine große Community gibt. Und WLAN hat nun mal jeder zuhause. Bei Lora wirds eben gleich schon komplizierter. Der gezeigte Fenstersensor kostet am Ende etwa 5 EUR, was mit anderen Komponenten schwer zu schaffen ist. Aber es geht ja auch um den Bastelspaß und darum zu sehen, ob man das am Ende zu einer funktionierenden Lösung bringt. Denn für 2 EUR mehr bekommst du inzwischen auch fertige Fensterkontakte. Aber hey, deine Vorschläge sind schon spannend. Vielleicht hast du ja Lust eine entsprechende Schaltung selbst zu designen und dein Ergebnis mit uns zu teilen. Unabhängig davon aber schon mal Danke für deine Anregungen. Das Thema Akkubetrieb ist für mich derzeit mit das Spannendste und es ist immer gut neue Ideen zu bekommen. Ich finde im Moment auch Bluetooth LE gerade total spannend ...
@ololh4xx
@ololh4xx 3 жыл бұрын
@@MakerMeik BT is schon toll - aber hat halt leider die geringe Reichweite ... ich würde mir echt eher LORA anschauen; damit kann man auch von der tiefsten Ecke im Keller den höchsten Punkt auf dem Dach erreichen, wenn notwendig. Und sooo viel Aufwand ist es nun auch wieder nicht; es gibt wie gesagt LORA-chips, die sich mit ganz simplen Protokollen ansteuern lassen und ebenso (Tief-)Schlafmodi haben, im Grunde lässt sich das wie ein serielles Protokoll abfrühstücken und sogar ganz banal mit strings befüttern; manche der chips nehmen ALLES (!) ab, inklusive connect, reconnect und sogar Parität. Ich für meinen Teil werd nie was Anderes anfassen :-)
@Konrad162
@Konrad162 2 жыл бұрын
With mechanical ventilation I'm not opening windows - no need for any sensors 😉
@laryssalima6435
@laryssalima6435 Жыл бұрын
Love german accent.
@axeldive
@axeldive 2 жыл бұрын
Moin Meik. Ich konnte Dich leider nicht anders erreichen. Ich würde gerne Deinen Arduino Adventskalender nachbauen. Wäre schön, wenn du dich kurz mal melden könntest.
@MakerMeik
@MakerMeik 2 жыл бұрын
Hi @axeldive, ja, das ist ein tolles Projekt. Am besten schreibst du mich per Twitter DM (@MakerMeik) oder per Discord an (Meik#9095).
@axeldive
@axeldive 2 жыл бұрын
@@MakerMeik Vielen lieben Dank für deine schnelle Reaktion. Leider hat Discord meine Einladung/Nachricht gebloggt.
@Fjyclydjgu
@Fjyclydjgu 3 жыл бұрын
Какой смысл встраивать зарядку (4056) если заряжать 1 раз в год, лучше сделать зарядник для всех датчиков и заряжать им.
@MakerMeik
@MakerMeik 3 жыл бұрын
Good point. As I said in my video, with such a long runtime, the question arises anyway whether rechargeable batteries are really worth it. As is always the case, I started the project with the components I had at hand. The TP4056 cost only 0.50 EUR at the time I designed the circuit. And the cheap Li-Ions, of which I had ordered far too many, cost 1.00 EUR/piece. In the meantime the prices have risen and I would possibly do it differently now. But hey, I share my project with you here, as it was the right decision for me at that time. If there are other requirement for you today, I would be happy, as probably many others here, if you fork my project on Github and present us your improvements. If something good comes up, I'd even link that here in the video description or pin the corresponding comment.
@georgepapa2950
@georgepapa2950 3 жыл бұрын
SONOFF Zigbee sensor ready made and no need to make your own.
@navidmorovati1742
@navidmorovati1742 3 жыл бұрын
hi
@MakerMeik
@MakerMeik 3 жыл бұрын
hi ;-)
An Improved Multi-sensor
29:40
ResinChem Tech
Рет қаралды 34 М.
#47 Power Saving with ESP8266 (Sleep Mode) Tutorial with some Tricks
12:28
Непосредственно Каха: сумка
0:53
К-Media
Рет қаралды 12 МЛН
Vampire SUCKS Human Energy 🧛🏻‍♂️🪫 (ft. @StevenHe )
0:34
Alan Chikin Chow
Рет қаралды 138 МЛН
Хаги Ваги говорит разными голосами
0:22
Фани Хани
Рет қаралды 2,2 МЛН
UFC 287 : Перейра VS Адесанья 2
6:02
Setanta Sports UFC
Рет қаралды 486 М.
I built my own computer. by hand.
13:03
jdh
Рет қаралды 1,2 МЛН
Forget WiFi! This Wireless Method is WAY Better?
12:14
GreatScott!
Рет қаралды 713 М.
Your home's air could be making you sick. Fight back!
13:24
Jeff Geerling
Рет қаралды 339 М.
BitBastelei #373 - µPoff - Akkusparen für Batterieanwendungen
31:07
Every Apartment needs this Upgrade! (WhatsApp/Telegram Notifications)
10:05
#400 The Best Power Source for ESP32/ ESP8266 Projects
14:30
Andreas Spiess
Рет қаралды 125 М.
ESP32 Battery Life Tips
17:40
Tech Dregs
Рет қаралды 6 М.
Непосредственно Каха: сумка
0:53
К-Media
Рет қаралды 12 МЛН