Arduino Uno Halloween Prop controller.

Hello Forum,

I just want to thank anyone in advance for reading and helping out with my question.

I been trying this project for a few years now. Since learning Arduino and C++. This is the project.
When someone walks passed the PIR then it tells the RGB to change color and play the sound audio file. Then it turns on a motor one and then turns on motor two. Then turns on the fog machines. As I writing this down.

I am remembering someone said if your project has more then two and's, then use a raspberry Pi. Would be to much for a single Arduino to do? I think the audio might not be in this code. Because I couldn't get the sd reader to work. Maybe someone can help me just know if a Arduino could do this. Also if the uno when the right board to use. or I need Raspberry pi for this?

I wanted to make a Arduino to control

  • PIR
  • 2 fog machines
  • Two motors
  • 4 Lights or 4 RGB Led light strips
  • one RGB LED
  • Play a short 30 sec audio clip

This is the code I have so far. Which I don't even know if its right.

//pin variables
int pirPin = 2; //choose the input pin (for PIR sensor)
int pirState = LOW; //we start, assuming no motion detected
int val = 0; //variable for reading the pin status
int bluePin = 6; // declare pin 6 is Blue RGB
int redPin = 3; // declare pin 3 is red RGB
int greenPin = 5; // declare pin 5 is Green RGB
int motorLiftPin = 7; // choose the pin for relay 1 MOTOR 1 lift
int motorSpinPin = 8; // choose the pin for relay 2 MOTOR 2 spin
int fogPin1 = 9; // choose the pin for fog Controllor 1
int redPin = HIGH;
int greenPin = HIGH;
int bluePin = HIGH;

void setup() { //set the mode of the pins
val = digitalRead(pirPin); //read input value
if(val == Hight) { //check if the input is HIGH
digitalWrite(motorliftPin, HIGH); //turn on motor lift
pinMode(bluePin, OUTPUT); // declare BLUE LED as output
pinMode(redPin, OUTPUT); // declare RED LED as output
pinMode(greenPin, OUTPUT); // declare GREEN LED as output
pinMode(motorLiftPin, OUTPUT);
digitalWrite(motorLiftPin, HIGH); // declare motor start lift
digitalWrite(motorLiftPin,HIGH); // declare relay motor spin
pinMode(fogPin1, OUTPUT);
digitalWrite(fogPin1,HIGH); // declare relay to fog machine to turn on
if (pirState == LOW) {
// we have just turned on
Serial.println("Motion detected!"); // We only want to print on the output change, not state
pirState = HIGH;
}
} else {
digitalWrite(ledPin, LOW); // turn LED OFF
if (pirState == HIGH){
// we have just turned of
Serial.println("Motion ended!");
// We only want to print on the output change, not state
pirState = LOW;
}
}
}

void loop(){
//turn on and off led
digitalWrite(redPin, redPin);
digitalWrite(greenPin, greenPin);
digitalWrite(bluePin, bluePin);

val = digitalRead(pirPin); // read input value
if (val == HIGH) { // check if the input is HIGH
digitalWrite(bluePin, HIGH); delay(7900); // turn on blue LED 8 sec
digitalWrite(bluePin, LOW); // turn off blue LED
digitalWrite(redPin, HIGH); delay(8500); // turn on red LED 9 sec
digitalWrite(redPin, LOW); //turn on and off LED
digitalWrite(greenPin, HIGH); delay(20000); //turn on green LED 20 sec
digitalWrite(greenPin, LOW); } //turn off green LED
if (pirState == LOW) { // we have just turned on
Serial.println("Motion detected!"); // We only want to print on the output change, not state
pirState = HIGH;
}
else {
digitalWrite(bluePin, LOW); // turn Blue LED OFF
if (pirState == HIGH){ // we have just turned of
Serial.println("Motion ended!"); // We only want to print on the output change, not state
pirState = LOW;
}
}
}

Well it doesn't compile. That's not a good start. When you've got it to compile post the new version.

Then you can tell us if it works and if not what exactly it does do.

At the moment I can only see 1 fogger and I can't see anything that plays a tune and I can only see 3 LEDs (or maybe one RGB LED). It doesn't look like you've finished it .

It sounds perfectly possible to do all you want with an Arduino but it's going to need a bit more effort. How are you planning to play your tune?

Steve

An Arduino should be able to run this prop easily. It reminds me of one that I did last year. I didn't control the fog machine with the Arduino, but did control several LED strips, a stepper motor, a servo, a drill, and an audio player. I used an ultrasonic range sensor instead of a PIR sensor.

Here is the link: https://www.enginearenough.com/projects/the-scarebox/.

I haven't uploaded the video yet but you should be able to get an idea of what is going on.

jb33:
An Arduino should be able to run this prop easily. It reminds me of one that I did last year. I didn't control the fog machine with the Arduino, but did control several LED strips, a stepper motor, a servo, a drill, and an audio player. I used an ultrasonic range sensor instead of a PIR sensor.

Here is the link: https://www.enginearenough.com/projects/the-scarebox/.

I haven't uploaded the video yet but you should be able to get an idea of what is going on.

Cool project. I've been thinking what I want to do this year.

OP- No problem using Arduino for this project.

As others have said an ararduino can do what you want.

As a note about using g6his forum
There is a sticky post at yhe top of evevery forum called How To Use This Forum.
Item #7 talks about code tags.

Once you get a chance to read that. Please revisit your post.
Go to the bottom right
Select other modify
And add code tags.

We always suggest doing one thing.at a time....
Sense people then ....
...make smoke
...make sounds
...move motors
Add one new thing at a time and it should work out for you.