The Holiday Boxes & LEDs Video Card (With my Best Wishes to All)
First of all, this machine represents my virtual Best Wishes for these holidays, a to all the community members So, enjoy the video first and see the notes on the build below.
Parts and Design
This project uses a bunch of components for motion and lighting:
- N.4 Microservos for light rotating
- N.1 Continuous rotation servo to move the big gear of the machine
- N.4 High Power White LED Lamps (50 cents to the Chinese store)
- N.2 White LED strip to illuminate the city skyline
- N.1 12 Neopixel LED ring
- N.1 Adafruit AGC Electret Microphone Amplifier based on the MAX9814 IC
- A lot of cardboard, hot glue, paper glue, and spray paint
For those interested to the cardboard and other stuff design and building I have posted a showcase of this project on Hackster.io with some image galleries just on the carboard cutting and assembling.
The real challenge of the project has been to make everything working with a single microcontroller board: the BBC micro:bit . I should admit that when I started building the first prototype of the electronic parts on my bench I have considered to include something else like an Arduino Nano to work together but then, as much stuff I was adding to the micro:bit as much the device continued to work well and responsively.
Almost all the parts are controlled by a Kitronik's All-in-one Robotic Board; As I started to test the feature of this board I was very impressed! It can control up to four DC motors (or two stepper motors) AND up to 8 servos, with an independent power source to the external devices while powering the BBC micro:bit. One of the most interesting aspects of this expansion board, IMHO, is communicating to the micro:bit via I2C. In few words, after you have connected all the stuff for your robotic project the micro:bit has already all the available GPIO pins free. I found this invaluable for this project.
The design idea was to make a complete scenario representing - inside a box - a metaphor of the most popular Christmas symbols. Maybe it is a bit distopyc but it moves, lights and reacts to music. The other not easy aspect of the building was just to use the cardboard as the primary material. The central moving parts have been inspired by the incredible quantity of DIY Marble Machines you can find on YouTube (just put the two terms for searching videos and you remain speechless).
At this point, let me show you what I have put inside.
The City Skyline
The hardware parts have been assembled and tested separately with small programs before starting the assembly of the box. The images below show the white LED strips and the testing effect when placed behind the city skyline. The power supplied to the robot controller - the main power line - is 6.5V 2.5A The two LED strips are originally provided with a USB port to be powered by a max 5V by a power charger or a laptop USB port; to avoid overvoltage I connected two strips together creating a 60 cm LED array.
The Big Rotating Gear
The big rotating gear is the main cardboard engine activated by a smaller gear to the base connected to a continuously rotating servo. The all-in-one robot controller can drive up to eight servos independently; I used five with great result: all of them worked as expected. The images below show the servo connected to the driving gear.
The video below shows the servo bench testing.
To make the colored flashlights I have used four cheap high brightness portable flashlights like the one shown in the photo after the complete disassembled.
Like the case of the white LED strips these lamps operate with three 1.5V AAA batteries so I connected a couple of them in series to avoid overvoltage. Also, the light reflecting support has been hacked to make it colored. To create the front screen of the lights I have used the top side of four of my preferred transparent sunshade caps.
Every light has been glued in a support connected to a microservo to create the rotation
Video showing the light mechanism under the bench test.
The Glowing Star
The glowing star is a double cardboard star with the fronm side partially open - making a design - with transparent 3D printed plastic cover. The internal part of the star has a 12 NeoPixel LEDs.
Note that the star uses the micro:bit PIn 16 of the GPIO. Together with the electret microphone is the only device directly connected to the board pinout while all the other parts are managed by the all-in-one robotic board.
The Electret Microphone
This device from Adafruit is a simple electret microphone breakout board with the Max 9814 amplifier. It is connected to the analog input Pin 2 of the micro:bit and the periodically read value changes the intensity of the lights depending on the music level. If no music is played around, the rhythmic noise of the servos anyway generates a nice light floating effect.
BBC micro:bit Firmware Update
As far as I know, the micro:bit internal libraries managing the I2C and SPI protocols has serious bugs. Someone has no difficulty to use them while in other cases (like me) it seems impossible to work correctly. The Kitronik's all-in-one robotic board communicate with the micro:bit through the I2C protocol; I had serious issues on the first run then I checked the firmware version of my board and it was 2.30 while the last update from the microbit.org site is the version 2.50. Everything worked fine after the firmware update.
To update the firmware of the micro:bit follow the instruction on the microbit.org specific link: https://microbit.org/guide/firmware/
Libraries and Sources
If you just copy and paste the java sources in the online micro:bit editor does not work. Don't forget to download the libraries from the Extensions option in the blocks online editor. you should install the Kitronik Robotic Library and the Adafruit Neopixel Library.