Amarino shield- CD4094 control with Arduino- WITHOUT SMART PHONE

This is the first experiment for Amarino shield. If you do not know anything about Amarino toolkit or this shield please click on the following links:
You can get a list of other experiments at the end of this post.
This experiment has been derived from HEF4794_- Arduino_ Experiment.
This example makes the use of an LED Driver in order to control an almost endless amount of LEDs with only 4 Arduino pins. In this experiment, we use the CD4094 chip. Here, you can get the original version of this experiment: http://www.arduino.cc/en/Tutorial/LEDDriver . The Arduino team has used HEF4794.
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. You need to refer to datasheet for connecting more CD4094.
The code example you 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.
NOTE: Switch ON the IC1 -1 P DIP switch. If the switch is off, the 10pcs of LEDs connected to CD4094 will not work.
Arduino Sketch: LINK
/* 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 = 8; | |
int strob = 7; | |
int clock = 10; | |
int oe = 9; | |
int count = 0; | |
int dato = 0; | |
void setup() | |
{ | |
Serial.begin(9600); | |
pinMode(data, OUTPUT); | |
pinMode(clock, OUTPUT); | |
pinMode(strob, OUTPUT); | |
pinMode(oe, OUTPUT); | |
} | |
void PulseClock(void) { | |
digitalWrite(clock, LOW); | |
delayMicroseconds(20); | |
digitalWrite(clock, HIGH); | |
delayMicroseconds(50); | |
digitalWrite(clock, LOW); | |
} | |
void loop() | |
{ | |
dato = 255; | |
for (count = 0; count < 8; count++) { | |
digitalWrite(data, dato & 01); | |
//serialWrite((dato & 01) + 48); | |
dato>>=1; | |
if (count == 7){ | |
digitalWrite(oe, LOW); | |
digitalWrite(strob, HIGH); | |
} | |
PulseClock(); | |
digitalWrite(oe, HIGH); | |
} | |
delayMicroseconds(20); | |
digitalWrite(strob, LOW); | |
delay(100); // waits for a moment | |
} |
Related tutorials:
- About Amarino toolkit
- About Amarino shield
- Flickr Images
- Experiment 1– Basic control over CD4094 without Android phone and serial emulator application
- Experiment 2- CD4094 control using Android phone and Amarino shield
- Experiment 3- Amarino experiment- RGB Lamp
- Experiment 4- Amarino experiment- Sensor Graph with LED Controller
- Experiment 5- Amarino experiment- LM35 based temperature sensor with LED controller
- Amarino Shield 3.0 Schematic
- Assembly tutorial
- Buy the shield
You can purchase this versatile Amarino shield at buildcircuit.net and Etsy. The store is owned and operated by the team which operates buildcircuit.com.