BBC micro:bit guinea pig timed feeder instructions
Last updated: Nov 5, 2022
This blog post is the instructions on how to use a timed servo motor circuit that I lashed up as part of a guinea pig feeder for a friend.
The hardware details can be found here: here
Software is on my GitHub site here
A friend wanted something to open a box of food to feed his guinea pigs. The box needs to open after an adjustable time.
I can think of no more noble cause to focus on than feeding our furry friends.
After a period of procrastination and confusion I supplied the hardware and software detailed in this post. The mechanical components that the device will operate are up to my friend to make. He is a highly experienced mechanical engineer. I am but a lowly electronics tech.
Between the two of us, the guinea pigs will be fed!
The microbit counts down for a preset amount of time. The remaining time is indicated on the LEDs on the microbit. At the end of the pre-set time, the servo motor lever moves 90 degrees. The two positions of the servo motor are shown in the pictures below.
The timer is adjusted using the A and B buttons as detailed in the Instructions section below.
Servo motor position while the timer is in operation
Servo motor position once the timer completes the countdown
Instructions for use
The A button adds 12 minutes to the timer. An extra LED will light up for each press of the button. The B button decrements 12 buttons from the timer. An LED will turn off for each press of the button. The photograph below shows two lit LEDs on the microbit, indicating 24 minutes or less are left on the timer.
The two lit LEDs indicate that 24 minutes are left until the servo motor is activated
The last timer setting is recorded to the memory on the microbit. When the board is reset, it will start counting down from this time. So, if you set the timer to 2 hours (10 LEDs lit), on resetting, you will see 10 LEDs lit up and the board will take 2 hours to trigger the servo motor.
The reset button on the back of the board restarts the board. Please see the photograph below which shows the position of this button.
Underside of the microbit with the rest button indicated, next to the battery connector
The components of the system are shown in the picture below. On the left is a AAA battery pack containing 2 x AAA batteries. I use battery packs with a switch, which I get from eBay. The microbit is in the centre, slotted into a kitronik microbit edge connector. This edge connector allows the signal pins of the microbit to be connected to the servo motor using female to male jumper cables . The cables are designed for the 0.1" pins and sockets found on the edge connector and the cable connected to the servo motor.
AAA. battery pack, microbit, servo motor
The full assembly including cabling is shown in the photo below.
AAA battery pack (right), microbit and edge connector board (centre), servo motor (top), connectors (right)
A close up photo showing how the cables from the edge connector and the servo motor connector are connected is shown below. The black/brown wires are ground, the red wires are the battery voltage and the yellow wire is the PIN0 signal line.
Pins from cables connected to the Kitroniks edge connector on the left, sockets connected to the servo motor on the right
The photo below shows how the cables connect to the pins on the Kitronik edge connector.
Cables connected to the Kitronik edge connector. Yellow goes to 0, black to 0V, red to 3V.