07/28/2021

How To Make RC Car Light System. Diy Remote Control RC Light Circuit.

RC car light system circuit. Diy remote control light module (signal, brake, headlight) for RC cars.

PCB Board: https://www.banggood.com/custlink/mmKEIObyOR
Arduino Pro Micro: https://www.banggood.com/custlink/DG3RZLbhOV
S8050 NPN Transistor: https://www.banggood.com/custlink/vmGYilAYjl
4.7R Resistor (1W or 2W): https://www.banggood.com/custlink/mvvh8jQEe5
5mm Leds: https://www.banggood.com/custlink/v3mh8LNYgj
Power Led (1W): https://www.banggood.com/custlink/3mKhZlAdee
150R and 1K Resistors: https://www.banggood.com/custlink/m3DySaARUA
BD139 NPN Transistor: http://bit.ly/3jpaCHb

Flysky FS-GT3B Radio control: https://www.banggood.com/custlink/vmmy8lAYAV

RC Car Light system Code:

unsigned long TIME1=0; 
unsigned long TIME2;
bool LEDSTATUS = false;
int SIGNAL;
int BRAKE; 
int HEADLIGHT;
 
 void setup(){
 pinMode(21, INPUT);      // Throttle Channel | Gaz Kanalı
 pinMode(20, INPUT);      // Steering Channel | Direksiyon Kanalı
 pinMode(19, INPUT);      // Channel 3 | 3. Kanal
 
 pinMode(5, OUTPUT);      // Signal Leds | Sinyal ledleri
 pinMode(6, OUTPUT);      // Signal Leds | Sinyal ledleri
 pinMode(9, OUTPUT);      // Headlights | Far ledleri

 digitalWrite(5, LEDSTATUS);
 digitalWrite(6, LEDSTATUS);  
 }
 void loop(){

BRAKE=pulseIn(19,HIGH);
SIGNAL=pulseIn(20,HIGH);
HEADLIGHT=pulseIn(21,HIGH);

if (SIGNAL>1600)
{
  digitalWrite(5, LOW);
    
  unsigned long TIME2 = millis(); 
  if (TIME2 - TIME1 >= 350) { 
     LEDSTATUS = !LEDSTATUS;
     digitalWrite(6, LEDSTATUS);
     TIME1 = millis();    
} 
}

if (SIGNAL<1400) 
{
  digitalWrite(6, LOW);
  
  unsigned long TIME2 = millis(); 
  if (TIME2 - TIME1 >= 350) { 
     LEDSTATUS = !LEDSTATUS;
     digitalWrite(5, LEDSTATUS);
     TIME1 = millis();     
}
}
if (BRAKE>1800) digitalWrite(3, HIGH); else digitalWrite(3, LOW);
if (HEADLIGHT>1600) digitalWrite(9, HIGH); else digitalWrite(9, LOW);
}