"When Pigs Fly" Micro:bit Powered Flying Piggy Bank

by BrownDogGadgets in Craft > Cardboard

3704 Views, 25 Favorites, 0 Comments

"When Pigs Fly" Micro:bit Powered Flying Piggy Bank

30cf12f7-e42f-4c17-822a-e865f70b05b6_rw_1920.jpg
14727521-5142-442b-910f-337850eb303d_rw_1920.jpg
a7b51d74-6559-47a1-b188-28c30bdbdcad_rw_1920.jpg
052d46f9-e75c-4026-a090-27c8d0b66b63_rw_1920.jpg
Flying Pig Piggy Bank Powered by MicroBit and Crazy Circuits - When Pigs Fly!

When will we save enough money? When Pigs Fly! We built a fun piggy bank using cardboard, a micro:bit, and the Crazy Circuits Bit Board. Some appropriate paint was added to make our pig look totally awesome. Programming was all done through a browser-based coding environment, and we'll provide all the code for you in case you want to build your own.

If you like our projects and want to see more of what we get up to each week please follow us on Instagram, Twitter, Facebook, and YouTube.

Supplies

Draw a Pig

When Pigs Fly - 1 of 42.jpeg
When Pigs Fly - 2 of 42.jpeg
When Pigs Fly - 3 of 42.jpeg
  • Draw a pig onto cardboard with a large oval in the center. Make sure it is large enough to fit the Bit Board and micro:bit, with extra room for money.
  • Draw one wing on a separate piece of cardboard to use as a template for both wings later.

Create a Box

When Pigs Fly - 4 of 42.jpeg
  • Create a house-shaped box. This will contain the electronics and the money collection area. Our walls were about 3.5 inches deep, and we measured it so that the entire box would fit nicely inside the pig that we drew in Step 1.
  • Use superglue to adhere the sides together. (This will be visible from the inside, so hot glue would not look as nice.)

Make a Divider Wall

When Pigs Fly - 5 of 42.jpeg
When Pigs Fly - 6 of 42.jpeg
  • To keep the electronics and the money separate, we made a divider wall.
  • We placed the micro:bit and Bit Board inside the box to make sure we placed the divider in a position that would allow it to fit.
  • We used superglue to hold it in place.

Place the Servo

When Pigs Fly - 7 of 42.jpeg
When Pigs Fly - 8 of 42.jpeg
  • We positioned the servo toward the back of the box so that the arm would be approximately in the center (front to back).
  • We cut a square hole in the cardboard, threaded the motor wires through, and placed the servo into position.

Create a Wing Track

When Pigs Fly - 9 of 42.jpeg
When Pigs Fly - 10 of 42.jpeg
When Pigs Fly - 11 of 42.jpeg
  • To keep the wings stable, we created a track for the wing wire to travel through. It will have a joint that is connected to the servo head and move it up and down.
  • We chose a triangle-shaped hole to focus the opening and closing of the wings, then folded a piece of cardboard to fit inside.

Create a Touch Circuit

When Pigs Fly - 12 of 42.jpeg
When Pigs Fly - 13 of 42.jpeg
  • We used Maker Tape to line the hole on both sides without the two pieces touching. This way, when a coin comes in contact with both of these pieces, it will complete the circuit and trigger the servo.
  • We ran the Maker Tape from each of the two pieces, around the box, and down to where the LEGO connections to the Bit Board were located. One is connected to pin 0 and the other is connected to Ground.

Glue the LEGO

When Pigs Fly - 14 of 42.jpeg
  • To keep the micro:bit in the same spot, but be able to remove it easily while building, we used superglue to attach the LEGO to the cardboard to match the holes of the Bit Board. To get the positioning right we placed the Bit Board over the LEGO while gluing, then removed it to let it dry.
  • We placed the Maker Tape over the LEGO pegs to connect to the Bit Board later.

Make the Pig 3D

When Pigs Fly - 15 of 42.jpeg
When Pigs Fly - 16 of 42.jpeg
  • We traced and cut a second pig silhouette out of cardboard, but didn't cut the round hole.
  • Instead, we traced the house shape onto the pig and cut it out. This way, the back would be open, and we could add a door so that we can replace the circuit and retrieve the money!

Stand Her Up

