I'm not very good with logic equations.

I'm still pretty new to this and I'm trying to make a relay board for my truck that will control the battery, fuel pump, systems, and ignition. This is an effort to make the truck keyless and still have it be "anti theft," through complication. Right now, I'm just trying to figure out how to get the LEDs to do what I need them to do. Here is a video example.


About all I can do is make an if/else statement using the battery switch and make the other red leds blink when the battery is on. I just don't know how to proceed. When I go to switch the fuel pump on I need to make the fuel pump led switch to the green led. I figure if someone could point me in the right direction on that simple part, I could probably go from there.

This is what I've got so far.


int fuelledwarn=2;
int sysledwarn=3;
int ignledwarn=4;
int fuelled=5;
int sysled=6;
int ignled=7;
int battswitch=10;
int fuelswitch=11;
int sysswitch=12;
int ignswitch=13;

void setup(){
  pinMode(fuelledwarn, OUTPUT);
  pinMode(fuelled, OUTPUT);
  pinMode(sysledwarn, OUTPUT);
  pinMode(sysled, OUTPUT);
  pinMode(ignledwarn, OUTPUT);
  pinMode(ignled, OUTPUT);
  pinMode(battswitch, INPUT);
  pinMode(fuelswitch, INPUT);

void loop(){
  if (digitalRead(battswitch)==LOW){
    digitalWrite(fuelledwarn, LOW);
    digitalWrite(sysledwarn, LOW);
    digitalWrite(ignledwarn, LOW);
  else {
    digitalWrite(fuelledwarn, HIGH); digitalWrite(sysledwarn, HIGH); digitalWrite(ignledwarn, HIGH);
    digitalWrite(fuelledwarn, LOW); digitalWrite(sysledwarn, LOW); digitalWrite(ignledwarn, LOW);


If anyone could help me out, I sure would appreciate it.

Hi, hope I’ve interpreted your question correctly. Have you tried

if (digitalRead(fuelswitch) == HIGH) {
digitalWrite(fuelled, HIGH);

you could combine it with an and to ensure the bat switch is on also.

if ((digitalRead(fuelswitch) == HIGH)&&(digitalRead(batswitch) == HIGH) {
digitalWrite(fuelled, HIGH);
. perhaps followed by some code to
…turn on fuel pump