TLC5940 and ADXL335 circuit ‘glitches’ on perfboard. Need decoupling caps

arduinodecoupling-capacitorvoltage

I created a circuit containing one TLC5940 and one ADXL335 breakout board. The ADXL board comes configured with 0.1 uF capacitors to set the bandwidth of each axis to 50Hz.

It is wired to an Arduino Mega 2560 like this. The ground is shared between both the TLC and the ADXL. 5V and 3.3V are hooked up to the Arduino.

On a breadboard, there is no problem. With the exact same circuit a perfboard, the ADXL values seem to fluctuate when the TLC is updated. Also, when fiddling with the 3.3V wire to the ADXL (connecting/disconnecting), LEDs are turning on and off randomly.

I checked my soldering, and while not the best there is (it's my first perfboard) there aren't any shorts/mistakes as far as I can see.

Could it be because the power sources are 'dipping' when updating the LED's? If so, do I need decoupling capacitors to smoothen it out?

Best Answer

Decoupling capacitors are absolutely essentialTM in any real world circuit.

You want a say 100 uF on the 5V supply to ground ON the perf board plus a 0.01 uF to 1 uF ceramic from 5V to ground at each IC as near to the supply pins as practical.

You also need to be ABSOLUTELY CERTAIN that all pins on all devices that should be connected to a defined level are connected. I'm not going to pore over avery pin description BUT YOU SHOULD.

5940 datasheet
ADXL335 datasheet


it's good to have a circuit diagram of what you are doing BUT what you have presented us with is very sloppy. eg the ADXL IC shows on its data sheet VERY CLEARLY that it needs a supply decoupling cap AND ALSO must have caps on its output lines WHICH CONTROL ITS BANDWIDTH. Either the caps are on your board but not on your diagram (very naughty) or not on your board (even naughtier). So, please to fix either board and/or diagram and report back. You may have decided to use no x y z caps and get max bandwidth - is that what you are now seeing as errors?

Coming back and asking more questions without fixing the board and or diagram and telling us what the reality is would be both pointless and rude - Olin will tell you this very loudly soon if I don't tell you now ;-).

BUT Olin will also vote to close your question and will influence others to do so too. I won't. I don't need to because others will do so quick enough if you don't fix these discrepancies. So, I suggest rapid action and we will all get a good result :-).