Minggu, 27 Mei 2012

Disco Lights Project



What does it do?
The Disco Lights project is what you get when you combine the fantastic beat detection circuitry of my ever popular beat triggered strobe light with coloured halogen lamps! In other words, four coloured lights flash in a variety of patterns in time with your music. Some seriously cool patterns can be achieved and the effect is really amazing!

Even better, the effects are achieved using a microcontroller, so you can program your own patterns and effects in fact you can even choose to use your own microcontroller that you are familiar with or if you're not familiar with microcontrollers, you can use the one shown in my design which can be programmed in either basic or with a flow chart, all you need is a PC with a serial port an old mouse cable & a couple of resistors and you're away!

Circuit details
Most of the circuit is actually borrowed exactly from the low voltage section of the beat triggered strobe light. In fact, it would be possible to assemble half of the circuitry on the beat strobe's circuit board, simply omitting the high voltage section and the opto isolator. Since I did not have any spare strobe boards and the circuit is relatively straight forward, I assembled it on vero-board. If you choose to take this route, just be very careful and check your work as I myself made a few errors along the way, it's fairly easy with vero-board. Figure 1 shows the initial analogue processing. Yes it is almost verbatim from the beat strobe, the only differences being the supply voltages. For details on how it works, please check out the beat triggered strobe.

Note: Images with GREEN borders can be enlarged by double clicking on them and returned to original size by single clicking. You need javascript enabled for this to work. The original size should fit a 1024x768 monitor comfortably but might not be as clear.
Figure 1: The audio processing section.


This consists of a microphone amplifier, 2nd order low pass filter and peak detector.
Pulse shaping and flash rate limiting
The next section of the strobe circuit is the pulse shaping section. It is shown in figure 2 below and again is the same as what was used in the beat triggered strobe light, except that instead of an opto-isolator, we take the pulses off to a point marked A. I also left out S1 & R18 but it is a matter of personal preference. I have found the music triggering to be excellent, especially when  the audio line input is used rather than the internal microphone.

Note: This image can be enlarged by double clicking and returned to original size by single clicking.

Figure 2: Pulse shaping section.


 The 555 timer must complete it's delay before U2B will allow it to retrigger, forcing a limit on the trigger rate. U2C detects the rising edge and converts it into a brief pulse.
Disco lights specific circuitry and microcontrollers
This is where the disco lights are different to the beat triggered strobe light. Instead of each beat triggering a high voltage xenon flash tube to create a bright white flash, it serves as a cue to a microcontroller to produce the next pattern on a set of coloured halogen lamps. These lamps are rated at 12V, 50W and came in red, yellow, green and blue. I purchased them from Jaycar Electronics, catalogue numbers SL2741-SL2744. I would urge that you also purchase some holders for these bulbs as they get rather hot so the proper ceramic bases are much less likely to cause a fire than any impromptue mounting solution and take it from me, the pins don't solder well and it's a pain to change bulbs if soldered to wires. ;)

But back to the circuit. Figure 3 shows the rest of the circuit for the disco lights. Here, I have chosen to use a PICAXE microcontroller. These are an educational variation of the PIC microcontroller family and whilst they have several major limitations, the only one that is going to be a problem here is the memory capacity. For this reason, I reccomend that you use the PICAXE 18X rather than the 18A that I used here (which has been discontinued but it was the one in stock at my local electronics shop). They are pin compatible. You can of course use any microcontroller and I highly reccommend using one that you're familiar with especially if it can be programmed in C as after a while, BASIC becomes a bit verbose for my liking at least. Details about the PICAXE can be found at www.picaxe.co.uk. You will also need to download the free software and make up a programming cable. They're really easy to use, even if you're new to microcontrollers (but know enough basic electronics to do the rest of the project). If you are experienced in the use PICs or ATMEGAs then you'd be better using those. I personally used a PICAXE so that I could give someone who'd never used a micro before a chance to write the code for me and the patterns were so cool that I continue to use his code. It can be downloaded at the bottom of this page. :)

The pulses from figure two come in on the right of figure 3 at the point marked A. These are then level shifted down from 9 volts to 5 volts by Q1 which also has the effect of inverting them. Thus, the microcontroller should be programmed to respond to a falling edge. S1 is a switch that I provided for manually changing patterns or otherwise interacting with the disco lights. Likewise, LED DS2 is next to this push button. I also placed LED DS1 next to the sensitivity pot from figure 1 on the panel to indicate triggering so that it can be adjusted more easily. Outputs 0 to 3 control the MOSFETs which in turn control the 50 Watt halogen lamps.







Figure 3: The microcontroller and power stage of the disco lights circuit.

