A while back we had a little bit of Socially Distant FUnicorn fun. We grabbed this $4 HC-SR04 ultrasonic distance sensor from adafruit, added it to the FUnicorn, and made our own little warning for anyone getting within 6 ft.
If you'd like to make your own Social Distance Unicorn, example code is now part of the FUnicorn Arduino library on GitHub - it's also installable & updatable through the Arduino IDE. Instructions for adding libraries to Arduino are on this project's page under "instructions".
- For distance sensor operation: Connect following wires from sensor to FUnicorn, GND to GND, ECHO to pin13, TRIG to pin12, VCC to 3.3V.
Here's a short video on how to hook up the distance sensor to the FUnicorn: