Introduction: 'Don't Touch Me' Anti-Virus Alarm

About: I used to teach middle school science, but now I run my own online educational science website. I spend my days designing new projects for students and Makers to put together.

Sometimes you just want to keep people at arms length, such as when you have a cold or the other people might have a horrible virus of their own. For those situations you need a device that warns you when others are getting too close. Thats why we built the "Don't Touch Me" Anti-Virus Alarm system! Whenever someone gets within 6 feet of you the speaker will start emitting a loud and annoying sound while the LED starts flashing faster and faster. Protect yourself today with proven technology!

We wanted to build a silly project to help pass our time in quarantine so we built this. It's a pretty simple project overall, using an Arduino for the brain and a simple ultrasonic range finder as a sensor. We built this using Crazy Circuits components so we could stick the project onto LEGO, but you could also easily build this using standard components and any Arduino compatible board.

If you like our projects and want to see more of what we get up to each week please follow us on Instagram, Twitter, Facebook, and YouTube.


Brown Dog Gadgets does in fact sell kits and supplies, but you don't need to buy anything from us to make this project. Though if you do it does help support us in creating new projects and teacher resources.


Other Supplies:

Step 1: Video Guide

For those of you who hate to read we also made this handy video guide.

Step 2: Lay Out LEGO and Electronics Components

In general you can just look at the above diagram and see how everything is connected.

We start by laying out some LEGO plates in order to build a platform for the Robotics Board to sit on. We used some 2x4 plates, but some 1 stud wide plates would also work just fine. You could also just have the Robotics Board hand off the edge of your LEGO base plate as well.

Then, plan out where your electronics will go. We chained the Negative of our LED and Piezo Speaker off each other, but you don't have to do that.

Lastly we added our 1/8th inch Maker Tape. This stuff is a nylon conductive tape which is super strong and durable which makes it perfect for the pressure fit of our Crazy Circuits components.

Step 3: Sensor Holder

Use some 2x3 and 2x2 bricks to build a platform for the sensor.

We'll also use a couple of 1x6 bricks to hold the sensor in place.

If you have a 3D printer you can also try printing your own sensor holder!

Step 4: Wire Up Sensor

The Robotics Board has pin headers on the back end for easy connection to sensors.

The way our code is set up we're using Pin 6 for the Echo and Pin 5 for the Trigger. Connect VCC to any 5V pin and GND to any GND pin.

We also used a 1x2 Technic brick as a wire organizer. Shoving four ribbon cables through it is possible, just don't expect to ever be able to take them out again.

Step 5: Add More Bricks

Add in a couple of 1x6 and 1x4 LEGO bricks to hold the sensor in place.

We also added some longer 1x6 LEGO Technic bricks to the top so we could attach the lanyard.

Step 6: Upload Code

Before this thing will work you'll need to upload code. If you've not done so already, make sure you have the latest version of the free Arduino IDE software installed on your computer.

Our code is found at our GitHub repo along with the NewTone_1.0 library. You'll need to install the NewTone library for this project to work.

The code is very straight forward. You can change the distance settings as well as which pins are being used for input and outputs.

Step 7: Enjoy!

Thats pretty much it for this project. We hope you've enjoyed making a personal alarm system for yourself.

With any luck you won't need it, but it may come in handy.

Or if nothing else you can use it to alert you to when a cat, dog, or small child is trying to sneak up on you while you work/ study at home. Pesky small mammals!