Arduino Forum

Using Arduino => LEDs and Multiplexing => Topic started by: dannydebont on Nov 03, 2013, 01:42 pm

Title: Which capacitor
Post by: dannydebont on Nov 03, 2013, 01:42 pm
Hi Guys,

I made a copy of Kevin Darrah's manual input to shift registers. My L.E.D's are jumping all over the place when I give the 74HC595B1 manual input. I tried putting a capacitor over the switches (in an attempt to cancel the bouncing) but now it is even worse.

My question is this: How would I calculate which capacitor is needed to prevent this bouncing of the L.E.D's. Google has too many conflicting formulas. I am familiar with the series and parallel connections of capacitors, but I need some formula for getting the right capacitor for any circuit.
Title: Re: Which capacitor
Post by: fungus on Nov 03, 2013, 02:25 pm
I looked my crystal ball but I can't see what you're actually doing from here...
Title: Re: Which capacitor
Post by: dannydebont on Nov 03, 2013, 02:30 pm
That is because you are using a crystal ball ... It is clouding your vision ... In a world without crystal balls "asking" normally does the trick ... :) ...
Title: Re: Which capacitor
Post by: fungus on Nov 03, 2013, 04:28 pm
I still have no idea what you're doing - where you're putting the capacitors, what values you've tried, how your 'switches' are wired, etc.

Title: Re: Which capacitor
Post by: TomGeorge on Nov 03, 2013, 11:37 pm
Hi Danny, can  you post a copy of your circuit diagram and post a copy of your sketch.
http://forum.arduino.cc/index.php/topic,148850.0.html
This link will help you with posting them.

Tom..... :)
Title: Re: Which capacitor
Post by: Grumpy_Mike on Nov 03, 2013, 11:48 pm
Quote
How would I calculate which capacitor is needed to prevent this bouncing of the L.E.D's

Use the formular Time constant = R x C
Title: Re: Which capacitor
Post by: cjdelphi on Nov 06, 2013, 05:37 am
Flickering would indicate a loose connection maybe on the latch or clock..

But a 0.1uf cap should be plenty between 5v pin and gnd pin....
Title: Re: Which capacitor
Post by: dannydebont on Nov 09, 2013, 08:53 pm
Hi Guys,

Sorry for the late reply ... I have included a schematic and a Fritzing file. I have now added a de-bouncing circuit and it works absolutely NOT ... NOTHING ... NADA ...

Please give me some pointers ...

Thank You

Danny
Title: Re: Which capacitor
Post by: Paul__B on Nov 09, 2013, 11:02 pm
Try raising the resistors on the HC595 LEDs to 1k, put a 100 nF capacitor across Vcc and ground on each (I am assuming you are using a breadboard) and  a 47 µF capacitor across the supply as well.
Title: Re: Which capacitor
Post by: TomGeorge on Nov 09, 2013, 11:08 pm
Hi,  Danny, what are you using as your power supply.
Have  you measured the voltage at the various switched input pins to check that they are getting 5V when the switch is activated.


Tom... :)
Title: Re: Which capacitor
Post by: dannydebont on Nov 10, 2013, 10:57 am
Hi,

I am using the power from an Arduino Uno's 5V and GND pins ... I still need to hook it up to be able to work from a 9v (or other) battery ... ( This project is to teach underprivileged school children (and myself of course  :smiley-red: ) so it  needs to work of a battery ) ...

The other thing I noticed is that when I take an L.E.D (that is lying around) and hold it against the leg of the DATA PIN or the leg of the LATCH PIN (on the actual 74HC595) while pressing their respective buttons (switches) they are very dim, but when I do the same to the LATCH pin, it is brighter ... Don't think it is serious, just thought I'd mention it ...

I will try the 47uF capacitor and changing the resistors on the output to the L.E.D's ...

Thanks to everyone assisting me ...  :D

Have a nice day

Danny

ps: O yes, all L.E.D's are 3mm
Title: Re: Which capacitor
Post by: TomGeorge on Nov 10, 2013, 11:43 am
Hi, I take it that you do not have a multimeter of any sort to measure voltages.
You will need one to help with development of your project.
Even a cheap chinese unit will suffice, a long as it can measure DC/AC , resistance and even test diodes.
The arduino 5V pin will not be able to power those LED's, you will need a separate supply to power the LEDs.

