Pages: [1]   Go Down
Author Topic: Problem with ShiftPWM and RGB LEDs  (Read 1156 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi there,

I am sure that this has been asked before but since I dont even know what the problem might be my searching the interwebs was quite unsuccessful (and frustarting). So please bear with me if this is going to be one of those dreaded "gaziilionth asked sand stupid" questions.

I am quite new to electronics but once I saw a LED cube in action I wanted to build one by myself. I have been experimenting for the last 6 months and learned quite a few basics.

I started out with a couple 3x3x3 simple led cubes to practice soldering and general setup. I used very simple software side multiplexing with 9 pins on the arduino (9 for colums and 3 for layers). This actually worked quite nicely and after a little break a couple weeks ago I thought I was ready to go to the next level.

I started reading up on RGB LEDs and how to multiplex a lot of those (since I was planning on doing a 5x5x5 RGB cube this time). I stumbled across ShiftPWM and found it to be excactly  what I was looking for. So got myself the parts needed (mainly the LEDs and a couple of 74HC595B shift registers) and started experimenting.

My initial tests went on smoothly and I figured Ill try the demo that is described here: http://www.elcojacobs.com/using-shiftpwm-to-control-rgb-leds-with-arduino/. (see the schematics). I set this up and after a painful realisation got it to work finally. I tested it with the sample sketch that is provided with ShiftPWM and everything worked as it is supposed to...

I was running the setup off of the arduino 5v and ground. Since I obviously cannot run 125 RGB LEDs off of my arduino I connected my bench supply and then the trouble started...

When connected to the bench supply there seems to be some kind of "noise" on the pinouts of the shift registers, i.e. even though only one LED should be led there are others (some directly next to it but even the most two apart) that light up randomly with all three colors. Once I shift the supply back to the arduino everything works just fine. What is up with that?

I thought maybe that had something to do with the capacitors I initially left out of the circuit but this does not seem to be the case. I read up on that and once I understood what a decouling capacitor is installed the 100nF ones across the rehisters and the 100 uF one across +5V and Ground, but the problem still persist.

Can somebody may help me with that? I have a couple of basic tools like a few beginners meters and an old analog 20 MHz scope (which I am not very good at operating) if you need more information from me.. Let me know if you need anything else - I guess I could supply some images if needed.

Thanx in advance,
Chris

TL;DR: Setup is 3 74HC595Bs and 8 RGB LEDs. Everything works fine while power is supplied by the arduinos 5V/Ground. When using my bench supply LEDs which are supposed to be off "flicker" randomly. Why?
Logged

Pullman, WA
Offline Offline
Edison Member
*
Karma: 11
Posts: 1245
Arduino Ninja
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

How are you connecting the bench power supply to your circuit? Specifically...what exact pins on which parts of the circuit and Arduino are you connecting to the bench supply?
Logged

Wearable Arduino-compatible LED matrix glasses: https://www.kickstarter.com/projects/macetech/rgb-led-shades

Victoria, Australia
Offline Offline
Edison Member
*
Karma: 46
Posts: 1644
Electronics Engineer/Industrial Control
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, when you connected the bench supply, did you connect the gnd /neg of the arduino circuit to the gnd/neg of the  bench supply.

Tom.... smiley
Logged

Everything runs on smoke, let the smoke out, it stops running......VK3DMK

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, when you connected the bench supply, did you connect the gnd /neg of the arduino circuit to the gnd/neg of the  bench supply.

Tom.... smiley

Hi Tom,

no I did not. I jut tried it and that fixes the problem! Thank you alot! I only had the data/latch/clock pins clock connected from the arduino while hooking the bench supply directly to my breadboard...

However could you elaborate a bit as to why this is is? As I said I have no electrical background and I was always under the impression that "ground = ground" (so it doesnt matter which one you take). Obviously that is not the case - just why? smiley

Thanx again,
Chris
Logged

NSW Australia
Offline Offline
Faraday Member
**
Karma: 93
Posts: 3714
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

As I said I have no electrical background and I was always under the impression that "ground = ground" (so it doesnt matter which one you take). Obviously that is not the case - just why? smiley

It is a fundamental principle of electrical circuits that you have to have a complete circuit for the current to flow.

"Ground" is a relative term, meaning a common point which is usually, but not necessarily connected in some way to electrodes buried in the earth such as the one below your meter box.  When putting a circuit together, each individual part must have that common reference connection, generally the negative, connected in order for current to flow from one part to another - and back.  They only become a common "ground" when they are actually connected.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 639
Posts: 34724
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
However could you elaborate a bit as to why this is is?
You might want to read this it has a good diagram explaining things:-
http://www.thebox.myzen.co.uk/Tutorial/Power_Supplies.html
Logged

Victoria, Australia
Offline Offline
Edison Member
*
Karma: 46
Posts: 1644
Electronics Engineer/Industrial Control
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Good one  Mike... smiley-cool
Logged

Everything runs on smoke, let the smoke out, it stops running......VK3DMK

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
However could you elaborate a bit as to why this is is?
You might want to read this it has a good diagram explaining things:-
http://www.thebox.myzen.co.uk/Tutorial/Power_Supplies.html

Indeed a good exlanation of why my setup did not work. However, to be honest I still dont get why... smiley

It is obvious that there is no path for the current BACK to the arduino but why doesnt the current use the path that is there to go to the "other" ground provided by the bench supply. From how I understand it there is an excess of electrons (coming from the arduino) that need to go somewhere. Why dont they go to the shortage at the ground of the bench supply?

Sorry for being stupid - just want to understand it.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 639
Posts: 34724
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
but why doesnt the current use the path that is there to go to the "other" ground provided by the bench supply
Because the ground on the arduino and the ground on the power supply are not electrically connected. Ground is a relative term not an absolute one. The current therefore can not flow to the power supply ground because there is not a circuit. It can only flow to it's own ground.
Logged

Pullman, WA
Offline Offline
Edison Member
*
Karma: 11
Posts: 1245
Arduino Ninja
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

This is the best answer for small electronics systems, but don't file it away as an absolute rule because it'll cause a lot of cognitive dissonance when you see a power system that uses actual dirt as a return line.
Logged

Wearable Arduino-compatible LED matrix glasses: https://www.kickstarter.com/projects/macetech/rgb-led-shades

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 639
Posts: 34724
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

So that would be a common dirt circuit then?

In the rest of the world this is the difference between ground and Earth. Earth being your dirt.

Quote
dissonance when you see a power system
We are talking the sort of system that powers local sub stations here.
Logged

Pullman, WA
Offline Offline
Edison Member
*
Karma: 11
Posts: 1245
Arduino Ninja
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, this is thread drift smiley I'm just promoting mental flexibility, people love to box themselves into rules that apply to a specific subset of reality, and then generalize them onto the rest of it.
Logged

Wearable Arduino-compatible LED matrix glasses: https://www.kickstarter.com/projects/macetech/rgb-led-shades

Pages: [1]   Go Up
Jump to: