Skip to the content
2 layers34.3 × 51.4 mmYAMS - Yet Another Motion Sensor, the printed circuit board in 3D

YAMS - Yet Another Motion Sensor

PProvost/YAMS-ESP01

Yet Another Motion Sensor - Uses an ESP01 and a cheap PIR motion sensor, sends activation events via MQTT, optimized for very low power use.

Size
34.3 × 51.4 mm
Copper layers
2
Thickness
1.6 mm
Parts
10
Nets
8
Pads
31
Tracks, vias
51, 0
Pours
2
Routed
Yes
KiCad
KiCad 5 (file 20171130)
Created
15 Jan 2019
Updated
26 Jan 2019

Overview

YAMS - Yet Another Motion Sensor is an open-source printed circuit board by PProvost, from the PProvost/YAMS-ESP01 repository on GitHub. It is a 2-layer board of 34.3 × 51.4 mm with 10 parts on 8 nets, routed with 51 tracks and 0 vias.

Its parts include 3 capacitors, 2 resistors, 2 ICs and 2 connectors. It belongs with the sensors and measurement boards and the ESP8266 boards of this library.

README

README.md

Build Status

YAMS-ESP01

Yet Another Motion Sensor - Uses an ESP01 and a cheap PIR motion sensor, sends activation events via MQTT, optimized for very low power use. Runs on 3 AA batteries (I use Panasonic Eneloop NiMh cells).

BOM

  • ESP8266-01 Module
  • HC-SR501 PIR Motion Detector
  • MCP1700-3302E TO92 Voltage Regulator
  • Resistors:
    • 220 ohm (x1)
    • 3.3K ohm (x1)
  • Capacitors:
    • 1uF ceramic (x2)
    • 100nF ceramic (x1)
  • Various pin headers, JST and molex connectors as you see fit
  • Battery caddy (aim for > 4V but stay within the limits of the MCP1700-3302E)

Implementation Notes:

  • If you have a Puya-based ESP01 module, you may need to apply this patch to get SPIFFS to write correctly: https://github.com/letscontrolit/ESPEasy/blob/mega/patches/puya_v3.patch#L8
  • You can force the WifiManager to reset its settings by writing the SPIFFS filesystem with a file called /config.json with the following contents: { "reset_settings": true }. This file is included in the /data directory in this repo.

Building the circuit

Credits: This circuit used in this design is based on the work described in Benny de Leeuw's article.

IMPORTANT!: This is a 3.3V circuit. The HC-SR501 PIR sensor is 5V, so you either need to maintain two power voltages or modify the PIR to run on 3.3V.

The circuit is designed to be battery powered, requiring between 3.7V and 6V due to the requirements of the MCP1700 LDO. This requires some special with your PIR sensor. Most of the cheap ones you will find expect 5V. See below for more information about modding your PIR sensor for 3V3.

Once I've built a few and ironed out the bugs, I will provide STLs for a case and a link to the PCB on OSHPark.

Please refer to the schematic PDF and the other files in the schematic/ folder.

Modding the HC-SR501 PIR Sensor

I wanted to reuse the VCC pin on the PIR sensor to make mounting easier, but also to power the PIR sensor with the same 3.3VDC the ESP takes. For some of my sensors, I made the following modifications successfully:

  • Removed the 3V3 voltage regulator
  • Connected the cathode (output) side of the diode to the VOUT pad where the regulator had been connected
  • Removed the 1k resistor between the controller IC and the signal pin and shorted the two pads.
  • NOTE:This permanently changes the sensor to only take 3.3V, do not power it with 5V after removing the regulator. If you don't want to remove the regulator from your sensor, you can still power it with 3.3V following the guide Modifying Cheap PIR Sensors, but you may still need to remove the 1k resistor. I've used this approach too.

Credits & References

  1. Stable ESP01 Motion Sensor
  2. ESP01 Pin Magic
  3. Modifying Cheap PIR Sensors

TODO:

  • Provide a better HASS discovery message
  • Better case design
  • Button/switch/jumper to make it stay awake (can help with network debugging; see also the DO_NOT_SLEEP define in main.cpp)
  • Enable OTA updating,
  • Figure out a reset button so you can reset the configuration without flashing the SPIFFS filesystem particularly for updating the config.json file but also maybe the firmware.
  • (Optional) front facing LED when motion detected
  • (Idea) Photoresistor to prevent triggering unless light levels are low enough

Parts

10
QtyValueFootprintReferences
21uFCapacitor_THT:C_Disc_D3.8mm_W2.6mm_P2.50mmC2, C3
1100nFCapacitor_THT:C_Disc_D3.8mm_W2.6mm_P2.50mmC1
1220RResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR1
13K3Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR2
1ESP-01v090ESP8266:ESP-01U1
1MCP1700-3302E_TO92Package_TO_SOT_THT:TO-92_InlineU2
1PIR_Motion_SensorSensors:PIR_Motion_Sensor_HorizPIR1
1PowerConnector_JST:JST_XH_B02B-XH-A_1x02_P2.50mm_VerticalJ1
1TTL-SerialConnector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ2

Similar boards

  • 2 layers57 × 55.2 mmLogicAnalyzer, the printed circuit board in 3D

    LogicAnalyzer

    gusmanb/logicanalyzer

    24 channel, 100Msps logic analyzer hardware and software

    10 parts5.1kGPL-3.0
  • 2 layers32.2 × 15.4 mmProtector, the printed circuit board in 3D

    Protector

    byrantech/laptop

    anyon_e, a highly integrated, high end, open source laptop. Attempt the impossible.

    10 parts4.3kMIT
  • 2 layers26 × 18 mmConn, the printed circuit board in 3D

    Conn

    yaqwsx/KiKit

    Automation tools for KiCAD

    10 parts2.1kMIT
  • 2 layers44.3 × 30.5 mmLime2-SATA RevA, the printed circuit board in 3D

    Lime2-SATA RevA

    OLIMEX/OLINUXINO

    OLINUXINO is Open Source / Open Hardware, low cost from EUR 24 Linux Industrial grade Single Board Computer capable to operate -25+85C

    10 parts1.5k
  • 2 layers17.8 × 43.2 mmNano Adapter, the printed circuit board in 3D

    Nano Adapter

    VoronDesign/Voron-Hardware

    Cool Hardware designed by the Voron Design group

    10 parts1.1kGPL-3.0
  • 2 layers53.9 × 23.2 mmBuffer, the printed circuit board in 3D

    Buffer

    hoglet67/RGBtoHDMI

    Bare-metal Raspberry Pi project that provides pixel-perfect sampling of Retro Computer RGB/YUV video and conversion to HDMI

    10 parts1kGPL-3.0

Questions

How big is the YAMS - Yet Another Motion Sensor PCB?

It measures 34.3 × 51.4 mm and has 2 copper layers, 1.6 mm thick.

What parts does the YAMS - Yet Another Motion Sensor use?

10 parts. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the YAMS - Yet Another Motion Sensor KiCad files?

From the PProvost/YAMS-ESP01 repository on GitHub, at the commit this page was made from: the board is kicad/YAMS - Yet Another Motion Sensor.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the YAMS - Yet Another Motion Sensor design in my own project?

Its repository states no licence, so its author keeps all rights: ask PProvost before reusing the design.