Tom.... :)
Title: Re: Which capacitor
Post by: Paul__B on Nov 10, 2013, 12:02 pm
Of course the LED diameter has nothing to do with the electrical characteristics.  XD

My suggestion to put a 100 nF (0.1 µF) capacitor across Vcc and ground on each 74HC595 chip may prove to be the most important one.   Digital ICs can oscillate if not correctly bypassed.

The Arduino has a limited capacity to supply current, if the 74HC595 chips managed (though unlikely) to draw sufficient current to exceed this, things definitely would get unreliable.
Title: Re: Which capacitor
Post by: Grumpy_Mike on Nov 10, 2013, 02:08 pm
Start off just trying to get one shift register to work only then try three.
The circuit is some what unconventional although nothing strikes be as wrong.
I agree with Tom, get a meter and measure that the voltage on the actual shift register pins is going up and down as expected, up being greater than 4V and down being less than 0.7V.
Title: Re: Which capacitor
Post by: dannydebont on Nov 10, 2013, 06:02 pm
O.k Guys,

I made the changes as suggested (see included jpg and Fritzing file ) ...

Is the circuit at least correct?  :~

Danny ...

p.s: I disconnected the other two shift registers  =( ... And yes ... I'll get a bloody multimeter ...  :D
Title: Re: Which capacitor
Post by: Grumpy_Mike on Nov 10, 2013, 10:38 pm
What good is a capacitor with a short across it?
The 47uF was supposed to be across the supply.

If the wiring reflects the schematic you have a way to go.
Title: Re: Which capacitor
Post by: Paul__B on Nov 10, 2013, 11:09 pm
Looks pretty good given that you sort out that glitch about the capacitors drawn with shorts across them.

You probably do not need the capacitor on the "data" pin or the "blank" input as for the first, the level will be stable since you set this before clocking it and if the LEDs flicker due to switch bounce, you will never notice it.
Title: Re: Which capacitor
Post by: dannydebont on Nov 11, 2013, 08:08 am
:P  L . O . L  :smiley-red:

I can only giggle at myself for that silly mistake of shorting out the capacitors ... In my defence however, it was a little late in the evening and I was watching NASCAR ... So I was distracted ...  ;) ... (will that hold up in a court of law?  :smiley-eek: ... ) ...

Guys, I think I've got it now ... I will post some pics and a video once it is finished ...

Thanks a lot for everyone's input and help, I greatly appreciate it ...

Danny
Title: Re: Which capacitor
Post by: Pedro147 on Nov 11, 2013, 10:10 pm
Hi dannydebont.
I am glad to see that I am not the only one that finds the idea of a manually controlled shift register an interesting subject  XD You might be interested in  this thread  (http://forum.arduino.cc/index.php?topic=61158.0) on this topic. I went a bit overboard with my version
my version  (http://www.youtube.com/watch?v=hfkZv59ByvU&feature=c4-overview&list=UUiDU4JVEj5d6OgizDqoi_SA)
by using a Atmega 328 IC (the Arduino chip) to control a 7 Seg display to count through each of the eight button presses on my eight LED version of this concept. Also to overcome the potential problem of any switch bounce on the clock input I used a monostable 555 timer circuit. It seems that you may have sorted out the problems you were having with your circuit so all the best and I for one would like to see a video of your project once it is all sorted out,
Pedro.
Title: Re: Which capacitor
Post by: TomGeorge on Nov 11, 2013, 11:22 pm
Hi, well done Danny, the process of getting something like this to function is probably the best part.
It helps with understanding rising  and falling edge trigger and serial to parallel conversion and fault finding.
And is certainly better than a computer simulation.
And you are excused for watching NASCAR. ( Marcus Ambrose fan)
Pedro has probably had the same experience and benefited from it, nice presentation, mate.

Tom.... :)
Title: Re: Which capacitor
Post by: Pedro147 on Nov 12, 2013, 12:25 am
Thanks Tom. Where are you based in Oz - I am in Canberra, but don't hold that against me  8)