I've followed this Arduino guide to build a circuit using a CD4021BE PISO shift register, and 10k pulldown resistors. It works perfectly fine with the Arduino's 5v supply.

I then attempted to use this circuit with my Raspberry Pi's GPIO, which only supplies 3.3v, and I was getting very unreliable readings from the data pin. Increasing the clock delay to 1ms improved it a bit, but it's still very unreliable. (Some bits read high every few seconds, when everything should be low.)

I assume that running a CD4021BE shift register at 3.3v requires a different value for the pulldown resistors, so which value would you recommend? I have seen this answer to a similar question about pullup/pulldown resistors, but would like to know if there is any 'rule of thumb' for pulldown resistors in a 3.3v circuit. I would guess that a 5k resistor should solve the problem, but I wanted to get some advice before buying resistors and desoldering the existing ones.

  • 1
    \$\begingroup\$ ti.com/product/cd74hct165 but the pinout is different. \$\endgroup\$ Commented Jun 18, 2013 at 1:48
  • 4
    \$\begingroup\$ Christ, as usual, the Arduino docs are sloppy and full of errors. You need a 0.1 uF bypass capacitor as close as you can get it to the power connections of each CD4021. \$\endgroup\$ Commented Jun 18, 2013 at 3:29
  • \$\begingroup\$ The fact that the tutorial doesn't include bypass capacitors tells you: A - it was not written by a person who is very familiar with electronics, and B - the arduino people apparently don't have any actual engineers or even people familiar with electronics proofreading their documents. \$\endgroup\$ Commented Jun 18, 2013 at 3:33
  • 1
    \$\begingroup\$ @AnindoGhosh - Bullshit - The url is www.arduino.cc, I certainly don't see any disclaimers that the content is crowd-sourced (hell, the URL doesn't even have "wiki" or similar in it. it's www.arduino.cc/en/Tutorial/ShiftIn). If they want to run a wiki, and have it include random, poorly written tutorials, they need to be pretty damn sure that it is CLEAR that said wiki and it's content is not directly affiliated with their brand. They have entirely failed to do this. \$\endgroup\$ Commented Jun 19, 2013 at 2:16
  • 3
    \$\begingroup\$ Also, their schematics are f**king horrible. \$\endgroup\$ Commented Jun 19, 2013 at 6:09

2 Answers 2


The pullup/pulldown resistors for the buttons can take almost any value, limited only by power supply current capacity (1-10 ohm) and noise resistances (hundreds of kilohms).

So in the referenced schematics, you can put any resistor between 1K and 500K, and it will work, no matter what the power supply voltage is - 3.3 or 5V. I like using 4.7K resistors because I have a big box of them.

For more complex cases (I2C, etc..) the rules may be more complicated, but buttons/switches really do not care.


The Texas Instruments data sheet for CD4021BE does allow for supply voltage from 3v to 18v.
However, notice in all of the timing diagrams that the device is only characterized down to 5 volts.

Operating the CD4021 at 3.3 volts means that things like propagation delay and transition time will be increased to an un-specified amount. The data sheet does show that maximum clock frequency also decreases as the supply voltage is decreased.

As suggested above by Ignacio Vazquez, changing over to the CD74HC165 (not CD74HCT165), will yield much better guaranteed performance. (The HCT device is only characterized down to 4.5 volts)


Not the answer you're looking for? Browse other questions tagged or ask your own question.