Otherwise, tweak and try to get them near 0. Open a serial monitor at 9600 bps and you'll start to see numbers scroll by.Īdvanced: I have a line in the code, starts with - int oct_bias - you can set those to 0 if you want to see raw data, but you're aiming for around '0'. Okay, double check your connections and plug it in. Load the sketch onto your Arduino. Here's my code (zip, ino file): FHT_XMas Dry Run of the Arduino FFT Frequency Analyzer The code is adapted from the demo code provided by OML, so I am greatly in debt. I played with a few libraries, and ended up using the one from Open Music Labs - I highly suggest checking out their benchmarks - FHT is pretty much as fast as you'll get here, and with an 8 bit microcontroller you need fast. You can use a ton of algorithms here to analyze the input to your Arduino - FFT (Fast Fourier Transform) being the most famous. I went slightly more obscure with FHT, or Fast Hartley Transform. It has alternating voltage on it, and you might get blue smoke instead of a voltage reading.Ĭompleted Arduino FFT Frequency Analyzer (Click to zoom) FHT Software for Arduino Building the Input Circuit and Low Voltage 'Stuff'ĭo NOT hook your headphone jack straight to a uC. If you've got a bunch of stuff already? You're getting off cheap. If you're thrifty, this will cost ~$75 - $130. $5 - 8 each.Ī number of the Amazon links are tied to our affiliate account we appreciate your support if you buy through them! We had 4, so I assume you might have some.). Optional - 8 strands of LED Christmas lights (assuming you don't have them.A promise you know what you're doing- the first half of the project you might fry a component, the second yourself - you assume responsibility. (Priceless!).Extension cord or power cable to sacrifice. $5.1 4.7nF capacitor (for decap - if you have issues with interference, toss a bunch more in there). All the components, $1 total.Headphone jack (like on your iPod) - get mono, unless you are more ambitious than me. Maybe 50 cents? (I pulled it off something.).5-10 feet of Romex for hookup wire - $10 maybe.Generic plugs to fit the faceplate - we got 'designer' plugs, but you can get rounded.Generic 4 Gang faceplate - isn't my aluminum nice?.Generic 4 Gang electrical box - get a deep one, from any big box store.Various hookup wire - you should use insulated wire for the signal hookup to the relay board inside the 4-gang box. $2?.A 10k Ohm logarithmic potentiometer - also known as an Audio Potentiometer.An 8 channel relay board from eBay - you likely want to get solid state relays since you'll be switching a lot.A microcontroller - I built it with an Arduino Nano. Use whatever you like, just make the modifications. Let's call it $20.What Do I Need to Build the Arduino Frequency Analyzer? Thus this project was born - 8 plugs (but certainly expandable) controlled by any random song you feel like playing through the line in. We've had music reactive displays and color organs for a long time – this much is true. I didn't like the previous implementations I had seen.īy far, the most common way to control Christmas lights is manually timing lights by using software like Vixen or Light O Rama. That's fine - I just didn't want to learn a new piece of software. Controlling Christmas Lights with an Arduino It uses FHT (Fast Hartley Transform) as its real time frequency analyzer algorithm, not the more commonly known FFT (Fast Fourier Transform) to do its real time processing. Notes activate a relay providing AC power to a plug, which in turn light up a strand of Christmas lights for each frequency band. You can take line in from any source in one of 8 audible octaves. I built an Arduino real time frequency analyzer with a microcontroller which doubles as a Christmas light controller.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |