I created this project a while ago and am now putting it up on the site.
As a beginning project for my new Arduino I decided to make a Photo booth. This project would require the Arduino to take 3 pictures after a button was pushed.
When the user pushes the button the LEDs count down for 4 seconds then it takes a picture. Then there is another countdown and another picture until all three pictures where taken.
What Hardware does it take to make this? Here is the supply list:
- Arduino UNO R3 board with DIP ATmega328P
- RC-201/N3 Remote Control – This is the one I used It will be taken apart, all you really need is the cable that fits the camera.
- A Small Breadboard and Some Jumper Wires
- 4 LEDs and resisters
- 1 of these to isolate the camera from the rest of the project 10 Pcs 2.54mm Pitch 4 Pins DIP Mounting Photo Coupler PC817
- 9 volt Battery and Plug
- 1 momentary switch to get the whole thing started.
Below are the Code that I used to control the Arduino and a diagram showing the wiring and usage.
THE CODE:
///////////////Count down Camera controll with buton push controll/////////////////////
/*If Button is pushed
then run lights and pics 4 times
then stop and wait for anouther button push.*/
///////////Variables/////////////////////////////////
const int buttonPin = 8; // the number of the pushbutton pin
const int SHUTTER_PIN = 7; //fire Shutter
const int delayTime = 500; //Delay time 1000= 1 sec
const int delayOffTime = 50; //LED's off elay time 1000= 1 sec
const int shootTime = 100; // FireCamera Hod Down time
//LED PINS
const int Led2_Pin = 2;
const int Led3_Pin = 3;
const int Led4_Pin = 4;
const int Led5_Pin = 5;
int buttonState = 0; // variable for reading the pushbutton status
void setup()
{
pinMode(buttonPin, INPUT);
pinMode(SHUTTER_PIN, OUTPUT);
pinMode(Led2_Pin, OUTPUT);
pinMode(Led3_Pin, OUTPUT);
pinMode(Led4_Pin, OUTPUT);
pinMode(Led5_Pin, OUTPUT);
}
void loop()
{
buttonState = digitalRead(buttonPin);
if (buttonState == HIGH) {
//////// One Photo //////////////////////////////////////////////////////
digitalWrite(Led2_Pin, HIGH); //Turns on LED #0 (connected to pin 2 )
delay(delayTime); //waits delayTime milliseconds
digitalWrite(Led3_Pin, HIGH); //Turns on LED #1 (connected to pin 3 )
delay(delayTime); //waits delayTime milliseconds
digitalWrite(Led4_Pin, HIGH); //Turns on LED #2 (connected to pin 4 )
delay(delayTime); //waits delayTime milliseconds
digitalWrite(Led5_Pin, HIGH); //Turns on LED #3 (connected to pin 5 )
delay(0); //waits delayTime milliseconds
digitalWrite(SHUTTER_PIN, HIGH); // open the shutter
delay(shootTime); // wait for a second
digitalWrite(SHUTTER_PIN, LOW); // close the shutter
delay(delayOffTime); // wait for one seconds
//Turns Each LED Off
digitalWrite(Led2_Pin, LOW); //Turns on LED #4 (connected to pin 6 )
delay(delayOffTime); //waits delayTime milliseconds
digitalWrite(Led3_Pin, LOW); //Turns on LED #5 (connected to pin 7 )
delay(delayOffTime); //waits delayTime milliseconds
digitalWrite(Led4_Pin, LOW); //Turns on LED #6 (connected to pin 8 )
delay(delayOffTime); //waits delayTime milliseconds
digitalWrite(Led5_Pin, LOW); //Turns on LED #7 (connected to pin 9 )
delay(delayTime); //waits delayTime milliseconds
//////// Two Photo //////////////////////////////////////////////////////
digitalWrite(Led2_Pin, HIGH); //Turns on LED #0 (connected to pin 2 )
delay(delayTime); //waits delayTime milliseconds
digitalWrite(Led3_Pin, HIGH); //Turns on LED #1 (connected to pin 3 )
delay(delayTime); //waits delayTime milliseconds
digitalWrite(Led4_Pin, HIGH); //Turns on LED #2 (connected to pin 4 )
delay(delayTime); //waits delayTime milliseconds
digitalWrite(Led5_Pin, HIGH); //Turns on LED #3 (connected to pin 5 )
delay(0); //waits delayTime milliseconds
digitalWrite(SHUTTER_PIN, HIGH); // open the shutter
delay(shootTime); // wait for a second
digitalWrite(SHUTTER_PIN, LOW); // close the shutter
delay(delayOffTime); // wait for one seconds
//Turns Each LED Off
digitalWrite(Led2_Pin, LOW); //Turns on LED #4 (connected to pin 6 )
delay(delayOffTime); //waits delayTime milliseconds
digitalWrite(Led3_Pin, LOW); //Turns on LED #5 (connected to pin 7 )
delay(delayOffTime); //waits delayTime milliseconds
digitalWrite(Led4_Pin, LOW); //Turns on LED #6 (connected to pin 8 )
delay(delayOffTime); //waits delayTime milliseconds
digitalWrite(Led5_Pin, LOW); //Turns on LED #7 (connected to pin 9 )
delay(delayTime); //waits delayTime milliseconds
//////// Tree Photo //////////////////////////////////////////////////////
digitalWrite(Led2_Pin, HIGH); //Turns on LED #0 (connected to pin 2 )
delay(delayTime); //waits delayTime milliseconds
digitalWrite(Led3_Pin, HIGH); //Turns on LED #1 (connected to pin 3 )
delay(delayTime); //waits delayTime milliseconds
digitalWrite(Led4_Pin, HIGH); //Turns on LED #2 (connected to pin 4 )
delay(delayTime); //waits delayTime milliseconds
digitalWrite(Led5_Pin, HIGH); //Turns on LED #3 (connected to pin 5 )
delay(0); //waits delayTime milliseconds
digitalWrite(SHUTTER_PIN, HIGH); // open the shutter
delay(shootTime); // wait for a second
digitalWrite(SHUTTER_PIN, LOW); // close the shutter
delay(delayOffTime); // wait for one seconds
//Turns Each LED Off
digitalWrite(Led2_Pin, LOW); //Turns on LED #4 (connected to pin 6 )
delay(delayOffTime); //waits delayTime milliseconds
digitalWrite(Led3_Pin, LOW); //Turns on LED #5 (connected to pin 7 )
delay(delayOffTime); //waits delayTime milliseconds
digitalWrite(Led4_Pin, LOW); //Turns on LED #6 (connected to pin 8 )
delay(delayOffTime); //waits delayTime milliseconds
digitalWrite(Led5_Pin, LOW); //Turns on LED #7 (connected to pin 9 )
delay(delayTime); //waits delayTime milliseconds
//////// Four Photo //////////////////////////////////////////////////////
digitalWrite(Led2_Pin, HIGH); //Turns on LED #0 (connected to pin 2 )
delay(delayTime); //waits delayTime milliseconds
digitalWrite(Led3_Pin, HIGH); //Turns on LED #1 (connected to pin 3 )
delay(delayTime); //waits delayTime milliseconds
digitalWrite(Led4_Pin, HIGH); //Turns on LED #2 (connected to pin 4 )
delay(delayTime); //waits delayTime milliseconds
digitalWrite(Led5_Pin, HIGH); //Turns on LED #3 (connected to pin 5 )
delay(0); //waits delayTime milliseconds
digitalWrite(SHUTTER_PIN, HIGH); // open the shutter
delay(shootTime); // wait for a second
digitalWrite(SHUTTER_PIN, LOW); // close the shutter
delay(delayOffTime); // wait for one seconds
//Turns Each LED Off
digitalWrite(Led2_Pin, LOW); //Turns on LED #4 (connected to pin 6 )
delay(delayOffTime); //waits delayTime milliseconds
digitalWrite(Led3_Pin, LOW); //Turns on LED #5 (connected to pin 7 )
delay(delayOffTime); //waits delayTime milliseconds
digitalWrite(Led4_Pin, LOW); //Turns on LED #6 (connected to pin 8 )
delay(delayOffTime); //waits delayTime milliseconds
digitalWrite(Led5_Pin, LOW); //Turns on LED #7 (connected to pin 9 )
delay(delayTime); //waits delayTime milliseconds
}
}