Creating a Button Sensor for Hummingbird
Subjects
Maker
Project Type
Interactive Games
Required Tutorials
No required tutorials
Estimated Time
Short (1-3 hours)
Description
Learn how to make a button sensor for the Hummingbird.
Teacher Credit
Karen Polstra of Christ Church Episcopal School
Project Map
Learning Goals
Wish your Hummingbird kit came with a button or switch sensor? We’re working on that, but until they do, check out this awesome video to see how to make a home-made button.
Materials
- Hummingbird Bit Base or Premium Kit
- Possible Craft supplies
Tips
- Have students work in groups of 2-3.
- Our Printables page has a variety of documents for making teaching and learning with Hummingbird easier. Visit and explore resources like the My First Robot Design Notebook now.
Steps
As shown in the image on the right, the button in Karen’s example is wired with the help of a pull-down resistor. This is a resistor wired from the ‘S’ terminal to the ‘-‘ terminal. This resistor keeps the sensor value low by providing a high-resistance connection to electrical ground (the ‘-‘ port). Any resistor from 100 ohms to 100 kilo-ohms should do the trick here.
The button itself is made of two wires: one yellow wire to the ‘S’ terminal and another red wire to the ‘+’ terminal. The ‘S’ terminal can hold both the end of one side of the resistor and the yellow wire. In the example in the video, these are also ingeniously connected to two pennies so that when the pennies touch, they make a circuit that connects S and + together, causing the ‘S’ terminal to be raised to the voltage of ‘+’ (5 volts). When the pennies aren’t touching, the pull-down resistor will cause the voltage on ‘S’ to sink back down to close to 0 volts.
To make the penny button, strip the other ends of the yellow and red wires. Then tape the end of the red wire to one penny, and the end of the yellow wire to the other penny. Then hot glue both pennies to a piece of cardboard so that you can “press the button” by folding the cardboard.
The video shows an LED turning on when you press the button. The code for doing so in Snap! is shown below. In general, you’ll want to select an “other” sensor block and then use a threshold. Check the value of the sensor when the button is pressed and when it is not pressed – when it is not pressed it should be close to 0, and when it is pressed it should be a high number – in the case of Snap!, at least 3 volts.
WHAT NOT TO DO
Do not connect together the ‘+’ and ‘-‘ terminals through a switch or any other method. This causes a short circuit (like connecting both ends of a battery together). Your Hummingbird has built-in current limiters that will prevent major damage, but other devices will be less forgiving when you connect ‘+’ and ‘-‘ together.
Standards Alignment
COMPUTER SCIENCE TEACHERS’ ASSOCIATION (CSTA)
CSTA Standards are split into different grade levels: 3-5, 6-8, and 9-10. Working with the Hummingbird Robotics Kit meets multiple standards across these grade-level delegations.
Visit this page for a more detailed explanation of how working with the Hummingbird Robotics Kit applies to meeting CSTA Standards.