DIY Intervalometer: Hey guys !!.....

This is my first instructable, hope it goes well.

In This a tutorial for an Intervalometer for Canon DSLRs. In this Instructable you can build your own Intervalometer. Here with this design you can choose from Hours to Seconds in the range of 999 : 999 : 999 (H : M : S), and It will start clicking at intervals you set. This is a simple and yet easy to make, and yes this is accurate.

For connecting it to the camera I have used an 3.5mm Audio Cable (M2M), and to the camera I connected it through 2.5mm(F2M) converter. There are couple of LEDs to Indicate Actions like power on(red) and clicks(blue). You could use direct 2.5mm Aux Cable (M2M). I used an ATmega8 microcontroller, So you must have an AVR ISP programmer to download the HEX file to the ATmega8, OR you could use Arduino as an ISP to program your ATmega8.

If you have not worked on AVR before, then start from step 1. Otherwise you can avoid these steps and jump direclty to step 4 (prototyping step).

It is interfaced with an 16x2 LCD and 4 buttons. It is simple and easy to use. So arrange for the list of materials mentioned below,

List of Components:

1. ATmega8(28 pin) (ATMega8 Base Reqd) - 1
2. 4 MHz Crystal Oscillator - 1
3. 16x2 LCD - 1
4. Push Buttons (1 small, 4 large) - 5
5. Switch(small) - 1
6. 3.5/2.5 mm Jack(F) - 1
7. 3.5/2.5mm Aux Cable(M2M) - 1
NOTE: (3.5(F) to 2.5(M) mm connector is reqd if 3.5 mm cable jack is used) - 1
8. LM7805 Regulator - 1
9. Resistors
1K - 4
1.5/2K or (5K Trimmer / POT) - 1
10K - 1
10. Capacitors
10uF/100uF - 1
1uF/10uF - 1
22pF - 2
11. 2N2222A Transistor - 1
12. LEDs
RED, GREEN, BLUE All (3 mm) - 1
13. 9v Battery - 1
14. Connecting Wires
15. General PCB
16. AVR ISP programmer / Arduino as ISP.

Let's Start !!

Step 1: Basic AVR Setup

-->>To begin with the project, First let’s start with basic AVR setup.

First lets right a program for an LED blinking.
(Follow the Schematic in Pics.)
1. AVR Studio 4 & WinAvr --> http://mycomsats.com/blogs/download-atmel-avr-studio-4-free/
2. Latest AVR Studio --> http://www.atmel.in/tools/ATMELSTUDIO.aspx

I am using AVR studio 4.

After opening the software,
Close the project wizard. goto project and select new project, project wizard opens again.
1. Select AVR GCC, Type in your Project name & give a name to the .c file, then Click Next.
2. Select Avr Simulator and look for ATmega8 and select, then click on finish.
3. Now we can Start programming.

Right Click on Header Files, then select Include Existing Header Files, and navigate to below specified location.
To include delay header file goto -> C:\WinAVR-20100110\avr\include\util and then select "delay" file.
CODE: ledblink.c

4. Now save, Add all header files if not added. Then Right Click on ledblink.c and select compile or use alt + F7.
5. Rectify if any errors, you may ignore any warnings. Now Right Click on ledblink.c and select build or use F7.
6. If Success, you'll get 0 errors, Warnings if any.
7. Now Click on Play or goto Debug->Start Debugging.
Use Press ALT + F5, for Auto Step. OR Press F11 for step by step.
8. On right side you'll find IO View Window. In that Select PORTB and Expand it. You can observe the output
at PORTB Register.

Now to download the program to the microcontroller.
1. If you are using AVR ISP ->
Download Khazama AVR Programmer - > http://khazama.com/project/programmer/
Open HEX file in Khazama -> Auto Program.
(Just "Auto Program" after you select HEX FILE, No need to SET any bits for ATmega8)
- > If you choose any AVR ISP programmer, you must get a guide with it just follow it.
2.If you are using Arduino as ISP - > https://www.instructables.com/id/How-to-program-a-A...
- > http://arduino.cc/en/Tutorial/ArduinoISP
(easy to understand) - > http://arduino.cc/en/Tutorial/ArduinoToBreadboard

(HEX file can be found in your project folder->Default folder->LEDblink.hex)

connect these pins, its this simple.
USB ISP/Arduino----------------------------------------ATMega8(Target)

3. After Successful programming you must see the LED Blinking.

Congrats !! You have completed Step1.

Step 2: LCD Interfacing

After Completion of LEDs, We can start with LCD interfacing.

I have defined a header file called mylcd.h for usage. You can download it.
You can use the schematic present in this section, to refers the pins configuration.
-> Image ->

The LCD that I have used JHD 162A, Its a 16x2 LCD.

Test with the sample code & follow the mylcd header files. It has function to write data to LCD.
Don't foget to include header file in project.

Sample Code:


Congrats ! You just completed step2.

Step 3: Button Detection Programming

The last thing to finally do is detect the button/key press.

Have a look at the schematic first. - > http://imageshack.us/photo/my-images/841/4kf1.jpg...

Logic to Detect.

1. First set DDR register to input. i.e., '0', Eg DDRB = 0x0F;
// First 4 pins (1111 -> F) are set as output pins.
// The remaining pins (0000 -> 0) are set as input pins.

2. To read a key/button, we first need to set the input pins to High and then pull it to low by connecting the other end of key/button to ground. So when ever a key is pressed, It gets connected to ground. The voltage across that particular pin goes from +5v to 0v. This change in voltage detects the key press.

