Make a model car park (parking lot) barrier with LEDs, Servos and an OLED screen.
YOU WILL NEED
• BBC Micro:bit
• Tinkercademy GVS breakout board
• Micro servo motor
• OLED display
• 2 x Octopus LEDs
• 4 X F-M Jumper wires
• Ice cream stick
• toilet roll
• Hot glue
Connecting the components
With your micro:bit in your breakout board, connect the micro servo to P0, and the LEDs to P1 and P2. Make sure the colours of the wires match the colours on the breakout board.
Attaching the display
The OLED display is a module that communicates with the micro:bit using I2C (an Inter-Integrated Circuit Communications protocol, also known as I2C). With I2C, several devices can be connected on the same pins, or bus, and still send and receive messages. The miccro:bit’s own compass and accelerometer use I2C too. The I2C pins on the micro:bit are P19 )S(L, or Serial Clock) and P20 (SDA, or Serial Data). On the Tinkercademy GVS Breakout Board, look for 3 rows of 4 pin holes labelled GND, VCC, SCL and SDA - plug the OLED in as shown, on any of the 3 rows, with the screen extending down.
Building the enclosure
• Let’s craft a model car park barrier/gantry! First, grab a suitably-sized box. You need access to the insides of the box, so you might need to cut a suitable lid for access if necessary.
• Start cutting holes for the components to attach while facing outwards. We have approximate measurements in image.
Mounting the servo
• Consider carefully the position for the micro servo. It should be attached to a suitable height off the “ground”, and the servo arm will act as a barrier/gantry when we attach an ice cream stick to it, laying across the path.
• Use jumper wires to locate the OLED screen away from the breakout board, so that it can be placed neatly on the outside of the box.
Try it out
Elevate the box if necessary. We use a toilet paper roll as a height extender here. Use double-sided sticky tape or hot glue to fix the components to the box.
Code and References
Made this activity? Good Job! Now spread the word. Share a photo of your creation on social media with #letsgethacking #CarparkGantry