Smart Transporter With Micro:bit and Servo.
by jwstynjao in Circuits > Microcontrollers
186 Views, 0 Favorites, 0 Comments
Smart Transporter With Micro:bit and Servo.



Instructables turns 20, and we wanted to celebrate with creativity and technology! 🥳
This time, we built an interactive cardboard protractor that combines art, electronics, math, technical drawing, and geometry.
The result is a protractor that, thanks to the Micro:bit's light sensor, moves a servo from 0° to 180°, displaying the angles. We also decorated it with party motifs and had the Instructables robot as our special guest 🤖, ready to help us hang garlands, balloons, and even signal when it's time for cake 🎂.
Supplies
1 Micro:bit with USB cable
1 SG90 servomotor
Jumpers (M-F)
Recycled cardboard
Paints, markers, scissors, ruler, compass
Hot glue or adhesive tape
Printed protractor (for reference)
Design and Plastic Arts




Draw a 180° semicircle on the cardboard using a compass or protractor.
Mark divisions every 10°.
Decorate with birthday motifs 🎊: balloons, confetti, garlands.
Draw or glue the Instructables robot 🤖 on the base as part of the celebration.
Assembling the Servo System and Microbit


Cut out the protractor.
Glue the servo to the center of the semicircle.
Place a cardboard arrow on the servo shaft (this will be the angle dial).
Secure the Micro:bit to the side with tape, leaving its light sensor free.
Connections
 7.29.29 a.m..png)
Orange servo cable → Micro:bit pin 0
Red servo cable → 3V
Brown servo cable → GND
Programming in MakeCode
 12.56.36 p.m..png)
When the Micro:bit is powered on, the servo connected to pin P0 is set to the initial 0° position.
This serves as the starting point, ensuring that the protractor arrow always starts from the same location.
Measuring and Converting Light to Angle
The Micro:bit measures the amount of light with its sensor (values ​​between 0 and 255).
This value is converted into an angle between 0° and 180°:
If the light level is 0 → the angle will be 0° (dark = start).
If the light level is 255 → the angle will be 180° (full light = end).
Intermediate values ​​are scaled proportionally.
Move the servo according to the detected light
The servo receives the calculated value (stored in the variable light) and rotates the arrow to that angle.
For example:
If the light is medium (≈128), the servo will move around 90°.
If there is bright light, the arrow will move towards 180°.
Test Your Protractor

Light up or cover the Micro:bit.
Watch the hand move proportionally from 0° to 180°.
Use the decorated protractor to check the angles.
🎉 Bonus: Use it as a spinner for party games to see which angle you get!
Light → Angle Conversion Table
 7.37.34 a.m..png)
DEMOSTRATION