When Pigs Fly - 17 of 42.jpeg
When Pigs Fly - 18 of 42.jpeg
  • We stood the pig up and used hot glue to attach the box to the two pig sides. We made sure that all four feet were flat before gluing so that the pig would be sturdy when standing.
  • We used hot glue on the outside of the box between the two pig silhouettes because we would be covering it later with other cardboard (so you won't see it in the end). Hot glue is quicker than superglue (but looks a bit messy).

Curve the Channel

When Pigs Fly - 19 of 42.jpeg
When Pigs Fly - 20 of 42.jpeg
  • We cut a curve into the top of the wing channel so that it matched the curve of the pig's back.

Make a Coin Slot Platform

When Pigs Fly - 21 of 42.jpeg
When Pigs Fly - 22 of 42.jpeg
  • Because we were was making this as we go, we realized that we needed to raise up the slot of the pig so that it would be tall enough to touch the top of the pigs back.
  • We created a box to add strength and placed a new set of Maker Tape pieces.

Create a Taller Slot

When Pigs Fly - 24 of 42.jpeg
When Pigs Fly - 23 of 42.jpeg
  • We added more Maker Tape to this taller slot and connected it to the respective pieces below. Luckily It worked just fine! (Whew!)

Cover the Exterior With Corrugated Cardboard

When Pigs Fly - 25 of 42.jpeg
When Pigs Fly - 26 of 42.jpeg
When Pigs Fly - 27 of 42.jpeg
When Pigs Fly - 28 of 42.jpeg
  • We removed one side from the cardboard to make it bendable and glued it around the exterior of the pig using superglue.
  • We were especially careful to align the cardboard edge on the front side of the pig perfectly.
  • For the front of the nose, we cut out two ovals for the nostrils. Before gluing it in place, we painted another piece of cardboard black and glued it behind the holes. We did this because it would have been harder to paint the interior of the nostrils later. :)

Finished Front and Back

When Pigs Fly - 31 of 42.jpeg
When Pigs Fly - 32 of 42.jpeg
  • Here are some photos of the front and back of the pig once everything was glued in place. It's looking pretty good! :)

Make Cardboard Wings

When Pigs Fly - 29 of 42.jpeg
When Pigs Fly - 30 of 42.jpeg
  • We drew one wing and made a template to cut two more.
  • We attached both wings in the center with a piece of armature wire and folded them outwards.
  • Then we kept folding back and forth on the same spot to make them easily "flappable."

"Painting a Pig"

When Pigs Fly - 33 of 42.jpeg
When Pigs Fly - 34 of 42.jpeg
  • We tested our acrylic paints on cardboard squares to choose colors. (Sometimes paint shows up differently when you paint it on the brown cardboard color.)

Still Painting a Pig

When Pigs Fly - 35 of 42.jpeg
When Pigs Fly - 36 of 42.jpeg
  • We chose to paint the inside gold to reflect the shiny money and exuberance of golden things representing wealth!
  • We painted the exterior of the pig white as a base coat to make the shimmer pink paint pop!

Windows & Doors

When Pigs Fly - 37 of 42.jpeg
  • We traced the piece of cardboard that we cut out of the back of the pig onto a piece of craft plastic to act as the window in the front of the pig. We placed it inside and used a dab of hot glue to keep it in place.
  • We did the same for the back door, cutting the house shape out of gold mirror paper to reflect the interior color of the pig. (This also helps make it look like there is more money in there!)

Painting the Wings

When Pigs Fly - 38 of 42.jpeg
When Pigs Fly - 39 of 42.jpeg
  • We painted the wings white, then covered them with a coat of glitter Mod Podge to add some sparkle.

Put It All Together

When Pigs Fly - 41 of 42.jpeg
When Pigs Fly - 42 of 42.jpeg
When Pigs Fly - 40 of 42.jpeg
f3aa341d-310e-492a-873a-c85785892a5d_rw_1920.jpg
  • We attached the armature wire to the LEGO piece that goes on the servo and created a chain link connection to the wing wire.
  • We placed all the electronics into the pig.
  • We added a pink pipe cleaner for the tail.

Load the Code

Code Screen Shot.png

We used makecode.microbit.org to program our board. It uses a simple drag and drop block interface.

We loaded the following code for our When Pigs Fly program: https://makecode.microbit.org/52127-51925-76309-29...

Fly, Pig, Fly!

3811112c-6400-4644-b196-45b804af0bbc_rw_1920.jpg
71bbc0fb-9f5f-40fb-8d6e-fb7daed42ed1_rw_1920.jpg
Flying Pig Piggy Bank Powered by MicroBit and Crazy Circuits - When Pigs Fly!
  • We gave the Pig some coins and he flew away! :)
  • Fun Note! Because the Bit Board with micro:bit can do capacitive touch, this flying piggy bank works with paper money too! As long as your fingers touch both pieces of the Maker Tape when putting in a dollar bill, the pig will fly.