Devices & Components
Arduino Nano
USB-A to Mini-USB Cable
ULN2803A relay driver IC
12VDC & 1 Amp Power Adapter
Sugar Cube Relay
Jumper wires (generic)
74LS164N Serial In Parallel Out Shift Register
Software & Tools
Arduino IDE
Project description
Code
Code for Nano Relay Module
c_cpp
1const int data_pin = 2; 2const int clk_pulse_pin = 3; 3byte zero = 0xff; 4int time_interval = 1500; 5void setup() 6{ 7 pinMode(clk_pulse_pin, OUTPUT); 8 pinMode(data_pin , OUTPUT); 9} 10void loop() 11{ 12 for (int Bz = 0x00; Bz < 0xff; Bz++) 13 { 14 shiftOut(data_pin, clk_pulse_pin, MSBFIRST, Bz); 15 delay(time_interval); 16 } 17} 18
Downloadable files
Wiring
This circuit is drawn by Proteus ISIS. Pin 1 and 14 is connected with +5Volt. Pin 7 is connected with Ground. Pin 2 is connected with Nano's digital pin 2 Pin 8 is connected with Nano's digital pin 3
Wiring

Wiring
This circuit is drawn by Proteus ISIS. Pin 1 and 14 is connected with +5Volt. Pin 7 is connected with Ground. Pin 2 is connected with Nano's digital pin 2 Pin 8 is connected with Nano's digital pin 3
Wiring

Comments
Only logged in users can leave comments