electronicaparatodos
Published © CC BY-NC

4 pin tv relay for arduino

This project will be very easy since we will create a relay with recycled materials from a tv

BeginnerProtip612
4 pin tv relay for arduino

Things used in this project

Hardware components

General Purpose Transistor NPN
General Purpose Transistor NPN
×1
Signal Relay, 5 VDC
Signal Relay, 5 VDC
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Perma-Proto Breadboard Half Size
Perma-Proto Breadboard Half Size
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

TV relay and arduino

recycled relay of a TV.
very easy to do

Code

led bluethot

C/C++
Here is a little example code.
you don't need to occupy it
char t;
 
void setup() {
pinMode(13,OUTPUT);   //left motors forward
pinMode(12,OUTPUT);   //left motors reverse
pinMode(11,OUTPUT);   //right motors forward
pinMode(10,OUTPUT);   //right motors reverse
pinMode(9,OUTPUT);   //Led
Serial.begin(9600);
 
}
 
void loop() {
if(Serial.available()){
  t = Serial.read();
  Serial.println(t);
}
 
if(t == 'F'){            //move forward(all motors rotate in forward direction)
  digitalWrite(13,HIGH);
  digitalWrite(11,HIGH);
}
 
else if(t == 'B'){      //move reverse (all motors rotate in reverse direction)
  digitalWrite(12,HIGH);
  digitalWrite(10,HIGH);
}
 
else if(t == 'L'){      //turn right (left side motors rotate in forward direction, right side motors doesn't rotate)
  digitalWrite(11,HIGH);
}
 
else if(t == 'R'){      //turn left (right side motors rotate in forward direction, left side motors doesn't rotate)
  digitalWrite(13,HIGH);
}

else if(t == 'W'){    //turn led on or off)
  digitalWrite(9,HIGH);
}
else if(t == 'w'){
  digitalWrite(9,LOW);
}
 
else if(t == 'S'){      //STOP (all motors stop)
  digitalWrite(13,LOW);
  digitalWrite(12,LOW);
  digitalWrite(11,LOW);
  digitalWrite(10,LOW);
}
delay(100);
}

Credits

electronicaparatodos

electronicaparatodos

0 projects • 0 followers

Comments