Thursday, 20 September 2012


ARDUINO LED DISPLAY CLOCK PROJECT


This is a project that I have been working on a few months now and I have completed its build very lately.  The main processor used in this project is an Arduino MEGA 2560 which is interfaced with a real time clock called the DS 1307 chip (which gives you the time and date).  

Both Red and Blue LED Displays are driven using NPN transistors ( I used 2N5551 NPN transistors).  The bases of these transistors are connected to the Arduino mega 2560 's digital pins.

The Arduino is also connected to 4 pushbuttons located separately on a small perfboard.  These pushbuttons allow the user to set the alarm time.  The arduino is also connected to a SAMSUNG DVD player front panel via optoisolators hence allowing the arduino to start the dvd player once alarm time is reached.  That basically means that once you have set the alarm time, lets say 6 a.m, the dvd player will play your favourite CD at 6 am and you can stop it by using your DVD remote control or pressing Power button on your DVD player.

I have below some images of the build process which I would like to share with you.


Above is a picture of the displays I used.  The upper 4 displays are 16 segment LED Displays used to display DATE and TIME alternately and light up red... they are also used to show ALARM function. The large displays are 8 in number and light up blue. Whole board measures 40 CM wide.


This 2nd picture shows a close up of the 16 segment LED Displays


The picture above looks complicated and messy...infact the four 16 segment displays are multiplexed  this that means all 4 displays are in parallel but the common anodes of EACH display is driven individually by npn transistors.


In this picture you see tons of npn transistors.. to the base of each npn is a 1 kilo ohm resistor which connects to the arduino pins.  The collector of each transistor is connected to a 150 ohm resistor . 


Ok so in this picture you see the npn transistor board connected to the led displays.. That involved alot of soldering.


I eventually multiplexed the larger blue displays and the displays were so big that they did not fit on the 30cm board I got from eBay so I had to adjust :) Anyway you can see the npn transistor driver board as well as the multiplexed displays in the above picture.  The driver board is identical to that one in use for the 16 segment displays.


You can see a very messy layout for testing purposes of course.  The metal thing you see on the left side of this picture is a heatsink I salvaged from an old ATX power supply.. On this heatsink I placed 2 regulators.  A 5V one (for the 4 segment led displays) and a dedicated 8V one to drive the larger blue displays

Yeah you guessed it I used LM7805 for 5V and LM7508 for 8V. Sweet.

 Ok you can see above the 4 pushbuttons I was talking about earlier on .. their purpose is to set the alarm time. I was using an arduino UNO to test out their functionality before actually mounting them on the arduino MEGA 2560 microcontroller.



Above is another close up view of the pushbutton board.


Looks weird I know. This is a LM 386 audio amplifier chip .. its purpose is to drive an 8 ohm speaker .. It receives audio input from the DVD player I modified.  So basically when alarm time kicks in the dvd player starts playing your CD and the audio is amplified and fed into a speaker by this LM 386 audio amplifier.

I used a gift box as enclosure . I fitted a 4 inch 5W 8ohm speaker in its front and glued a protective metal grill onto it ( I salvaged this grill from an ATX power supply fan).

Above you can see the whole setup finished.  I placed it all in my room to wake me up in the morning :)
You will notice a small square thing attached to the displays (just right to the upper 4 displays) , its a green LED which turns ON when alarm is enabled and goes OFF when alarm time is reached or when alarm is off.

Behind those displays is a cardboard box I have.. I stuffed in all the electronics and you can see the arduino MEGA clearly.

Here is a picture (which probably I should have shown earlier) where you can see the arduino connected via I2C protocol to a greenish pcb.  This greenish pcb is actually the DS1307 clock chip which has a 3V battery on it.. It doesnt lose memory and keeps counting time and date even if arduino is off which is lovely.


I took this on the 09/09/12 .. The green LED is on letting you know that alarm is enabled.


Shows you the time for 5 seconds and then date for 3 seconds alternately.


I set the ALARM time for 6:15 a.m. Yeah I wake up that time every morning.


DVD tray open ready to load you favourite CDs. Whats cool with my DVD player (I'm not sure about other models) is that you can select a song and stop the player.  Once arduino hits play its gonna start from there and play the song you wanted from that CD.


Another view of the whole setup.  I could have used an MP4 player or something to play music but this DVD player was collecting dust so I thought of putting it to use :)

NOTE: - 

(1) I did not use any shift registers or LED driver ICs for this project because it would have complicated everything and the code would have been hard to build.

