LED Driver

This example makes use of an LED Driver in order to control an almost endless amount of LEDs with only 4 pins. We use the 4794 from Philips. There is more information about this microchip that you will find in its datasheet.

An LED Driver has a shift register embedded that will take data in serial format and transfer it to parallel. It is possible to daisy chain this chip increasing the total amount of LEDs by 8 each time.

The code example you will see here is taking a value stored in the variable dato and showing it as a decoded binary number. E.g. if dato is 1, only the first LED will light up; if dato is 255 all the LEDs will light up.

Example of connection of a 4794

/* Shift Out Data
 * --------------
 * Shows a byte, stored in "dato" on a set of 8 LEDs
 * (copyleft) 2005 K3, Malmo University
 * @author: David Cuartielles, Marcus Hannerstig
 * @hardware: David Cuartielles, Marcos Yarza
 * @project: made for SMEE - Experiential Vehicles

int data = 9;
int strob = 8;
int clock = 10;
int oe = 11;
int count = 0;
int dato = 0;

void setup()
  pinMode(data, OUTPUT);
  pinMode(clock, OUTPUT);
  pinMode(strob, OUTPUT);
  pinMode(oe, OUTPUT);

void PulseClock(void) {
    digitalWrite(clock, LOW);
    digitalWrite(clock, HIGH);
    digitalWrite(clock, LOW);

void loop()
   dato = 5;
   for (count = 0; count < 8; count++) {
    digitalWrite(data, dato & 01);
    //serialWrite((dato & 01) + 48);
    if (count == 7){
    digitalWrite(oe, LOW);
    digitalWrite(strob, HIGH);

     digitalWrite(oe, HIGH);

  digitalWrite(strob, LOW);

 delay(100);                  // waits for a moment