Connect with us

Shift Register weird response

Discussion in 'General Electronics Discussion' started by cl10Greg, Aug 23, 2016.

Scroll to continue with content
  1. cl10Greg


    Mar 20, 2014
    Hello Everyone,

    I am working on a project with a Raspberry PI to control some LEDs with a shift register. I breadboarded the design first and it worked perfectly but now I started to solder it to a perf board, it's acting weird. I am using the PI to get 5V and GND along with the 3 SR signals (the CLEAR and OE are just tied to PWR and GND) and a signal to control a transistor. I have a basic setup as attached. So I am controlling the LED brightness with a PMOS that is driven by a PWM signal. I am controller the LEDs by sinking current through the SR so to turn on the LED I need to set the PMOS signal to low and then Shift in a 0 to complete the circuit. On the breadboard it all worked well and was able to do patterns and all kinds of things. As soon as I started to prototype it on a protoboard it is doing a weird thing. If I am just trying to turn on channel 0 (10000000, LSB first) the result is actually channel 0 and channel 1 turn on (11000000). If I try to turn on just channel one, it turns on channels two and three (01000000 -> 00110000). I didn't change any of the code that was from the breadboard to the design yet. The only thing that I added was a power capacitor for the power line to decouple any noise from the LED/transistor switching. I do have the PMOS wired to all the other LEDs that are currently floating but that shouldn't matter. Maybe I need to add a delay between the Data/Clk? It is consistent so I don't believe it's noise anywhere that is causing a random bit. I will scope the line and see what's going on later and double check my pinouts but at least wanted to jog my thought process with some debate of what could be happening.

    Attached Files:

  2. cl10Greg


    Mar 20, 2014
    Well I figured out the problem but don't totally understand the solution from every example I have seen. I tried to probe the signals with my scope and noticed that when I probed the clock that the circuit worked perfectly. So I looked at the clock signal and looked super clean and worked well. So I added a resistor to the clock signal and it worked perfectly. So something must have been going on with either the clock signal and rise and fall time and how it correlated to the data bit and timing. Anyways, it all works.
  3. BobK


    Jan 5, 2010
    It sounds to me like you do not have a common ground for the two circuits. The ground of the Rasp Pi and your shift register circuit must be connected together.

    (*steve*) likes this.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day