Automatic Leprechaun Trap
by BrownDogGadgets in Circuits > Microcontrollers
1467 Views, 4 Favorites, 0 Comments
Automatic Leprechaun Trap
Have you been trying to catch a Leprechaun, but he always gets away? This year use a distance sensor and servo along with a micro:bit and a Crazy Circuits Bit Board to instantly sense the presence of a Leprechaun so that you can trap him and get three wishes!
If you like our projects and want to see more of what we get up to each week please follow us on Twitter, Instagram, Facebook, and YouTube.
Supplies
Brown Dog Gadgets sells kits and supplies, however with a few changes you can build this project without buying anything from us. (Though purchasing from us does help support our small business and allows us to keep building fun projects like this!)
Electronics:
- micro:bit
- Crazy Circuits Bit Board
- Distance Sensor
- Brick Compatible 720 Degree Servo Motor
- 2 AAA Battery Pack
- Jumper Wires
Craft & Other Supplies:
- LEGO Technic Beam 3 x 3.8 x 7 Beam Bent 45 Double (32009 / 41486)
- LEGO Brick 2 x 2 with Pins and Axlehole (30000 / 65514)
- Miscellaneous LEGO Bricks
- Rainbow Colored Paper and Cotton Balls
- Gold Coins or Shiny Objects
- Top Hat
- Foam Core
Tools:
- Computer
- Scissors
- Stapler
Note on the Supplies
- The first thing you'll need is a trap chamber. We used a green top hat, but you could also use a small cardboard box.
- To entice the Leprechaun you'll need something that looks like gold. We used some plastic gold coins that look very shiny - they could be real! We put them in a small pot.
- To make the trap visible from afar use a rainbow! We all know that gold can be found at the end of a rainbow, so the Leprechaun will surely be lured into your trap. We made ours from paper and cotton balls.
Cut a Hole in the Hat
- Cut a hole in the back of the hat. This will allow the sensor to "see inside" the hat, and for the motor arm to grab onto.
Make the Base and the Hinge
- Cut a piece of foam core about 5 inches larger than the size of the hat.
- Staple the hat's brim to the foam core to make a hinge as shown. (If you're using a cardboard box, cut off all but one of the flaps and staple the remaining flap to the foam core.)
Make the LEGO Structure
- Use LEGO Bricks to create a structure that holds the distance sensor up in a way that it points through the hole in the hat.
- Add LEGO parts to create a spot for the Bit Board.
Attach the Motor
- On top of the distance sensor, add another layer of LEGO to mount the servo motor. Use a LEGO Brick with Pins to mount the motor on its side, as shown.
Connect the Wires
- Connect the 2AAA battery pack to the screw terminals.
- Connect:
- VCC to +
- Trig to P14
- Echo to P13
- GND to -
- Servo Motor to P1, + and -
Code the Micro:bit
- Download the code to the micro:bit https://makecode.microbit.org/_Tx4ap637EE65
- This code sets the servo motor to the "Start Angle" and keeps it there until the distance sensor senses a Leprechaun coming within 3 inches of the sensor. When it does, it moves the servo to the "Capture Angle" to drop the hat over the Leprechaun and trap him inside!
Attach the LEGO Beam to the Servo
- Press Button "A" to move the motor to the Start Angle. Place the motor arm on the motor in the location where it will hold the hat up.
- Press Button "B" to test that the LEGO Beam doesn't hit the LEGO Bricks when it moves to the Capture Angle.
Set the Trap
- Place the trap in a location where a Leprechaun could see it easily, preferably on a dresser or nightstand so that the Leprechaun will think you are asleep and try to sneak in to steal your gold!
- Press the "A" button to move the motor to the "Start Angle" and place the hat over the motor arm.
- Decorate the area around the trap with gold. Make sure that there is a lot of gold under the hat, but nothing within 3 inches of the sensor.
- Add rainbow embellishments or a sign that says "FREE GOLD!".
Trap Your Leprechaun
- With the tap set the night before St. Patrick's day, go to bed as usual.
- If you hear the trap go off, wake up! Tell your Leprechaun that you will let him go if he grants you 3 wishes.
- MAKE 3 WISHES! What will you wish for?