shift register newbie fade led question

Hello to all, this is my first post here.

I'm an amateur in electronics and doing some tests to get some intuition. I followed the shift register tutorial and i have connected to the arduino a shift register and 6 leds. I have used 220 ohms resistors for each led. Everything works ok. I'm using a potensiometer through one analog in and according to the sensored value i switch on the leds serially. but my problem is that the leds fade after a couple of seconds and when i touch one of my potensiometer contacts they get bright again. So if someone can explain me what happens i would be very happy.

Regards, John

Which program? What circuit? How am I to guess? Ohh --->,148850.0.html

Yes i have read that, and i tried to put my question accordingly but i'm not sure if i succeded that. Also sorry about my english. Well the program is the "arduino tutorial for the shift register" and the circuit is the "circuit of the tutorial of the shift register".. And i did some modifications. I 'm positive that the program is ok. It's something about the circuit. Well i'm just asking for some guidance about the behaviour i experience. What should i read. Is it due to current that the leds use? Something with the ground? What my touch does to the circuit and the faded leds get bright again. Anyway, i thought that it must be something very common for amateurs and someone could give me a hint. It's not the cable and the connections. It's not the program. I have powered the leds from the pins of the shift register. The only power supply is from the laptop. I use the arduino uno. I will connect 6 leds straight to the arduino pins to see if i have similar behaviour. If i get the same behaviour what should i suppose? That is the question. My leds consume to much current? And why they fade after 5 seconds? And why they get bright again when i touch one of the contacts of the potentiometer (that i use to take a value and control which of the leds will be lit or what rate the leds are going to visualise "counting"). I 'm not sure if i can make it clear.


It has nothing to do with your “bad english”. Unless it is very very bad, and it isnt. But “Post your code” means that you cut-n-paste your code into the question and then use the [ # ] button so it cones into a nice little code box. “We” do not care how good or bad your description of what you think your code is doing - and it clearly isnt, as you ask why it fails - we need to see the code.

The same argument goes for the circuit diagram. Instead of a long explantion just draw it with pencil&paper and then scan it (or use you smartphone or other camera). Of course if you have a circuit/layout software to draw it (Fritzing is free), that is nicer, but not essential.

Just because it happens to you does not make it “very common”. (Nor, as some people assume, a totaly new and unique problem). But the number of possible faults is to large to list or guess or explain how to sort them out.

So - post your code, post your circuit, tell us what you want to happen, but what happend instead. THEN you get a quick answer.

:astonished: At this moment I am guessing the red wire on the potetiometer is loose. :fearful: Or the “if ( count > 10 )” should be “if ( count <= 10 )”. (Sarcasm off) :wink:

Hi, yes Fritzing is very good. I have started using it.

Anyway, i will find some way to figure out what's going on. Arduino is real fun.

Another question. I'm using the l239D motor driver to drive 2 motors. I have no rating for the motors, i got them from cd roms or disk drives. I have used a second 6V supply (transformer) for the driver+motors and the normal laptop supply for the arduino. It works ok. I haven't used that protective diode for the back emf. I have some "4007" diodes. Where to put it? Connect the + pole of the motor through the diode to the ground? Should i use resistors somewhere for extra protection?