7 6 5 4 3 2 1 0
1 1 1 1 0 0 0 0 - > F0 in hexadecimal
PB.0 = 0, O/P pin PB.5 = 1, I/P Pin
PB.1= 0, O/P pin PB.6 = 1, I/P Pin
PB.2= 0, O/P pin PB.7 = 1, I/P Pin
PB.3= 0, O/P pin PB.8 = 1, I/P Pin
DDRB = 0x0F; //Lower Higher 4pins(0000) are directed as input pins.
PORTB = 0xFF; //Setting Input pins as high to detect a key press.
key = PINB && 0xF0; // key = F0 && F0 = F0 if no key pressed, loop continues until it detects.
// Assuming PB.7 is pressed then key = 0x70 && F0 = ox70, loop stops.
}while(key == 0xF0);

Sample Code:
I have defined this as an header file in my program.
mybutton.h -> https://docs.google.com/document/d/1MLIU19IGr1liBq...

Congrats ! You Completed step3, Now lets prototype and build it.

Step 4: Prototyping on Bread Board

You can find snapshots of prototyping it on breadboard.

Codes Download Link:
Download the entire RAR file. It contains the code, all required header files and complete HEX file. This project is ready to Burn on your AVR.
If you choose to start right from scratch, then you better include all header files that is included in this project.
It has been tested and works 100% Accurate.


Take a look at the snaps for any references, I have encased it in a small box to get the feel of a remote.

All The Best ! Do build it. Start with TimeLapse.

Few tips to set intervals for your timelapse.
* For TL of 1s ->> (if interval = 5s), PICS = 24*1 or 30*1 = 24 or 30 pics, (at 24fps or 30fps respectively)
i.e., For a 24fps Video you will set 5s interval and click 24 pics, For a 30fps Video you will take 30 pics. (Time Consumed will be 24 pics * 5s = 120 Seconds or 30 pics * 5s = 150 Seconds )

* For TL of 10s ->> (if interval = 5s), PICS =24*10 or 30*10 = 240 or 300 pics, (at 24fps or 30fps respectively)
i.e., For a 24fps Video you will to set 10s interval and click 240 pics, For a 30fps Video you will take 300 pics. (Time Consumed will be 240 pics* 5s = 1200 seconds or 300 pics *5s = 1500 Seconds )

* For TL of 1min ->>(if interval = 5s), PICS = 24*60 or 30*60 = 1440 or 1800 pics, (at 24fps or 30fps respectively)
i.e., For a 24fps Video you will to set 10s interval and click 1440 pics, For a 30fps Video you will take 1800 pics. (Time Consumed will be 1440 pics * 5s = 7200 seconds or 1800 pics * 5s = 9000 Seconds )

In general,
At 24 fps, pics to be clicked, PICS = 24 * (Video Duration Reqd(s)), Applies to min and hrs also.
Time Consumption (s) = 24 * (Video Duration Reqd ()) * (Interval Set in s), Applies to min and hrs also.

At 30 fps, pics to be clicked, PICS = 30 * (Video Duration Reqd(s)), Applies to min and hrs also.
Time Consumption(s) = 30 * (Video Duration Reqd(s)) * (Interval Set in s), Applies to min and hrs also.

<p>Hey thanks man, congratulations, it's an excellent DIY project and i really appreciate that. I have a question, on your .rar the myctimer.h file is empty, i'm been trying to change from english to spanish for mi convenience. My problem is when i'm simulating in proteus it doesn't work by the same way as if I used your intervalometer.hex file included on the rar. Can you refresh your link with the correct myctimer.h file please?</p>
<p>My friend, thanks for trying to build it. I appreciate it :) .</p><p>You <br> don't need myctimer.h file. It was an empty file, Its not required at <br>all, I apologize for that. The link has been updated (just removed <br>myctimer.h and added jack pic).</p><p>Try to stick to logic that I have used, It should work the way as mine works.</p><p>These <br> circuits which requires MMI (Man Machine Interface) they don't work <br>properly on simulators, It may lead to unexpected results. (Hoping that <br>you got it what I am trying to tell u.) </p><p>I have no idea on Proteus (Do let me know about it, ok ?). Just try it on breadboard you should be able to get expected results.</p>
<p>I finished it bro :D !!! thank you very much, my problem was solved changing the instruction #define F_CPU 4000000UL before #include &lt;util/delay.h&gt; this because i'm using ATMELStudio 6 and not AVRStudio 4, which is your case.</p><p>About simulating on proteus (ISIS), the result is the same if I try it on the breadboard. So if someone want to skip the breadboard step, be sure of the correct components operation (e.g: Set the MCU clock at 4MHz, connect the circuit, the LCD and the buttons properly, use all the material needed for the schematic,etc) and the expected results.</p><p> i'm very thankful for your help and your time, I hope you can do more DIY proyects :) </p>
Hi, <br>How to arduino?
The code here is custom, Just use AVR studio to compile it and do the flashing/burning through Arduino. Just follow the Arduino as ISP you will get know. <br>(I have given the HEX file, just use that to flash it to your Fresh ATmega8) <br> <br> http://arduino.cc/en/Tutorial/ArduinoToBreadboard <br> <br>If you want to build it using ardunio then you will have to understand the logic and then write the code yourself my friend.
<p>Hi, thanks for the project, saved me having to buy one lol</p>

About This Instructable




More by jajmeri:DIY Intervalometer for canon DLSRs 
Add instructable to: