Sunday, July 24, 2011
Friday, July 8, 2011
[DIY] Arduino VU Spectrum Analyzer
While searching on the Internet on interesting way of approaching the purpose of doing Fourier transform and why we need FT for my teaching.
I came across a fellow arduino user (http://andydoro.com/vulol/) that posted his toy project on using Fast Fourier Transform (FFT) to make a VU meter. Couple of years back, I did played with my home made wireless VU using electronic components that is available from the store. I am quite surprised that an 8bit Arduino is capable of doing FFT, never did I thought of using it because usually I am using a PIC32dsp for transforming from time domain to frequency domain for signal manipulation purposes. Arduino did gave me the WOW moment for a while.
From the detailed explanations on his website , i downloaded his code and hook up my LOLshield on my laptop playing some song to enjoy the geekness of arduino LOL shield VU meter.... To my dismay, it doesn't work "out of the box". It just display a 1 liner.... both plug in to my laptop and plug out from my laptop. Seems that the VU only picking up white noise from the ambiance. The connections are correct, pin A5 for +ve signal from the left channel and ground to common ground of the mini stereo jack.
To further complicate the issues, I tried on a variety of input of devices ranging from my android phone, my speakers with a BIG ASS amp etc. Suddenly IT hit me, probably the analog signal read in at pin A5 is too low to be detected as a usable base band signal where the FFT would chop up the signal in time domain to be put into frequency domain and the harmonics combined as 14 outputs (LOL shield only have 14 columns of LED).
There are 2 ways to put the analog in on steroids. The hardware method, I would use a TIP31C or TIP41C audio amplifying circuit OR the software method by scaling up the data read in on A5. I choose the software method, it requires little time to prove my hypotheses compared to the hardware method.....
It is kind of worrying.... the VU is more sensitive now ,picking up ambiance noise which is reflected in the below picture. The LEDs are lighting up ....More work needed to change part of the code to filter AWGN....

But once I plug the mini stereo jack to a Y connector with the headphone stereo jack into my laptop, the noise signal disappear.
Played one of my favorite songs with rich sound texture... Sorry for poor sound quality... I am playing it through my headphone.... still office hour and I can't turn on the LOUD music...
enjoy the code. you would need to place the FFT and charlieplexing libraries in your arduino\lib\ folder to compile successfully.
I came across a fellow arduino user (http://andydoro.com/vulol/) that posted his toy project on using Fast Fourier Transform (FFT) to make a VU meter. Couple of years back, I did played with my home made wireless VU using electronic components that is available from the store. I am quite surprised that an 8bit Arduino is capable of doing FFT, never did I thought of using it because usually I am using a PIC32dsp for transforming from time domain to frequency domain for signal manipulation purposes. Arduino did gave me the WOW moment for a while.
From the detailed explanations on his website , i downloaded his code and hook up my LOLshield on my laptop playing some song to enjoy the geekness of arduino LOL shield VU meter.... To my dismay, it doesn't work "out of the box". It just display a 1 liner.... both plug in to my laptop and plug out from my laptop. Seems that the VU only picking up white noise from the ambiance. The connections are correct, pin A5 for +ve signal from the left channel and ground to common ground of the mini stereo jack.

To further complicate the issues, I tried on a variety of input of devices ranging from my android phone, my speakers with a BIG ASS amp etc. Suddenly IT hit me, probably the analog signal read in at pin A5 is too low to be detected as a usable base band signal where the FFT would chop up the signal in time domain to be put into frequency domain and the harmonics combined as 14 outputs (LOL shield only have 14 columns of LED).
There are 2 ways to put the analog in on steroids. The hardware method, I would use a TIP31C or TIP41C audio amplifying circuit OR the software method by scaling up the data read in on A5. I choose the software method, it requires little time to prove my hypotheses compared to the hardware method.....
It is kind of worrying.... the VU is more sensitive now ,picking up ambiance noise which is reflected in the below picture. The LEDs are lighting up ....More work needed to change part of the code to filter AWGN....

But once I plug the mini stereo jack to a Y connector with the headphone stereo jack into my laptop, the noise signal disappear.
Played one of my favorite songs with rich sound texture... Sorry for poor sound quality... I am playing it through my headphone.... still office hour and I can't turn on the LOUD music...
enjoy the code. you would need to place the FFT and charlieplexing libraries in your arduino\lib\ folder to compile successfully.
Saturday, June 18, 2011
BGP awesomeness with Packet Tracer 5.3.2
With Packet Tracer 5.3.2 you can experiment with BGP (eBGP)
It serves as a good tool for a refresher, especially for poor chap like without exclusive access to the cisco racks....
Here I demo Cross AS BGP. Not all the BGP peers have a direct peering. I use the "network" command to do the routing.
Common mistakes that might occur
1. Peering with BGP peer on the wrong AS
2. Peering with BGP peer on the wrong IP subnet
3. Configure wrong AS for BGP on the victim router
4. and the list go on....
to verify your settings...
sh ip bgp
sh ip bgp neigh
come code for your reference.....
It serves as a good tool for a refresher, especially for poor chap like without exclusive access to the cisco racks....
Here I demo Cross AS BGP. Not all the BGP peers have a direct peering. I use the "network" command to do the routing.
Common mistakes that might occur
1. Peering with BGP peer on the wrong AS
2. Peering with BGP peer on the wrong IP subnet
3. Configure wrong AS for BGP on the victim router
4. and the list go on....
to verify your settings...
sh ip bgp
sh ip bgp neigh
come code for your reference.....
Wednesday, June 15, 2011
my first attempt: solar cooker
Get a BIG cardboard, some aluminium foil and adhesive.
1 black or dark colored cooking vessel.
1 small piece of wood as insulator.
1 clear plastic bag. I got mine from the fresh fruits section at NTUC... but realise it was a lil too small to fit the flower pot I am going to use.
We are going to form a cone shape with the cardboard, hence make a cut with a diameter of 25cm or more to accommodate it. Paste the foil on the cardboard, shinny side up. I made a mistake of inverting it....oh well...
I was hunting for a pot like apparatus to secure my new toy... Went hunting around and discover some flower pots......
weather check.... it was cloudy.... not a good day for solar cooking....
I am experimenting whether solar cooking rice or sweet potato will be edible? Typical Asian staple.
arrange in this order and secure with cable tie.
/\
/ \
/ \_______
| air |
| |
|cooking ware|
| insulator |
|plastic bag|
-------------
Just in case you guys wondered where did the flower pot went to ...
Cooking time -> 1245 - 430pm...
the plastic bag burst....
Conclusion.....
The rice is not cooked..... but the rice water is warmer then room temperature.
The sweet potato is not cooked thoroughly. Never buy $1 sweet potato from NTUC... rotten ...
next up.... improvised on
a. neater foil reflector will lesser creases when pasting it to cardbord.
1. weather check appratus..
2. temperature check apparatus....
3. quantify the heat generated from this solar cooker.. (a lil far fetched)
1 black or dark colored cooking vessel.
1 small piece of wood as insulator.
1 clear plastic bag. I got mine from the fresh fruits section at NTUC... but realise it was a lil too small to fit the flower pot I am going to use.
We are going to form a cone shape with the cardboard, hence make a cut with a diameter of 25cm or more to accommodate it. Paste the foil on the cardboard, shinny side up. I made a mistake of inverting it....oh well...
I was hunting for a pot like apparatus to secure my new toy... Went hunting around and discover some flower pots......
weather check.... it was cloudy.... not a good day for solar cooking....
I am experimenting whether solar cooking rice or sweet potato will be edible? Typical Asian staple.
arrange in this order and secure with cable tie.
/\
/ \
/ \_______
| air |
| |
|cooking ware|
| insulator |
|plastic bag|
-------------
Just in case you guys wondered where did the flower pot went to ...
Cooking time -> 1245 - 430pm...
the plastic bag burst....
Conclusion.....
The rice is not cooked..... but the rice water is warmer then room temperature.
The sweet potato is not cooked thoroughly. Never buy $1 sweet potato from NTUC... rotten ...
next up.... improvised on
a. neater foil reflector will lesser creases when pasting it to cardbord.
1. weather check appratus..
2. temperature check apparatus....
3. quantify the heat generated from this solar cooker.. (a lil far fetched)
Thursday, May 19, 2011
kit set amp for old Sony speakers
So there were 2 VERY OLD, DUSTY (at least 1" thick beneath the cover!!) and UNAPPRECIATED Sony speakers that one day magically appeared in our T902 club hauZ. Seems that somebody conveniently let this GOOD SPEAKERS rot in an isolated corner, get kick around and UNLOVED.
Upon close inspection, the speakers are still usable. Well, at least the leads to the + and - terminal are still intact and no sign of corrosion from the moisture yet. To make these bad boys start to sing angelic tunes AGAIN, I need something to amplify the audio signal from iPod, laptop, android phones etc (not necessary be mine laaaaa). By plainly hooking the other exposed end of the mini stereo jack to the speaker’s 2 terminal won’t yield any sound. Better luck if the speakers are hooked up to a 2kHz function generator.
I need an AMP as cheap as possible. There is no luck finding the original Sony ones. Obviously, it was dumped because of the spoilt amp and hifi system. Try making one amplifying circuit from components from the lab, e.g some TIP31C, R&C ? Too time consuming and the amplified signal produced may only yield <1W from these big ASS speakers. We need something that can yield 8W from the circuit. A quick look at the store, no such IC’s readily available..... Some shopping is seriously needed at your friendly Sim Lim Tower......... After some browsing at the kit set’s section, I came across a 8W amplifying circuit kit set complete with good quality PCB with routes thick enough to pass high current, BIG heat sink and the best part, it is only s$17.50. After laying my paws on it, I hurried back to office can’t wait to start work on it.
The I/O parts are not supplied in the package, just few pieces of measly bare copper connector. I modified the inputs to a 3.5mm Stereo jack for the convenience's sake of plug to a laptop/android/iPod etc. As if it is going to be the headphone, albeit a BIG one. As for the power jack, it is done using a DC power jack with the +ve leads in the inner ring. DO NOT SOLDER or CONNECT inversely ! Outputs, I used some screw down terminal blocks meant for PCB. Too bad the PCB is designed for the above mentioned copper. I got to cut the terminal blocks to half to use it. Make sure to stick some tape on the components side, this is to prevent the components from falling out of place when soldering.
Fire up the soldering gun and start soldering......
Next up, I need a power supply that can supply 12V DC for 1A. My unloved HP charger can only go up to 6v and 200mA. I quick dive into my pile of junk and tadahhhhh... I found a dc wall adapter that satisfy the requirement. Lesson learnt, do not discard the old parts. It may come handy some day. I also added my VU meter which i made many years for practising my soldering skill. Now we got LED light indicators on the sound
Hook up the dc adapter, stereo jack to laptop and speakers to the amp circuit. Enjoy!
On a side note, the boys hook up this set to their home made projector and now we got a poor man’s cinema complete with “dolby digital surround” (speakers on the floor facing wall and reflectors to create the effects)!
What's neXt? Tube Amplifiers ???? teeeheeeheeeee
Upon close inspection, the speakers are still usable. Well, at least the leads to the + and - terminal are still intact and no sign of corrosion from the moisture yet. To make these bad boys start to sing angelic tunes AGAIN, I need something to amplify the audio signal from iPod, laptop, android phones etc (not necessary be mine laaaaa). By plainly hooking the other exposed end of the mini stereo jack to the speaker’s 2 terminal won’t yield any sound. Better luck if the speakers are hooked up to a 2kHz function generator.
I need an AMP as cheap as possible. There is no luck finding the original Sony ones. Obviously, it was dumped because of the spoilt amp and hifi system. Try making one amplifying circuit from components from the lab, e.g some TIP31C, R&C ? Too time consuming and the amplified signal produced may only yield <1W from these big ASS speakers. We need something that can yield 8W from the circuit. A quick look at the store, no such IC’s readily available..... Some shopping is seriously needed at your friendly Sim Lim Tower......... After some browsing at the kit set’s section, I came across a 8W amplifying circuit kit set complete with good quality PCB with routes thick enough to pass high current, BIG heat sink and the best part, it is only s$17.50. After laying my paws on it, I hurried back to office can’t wait to start work on it.
The I/O parts are not supplied in the package, just few pieces of measly bare copper connector. I modified the inputs to a 3.5mm Stereo jack for the convenience's sake of plug to a laptop/android/iPod etc. As if it is going to be the headphone, albeit a BIG one. As for the power jack, it is done using a DC power jack with the +ve leads in the inner ring. DO NOT SOLDER or CONNECT inversely ! Outputs, I used some screw down terminal blocks meant for PCB. Too bad the PCB is designed for the above mentioned copper. I got to cut the terminal blocks to half to use it. Make sure to stick some tape on the components side, this is to prevent the components from falling out of place when soldering.
Fire up the soldering gun and start soldering......
Next up, I need a power supply that can supply 12V DC for 1A. My unloved HP charger can only go up to 6v and 200mA. I quick dive into my pile of junk and tadahhhhh... I found a dc wall adapter that satisfy the requirement. Lesson learnt, do not discard the old parts. It may come handy some day. I also added my VU meter which i made many years for practising my soldering skill. Now we got LED light indicators on the sound
Hook up the dc adapter, stereo jack to laptop and speakers to the amp circuit. Enjoy!
On a side note, the boys hook up this set to their home made projector and now we got a poor man’s cinema complete with “dolby digital surround” (speakers on the floor facing wall and reflectors to create the effects)!
What's neXt? Tube Amplifiers ???? teeeheeeheeeee
Subscribe to:
Posts (Atom)












