ESP8266 WiFi Motion Sensor

After fighting with Z-Wave multisensors for a while, I finally gave in and built my own WiFi based solution. The first iteration is just a PIR motion sensor with indicator LEDs and a speaker, but I am working on revision 2 with more features such as gesture based dimming, and temperature sensors.

Here’s an image of the completed device:

And here is a link to my GitHub where you can find the code and schematics.

6 Likes

Looks awesome (and beyond my level of knowledge). Look forward to seeing a video of this in action.

Nice!!:+1:

I built a neat temperature sensor with an ESP8266 and a DHT22

Greets
Jacko

Excellent! I was planning to do the same but also include a temp sensor (prob a DHT22) and a photoresistor to tell the light level in the room.

I have many questions :slight_smile:

Do you have a part number for the speaker?
How did you breakdown the mains power to 5V?

You may also want to take a look at ESPEasy as they allow you to change the SSID / MQTT messages etc via a web interface instead of having to compile a different .bin file for each sensor.

This is great. Would appreciate it if you would publish the part list and any instructions (for a newbie). Would like to give this one a go.

@chanders
For 5v I just use a normal usb-powerplug

I’ve never took a look at ESPEasy nor did I thought about it.

1 Like

I built this a while ago: https://github.com/bobdrummond/mqtt-multinode

I’ve gotten sidetracked with life and haven’t gotten back to it. It’s got a few features you might find useful.

  • I’m storing some per-device config info in a JSON file in the persistent flash. Really useful for software updates if you bought a few different ESP8266 dev boards that have different pin layouts.
  • Support for a relay to use as a switch in HA
  • DHT temperature and humidity sensor

My error handling seemed shaky at the time, but I’ve got 4 of them in my house controlling MiLights through HA pretty well for the past 3 months.

Wow. This is exactly what I was planning to do. I am planning to include a photoresistor coupled with rollerblinds. The aim is to ratio natural light with the light fixture so that it would maintain one preset lux level in the room but allow as much natural light as possible.

@bthome
Sorry for the late reply, but look for:

  • ESP8266 (NodeMCU or so are pretty simple because the ftdi-chip is onboard)
  • Breadboard
  • DHT 22 (Temperature & Humidity Sensor)
  • 10k resistor
  • Some Jumper-Wires

Thats all the necessary stuff to begin with an ESP

Greets
Jacko

DHT 22 should in general also use a 10k or similar resistor as a pull-up. =)

1 Like

Sorry for such a late reply, but I have been very busy with school work. The speaker is a cellphone one that I bought years ago and the only distinguishing marks I can see on them is “CO2717”. I think you can get them on AliExpress, but I would look for other retailers first because I don’t really trust them.