• EUR€
  • £GBP
  • $USD
PROJECTS micro:bit

Make a micro:bit Surprise box

DFRobot Dec 04 2017 2132

This Tutorial is created by Mark Ng. 

Make a micro:bit Surprise box

How it works?

The servo motor is set at default 90 degrees position.  The ambient light sensor detects the intensity of the surrounding light. When the box is opened, the light level is greater than 100, the servo will move to 170 degrees. A flashing heart will be displayed. When the user closes the box,  the light sensor is block by the cover of the box, the servo will move back to the 90 degrees position. The heart will disappear.

Materials In Need:

  • micro:bit
  • DFRobot micro:bit Expansion Shield
  • DFRobot Ambient Light Sensor
  • Servo Motor 9g
  • Glue Gun
  • Picture
  • Box
  • Cable Tie

  • Making the picture pops up

    1.Use the glue gun to secure your favourite picture to the straw. Apply some glue into the other end of the straw before pushing in the half servo arm.

    2.Inside the box. The servo motor is secured using a cable tie. The light sensor is placed near to the front of the box.

    How to make a micro:bit Surprise box


    P1 to ambient light sensor

    P2 to servo


    1. Check the readings of the sensor. Observe both the readings when the light sensor is covered and not covered.

    2. I noticed that the reading will fall below 100 whenever I cover my light sensor.

    3. You might need to adjust the value of >100 based on your own lighting conditions.