Playground Sentinel

Simple perimeter alarm for a kid’s room or garden

ATtiny202 + PIR + FS1000A/XY-MK OOK link. Designed for a 3×AA rail with single-digit µA idle draw.

ATtiny202 433 MHz OOK Edge counting Low-power

What it is

Playground Sentinel is a playful perimeter alarm for a garden or a kid’s room. A tiny ATtiny202 monitors a PIR sensor and, when triggered, wakes a 433 MHz OOK transmitter to send a short burst. A matching receiver counts signal edges in a 10 ms window and lights LEDs for the detected alarm bins.

Hardware at a glance

Transmitter

  • ATtiny202 @ 20 MHz (internal oscillator, prescaler disabled).
  • SEN-HC-SR501 PIR on PA4 (output pulled low internally).
  • FS1000A DATA on PA1, supply from the battery rail.
  • PA2 LED mirrors each RF burst.

Receiver

  • ATtiny202 + XY-MK-5V ASK module feeding PA1.
  • PA2 and PA3 drive LEDs for the active bands.
  • Other bands are defined for future use.

Power

  • Runs directly from a 3×AA/AAA rail.
  • Idle current in µA range.
  • linear regulators for components included.

Signaling

Every 500 ms the transmitter emits a 10 ms burst of a square wave. The carrier frequency encodes the alarm ID. The receiver starts a 10 ms window on the first edge, counts transitions, and compares the total to per-alarm ranges.

Carrier Edges in 10 ms (ideal) Notes
1 kHz20Reserved (future)
2 kHz40Alarm 2 (PA2)
3 kHz60Alarm 3 (PA3)
4 kHz80Reserved (future)
5–10 kHz100–200Reserved; practical ceiling near 10 kHz

Firmware architecture

Transmitter

  • TCA0 in single-slope mode with /16 prescaler.
  • CARRIER_FREQ_HZ (default 3000) defines burst frequency.
  • send_burst() aligns to TCA overflow and emits an exact-cycle 10 ms burst.
  • PA2 LED mirrors burst activity.

Receiver

  • PORTA interrupt on PA1 (both edges) counts transitions.
  • First edge arms a 10 ms window; counts accumulate until timeout.
  • Counts are compared to per-band ranges; matching bands latch LEDs for 200 ms.
  • Higher bands (beyond PA2/PA3) are defined but currently unused.

Build & flash

sudo apt install gcc-avr avr-libc avrdude   # once
./build.sh                                  # builds receiver + transmitter
./flash.sh transmitter                      # flash build/transmitter/transmitter.hex
./flash.sh receiver                         # flash build/receiver/receiver.hex

flash.sh requires you to name the image explicitly to avoid accidentally flashing the wrong device. Default port is /dev/ttyUSB0; override via AVR_PORT=/dev/ttyUSB1 ./flash.sh transmitter.

Repository layout

Extending the system