Preparation
1. Cut a hole on a piece of acrylic and place it inside the photo frame.
2. Secure the 16 pixels ring around the hole
3. Secure the speaker & 360 servo motor to the bottom of the photo frame and make sure that the motor is at the centre of the hole.
4. Laser cut the Christmas tree with stand.
5. The stand is made up of 2 parts. The top is a cross and the bottom is a hole. The hole size is the same as the 360 servo.
How it works?
When Button A is pressed, the 360 servo will start to turn anticlockwise, display rainbow colours and the mp3 will begin to play.
When Button AB is pressed, the servo will turn anticlockwise.
When B is pressed, the servo & mp3 will stop and the colours from the LEDs will be set to off.
On start will run once the micro:bit is powered on.
We set a variable light and inform micro:bit how many RGB leds are there.
The dfplayer will play the mp3 file when it receives a signal from the microbit via pin 1. As we do not need the dfplayer to send a signal back to the micro:bit, we do not need to connect pin 13 but we still need to specific in the program.
The volume from the dfplayer and the brightness of the LED pixels ring can be easily adjusted.
The leds are set to off.
Forever contains the instructions that get repeated over and over until the board is turned off.
We will show the lights and rotate by 1 pixel. Initially when we power on, the lights are set to off and thus nothing to show.
When Button A is pressed, the RGB ring will display rainbow colours. The forever loop will show the colours and rotate pixel by 1.
Since we are powering the dfplayer, led ring and 360 servo, we have to connect the power to the micromate instead of the micro:bit. If the servo is not turning, turn the voltage selector to 5v.
You can add pir to it so that the Christmas tree will respond when someone enters the room.
DFRobot introduces seeMote Cap and Cube for Apple Vision Pro. Empower your visionOS apps with 6DoF tracking, physical tool integration, and haptic controls.
Discover our new series of 11 industrial-grade RS485 water quality sensors. Featuring IP68 rating, Modbus RTU, optical dissolved oxygen (DO), and Arduino compatibility for continuous IoT water monitoring.
Explore DFRobot’s AI & STEM education ecosystem at Bett Brasil 2026 (Booth M120, São Paulo). Hands-on AI literacy, robotics, and GenAI projects for K-12 classrooms.