(2) The library to communicate with the DS 1307 is available at adafruit as a free download.

Thats it guys! I hope you liked my build and I just thought of sharing it with you :)
All comments appreciated.

Below is a collection of higher resolution images of the completed build.







 Below you can find a link of my clock in action.. In this demonstration I set the alarm time to 17-23-00 and the music starts playing when alarm time is reached.

 http://www.youtube.com/watch?v=4pBeb0jBBqM&feature=youtu.be

Thanks alot for visiting my blog!



Saturday, 25 August 2012

FLIP FLOP CIRCUIT USING ONLY A FEW COMPONENTS

This is a circuit I made not so long ago.  This circuit controls 2 LEDs and turns them on and off alternately.

Thursday, 9 August 2012

Flip Flop based Circuit

I made this little circuit a while ago and finally decided to publish it.  Basically if you press on the push button once it turns on the relay and if you press the push button again well it turns the relay off. Real simple.  You can find below some images of my build.

































In case you are wondering what the blue and red LED do in the circuit well they are supposed to indicate in which state the flip-flop circuit is in. Below is the schematic of my build.

NOTE: Components layout isn't essential but I recommend using the component values I have used (just because it works well with these component values)




S1 is basically a push button. The capacitors of value 22 uF are not wrongly wired up! Wire them the same way as given in the schematic don't worry its going to work.  The original circuit diagram is strongly based on  a video I saw on you tube and here is the link explaining in great detail how this whole circuit works.

http://www.youtube.com/watch?v=IykOrxVcdyg&feature=plcp

I simply added one PNP transistor and a relay to his original circuit. All credits go to the creator of this circuit design.

Special thanks to you tube user : AllAmericanFiveRadio
















Wednesday, 8 August 2012

LM 386 Audio Amplifier Project


The LM 386 is an inexpensive audio amplifier chip which is available in almost any electronics retail shop.  The big advantage with this amplifier chip is that you don't need alot of parts to get it up and running and although there are a lot of substitutes for this kind of amplifier it still remains the hobbyist's audio chip amp.



The datasheet for the LM 386 can be found here: www.nari.ee.ethz.ch/wireless/education/PPS/PPS02/doc/LM386.pdf

Anyway, if you google "LM 386 audio amplifier projects" you will realise that many people have built this amplifier before and infact its not that easy to get it working in the beginning itself. 

It can start making a lot of buzzing and hissing which can confuse you and make you abandon this chip amp.  LM 386 itself is hated by many (yea lol) but heres my completed version of the LM 386 chip amp.



I mounted the whole thing on a bare piece of perfboard that I had.  If you are wondering what the "M" symbol is for well its just a shiny motorola cover that I had so I glued it onto the switch.  I tested it and it works fine no buzzing or hissing no issues with my build and thats why I wanted to share this build with you people.  

Here is the schematic of my build and I have to admit that I had to go through alot of troubleshooting before getting the LM 386 to work properly hence my final design.

I forgot to mention that this amplifier can put out about 1 Watt RMS into an 8 ohm load (refer to datasheet for more details).  Its quite loud but don't expect it to rattle your windows.  Its rather more suited for battery powered applications like making portable audio devices and so forth.



As you can see in the schematic, my overall design doesn't differ much from what is mentioned in the datasheet of the LM 386, however I have added a coupled of features like input decoupling capacitor C5, I also added C6 and C7 which form an effective power supply filtering circuit.  R1 is a 10 K potentiometer and also resistor R3 and capacitor C8 form a feedback loop that help reduce noise further. The idea behind using C8 and R3 is not mine I just saw it on the web I can't remember where exactly. The rest of the schematic is lifted off straight from the LM 386 datasheet.

Make sure you use a speaker of impedence 8 ohm or higher to avoid killing the little audio amplifier.

PARTS LIST:

Don't use the LM 386 with a higher voltage than the parts you have can take eg. If you intend to use the   LM 386 at lets say 12V well don't buy any parts rated at under 12V (thats logical  but still need to mention)

Capacitors 

C1                                       220  uF (Electrolytic)
C2                                       10    uF (Electrolytic)
C3                                       10    uF (Electrolytic)
C4                                       0.05 uF (ceramic) - - - - If you can't get the exact value get one close to it
C5                                       0.1   uF (ceramic)
C6                                       0.1   uF (ceramic)
C7                                       100 uF (Electrolytic)

Resistors

R1                                       10 K potentiometer
R2                                       10 Ohm resistor
R3                                       10 K resistor

Speaker  - - 8 ohms or higher