Keep Space Alert –

It is essential in these days to maintain distance from others. However, it is not that easy to remember this every time or help those who are very close with others. This is a do it yourself extremely simple security alarm device that helps to keep safe social distancing!

Using passive infrared (PIR) motion sensing technology, the little device runs on a rechargeable (Li-ion) battery. It detects when someone comes within 2m/6ft, alerting the user (and the near person) with an obtrusive audio and visual alert. I guess you cannot wait to flaunt your new project to your beloveds and neighbors. Okay, let us get started…

Inside Electronics

The core of the project revolves around an Arduino microcontroller. In addition, there is a minuscule PIR motion sensor module. When I started this project, I searched in my drawer for a small passive infrared motion sensor module that was more stable than the cheap sensors I had previously used. I found a digital intelligent PIR sensor module –the Grove Mini PIR Motion Sensor (v1.0) from SeeedStudio! See one related do it yourself project

I was approached by SeeedStudio with an opportunity to review their Seeeduino Nano (v1.0) product. It sounded like something I would be interested in. After a short talk I was given an offer to pick a few parts to create some hobby electronics projects. I placed my ‘free’ order, and a nifty packet arrived within 3 weeks.

The Seeeduino Nano is the SeeedStudio edition of Arduino Nano, a more compact and breadboard-compatible version of the Arduino Uno, but with some unique features. The Seeeduino Nano is packed in a small lime-green colored box.

Apart from the cheerful USB-C connector, the next main attraction of the Seeeduino Nano board is the inclusion of a dedicated I2C digital Grove connector. In this project, I used the Grove Arduino Nano Shield (v1.0) for fast prototyping. It is not essential though.

Related projects links,

The following figure shows how the Seeeduino Nano connects to the remaining electronics. The controller has three outputs that drive those external components. The 4-pin header/connector (SEN1) links the Grove Mini PIR Motion Sensor to the D4 – 5V – GND pins of the Seeeduino Nano (M1). The D3 output drives a standard piezoelectric speaker (PZ1) through a small driver transistor (T1) that I will elaborate later. The D2 signal enables the visual alert indicator (LED1). If you do not need an external visual alert indicator, just use the onboard amber LED internally wired to D13 output of Seeeduino Nano board (there is also a blue power supply status indicator onboard).

I am fortunate to live in a time when it is easy to buy USB rechargeable 9V lithium-ion battery packs! You can buy them from multiple online retail sources. There are several poor quality /fakes for sale. I recommend trying a trusty vendor and paying a couple more dollars. This is the 9V battery used in this project (no ties – just to help others find it).

Software Playtime

scale, you will need a computer to upload the software (Arduino Sketch) into Seeeduino Nano through a USB-C cable. The Arduino Sketch is a crude one, but it can easily be extended to other exquisite functions!



 * .........Keep Space Alert...........*

 * Build Your Own Social Distance Alarm

 * Key Hardware: Seeeduino Nano v1.0/Arduino Nano v3

 * & Grove Mini PIR Motion Sensor v1.0 (see article)!

 * Arduino Sketch: v1.0 / My Arduino IDE v1.6.9

 * Author: T.K.Hareendran/08.2020

 * Publisher:


#define alertLED 13 // Alert Lamp Output D13

//#define alertLED 2 // Alert Lamp Output D7 (see article)!

#define alarmPin 3 // Alert Sounder Output D3

#define sensorIn 4 // Presence Sensor Input D4

int state = 0;

void setup()


    pinMode(alertLED, OUTPUT);

    pinMode(alarmPin, OUTPUT);

    pinMode(sensorIn, INPUT);


void loop()


    state = digitalRead(sensorIn);

    digitalWrite(alertLED, state);

    if (state == 1)


      for(int hz = 440; hz < 1000; hz++){ // Siren Generation

        tone(alarmPin, hz, 50);




      for(int hz = 1000; hz > 440; hz--){

        tone(alarmPin, hz, 50);










At the beginning, I tried out the piezoelectric speaker driver circuitry (leftmost part in the schematic) severally by feeding a 5Vp-p square wave signal (1kHz/50% duty cycle) to its input. Look, the optional (insignificant) capacitor (C2) was not used at that time. Yes, it worked!

As you might noticed, I (unintentionally) utilized a standard 16Ω “PC motherboard internal speaker” (, usually put-upon to obtain BIOS beep codes from motherboard, in my breadboarded quick test setup.

Construction Clues

You can use your own construction method: point-to-point, perfboard or a devoted single-sided PCB. Once you have completed the build, try to enclose the entire build inside a low-profile and lightweight (preferably 3-D printed) ‘wearable’ enclosure. Early 3-D printers were not affordable for the DIY community. But 3-D printing technology quickly advanced, and now we are benefited from some incredible capabilities (of course, you could still build an ordinary project enclosure from scratch). This is a front-panel art of the enclosure.

First Run

As I do not have a proper enclosure for the unit, I decided to go for a quick and dirty prototype (sensor and speaker suspended in the air ha)!

And, did powered my assembly through two DC power sources (with a shared ground rail) – 9V battery for the piezoelectric speaker driver, and USB power bank for Seeeduino Nano (you do not need to use two power sources). The first test results are really promising, and it works well enough for the signed practical application (detection distance ~ 2m). Moreover, the Grove Mini PIR Sensor module does not respond to high to temperature fluctuations (unlike most common ‘analog’ passive infrared motion sensors)!

Taking It Further…

The Seeeduino Nano/Arduino Nano has a powerful micro brain, giving a great opportunity to enhance the basic scheme shared here with more and more rattling functionalities. Likewise, you can start your next experiments with other applicable sensors (and transducers) because the controller simply looks for a TTL logic-high signal input to utter aloud. Just think about other digital PIR motion sensors, microwave radar motion sensors, ultrasonic distance sensors, active infrared presence/proximity detectors, and time of flight sensors (which I was going to go for, but the budget would not stretch). You are welcome to share your unique thoughts with us. Give it a good try!

Finally, I update this post with my final thoughts (only after a close examination) to hopefully make things a bit easier and cheerful. If you need any help just ask here and I will help you the best I can. !

Parts List

M1 Seeeduino Nano v1.0 Preferred Microcontroller
Grove PIR Grove Mini PIR Motion Sensor Module v 1.0 Preferred Motion Sensor
T1 S8050
D1 1N5819
LED1 5mm Red LED Optional
C1 100u/25V Polarized Capacitor
PZ1 16Ω Piezoelectric Speaker Not a Piezo-Buzzer!
R0 100K ¼ w Resistor Optional
R1 470Ω ¼ w Resistor
R2 10Ω ½ w Resistor
R3 470Ω ¼ w Resistor Optional
C2 N/A Reserved For Future!
S1 SPST/SPDT Slide Switch

Leave a Comment