Introduction: PICAXE - Music Responsive, Fog Producing, LED Light Show and Audio Amplifier All in One
I am the type of person who loves being able to have an idea and being able to turn that idea into a physical working product, this probably explains my passion for CAD (Computer Aided Design) software and 3D Printing which when both are used in conjunction with each other can turn a virtual design into reality. I currently 3D print a few designs using Shapways.com (and try and sell some of my designs in the process) however this Instructable is not about 3D printing (most of my other Instructables are) as with this project I had access to techniques far superior in quality (be it with a lot more effort) than 3D printing and more functionality than can be made possible with 3D printing (until 3D printed circuits can be made); with this project I joined both my passion for design and electronics to create a fully working prototype product, the functionality is quite difficult to explain in words so please watch the video below and it will make the functionality very clear and then read my explanation beneath the video.
This is a project I recently endeavoured on as part of an 'Electronic Products' qualification, it seemed a bit ambitious at first but thankfully it all worked perfectly in the end.
I could design any electronic based product I could imagine (within reason and time constraints) and this is what I made, every aspect of this project is my own original design and original conception of function, which i believe to be the first of its kind ever created, which was improved throughout the duration of the making of this project. The entire project was made by myself.
Below is a demonstration of the device in action (a video speaks louder than words):
Unfortunately the project has to stay at school at the moment so this video had to be taken on my phone however I will record a better quality video when I am allowed to take this project home. The room was very loud at the time of this video so please ignore the bad sound quality as my phone's microphone is not the best so I have dubbed the original music track on top of the video. Unfortunately my phone's camera's frame rate is also not high enough (and exposure is to long) to appreciate the full effect of this device due to the low lighting. View the video from half way if you want to see it working finely tuned.
So what is it? Simply put, this device has three functions:
1. Firstly this device is a audio amplifier which can plug into your iPod/iPhone/Phone or anything that has a headphone socket (3.5mm jack) and it will amplify the audio with the control of a volume knob on the side of the device, this audio is then outputted through two 10 Watt speakers.
2. With the help of a Picaxe 18M2 microcontroller, this device, while amplifying your music, also flashes rings of LEDs to the 'beat' of the music playing, similar to a 'VU Meter', the sensitivity and brightness of the LED's response to the music can be controlled using two control knobs (potentiometers). This light from the LEDs is projected through a layer of dense fog which is being produced by an Ultrasonic Atomiser fed by ordinary water in the separate box at the back of the unit which 'pours' the fog into the bowl.
3. Using the LCD display and the two push buttons, the user can also navigate a menu system to select 1 of 4 preset LED patterns and adjust their speed using one of the potentiometers, this can be an alternative to having the LEDs being controlled by the music. This makes this device functional even if there is no music playing.
Equipment I Used:
Easy PC (Software)
Printer
Light Box
PCB Etcher
Sandpaper
Pillar drill with 1mm bit?
Soldering Iron + Sponge
Water
Solder
Wire cutters (for the components after soldering)
Laser Cutter
Blow Moulder
Drill + Countersink drill bit
PIXCAXE Programming Editor (PC Software)
PICAXE Download Cable
Autodesk Inventor (Software)
Corel Draw (Software)
Materials I Used:
Blank Photosensitive PCB Board
Picaxe 18m2 IC
Picaxe Download Socket
Capacitors of various capacitances
Variety of Resistors
16* 5mm ultra bright blue LEDs
Low Power Diode
Audio Amplifier IC
3.5mm Audio Jack
3* Potentiometers (100K ohms)
2* Push Buttons
LCD Display
On/Off Switch
Battery Box for 3 AA Bateries
3* AA Batteries
Ultrasonic Atomiser
24v Power Supply
2* 75mm diameter 10 Watt speakers
The total cost of this project was £43.77
Step 1: Conception of Idea
Below is a video I made of the testing out the ultrasonic atomiser (fogger) with a laser:
With this inspiration, I started to design the electronics within the design, followed by the casing...
Step 2: Electronics - Design
Step 3: Electronics - Manufacture of PCB
Step 4: Electronics - Population and Soldering
Above is shown the finished populated circuit board, the important components are annotated.
Step 5: Electronics - Programming
The program itself is written in the 'BASIC' programming language and basically allows the chip to take the audio 'tapped off' from the amplifier through a diode and convert it to a digital value using the chips ‘Analogue to DC’ (ADC) converter ability, the chip then uses this value in combination with the positions of 2 of the potentiometers used for 'LED Brightness' and 'LED Sensitivity' through a mathematical formula to decide how many LEDs to light up, the result of this is LEDs that ‘dance’ to the beat of the music dependent on the ‘power’ of the music at that point in time.
The second section of the programming was the ‘Menu System’ which could be accessed by pressing both push buttons at the same time, this menu system allowed the user to choose between 1 of 4 preset LED patterns, whose speed can be controlled by on the the control knobs, and the original 'music controlled LEDs' program making this device useful even when it is not being used as a music amplifier.
Below is the program I wrote, I am relatively new to Picaxe programming (in BASIC) so there may be simpler and more memory efficient ways of creating this program however this works just fine (text proceeded by a apostraphy ' are notes and are not a part of the program):
main:
pause 500
serout B.5, N2400, (254, 64, 32, 36, 44, 63, 63, 44, 36, 32)
serout B.5, N2400, (254, 72, 32, 36, 38, 63, 63, 38, 36, 32)
serout B.5, N2400, (254, 80, 32, 32, 59, 32, 32, 49, 46, 32)
serout b.5, n2400, ( 254, $80 ) ' First line of LCD display
serout b.5, n2400, ("Maundy's Designs")
serout b.5, n2400, ( 254, $C0 ) ' Second line of LCD display
serout b.5, n2400, (" Presents... ")
pause 250
high 0
pause 250
high 0, 1
pause 250
high 0, 1, 2
pause 250
high 0, 1, 2, 3
pause 500
low 0
pause 250
low 0, 1
pause 250
low 0, 1, 2
pause 250
low 0, 1, 2, 3
goto VUMeterText
VUMeterText:
serout b.5, n2400, ( 254, $80 ) ' First line of display
serout b.5, n2400, ("Music to Lights!")
serout b.5, n2400, ( 254, $C0 ) ' Second line of display
serout b.5, n2400, ("Press ",8,"+",9," 4 Menu")
goto VUMeter
VUMeter:
if pinc.7 = 1 then
goto PresetsFlashQ
else
readadc c.1, b1 'pin c.1 is the audio input from the audio amplifier circuit
readadc b.7, b2 'pin b.7 is the 'LED Sensitivity' Potentiometer
readadc c.0, b3 'pin c.0 is the 'LED Brightness' Potentiometer
let b2 = b2/20
let b3 = 255 - b3
if b3 <= 127 then
let b3 = 127 - b3
let w4 = b3 * 15
let w3 = b2*b1-w4
else
let b3 = b3 - 128
let w4 = b3 * 15
let w3 = b2*b1+w4
endif
if w3 > 4000 then
let w3 = 0
endif
if w3 > 600 then four
if w3 > 450 then three
if w3 > 300 then two
if w3 > 150 then one
if w3 <= 150 then zero
endif
goto VUMeter
zero:
low 0, 1, 2, 3
goto VUMeter
one:
low 0, 1, 2, 3
high 0
goto VUMeter
two:
low 0, 1, 2, 3
high 0, 1
serout b.5, n2400, ( 254, $C0 )
goto VUMeter
three:
low 0, 1, 2, 3
high 0, 1, 2
serout b.5, n2400, ( 254, $C0 )
goto VUMeter
four:
low 0, 1, 2, 3
high 0, 1, 2, 3
serout b.5, n2400, ( 254, $C0 )
goto VUMeter
PresetsFlashQ:
if pinc.6 = 1 then
goto PresetsFlash
else
goto VUMeter
endif
PresetsFlash:
serout b.5, n2400, ( 254, $80 ) ' First line of display
serout b.5, n2400, (" Main Menu ")
serout b.5, n2400, ( 254, $C0 ) ' Second line of display
serout b.5, n2400, (8," Preset 1 ",9)
low 0, 1, 2, 3
high 0
pause 100
high 0, 1
pause 100
high 0, 1, 2
pause 100
high 0, 1, 2, 3
pause 100
low 0
pause 100
low 0, 1
pause 100
low 0, 1, 2
pause 100
low 0, 1, 2, 3
pause 100
goto Preset1
Preset1:
low 0, 1, 2, 3
serout b.5, n2400, ( 254, $80 ) ' First line of display
serout b.5, n2400, (" Main Menu ")
serout b.5, n2400, ( 254, $C0 ) ' Second line of display
serout b.5, n2400, (8," Preset 1 ",9)
pause 200
goto Preset1loop
Preset1loop:
if pinc.7=1 then goto Preset1L 'Pin 7 is the 'Left' Push Button
if pinc.6=1 then goto Preset1R 'Pin 6 is the 'Right' Push Button
goto Preset1loop
Preset1R:
pause 100
if pinc.7=1 then goto Preset1RunText
goto Preset2
Preset1L:
pause 100
if pinc.6=1 then goto Preset1RunText
goto PresetVU
Preset1RunText:
serout b.5, n2400, ( 254, $80 ) ' First line of display
serout b.5, n2400, (" Preset 1 ")
serout b.5, n2400, ( 254, $C0 ) ' Second line of display
serout b.5, n2400, ("Press ",8,"+",9," 4 Menu")
pause 200
goto Preset1Run
Preset1Run:
low 0, 1, 2, 3
high 0
if pinc.6=1 and pinc.7=1 then goto Preset1
readadc c.0, b5
pause b5
high 0, 1
if pinc.6=1 and pinc.7=1 then goto Preset1
readadc c.0, b5
pause b5
high 0, 1, 2
if pinc.6=1 and pinc.7=1 then goto Preset1
readadc c.0, b5
pause b5
high 0, 1, 2, 3
if pinc.6=1 and pinc.7=1 then goto Preset1
readadc c.0, b5
pause b5
low 0
if pinc.6=1 and pinc.7=1 then goto Preset1
readadc c.0, b5
pause b5
low 0, 1
if pinc.6=1 and pinc.7=1 then goto Preset1
readadc c.0, b5
pause b5
low 0, 1, 2
if pinc.6=1 and pinc.7=1 then goto Preset1
readadc c.0, b5
pause b5
low 0, 1, 2, 3
if pinc.6=1 and pinc.7=1 then goto Preset1
readadc c.0, b5
pause b5
if pinc.6=1 and pinc.7=1 then goto Preset1
goto Preset1Run
Preset2:
low 0, 1, 2, 3
serout b.5, n2400, ( 254, $80 ) ' First line of display
serout b.5, n2400, (" Main Menu ")
serout b.5, n2400, ( 254, $C0 ) ' Second line of display
serout b.5, n2400, (8," Preset 2 ",9)
pause 200
goto Preset2loop
Preset2loop:
if pinc.7=1 then goto Preset2L
if pinc.6=1 then goto Preset2R
goto Preset2loop
Preset2R:
pause 100
if pinc.7=1 then goto Preset2RunText
goto Preset3
Preset2L:
pause 100
if pinc.6=1 then goto Preset2RunText
goto Preset1
Preset2RunText:
serout b.5, n2400, ( 254, $80 ) ' First line of display
serout b.5, n2400, (" Preset 2 ")
serout b.5, n2400, ( 254, $C0 ) ' Second line of display
serout b.5, n2400, ("Press ",8,"+",9," 4 Menu")
pause 200
goto Preset2Run
Preset2Run:
low 0, 1, 2, 3
high 0
if pinc.6=1 and pinc.7=1 then goto Preset2
readadc c.0, b5
pause b5
low 0, 1, 2, 3
high 1
if pinc.6=1 and pinc.7=1 then goto Preset2
readadc c.0, b5
pause b5
low 0, 1, 2, 3
high 2
if pinc.6=1 and pinc.7=1 then goto Preset2
readadc c.0, b5
pause b5
low 0, 1, 2, 3
high 3
if pinc.6=1 and pinc.7=1 then goto Preset2
readadc c.0, b5
pause b5
low 0, 1, 2, 3
high 2
if pinc.6=1 and pinc.7=1 then goto Preset2
readadc c.0, b5
pause b5
low 0, 1, 2, 3
high 1
if pinc.6=1 and pinc.7=1 then goto Preset2
readadc c.0, b5
pause b5
goto Preset2Run
Preset3:
low 0, 1, 2, 3
serout b.5, n2400, ( 254, $80 ) ' First line of display
serout b.5, n2400, (" Main Menu ")
serout b.5, n2400, ( 254, $C0 ) ' Second line of display
serout b.5, n2400, (8," Preset 3 ",9)
pause 200
goto Preset3loop
Preset3loop:
if pinc.7=1 then goto Preset3L
if pinc.6=1 then goto Preset3R
goto Preset3loop
Preset3R:
pause 100
if pinc.7=1 then goto Preset3RunText
goto Preset4
Preset3L:
pause 100
if pinc.6=1 then goto Preset3RunText
goto Preset2
Preset3RunText:
serout b.5, n2400, ( 254, $80 ) ' First line of display
serout b.5, n2400, (" Preset 3 ")
serout b.5, n2400, ( 254, $C0 ) ' Second line of display
serout b.5, n2400, ("Press ",8,"+",9," 4 Menu")
pause 200
goto Preset3Run
Preset3Run:
low 0, 1, 2, 3
high 0
if pinc.6=1 and pinc.7=1 then goto Preset3
readadc c.0, b5
pause b5
low 0, 1, 2, 3
high 2
if pinc.6=1 and pinc.7=1 then goto Preset3
readadc c.0, b5
pause b5
low 0, 1, 2, 3
high 1
if pinc.6=1 and pinc.7=1 then goto Preset3
readadc c.0, b5
pause b5
low 0, 1, 2, 3
high 3
if pinc.6=1 and pinc.7=1 then goto Preset3
readadc c.0, b5
pause b5
goto Preset3Run
Preset4:
low 0, 1, 2, 3
serout b.5, n2400, ( 254, $80 ) ' First line of display
serout b.5, n2400, (" Main Menu ")
serout b.5, n2400, ( 254, $C0 ) ' Second line of display
serout b.5, n2400, (8," Preset 4 ",9)
pause 200
goto Preset4loop
Preset4loop:
if pinc.7=1 then goto Preset4L
if pinc.6=1 then goto Preset4R
goto Preset4loop
Preset4R:
pause 100
if pinc.7=1 then goto Preset4RunText
goto PresetVU
Preset4L:
pause 100
if pinc.6=1 then goto Preset4RunText
goto Preset3
Preset4RunText:
serout b.5, n2400, ( 254, $80 ) ' First line of display
serout b.5, n2400, (" Preset 4 ")
serout b.5, n2400, ( 254, $C0 ) ' Second line of display
serout b.5, n2400, ("Press ",8,"+",9," 4 Menu")
pause 200
goto Preset4Run
Preset4Run:
low 0, 1, 2, 3
high 0, 3
if pinc.6=1 and pinc.7=1 then goto Preset4
readadc c.0, b5
pause b5
low 0, 1, 2, 3
high 1, 2
if pinc.6=1 and pinc.7=1 then goto Preset4
readadc c.0, b5
pause b5
low 0, 1, 2, 3
high 0, 1, 2, 3
if pinc.6=1 and pinc.7=1 then goto Preset4
readadc c.0, b5
pause b5
low 0, 1, 2, 3
high 1, 2
if pinc.6=1 and pinc.7=1 then goto Preset4
readadc c.0, b5
pause b5
low 0, 1, 2, 3
high 0, 3
if pinc.6=1 and pinc.7=1 then goto Preset4
readadc c.0, b5
pause b5
low 0, 1, 2, 3
high 0, 1, 2, 3
if pinc.6=1 and pinc.7=1 then goto Preset4
readadc c.0, b5
pause b5
goto Preset4Run
PresetVU:
low 0, 1, 2, 3
serout b.5, n2400, ( 254, $80 ) ' First line of display
serout b.5, n2400, (" Main Menu ")
serout b.5, n2400, ( 254, $C0 ) ' Second line of display
serout b.5, n2400, (8," Music2Lights ",9)
pause 200
goto PresetVUloop
PresetVUloop:
if pinc.7=1 then goto PresetVUL
if pinc.6=1 then goto PresetVUR
goto PresetVUloop:
PresetVUR:
pause 100
if pinc.7=1 then goto VUMeterText
goto Preset1
PresetVUL:
pause 100
if pinc.6=1 then goto VUMeterText
goto Preset4
Step 6: Casing - Design
Step 7: Casing - Manufacture
The laser cut parts are then assembled using Dichloromethane which is a chemical used to welt this type of plastic together which results in an extremely strong bond. As I am using countersunk M3 bolts to attach the bottom face of the casing I used a drill and countersink bit to countersink the 4 holes in the bottom face and in the 2 holes in the top face of the separate box for the creation of the fog so the countersunk bolts would lie flat with the surface of the plastic when screwed in.
Next is the manufacture of the Dome within the design.
Step 8: Casing - Manufacture Contintued
Sixteen 5mm holes are then drilled in the dome for the later holding of 16 blue LEDs.
Step 9: Assembly - LEDS
Below is a short video of me testing the LEDs and their 'levels':
The dome is then attached to the main casing using the same chemical as before (Dichloromethane) to weld the parts together.
Step 10: Final Assembly
The rings of LEDs are now connected to the circuit board using flying leads and the circuit board is held in place using a PCB Grip. Finally the battery box is then securely attached to the casing using Velcro to stop it rattling around inside the casing.
Step 11: FINISHED
Check out the video below for a demonstration of the ‘Foggy Music Light Show’ in action!
If you like this project enough, I would appreciate it if you could vote for this project in the ‘UP! Contest’, Thanks
Please also check out my 3D printing related entry to this contest: TriStand Minimal - 3D Printed Minimalistic iPhone Case with built in KickStands
Step 12: What's Next?
Here is my latest project which I spent a whole solid day yesterday modelling, I wanted to make something tactile and just fun to use, It has turned out to be a Steampunk themed desk organizer which can hold paperclips etc. in the tray and maybe pencils/pens in the holes around the top or balanced on the handles when not moving:

This design consists of a cube, on each of 4 sides of the cube are 7 gears: 2 large outer ones that move in opposite directions, the outer has handles on it so it can be easily rotated, the motion between the 2 large cogs is reversed due to 5 smaller gears in a similar layout to a planetary gearbox to reverse the gear's direction on each of these 4 faces. Each of these sets of gears on the 4 faces are all liked through the big gear on each of the 4 faces meshing at 90 degrees with the big gear on each of the 2 neighboring sides. This means that theoretically if any one gear is spun, they should all spin in a memorizing pattern. Best of all it should be printable as one piece.
The design also comes with a stand so it can stand up on a desk, this stand also has a flat plaque with embossed text that I may consider allowing to be customized by the buyer.
I have also just modeled a removable lid that can be placed on the top of the cube and is locked and unlocked by rotating the cogs (the lid locks at the centers of all 4 sides below the gears on the lid) just to make it a bit more interesting and to give it a bit more functionality. This brings up the possibility of designing interchangeable mechanical add-ons that can be put in place of this lid and driven by the rest of the cogs...
Unfortunately due to the very costly nature of 3D printing services such as Shapeways and after my two recent orders of the two prototypes of the 'Centrifugal Puzzle Box' I am going to have a break from 3D printing so I don't run out of money! Hopefully one day I will own my own 3D printer so this will not be an issue.