ESP8266 as Window Sensor with years of battery life

  Переглядів 174,964

MakerMeik

MakerMeik

День тому

Donations: paypal.me/MeikDangmann
Meanwhile the viewer "gadjet" has optimized and minimized the PCB.
Check out his great website and project on Github:
gadjetsblog.blogspot.com/2022...
github.com/gadjet/Window-Door...
Project-Idea by Michael Dworkin:
esp8266-server.de/Reedkontakt...
Links:
Code, Battery-Spreadsheet, KiCAD- and CircuitJS-Files:
github.com/MakerMeik/Window-S...
3D-Model of the Case on Thingiverse:
www.thingiverse.com/thing:501...
KiCAD:
www.kicad.org/
www.thingiverse.com/thing:501...
CircuitJS:
www.falstad.com/circuit/
Andreas Spiess: How to install the IOT-Stack on a Raspberry Pi:
• #295 Raspberry Pi Serv...
Required Components:
1x ESP-12F
1x 1000 uF Electrolytic Capacitor
2x 100 nF Capacitor
4x 10k Resistor (SMD 0805)
1x 1M Resistor (SMD 0805)
2x Switch Buttons (SMD 0805)
1x HT7333 (SMD)
1x Pin Header
1x Reed Switch NO (normally open)
1x 74HC86 (THT)
1x TP4056
1x Li-Ion 18650
1x Magnet
0:00 Intro
1:07 Requirements
1:27 The idea
3:06 ESP8266 basics
3:57 Simulation in CircuitJS
6:32 Circuit design in KiCAD
9:04 SMD-Components
9:58 PCB-Design in KiCAD
11:34 Assembly and SMD-soldering
13:07 Programming and software
13:39 Test run and current consumption
14:59 Housing and installation
16:38 Improvement ideas
Songs:
"8-bit-Laserstrahl" by betatronik (CC BY-NC-SA)
"Auf Dem Wind (calm)" by betatronik (CC BY-NC-SA)
"Old River Boat" by Lobo Loco (CC BY-NC-SA)
"Long Story" by Sergey Cheremisinov (CC BY-NC)
"Make-New" by Ketsa (CC BY-NC-ND)
"Salt Lake Swerve - Chillout Remix" by Maarten Schellekens (CC BY-NC)
"Salt Lake Swerve - Chillout Remix" by Maarten Schellekens (CC BY-NC)
"Hachimantai Snow" by Maarten Schellekens (CC BY-NC)
"Just Wondering" by Maarten Schellekens (CC BY-NC)
"Poor Boy" by Pedro Santiago (CC BY-NC-SA)
"Tuesday Night - Radio Edit" by Maarten Schellekens (CC BY-NC)
"Deep" by Bio Unit (CC BY-NC-SA)
"D2" by Maarten Schellekens (CC BY-NC)
Photos/Videoclips:
Alexas_Fotos (Pixabay License)
Grieslightnin (Pixabay License)
Vincente.niclos (CC BY-SA)
FindingFootage (pixabay license)

