Electronic Flapping Butterfly
by bornach in Circuits > Electronics
1769 Views, 9 Favorites, 0 Comments
Electronic Flapping Butterfly
If you've already mastered the blinking LED sketch in your microcontroller electronics journey, why not try incorporating a kinetic sculpture? I was looking over a collection of magnets that I inherited from my brother, wondering what I could make with them. Inspired by Carl Bugeja's Youtube channel I decided to try my own spin on his flapping butterfly project. The flapping motion of the wings is effected by a hand wound coil suspended in a strong magnetic field. A short pulse of high current has to be sent through the coil to make the wings move, so I've included a driver circuit that uses an optocoupler to protect microcontrollers and other sensitive electronics from any high voltage inductive spikes.
Supplies
- Card stock - I used food packaging
- Paper - printer is optional
- Magnet wire (0.25 mm thickness)
- 2x N42 magnets
- N-Channel MOSFET (IRLZ44N)
- PC817 optoisolator
- 10K resistor
- 1N4148 diode
- Protoboard
- 4x AA batteries or 18650 Lithium Ion battery
- 2x 3V coincells
- 1.5V battery
- (optional) Micro:bit or other microcontroller board
- (optional) 555 timer + passive components to make astable multivibrator (for testing)
- Crocodile leads
- Acrylic glue - or clear nail polish
The Hand Wound Coil
Cut a cardboard rectangle (50mm x 25mm) and a cardboard square (25mm x 25mm). Using a small dot of glue, attach the square to the rectangle so that it covers one half. Be careful not to use too much glue; the edges of the square should not be adhered to the rectangle. The gap between the two layers of card is where we shall be winding the coil of magnet wire.
Cut two short slits on the other half of the rectangle. Anchor the end of the magnet wire by hooking a bend through one of the slits. When the glue has dried, start winding the magnet wire around the glued spot. After every few turns, apply acrylic glue to the coil to keep the winds in place (I used clear nail polish).
After about 50-100 turns, cut the magnet wire and hook the end in the second slit. Secure the wire to the card with adhesive tape but do not cover the ends of the wire. With sharp blade, scrape the varnish off each end of the magnet wire.
The Actuating Flap
Draw the net of a box (40mm x 30mm x 20mm) onto a piece of card stock and cut it out. in the middle of centre panel, mark two points; this is where the two ends of the coil will pass through.
Punch the holes using a pin. Feed the two exposed ends of the wire through the holes. Secure the cardboard rectangle on which you had wound your coil, to the centre panel with tape. The rectangle should be attached to the panel only along one edge so that it is free to move like a hinged flap.
Fold the edges of the net of the box so that it forms its 3D shape. Glue the overlapping panels together.
The Driver Circuit
Using adhesive tape, attach an N42 magnet under the lip of the open end of the box. Attach another N42 magnet to the opposite lip of the opening. The magnet poles should face each other so that they are repelling each other (e.g. north facing inwards).
Test your electromagnetic actuator by very briefly hooking up the coil to 4 AA batteries in series. An 18650 lithium battery could also be used. You should see the coil move. If it doesn't try reversing the polarity of the battery connections. Make a note of the direction of current that caused the coil to move.
Note: This step may require a bit of experimentation. I found that a coil with many small diameter turms would work with my weaker magnets, but a coil with fewer and larger diameter turns needed to be used with much stronger magnets to show any significant movement.
Warning: Do not leave the coil connected to the battery for more than a quarter of a second. It will get very hot and you might also damage your batteries if it left connected for longer than that.
When the current stops flowing through the coil, the collapsing magnetic field might induce a very high voltage across the coil which could damage your microcontroller and any other electronics connected to it. To prevent any high voltage spikes from reaching your microcontroller GPIO pins, use the MOSFET driver circuit shown in the schematic. It makes use of a PC817 optoisolator to enable a microcontroller to safely switch the high currents flowing through the coil.
If you don't have a logic level MOSFET, you can use one with a higher threshold voltage by using four 3V coin cells instead of 2. Alternatively you can use a A23 12V battery to drive the gate.
Test the circuit by briefly hooking up a 1.5V battery to the GPIO terminals. A 555 timer configured as an astable multivibrator can also be used. Make sure the duty cycle is suitably adjusted so that the coil is never energised for more than 100ms and there is sufficient off-time to avoid the coil overheating. A microcontroller such as the Micro:bit can also be used for this purpose but verify that the GPIO signal pulse width is suitably short before hooking it up to the optoisolated MOSFET driver circuit.
The Kinetic Assembly
Cut card stock into a diamond shape with flaps to allow it to be glued on top of the box. This creates a sloping edge to which you can attach a pair of paper wings. Draw and then cut out the pair of wings (or alternatively a heart shape) from a thin sheet of paper. Mount it to the sloping edge using very minimal strips of adhesive tape. The aim is to attach the wings such that there is very little resistance to being bent at the point of attachment. Cut a pair of cardboard struts and tape these to the cardboard square that caps the hand wound coil. Attach the other end of each strut to the underside of each wing.
Connect your microcontroller GPIO pins to the optoisolated MOSFET driver circuit. The wings should start flapping, or the heart should start beating. If you are not happy with the flapping motion you might need to adjust length of the struts and point where they have been attached. If the folded centreline of the paper wings offers too much resistance to motion, try cutting a slit along part of its length. I've cut the heart into two halves, and taped them back together at just two places.
Future Ideas
- There is much room for experimentation by varying the number and size of the coils and the placement of magnets. If the magnet is light enough, it can be on the hinged rectangle while the coil is kept stationary
- The short pulse of high current calls for the use of a super capacitor. I might try swapping this for the 18650 battery
- The beating paper heart really should be triggered by my pulse. I shall try to interface a microcontroller to a pulse sensor module.