Fun with BirdBrain Motors and Sensors
Fun with BirdBrain Motors and Sensors
Fun with BirdBrain Motors and Sensors
🎓 Grade:
3+
⌛ Time to read:
8 min
📥 Includes:
Video, Overview, Photos
Activity Summary
Curious about our 4D (Discover, Define, Develop, Deliver) model for technology and engineering design? Read about why we selected this framework and how it can be implemented in your classroom!
Learn about the 4D model

Overview

In preparation for our attendance at PETE&C, we wanted to have all sorts of goodies and gadgets for folks to explore and play with to really get the feeling for what we’re all about at Fluxspace. Part of that mission was to create a way to showcase the features, sensors, and outputs of Birdbrain’s Hummingbird kit. Long time Fluxspace readers will remember Claire’s awesome blog post about our first experiences with Hummingbird, but for this project, I wanted to create something new and ideally, something fun. 

I started off by perusing some documents of projects that folks have done in the past by searching through Birdbrain’s website to familiarize myself with all of the sensors and motors. I landed on the demo video of the position servo, which shows a model of the muscles and bones in the arm. I liked this, but wanted something more interactive. The image of the skeleton reminded me of old school cartoon skeletons. That was all I needed to see—I was off to find models to laser cut from the Noun Project.

I found a skeleton model that I liked and was just about ready to laser cut the design, but then our team member (and long time friend of mine) Jay walked over. “Halloween was like 4 months ago.” Sigh. Back to the drawing board. I thought a bit more and decided that DaVinci’s Vitruvian Man was a perfect representation of the limb motion that I wanted. I found a file and cut it out.

With my model selected, I had to make a few edits to detach the arms and make mounts for the motors but, it was time to get coding. I opened Microsoft MakeCode and grabbed a MicroBit from our supply. After some fidgeting with the specifics on the math of the sensors and motors, I landed on the following code.

The decision making process of how to add, subtract, or multiply numbers is completely based upon what values the sensors output and what values the servos take as inputs. The position servos take any number between 0 and 90°, so I set #2 to the distance sensor times 3, since I found the exact readings of the distance sensor a little inaccurate at large distances. Next, I set the rotation servo #4 to the dial (whose values range from 0 to 100) minus 50 and multiplied that by 2. This gave me a range from -100 to 100. As for rotation servo #3, I found that the sound sensor had the same value range from 0 to 100, so I used the same formula as #4. Position servo #1 gets handled on the other end of the radio, however.

The acceleration (tilt) sensor ranges its values from -1023 to positive 1023. Instead of doing the math for that, I used the map block, which allows you to set a low and high for your inputs and map them to a low and high output. This way, -1023 maps to 0°, 0 maps to 45°, and 1023 maps to 90°.

I assembled all the pieces and was presented with something that looked pretty decent. It wasn’t quite enough, though. I wanted to make the controllers feel a little more user friendly, so I designed little boxes for all of them out of cardboard. Here’s the final product: If you want to see the game in action, check out our YouTube video.

Assets
No items found.
Materials
Linked Materials
No items found.
Grade Modifications
Print
Materials