Automatic Leprechaun Trap

by BrownDogGadgets in Circuits > Microcontrollers

1420 Views, 4 Favorites, 0 Comments

Automatic Leprechaun Trap

Automatic Leprechaun Trap w/ Distance Sensor Technology from Brown Dog Gadgets

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:

Craft & Other Supplies:

Tools:

  • Computer
  • Scissors
  • Stapler

Note on the Supplies

IMG_4855.jpg
IMG_4864.jpg
IMG_4936.jpg
  • 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

IMG_4861.jpg
IMG_4863.jpg
  • 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

IMG_4866.jpg
IMG_4871.jpg
IMG_4873.jpg
  • 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

IMG_4875.jpg
IMG_4887.jpg
IMG_4893.jpg
  • 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

IMG_4895.jpg
IMG_4896.jpg
  • 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

IMG_4898.jpg
IMG_4902.jpg
  • 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

Screen Shot 2022-02-22 at 1.57.06 PM.png
  • 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

IMG_4911.jpg
IMG_4912.jpg
IMG_4913.jpg
  • 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

IMG_4938-Edit.jpg
IMG_4939.jpg
  • 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

IMG_4942.jpg
IMG_4943.jpg
IMG_4946-2.jpg
  • 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?