КОМЕНТАРІ: 229
@MakerMeik
@MakerMeik 2 роки тому
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.
@stupossibleify
@stupossibleify 2 роки тому
So much learning value in a single video, pure gold! Thanks for making this, really high quality project, supporting links and video production. Subscribed!
@enlacdmx4379
@enlacdmx4379 2 роки тому
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 !!!
@mirino75
@mirino75 2 роки тому
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.
@SmithyScotland
@SmithyScotland 2 роки тому
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 2 роки тому
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: ukposts.info/have/v-deo/qpaBq4Wrpn2AlXk.html 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/
@the_smart_home_maker
@the_smart_home_maker 7 місяців тому
Awesome tutorial 🔥
@oliverhihn8505
@oliverhihn8505 3 місяці тому
Very well done video, subscribed instantly! Keep it up!
@ilducedimas
@ilducedimas 2 роки тому
A true Renaissance man. Hats off to you my dear.
@aba-nascu
@aba-nascu 2 роки тому
You are a genius. Subscribed!
@edwardsoares3838
@edwardsoares3838 2 роки тому
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 2 роки тому
Hehe ... When I started with the whole topic two or three years ago, the question was rather what I wanted to build *first*. ;-)
@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)
@PhG1961
@PhG1961 2 роки тому
Nice and interesting video. I liked it and immediately subscribed too ! Looking forward to see more of your videos.
@illygah
@illygah 2 роки тому
that intro music was not expected. You just blew my mind. 10/10.
@illygah
@illygah 2 роки тому
Nicely done. Kicad is the gift that keeps on giving.
@MakerMeik
@MakerMeik 2 роки тому
Thank you, I'm glad to hear that. The intro is based on a song about retro computing that I made with a friend: ukposts.info/have/v-deo/cYR6nX9pkIRpkok.html (Unfortunately, it is only available in German)
@brandonvanderryst176
@brandonvanderryst176 2 роки тому
Great video! I would love to see more details about the programming side of things though.
@MakerMeik
@MakerMeik 2 роки тому
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: ukposts.info/have/v-deo/cXdeooN-mnt9qGw.html And in this video he shows how you can install your own MQTT broker including iot-stack. ukposts.info/have/v-deo/mWaenqpvq42G2Kc.html
@brandonvanderryst176
@brandonvanderryst176 2 роки тому
@@MakerMeik This really helps, thank you
@Bianchi77
@Bianchi77 2 роки тому
Cool video, thanks :)
@oliveralff3461
@oliveralff3461 2 роки тому
Ein wirklich angenehmes Video 👍😊 Mein Abo hast du 😉
@tonystephens1215
@tonystephens1215 2 роки тому
Great video! 👍👍
@smartifi_egypt
@smartifi_egypt 2 роки тому
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 2 роки тому
If you still want to stick with Wemos D1 minis instead of your own PCBs, you can see how to do that here: ukposts.info/have/v-deo/qpaBq4Wrpn2AlXk.html
@antmck33
@antmck33 2 роки тому
Subscribed instantly 😀
@keshav2136
@keshav2136 2 роки тому
Great! I've an ESP8266 and I use it for IoT WiFi
@ThePlazmaBeast
@ThePlazmaBeast 2 роки тому
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 2 роки тому
LoRa is very expensive for this application
@jirihala8684
@jirihala8684 2 роки тому
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 2 роки тому
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. :-)
@patricf209
@patricf209 2 роки тому
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 2 роки тому
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.
@sapuseven6119
@sapuseven6119 2 роки тому
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 2 роки тому
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?
@mim2990
@mim2990 5 місяців тому
Amaizing
@AntonioDellaRovere
@AntonioDellaRovere 2 роки тому
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 2 роки тому
Same could happen because of placing magnet sensor so close to antenna
@AntonioDellaRovere
@AntonioDellaRovere 2 роки тому
@@gmag11 Your point is actually even more important. Great!
@MakerMeik
@MakerMeik 2 роки тому
@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.
@mohammedbenhadine
@mohammedbenhadine 2 роки тому
A Masterpiece
@nonameiskickass1319
@nonameiskickass1319 2 роки тому
Sehr toll
@b5a5m5
@b5a5m5 2 роки тому
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?
@dickesf8525
@dickesf8525 2 роки тому
You just got a Like for the intro alone xD
@MakerMeik
@MakerMeik 2 роки тому
This is based on the song I wrote with a friend. It's in German and it's about retro computing: ukposts.info/have/v-deo/cYR6nX9pkIRpkok.html
@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 10 місяців тому
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 9 місяців тому
The guy in the following video is amazing. ukposts.info/have/v-deo/cJSFbWuxeZuTkok.html 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.
@istvanzilizi6194
@istvanzilizi6194 2 роки тому
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 2 роки тому
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.
@gadjetsvideo
@gadjetsvideo 2 роки тому
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 2 роки тому
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 2 роки тому
@@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.
@teuluPaul
@teuluPaul 2 роки тому
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 2 роки тому
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 2 роки тому
@@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 2 роки тому
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: ukposts.info/have/v-deo/o519YY6xf6B0l6c.html 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 2 роки тому
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.
@schweizergeizer8028
@schweizergeizer8028 2 роки тому
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 2 роки тому
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 2 роки тому
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 2 роки тому
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: ukposts.info/have/v-deo/bn6kdoRraXhpkYU.html
@wjn777
@wjn777 2 роки тому
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 2 роки тому
@@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 ukposts.info/have/v-deo/n2Gjln9-aXiAkYk.html
@myounges
@myounges 2 роки тому
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!
@MaxtanStarack1209
@MaxtanStarack1209 2 роки тому
Amzing
@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: ukposts.info/have/v-deo/po9yk26Qa65_2Ww.html 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!
@marcguillamon5998
@marcguillamon5998 2 роки тому
Awesome video! Where do you usually buy the components?
@MakerMeik
@MakerMeik 2 роки тому
The PCBs shown are from PCBway. But you can also find UKposts 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.
@vinceandcreeperlp
@vinceandcreeperlp 2 роки тому
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 2 роки тому
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 2 роки тому
@@MakerMeik Thank you verry much! I will then update the pads on the PCB to larger ones :)
@tornadokat
@tornadokat 2 роки тому
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 2 роки тому
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.
@Fake_kitchen
@Fake_kitchen 2 роки тому
Nicht schlecht 💪
@sheminasalam
@sheminasalam 2 роки тому
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 2 роки тому
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 2 роки тому
@@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 2 роки тому
I have upgraded this sensor with ESPnow, making the update interval less than 1 second. Also have added the voltage divider. Thanks
@steffenuhlig1970
@steffenuhlig1970 2 роки тому
This looks terrific! Any chance you selling the PCB; perhaps with the SMD components pre-assembled?
@MakerMeik
@MakerMeik 2 роки тому
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.
@abdoun8214
@abdoun8214 9 місяців тому
More videos.. please!
@xn0gaming
@xn0gaming 2 роки тому
I like the Arduino-style bomb with a battery hot-glued to it.
@nkronert
@nkronert 2 роки тому
1st comment for once 🙂. I bet that the battery lasts longer than the double sided tape. Thanks Meik! 👍
@ardhi1269
@ardhi1269 2 роки тому
I like the intro so i subscribe
@MakerMeik
@MakerMeik 2 роки тому
Thank you, I'm glad to hear that. The intro is based on a song about retro computing that I made with a friend: ukposts.info/have/v-deo/cYR6nX9pkIRpkok.html (Unfortunately, it is only available in German)
@kalvinpearce
@kalvinpearce 2 роки тому
would be super keen to see a zigbee version and how you go about making that!
@MakerMeik
@MakerMeik 2 роки тому
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 2 роки тому
@@ruakij6452 yooo thats awesome news! thanks for letting me know!!
@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
@morsine
@morsine 2 роки тому
Cool intro!
@MakerMeik
@MakerMeik 2 роки тому
The intro is based on a song about retro computing that I made with a friend: ukposts.info/have/v-deo/cYR6nX9pkIRpkok.html (Unfortunately, it is only available in German)
@morsine
@morsine 2 роки тому
@@MakerMeik thanks mate. i like your version more
@NorthcodeNoCh
@NorthcodeNoCh 2 роки тому
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 2 роки тому
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.
@rakeshc2723
@rakeshc2723 2 місяці тому
Please share steps to flash it using esphome for home assistant
@sandeshshakya5900
@sandeshshakya5900 2 роки тому
I'm new to PCB design. At 8:15, is there a reason why you chose those types and values of capacitors?
@MakerMeik
@MakerMeik 2 роки тому
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.
@robinbinder8658
@robinbinder8658 2 роки тому
Nochn deutscher kleinelektronik Kanal nice subbed
@jayytee8062
@jayytee8062 2 роки тому
What if you have a second reed switch that switches the battery on/off so there is no current draw at all....??
@MakerMeik
@MakerMeik 2 роки тому
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.
@svenkicherer
@svenkicherer 2 роки тому
your 100 nF capacitor has the wrong symbol - it should be unpolarized. but besides this: nice project!
@M4XD4B0ZZ
@M4XD4B0ZZ 5 місяців тому
Wow crazy intro 😅
@MoritzvonSchweinitz
@MoritzvonSchweinitz 2 роки тому
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 2 роки тому
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: ukposts.info/have/v-deo/oJV1ZbCuaph-yas.html
@sebastien4116
@sebastien4116 Рік тому
Things on Edge Cricket may do what you want
@MoritzvonSchweinitz
@MoritzvonSchweinitz Рік тому
@@sebastien4116 cool! Thanks! Sounds almost ideal!
@MoritzvonSchweinitz
@MoritzvonSchweinitz Рік тому
@@sebastien4116 you meant "OKdo CRICKET V1.0" by "things on edge", I think.
@sebastien4116
@sebastien4116 Рік тому
@@MoritzvonSchweinitz no, "Things on Edge" is the manufacturer, and board is called "IoT Cricket module". OKdo is just one of the resellers.
@erjonameti1066
@erjonameti1066 2 роки тому
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 2 роки тому
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: ukposts.info/have/v-deo/oJV1ZbCuaph-yas.html
@erjonameti1066
@erjonameti1066 2 роки тому
@@MakerMeik Thank you. I appreciate it.
@edwardsoares3838
@edwardsoares3838 2 роки тому
@@MakerMeik This sounds highly inaccurate.
@MakerMeik
@MakerMeik 2 роки тому
@Edward Soares: Hehe ... you seem to be an expert on this subject. Please explain it from your point of view.
@edwardsoares3838
@edwardsoares3838 2 роки тому
@@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.
@gadjetsvideo
@gadjetsvideo 2 роки тому
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 2 роки тому
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.
@manmeetk3939
@manmeetk3939 10 місяців тому
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 9 місяців тому
The guy in the following video is amazing. ukposts.info/have/v-deo/cJSFbWuxeZuTkok.html 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.
@asdomega
@asdomega 2 роки тому
Nice video, but did I miss the Part with the Windsensor?
@MakerMeik
@MakerMeik 2 роки тому
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 UKposts 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 UKposts ... let's see, maybe there will be something about this topic some day 😂
@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?
@shekharnandkoemarsing158
@shekharnandkoemarsing158 2 роки тому
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 2 роки тому
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. ukposts.info/have/v-deo/h5Wgm4mxg56DrZ8.html
@PinterAdamm
@PinterAdamm Рік тому
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?
@maxcoff2
@maxcoff2 2 роки тому
Hi. How long does it take from the actuation of the reed switch to the arrival of the MQTT message?
@MakerMeik
@MakerMeik 2 роки тому
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 2 роки тому
@@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 2 роки тому
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 ;-)
@Ramdaron
@Ramdaron 2 роки тому
Hi. What kind of soldering iron are you using here? 11:54
@MakerMeik
@MakerMeik 2 роки тому
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 2 роки тому
​@@MakerMeik It seems to be more expensive than a diy kit from aliexpress for hakko t12 soldering tips. Thanks!
@scream221
@scream221 2 роки тому
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 2 роки тому
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.
@f.g.4309
@f.g.4309 Рік тому
Hi, Can I ask once question why GPIO 15 have to pull down to ground?
@MakerMeik
@MakerMeik Рік тому
Hi, your ESP will not boot if you don't pull it to GND.
@f.g.4309
@f.g.4309 Рік тому
Oh wow, thank you I am very new in here.
@sheminasalam
@sheminasalam Рік тому
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.
@hanssprungfeld4110
@hanssprungfeld4110 2 роки тому
Wie hast du die platine von der Größe begrenzt?
@MakerMeik
@MakerMeik 2 роки тому
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).
@superbikeengineer
@superbikeengineer 10 місяців тому
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?
@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.
@quaninhphamhong7130
@quaninhphamhong7130 3 місяці тому
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 роки тому
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.
@burhanuddinbhiwaniwala618
@burhanuddinbhiwaniwala618 2 роки тому
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 2 роки тому
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 2 роки тому
@@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....
@noonecz5201
@noonecz5201 2 роки тому
Can't you make it recharge it self by adding a string and some smaller energy generator?
@MakerMeik
@MakerMeik 2 роки тому
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 2 роки тому
@@MakerMeik Oh.. I guess I missed that, still thx for the answer :D
@kocherovkn
@kocherovkn 2 роки тому
Looool. Man just use a reed switch with million years of life without all this boards xD
@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.
@KrnlKlink1
@KrnlKlink1 2 роки тому
Does this report battery voltages?
@MakerMeik
@MakerMeik 2 роки тому
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.
@zzizzimizzi6028
@zzizzimizzi6028 2 роки тому
What trippp you usinng,your voice ....
@yourpersonaldatadealer2239
@yourpersonaldatadealer2239 2 роки тому
(GPIO_SENSOR=window) ? 1 : 0 We got a one Larry, yeh. That’s a window.
@Spelter
@Spelter Рік тому
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.
@Nickle314
@Nickle314 2 роки тому
a battery monitor to send a message when the battery needs to be changed. Once a day would be sufficient.
@MakerMeik
@MakerMeik 2 роки тому
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 2 роки тому
@@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.
@kingundfaker
@kingundfaker 2 роки тому
Hi meik wie hast du dir das ganze Wissen dafür angeeignet? Oder wie sollte ich mir das Wissen dafür aneignen?
@MakerMeik
@MakerMeik 2 роки тому
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 UKposts 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 UKposts 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 2 роки тому
@@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 UKposts leider nicht so erläutert werden, warum man etwas macht 😅 aber dein Kommentar ist gescreenshoted Vielen Dank nochmal für die Info :)
@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.
@danielkoenen859
@danielkoenen859 2 роки тому
Why is WiFi overkill when using mqqt
@MakerMeik
@MakerMeik 2 роки тому
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.
@JobPWN
@JobPWN 2 роки тому
A TP4056 for 2 euros! You're being ripped off at those prices 😜
@MakerMeik
@MakerMeik 2 роки тому
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 2 роки тому
@@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
@MrMohab0
@MrMohab0 2 роки тому
How much did it cost you in total?
@MakerMeik
@MakerMeik 2 роки тому
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.
@alexgavr6084
@alexgavr6084 2 роки тому
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 2 роки тому
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 2 роки тому
@@MakerMeik thank you
@ololh4xx
@ololh4xx 2 роки тому
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 2 роки тому
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 2 роки тому
@@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 :-)
@browaruspierogus2182
@browaruspierogus2182 2 роки тому
but.. why would you use bloated Arduino and slow protocols like mqtt...
@MakerMeik
@MakerMeik 2 роки тому
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.
@BlueyMcPhluey
@BlueyMcPhluey 2 роки тому
what would you use if you weren't using WiFi?
@MakerMeik
@MakerMeik 2 роки тому
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.
@NoProblem76
@NoProblem76 2 роки тому
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 2 роки тому
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 2 роки тому
@@MakerMeik Maybe we could consider using ESP-Now and ditch WiFi here, as discussed by Andreas here, ukposts.info/have/v-deo/bn6kdoRraXhpkYU.html, 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 2 роки тому
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.
@moczikgabor
@moczikgabor 2 роки тому
@@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.
@laryssalima6435
@laryssalima6435 5 місяців тому
Love german accent.
@garymccrohan7247
@garymccrohan7247 Рік тому
What is the code?
@MakerMeik
@MakerMeik Рік тому
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)
@Konrad162
@Konrad162 Рік тому
With mechanical ventilation I'm not opening windows - no need for any sensors 😉
@ReneKnuvers74rk
@ReneKnuvers74rk 2 роки тому
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 ;-)
@Fjyclydjgu
@Fjyclydjgu 2 роки тому
Какой смысл встраивать зарядку (4056) если заряжать 1 раз в год, лучше сделать зарядник для всех датчиков и заряжать им.
@MakerMeik
@MakerMeik 2 роки тому
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.
Every Apartment needs this Upgrade! (WhatsApp/Telegram Notifications)
10:05
Control ANY COMPUTER with these Pi KVMs!
17:46
Jeff Geerling
Переглядів 780 тис.
Китайка и Мармеладный Лего😂😆
00:19
KITAYSKAYA ZMEYKA
Переглядів 2,1 млн
Парковка Пошла Не По Плану 😨
00:12
Глеб Рандалайнен
Переглядів 12 млн
Эффект Карбонаро у глазного врача 
01:00
История одного вокалиста
Переглядів 7 млн
Try these 16 Brilliant ESP32 projects!!!
11:18
ToP Projects Compilation
Переглядів 501 тис.
Power Your Projects With Batteries! (LiPo/Li-ion)
9:27
Sine Lab
Переглядів 21 тис.
ESP32 wake from Deep Sleep | ESPHome and HomeAssistant + MQTT
8:38
OMG The Cloud!
Переглядів 10 тис.
Gas meter - Receive magnetic pulses with an ESP8266
12:57
MakerMeik
Переглядів 65 тис.
15 Brilliant ESP32 Projects that are Worth-trying!!!
11:12
ToP Projects Compilation
Переглядів 158 тис.
Aggressively Low Power with the ESP8266
10:18
CNLohr
Переглядів 77 тис.
Simmerstats: The genius old tech that controls your stovetop
36:31
Technology Connections
Переглядів 629 тис.
Contact Sensor 3 - an ESP8266 Door & Window Sensor
5:31
MrDIY
Переглядів 14 тис.
How to Design Mechanical Keyboard PCBs with Kicad
20:19
Joe Scotto
Переглядів 58 тис.
Сомнительно... Ну Окэй... Распаковал Nothing Phone (2a)
16:19
РасПаковка ДваПаковка
Переглядів 54 тис.
Распаковка айфона в воде😱 #shorts
0:25
НЭКС
Переглядів 421 тис.