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.

ChatGPT Image 4 sept 2025, 15_42_05.png
1756918337680.jpg
1756917992714.jpg

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

1756918965268.jpg
1756918965281.jpg
1756918965292.jpg
1756918965300.jpg

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

1756920808319.jpg
1756920808299.jpg

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

Captura de Pantalla 2025-09-04 a la(s) 7.29.29 a.m..png

Orange servo cable → Micro:bit pin 0


Red servo cable → 3V


Brown servo cable → GND

Programming in MakeCode

Captura de Pantalla 2025-09-03 a la(s) 12.56.36 p.m..png
Set servo P0 angle to 0°

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


Set light to map light level
From low 0 → From high 255
To low 0 → To high 180


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


set servo P0 angle to 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

1756918284541.jpg

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

Captura de Pantalla 2025-09-04 a la(s) 7.37.34 a.m..png

DEMOSTRATION

Robotica , artes y matemáticas proyecto SETAM en el AULA "SERVOTRANSPORTADOR"!