Electronic – 8-bit shift register 74LS164 not working

raspberry piregisterttl

I am trying to use an SN74LS164 8-bit serial-to-parallel shift register with my Raspberry Pi, but I have some problems.

I connected:

  • VCC, A, B and CLR to +5V
  • GND to 0V
  • CLK to Raspberry Pi GPIO

schematic

simulate this circuit – Schematic created using CircuitLab

When I power-on the circuit, all the LEDs are off. Then I send a clock pulse from the Raspberry Pi (go high for 100ms then go low). However instead of having the just first output (QA) go high, the first 3 or 4 outputs go high (QA, QB, QC and QD).

What am I doing wrong?

I took some photos of the scope, the first is the clock from the GPIO (without nothing) and the second is the clock connected to the register.

Clock only

Clock connected to register

— EDIT —

I added capacitors and MOSFETs to respect max output current. I re-added pull-down resitor on clock line because of the natural +1V offset (this offset come from the register not the pi)

Best Answer

I resolved my problem. The register was clocking multiple times because the clock signal wasn't enough clean. So I added a schmitt trigger between the raspberry pi and the register clock input, and now it shifts exactly the number I want.

Thanks for all your advices and suggestions, have a nice day ;)