Easter Eggs That Hide Themselves

About the project

A simple robot that gives easter eggs the ability to run off and hide themselves.

Project info

Difficulty: Easy

Platforms: ArduinoDFRobot

Estimated time: 2 hours

License: GNU General Public License, version 3 or later (GPL3+)

Items used in this project

Hardware components

Ultrasonic Sensor - HC-SR04 (Generic) Ultrasonic Sensor - HC-SR04 (Generic) x 1
DC motor (generic) DC motor (generic) x 2
DFRobot Romeo BLE - Arduino Robot Control Board with Bluetooth 4.0 DFRobot Romeo BLE - Arduino Robot Control Board with Bluetooth 4.0 x 1

Software apps and online services

Arduino IDE Arduino IDE

Story

Intro

We go through the effort of hiding eggs each year, but what if they could hide themselves? Better yet, what if they could try to run away from us to protect the little candies inside? Today, we're putting together a simple robotic system for allowing eggs to be on the lookout for an approaching human and run away if they see one.

I had this idea only a couple days before Easter, so it's a simple build that is focused around just being a fun and goofy project that also provided some amusement for my kiddos. It's a low cost and easy project for anyone looking for an easy one to learn some basics with.

Supplies and Setup

The project takes only a few electronics. The Romeo BLE is handy because it acts as a motor driver and the arduino device, so it cuts down on the hardware list a bit and makes things slightly simpler. I had a couple of 6v 133RPM motors so I went ahead and used those for the robot's mobility. For the eyes, we're using an ultrasonic sensor. The power is just a 4x AA battery holder. Otherwise, it's all literal junk I had lying around, so the supply list from here feels super doable (and, very obviously, cheap!).

For wheels I used 2 lids of the same size. I used just a small thin board for the body, a couple rolly wheels I found for some added stability, and random wood pieces to get those wheels a bit closer to the ground relative to the lid-wheels. The motors sat on a bent piece of metal I had around.

The motors get plugged into the designated left and right motor spots on the Romeo BLE. The ultrasonic sensor connects like so:

Vcc → Romeo 5 V

Gnd → Romeo Gnd

Trig → D2

Echo → D3

And we just connect the battery pack to the Romeo BLE for power. This is enough power for both the motors as well without extra effort.

Code

As always, the code is provided, but here's a brief overview of what it does. We check for if we see something between 1 foot and just under 6 feet and start the run away process if we see something. We look for something past 1 foot in case it stops near something. If it's hiding, it's better that it stays put instead of just scaring itself away over and over unless we do see someone approaching! We keep it under 6 feet to ensure the ceiling isn't detected during testing.

When we see someone within that range, the robot backs up, turns around, and then books it in the opposite direction. After a certain point in the running, it can do some slight turns for additional evasive maneuvering.

The robot runs through a few simple states: cruising around, dodging when it sees someone, sprinting away, and then stopping until it sees another person. The sprint time is random, just to keep things fun. And while I originally thought about making it find a hiding spot, it turns out just running like a maniac works better — so that's what it does now.

Putting it Together

Last but not least is the egg. I'm going to include the models I put together for the egg. I wasn't able to use them, as they wouldn't have been done in time, but hey the models exist now so maybe someone out there will enjoy them. The 2 holes are for the ultrasonic sensors.

I ended up just adding a horde of plastic eggs to the top of the robot and calling it a win. Now, many eggs get the power to escape. Perfect.

My kids had a blast with it as the robot ran away from them on approach. It's a simple build, but I had fun with it so hopefully you enjoyed the journey as well. Have a good one.

CAD, enclosures and custom parts

eggbigger_good_topleft_D6C6nZiohI.stl

Go to download

eggbigger_good_bottomleft_qFHMlh3SZX.stl

Go to download

eggbigger_good_bottomright_2N0kw5b9PU.stl

Go to download

eggbigger_good_topright_6w0ZhAsYRL.stl

Go to download

Code

self_hiding_egg.ino

Full code for the self hiding egg robot

Credits

Photo of donutsorelse

donutsorelse

I like to make stuff and make something different every week!

   

Leave your feedback...