It’s really hard to overstate how awesome ESP8266 development boards like the Wemos D1 Mini really are. For literally a couple of dollars you can get a decently powerful Wi-Fi enabled microcontroller that has enough free digital pins to do some useful work. Like the Arduino and Raspberry Pi before it, the ESP8266 is a device that’s opening up whole new areas of hacking and development that simply weren’t as practical or cost-effective as previously.
As a perfect example, take a look at this stupendously simple Internet-connected motion detector that [Eric William] has come up with. With just a Wemos D1 Mini, a standard PIR sensor, and some open source code, you can create a practical self-contained motion sensor module that can be placed anywhere you want to keep an eye on. When the sensor picks up something moving, it will trigger an IFTTT event.
It only takes three wires to get the electronics connected, but [Eric] has still gone ahead and provided a wiring diagram so there’s no confusion for young players. Add a 3D printed enclosure from Thingiverse and the hardware component of this project is done.
Using the Arduino Sketch [Eric] has written, you can easily plug in your Wi-Fi information and IFTTT key and trigger. All that’s left to do is put this IoT motion sensor to work by mounting it in the area to be monitored. Once the PIR sensor sees something moving, the ESP8266 will trigger IFTTT; what happens after that is up to you and your imagination. In the video after the break, you can see an example usage that pops up a notification on your mobile device to let you know something is afoot.
With its low cost and connectivity options, the ESP8266 is really the perfect platform for remote sensing applications. Though to give credit where credit’s due, this still isn’t the simplest motion sensor build we’ve seen.
Great project, but that soldering makes me cringe.
In the past, crimp contacts for PCB connectors, and the matching crimping tools were very expensive, so I also often soldered wires to those connectors, but nowadays they’re so cheap, that there’s no excuse to not crimp your own cables.
For a semi permanent installations, I prefer soldering personally, especially for a “security” device. Just one less potential issue, troubleshooting intermittent connection issues can suck. :)
At the very least he could have desoldered the pin headers and just solder the wires through the holes.
I bought a cheap wire wrapping tool and haven’t looked back. Life changing! To me it’s more reliable than soldering, as you don’t get wire solder joints that break when you’re messing about with the board and such. Also easy to remove if needed.
I haven’t used wire wrapping since college (33 years ago)! Yikes! Hard to believe it’s still being used! lol
Honestly, soldering (if done properly) is the way to go. I have a D1 Mini that I use on a bread board to work up my projects, and then I use a new one and solder my wired connections directly to the holes on the new board. They’re only a couple of bucks, so I try to have a few on hand “just in case!” There’s always a need… :)
Don’t let the fear of soldering trap you. There are lots of good YouTube videos about how to do it well. Get your favorite comfort food, favorite stuffed animal, a blanket and your remote control for your smart TV (sure hope you have one) and adventure forth through the video tutorials in your most comfortable chair/couch. Its worth overcoming and life is much better on the other side. If you feel encouraged enough, this video looks like a good starting point. :-)
https://www.youtube.com/watch?v=9DTYdZTCOFs
????
Looks like the maker of this project would do well to take my advice. We all start somewhere. :-)
I don’t think JD was trying to convey fear… Revulsion at the soldering in the video, perhaps….
Yes, I figured that out. I was trying to be encouraging where it wasn’t necessary, a side effect from being up typing at the keyboard when I should have been sleeping. :-)
> being up typing at the keyboard when I should have been sleeping.
Don’t we all?
I still enjoy watching soldering tutorials once in a while. Thanks.
Yeah that’s pretty rough.
With more and more stuff going SMD, I suppose proper soldering is becoming a lost art (and it’s only going to get worse). Of course, even when through hole was at its peak, plenty of people weren’t any good at it so…
I think RoHS solder has more to do with soldering becoming “a lost art”.
The soldering is pretty brutal, but in his defense, those pins aren’t meant to be soldered to at all. It’s pretty amazing that it works at all.
I would use header cables instead of soldering, or if it’s absolutely necessary desolder the headers and use the through-holes.
Should have used D1. D4 causes boot failure after reboot. Fatal exception (0).
I’m fairly sure you need a power supply for this!!!
So not as invisible as it appears.
Considering that there are dozens of (pretty much the same) motion sensor projects on the internet, this must be one of the worst:
– the code is a mess and a wild copy-paste result with, for example, definitions and unused variables all over the place
– the code does not even try to save a tiny amount of energy, which could be done with built-in functions of the ESP with a couple of lines of code and no negative impact
So.. you going to post the revision? . Seriously I am interested.
As I said there are already more than a dozen tutorials out there who do exactly the same. No need to repeat it again and again. Furthermore, as commented by other people here, the design is seriously flawed. There is no need to put lipstick on a pig…
I stopped using this sensor with esp8266 while ago because of false triggers. Somehow 2.4Ghz wifi from esp8266 is triggering motion sensor. I tried shielding sensor with aluminium foil, adding capacitors… nothing helped. I googled and found that I’m not the only one. Radar sensors like HB100 are better solution for use with esp8266.
Try AM312 (or the more configurable AM412 and AM612) : they are very compact and much better at working with ESP. I had the same false trigger problem before until I discovered AM312.
Came here to say exactly this. Generally I like supporting people and new projects, however I don’t know how this made it to HaD — bad code, bad advice on hardware choice, and one of the easiest projects on the internet which is documented many times over (and better).
I like this version, which introduced me to the AM312): https://www.youtube.com/watch?v=jpjfVc-9IrQ
You can mitigate it by making sure all the wires to the PIR pass through a ferrite, and wrapping the PIR in grounded foil. I’ve had the same issues with using a PIR too close to a Pi Zero W.
I can also vouch for this. Also other types of motion sensors can be triggered by other types of radios. But not the AM312, which besides being small comes with the benefit of lower current consumption.
Some of my notes here: http://www.electrobob.com/10002-motion-sensors/
I fear you gonna run into the fals alert trouble as so many others (and myself) run with this PIR next to the eps8266 RF power. However, good luck ;)
I’ve start using the Human Radar Sensor Modules. Sofar so good.
and the end package is alot smaller smaller.
Mind you the have been selling smaller motion detectors that are a bit more, but they are less the a 1/4 of the size.
And I just found out how cheep the backup sensors are. Just got a package in now to play with.
Looks really good. $12 gets you 4 sensors that are really small and the little computer that comes with it as well.
Its play time..
OH Boy “the”‘s really messed my sentence.
“Mind you they have been selling smaller motion detectors that are a bit more, but they are less then a 1/4 of the size.”
That looks better.
“I’ve *started using the Human Radar Sensor Modules. *So far so good.
and the end package is *a lot smaller.
Mind you *they have been selling smaller motion detectors that are a bit more, but they are less *than a 1/4 of the size.
And I just found out how *cheap the backup sensors are. Just got a package in now to play with.
Looks really good. $12 gets you 4 sensors that are really small and the little computer that comes with it as well.
It’s play time..”
Hope this helps :)
I understood this type of pir and the 8266 WiFi player havoc on eachother
Thanks for this – it at least got me to buy some Wemos boards.
Question – don’t you get like 10 text messages from one motion event this way? I think there needs to be a threshold, where it only sends an alert when there have been > 3 hits – and then stop sending alerts for 10min or some time after, in case someone is dancing in front of the PIR for half an hour. I’d hate to get a thousand alerts…
There are a lot of ways to address your question. If integrated with Home Assistant, for example, the options are as infinite and as varied as their are integrations. But, delays can be set directly on the PIR as well, and even the D1 Mini can be programmed with delays, though don’t ask me how, cause at this point I’ve not had the patience to figure out the logic programming to set that up. I must have gotten lazy in my “old age”…