Simulator

A 74HC595 shift register simulator: eight LEDs from three pins

Mokxi is a free online shift register simulator that runs in your browser, with nothing to install and no account needed. An Arduino Uno shifts a byte into a 74HC595 one bit at a time on three pins, data, clock and latch, and the chip’s eight outputs light eight LEDs. They fill up one at a time, then clear and start again.

  • 455parts on the bench
  • 43boards running now
  • 1.00xreal time, on every board
Arduino Uno: eight LEDs on a 74HC595live0.000 s 0.00x
Click to open it in the editor
The LEDs fill up one every 0.3 seconds. Click the circuit to open it in the editor.

What you can do here

In the circuit above, or in the editor it opens.

  • Watch shiftOut clock eight bits into a 74HC595
  • See why nothing changes on the outputs until the latch pin rises
  • Change the pattern the sketch sends and run it again
  • Drive the same LEDs from the serial monitor in the companion project
  • Chain a second 595 from QH′ for sixteen outputs
  • Read eight buttons the other way with a 74HC165

What the running circuit shows

Serial in, parallel out.

shiftOut() puts each bit of a byte on the data pin and pulses the clock, eight times. Inside the 595, every clock pulse moves the bits one place along an eight-stage register. The outputs do not follow as the bits ripple past: they take the register’s contents only when the latch pin goes from LOW to HIGH, so all eight change at once and the LEDs never flicker through the values in between.

In the engine the chip’s outputs read 1, 3, 7, 15 and on up to 255, one more LED every 300 ms, while the serial monitor counts “LEDs lit: 1” to “LEDs lit: 8”. A pass takes 2.7 seconds, then the outputs go back to 0 and it starts again.

How the chip is modeled

The 16 pin 74HC595, pin for pin.

The 595 here behaves as its datasheet says: a shift register clocked on SHCP’s rising edge, a storage register clocked on STCP, an output enable that floats every output while it is HIGH, a master reset, and QH′, the serial output that feeds the next chip in a chain. VCC and GND have to be wired, and an unpowered chip lights nothing.

What it leaves out: a real 595 can only give so much current across all eight outputs at once, and eight LEDs at full brightness can ask it for more than it should give. Here the chip does not heat up, so size the resistors for a real one, not for the simulator.

Questions

Is it free?

Yes. The circuit on this page, every part in it and the editor it opens in are on the free plan, with no card.

Do I need an account?

No. The circuit runs the moment the page does, and the editor opens without one. A free account is only for saving a project to the cloud and sharing it by link.

What is the latch pin for?

It copies the shift register to the outputs. Without it, every LED would flicker through the bits as they shift past; with it, all eight change at once.

How many outputs can three pins drive?

Eight with one 595. Chain a second from the first one’s QH′ and the same three pins drive sixteen, and so on: each chip adds eight.

Can I control it from the serial monitor?

Yes. In the companion project, “Serial monitor drives eight LEDs”, type a number from 0 to 7 and that LED lights; type x to clear them all.

Shift some bits

Open the circuit, change the pattern and press Run. Nothing to install, and no account needed.