MOSFET Selection
I used IRF1405 MOSFETs as I had some spare and they were massively overkill for this application. Yes the 169A drain current rating would probably melt the legs clean off but I originally purchased them due to the low drain resistance of 0.0053 ohms. Remember, the lamps will draw around 4A but could pull a lot more when cold, so I suggest at least a 16A MOSFET to be safe. As they are a little bit inductive, a 30 volt or more MOSFET is preferable, otherwise you will need fast diodes and/or snubbers. When you have some you'd like to use, calculate the loss at 4A continuous. My MOSFETs have a junction to case thermal resistance of 62 degrees per watt which means that for every watt that they dissipate, their junction will be 62 degrees hotter than the ambient air. The air could well be as high as say 35 degrees with those halogens near by so at 1 watt, they would hit 97 degrees and their maximum temperature of 175 degrees C would be hit at (175-35)/62=2.26W. Due to their low on resistance, however, they will dissipate just 4x4x0.0053=0.08W so will barely get warm and won't need a heatsink. For a thermal resistance of 62 degrees, I'd suggest you find a MOSFET of no more than 0.05 ohms as although this is conservative, the resistance of a silicon MOSFET goes up as it gets hot, causing a phenomenon known as thermal runaway where it gets hotter so dissipates more power so gets hotter etc until it is destroyed! Of course you could dissipate a few watts with a decent size heatsink but I'd rather spend that heatsink money on better transistors in the first place!

The big stuff
Figure 4 shows the rest of the circuit. This is the power supply. T1 is a 110V or 230V (depending where you live) to 9V AC transformer. I suggest you use at least a 150VA transformer and limit the number of simultaneously on lamps to 2 in your software as this gives plenty of overhead. I used a 300VA toroidial transformer that I had lying around from an old project so am able to easily run all 4 lamps at once, although the bridge would get extremely hot if I were to do this. Some might find it odd that I use a 9V transformer for 12V bulbs and still others might say that it's because when I rectify and filter the output, I get 12V DC. Neither is entirely true. To get anywhere close to a smooth DC with such high power, low voltage lamps, C1 would need to be almost a farad! It is more a token gesture to smooth out any spikes. So the bulbs are in effect getting a rectified 9V sinewave which is going to mean they are not running at full brightness. I have not noticed any lack of brightness to be honest, they are unpleasant to look at directly and I feel that the extended bulb life is worth it. (They are not designed for being flashed as far as I know). This is, however, one of the main areas where I shall improve on in the disco lights MK2 but that is a long way off.  F1 should be a slow blow fuse rated sensibly according to your transformer. E.g. my 300VA transformer at 230V shoul in theory draw up to 1.3A at full load so a 2A fuse makes sense or with only 4 lamps, a 1A may even be ok! At 110V on a 300VA you would want a 3A fuse, etc etc.

Please note, it is not an error, the negative of bridge D2 is not connected! Whilst all circuits here share a common earth through D1 (and the associated rather large ground bounce), D2 supplies the positive rail for the small electronics an C3 is able to smooth this pretty well due to the much smaller power consumption of the circuits compared to that of the lamps. Thus, D1 should be a large bridge and WILL NEED TO BE WELL HEATSINKED! In the photos further down you will see that I used a small CPU heatsink I had lying around. D2 won't need a heatsink and could be constructed using 2 common 1N4001 or 1N4004 diodes. It is fairly obvious that P1 is a mains plug and S1 is a mains rated power switch. U1 ensures that the audio electronics receives a nice clean power supply. Without it, there WILL be false triggering, believe me, I tried without it. R2 and C6 provide a low pass filter for a super quiet power rail for the microphone. U2 provides a 5V rail for the microcontroller.

Figure 4: Power supply section of the disco lights project.
Important construction issues
Please note, this is not a directly mains project, however, it will require you to correctly wire up a transformer to the mains for power supply. If you are not sure that you can do this safely and don't know anyone who can assist you, then please do not construct this project yet!
The main issue with building the disco lights is heat. You will need to use proper holders designed for holding hot halogen lamps. I would suggest a sealed case that you can create holes at one end for air to enter in and a hole at the other end for a fan. Trust me, you WILL NEED A FAN! The fan gets connected across C3 in figure 4. It should blow hot air out of the case. The inlet holes should between them have roughly the same area as that of the fan and please put a grill over the fan to prevent fingers from getting nibbled.

Aside from the thermal issues, the project is pretty straight forward to construct as per the circuit diagrams. Note that the lead from the bridge D1 to the lamps wil need to be pretty heavy guage as it can potentially carry up to 16A so at least 2.5mm^2 is needed.

Have fun, I've yet to blow a bulb but I suggest you keep a set of replacements as losing one in the middle of a party might be very annoying. Just remember when you change it, they will be hot! Below are pictures of the finished unit and a view of inside the case.

Finished

Inside Box




Sumber : http://electronics.rory.co.nz/

Tidak ada komentar:

Posting Komentar