Control relay with TIP120

Control Omron G5LE-1 relay that requires 12V to switch the relay on and off. The relay it self is turning a 220VAC circuit on and off.

DC motor

You will need:
- DC Motor
- Power diode
- TIP 120

Turn the motor on with this code:

  1. void setup() {                
  2.   pinMode(8, OUTPUT);    
  3. }
  4.  
  5. void loop() {
  6.   digitalWrite(8, HIGH); // Turn on motor
  7.   delay(5000);
  8.   digitalWrite(8, LOW); // Turn off motor
  9.   delay(5000);      
  10. }