BreakoutBros Halloween Special: Remote Control Jack-o-Lantern

We wanted to get into the Halloween spirit at BreakoutBros but we are super busy writing reviews, tutorials, and decorating our houses. While I was testing parts to review the ControlEverything.com Arduino Shield I realized I was just a few spliced wires and a relay away from something fun.

20161026_182740

So I combined that shield, the Arduino Light Control Tutorial, a ceramic Jack-o-Lantern, and some wire. The pumpkin I used already had a male plug, so I decided to make a relay controlled outlet. This also made it easy because modern wall outlets have places to simply push in wires. That way I didn’t need to use any wire nuts, just the screw terminals on the relay board. I even used the Normally Closed  terminal on a 2nd relay for the return wire.

20161026_182639

To keep my dogs out of the wires, I put all the hardware in a shoebox and plugged in the Arduino and Pumpkin.

20161026_163232

In the spirit of keeping it simple I have it come on when the button is pressed and stay on until its released.

Here is the code:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
void setup() {
  pinMode(5, OUTPUT);   //Set up the pin for the Relay 
  pinMode(13, OUTPUT); //These two lines turn OFF the buzzer
  digitalWrite(13, LOW);   //The buzzer is rather useful most of the time
}
 
void loop() {
      if (digitalRead(6) == HIGH)  //check for remote press from the shield
      {
           digitalWrite(5, HIGH);      //Close the relay to turn on the light as long as the button is held
      }
    else
      {
      digitalWrite(5, LOW);     //leave the light OFF otherwise 
      }
}

Even my dog wanted to check out the show.

The great thing about this is how easily expandable it is, you could add a motion or proximity sensor to make it automatic or you could add a speaker and audio shield for a sound effect.

Happy Halloween Everyone.

Leave a Reply

Your email address will not be published. Required fields are marked *