Pocket Protectors: They Don’t Just Protect Pockets Anymore


This is just a quickly put together project to have a little fun with social distancing. The project uses an ultrasonic distance sensor, microcontroller, and an RGB LED. The set-up is hot glued to a piece of cardboard, with a battery pack glued to the folded over part that fits in a shirt pocket. If it doesn’t detect anything within 10 feet, the LED is off. If it detects something between 8 and 10 feet, it lights up green, indicating a proper social distance is being maintained. Between 8 and 8 feet, it turns yellow, and if it detects something 6 feet or less away, it flashes red to warn both parties that the proper social distance is not being maintained.

As I mentioned, it’s just for fun, and isn’t very practical, as the sensor reacts to anything in front of it, not just another person. If you really want to get fancy, you could add a camera and face detection, so that the sensor only reacts when a person is in front of you.


Social Distancing Sensor

Social Distancing Sensor

RCWL-1601 Ultrasonic Sensor

breadboard closeup

A closeup of the fully wired breadboard and components

  • The system uses an Adafruit RCWL-1601 distance sensor. A nice thing about this sensor is that it can operate at either 3V or 5V. The sensor has four pins: Vin, Ground, Trigger, and Echo. You send a trigger pulse to make a measurement, and then the length of the return pulse on the Echo line tells you the distance.
  • The microcontroller is a Teensy 2.0 that I had lying around.  Pretty much any Arduino compatible board will work.
  • The battery input is run through a 7805 voltage regulator to put our a steady 5V. I should be providing a bit higher voltage as input, but the 6V does seem to work.
  • The RGB LED is one I had around, I don’t remember the model.
pocket protector social distance sensor

The finished Social Distance Sensor

Everything is wired up using a breadboard and then the components hot-glued to the cardboard “pocket protector.”

The Software

The software is very straight-forward. The one minor twist is that I decided that when the sensor detected something 6 feet or less away, it would flash, not just have a steady light. Because it also needed to be continually sensing, I couldn’t use delay() to do this. Normally one uses millis() and continually loop and checking on each pass whether or not enough time had passed to turn the LED on or off. In this case, however, I decided to measure distance four times a second (every 250 milliseconds) and also have the duration of each on or off period also be 250 milliseconds. This makes the already simple code a little simpler, but at the expense of flexibility.

The software can be downloaded from github.

The Test: Don’t Stand So Close to Me

So here’s the result. My wife walked towards me holding the camera. As you can see in the video, the LED is initially off. When she gets within 10 feet, it turns green. It skipped over the narrow range when it’s yellow, but when she gets to 6 feet, it begins to flash red.

National Maker Faire 2016

I attended the National Maker Faire held over Father’s Day weekend at the University of the District of Columbia, and thought I’d share some observations and pictures. They’ve added the National Maker Faire to the list of flagship faires around the US, along with the original Bay Area and World Maker Faires. I’ve been to the World Maker Faire once, and from that and what I’ve heard of the Bay Area Faire, the National Faire is much smaller than either. You could certainly see it all in less than half a day. It’s also a bit random in its layout, as it makes use of several areas of campus buildings and grounds. Unlike the other two major faires, I would not travel from out of town to see this one. But for anyone on the greater DC area, I found it well worth my time.

It’s not new, but I hadn’t seen the Intel Arduino 101 board before. I’d have loved if it had WiFi but the built in real-time clock, bluetooth, accelerometer, and gyro make it quite interesting. Apparently the Curie system on a chip module it’s build around also has a 128-node neural network for machine-learning, but there is, at least as of now, no software released to access it.

Ability3D had a table promoting their planned 3d metal printer, with a kickstarter campaign planned for January 2017. They were showing a development prototype model (the final consumer product to be smaller). It prints with powdered metal. I believe they said they were targeting the several thousand dollar range for price, so not inexpensive for a home printer, but an order of magnitude cheaper than current metal powder printers.
Nova Labs, one of the local area makerspaces, was also there with some interesting demos and projects.

There was also a lock picking village put on by TOOOL, which was quite full when I went by. It was also nice to see a short waiting line for the “Learn to Solder” hands on booth. How often do you see people lining up to learn to solder? Unfortunately for some reason the drones only were being flown on Saturday, and there were no drone demos when I went on Sunday.

Below are a number of photos from the event:

Learn to Solder hands on exhibit

Learn to Solder hands on exhibit

Ability3D's booth. Developing a home metal powder 3D printer

Ability3D’s booth. Developing a home metal powder 3D printer

Cardboard pinball kits, with options to add arduino, electronics, servo, etc. There's going to be an upcoming kickstarter campaign.

Cardboard pinball kits, with options to add arduino, electronics, servo, etc. There’s going to be an upcoming kickstarter campaign.

Review and Build Report: MAKE Rovera 2WD Arduino Robot Kit, Part 2

Back to robotics! I dug out the Rovera 2WD robot that I started reviewing awhile back, added the center IR emitter/sensor and moved the left and right sensors closer to the middle, so it would be in line-following mode and loaded up the line following code. In order to have a track to follow, I printed out the pdf template patterns that Parallax has made available for their line scribbler robot and taped them down to some particle board. The first runs went quite badly, but after adjusting the damping variable in the provided code (the proportional response), and adjusting the width of the sensors and the run speed, it almost works:

As you can see, it navigates most of the course, but fails at the tricky sharp multiple curve at one corner of the track.  You can also see that it wiggles a bit going straight down the track. I need to check it out more, but it also seems to be more sensitive and react more strongly to left than to right turns.

So, while I’ve got some work to do, I’d say the Rovera 2WD robot also makes a nice robot to experiment with line following.  The provided code uses proportional control, but there’s no reason that you couldn’t add PD or full PID control logic, or drop back to bang-bang control to see how that works. The three sensors are fully adjustable in terms of lateral spacing, and you can also adjust the height if you want.

There’s also a modified version of the line-following code that transmits key variable values out while the robot is running, and a Processing program provided to graphically display the results, so that one can monitor the outputs of the sensors and the motor settings (or modify the code to track any other variable you want).  That’s part of my next step. I’ve got the Processing code up on a laptop.  I’m going to replace the complex curve with a simple one, and run the robot in some simple clockwise and counterclockwise loops to see how it behaves and see if it’s the motors or the sensors that seem to be generating the asymmetric behavior.

So, all in all, I’m quite happy with the Make Rovera 2WD kit. I’d recommend it for someone who has some experience with programming and isn’t afraid to do or learn some simple soldering. It also has a Ping ultrasonic sensor, which I’ve used on another robot, but not this one yet, so I can’t report on that aspect.

Side notes:

  1. The kit comes with an Arduino Leonardo, which many report having trouble getting uploads to work reliably on. I’m one of those. What’s working best for me is to hold down the reset key while launching the upload, then releasing the button immediately.  I think they may have been better off going with a Uno.
  2. The book doesn’t tell you to move the library functions into the libraries sub-folder in your Arduino sketchbook. I hadn’t realized that’s where they should go, so when I went from 1.0.4 that I’d been using to 1.0.5, the new version of the Arduino IDE didn’t know where to look for the robot libraries, and gave error messages.  A simple fix, but I see from various online forums that I’m not the only one who got caught by that on various projects.
  3. You can get the robot online through the Make Shed store, but also, if you have a MicroCenter near you, they’ve started to carry a lot of electronics kits, and I found mine at my local MicroCenter. Always nice to be able to give some maker business to local brick and mortar shops.