Are you getting excited, desperate to try out the new toy?
We are almost finished with the prototype controller but without the program its not going to do a lot, in fact it’s not going to do anything.
Before you upload the program you need to install a library to control the LCD display, this rather excellent piece of work has been created for you by Dale Wentz and you can find out more in the Arduino Playground
There is a tiny bug in the library code which has not as yet been updated, so to save explaining how to fix it I have included the fixed library along with my program.
First thing you need to do is grab the Camera Controller Program and save it to your desktop or other easy to find place.
Inside the zip file you will find 2 folders, CamConV2 is the actual program for the controller, which needs to be copied to your Arduino sketches folder – In windows the default directory is My Documents/arduino/ Unfortunately I have no idea about Macs and Linux because I have never used one, but wherever the default sketches folder is on your system that’s where to copy the CamConV2 folder and its contents
The other folder is LCDi2cR and contains the LCD library code, this folder and its contents should be copied into the libraries folder in the default Arduino sketches folder. If the libraries folder is not there just create it first.
OK, the moment of truth is upon us, time to program the controller.
Start up the Arduino software and select File – Sketchbook – CamConV2. You should be presented with the program in a new window. I am assuming you have the Arduino plugged into the USB port on the computer and everything is ready to go, I did tell you previously that you should install the software and successfully upload the blink demo to the Arduino.
Now select File – Upload to IO Board, the lights on the Arduino should have a fit, and then you should get a message appear on the LCD, then the main menu. If you don’t get any error messages on your computer screen and don’t get a menu displayed on your LCD display it would be a good idea to pull the plug on the controller and check your connections again
If you do end up with a menu appearing on your LCD then things are indeed looking good, if you have made a sensor or two things are looking even better. I guess an attempt at describing how this thing works is now in order.
First of all the controls, you either have a keypad or 5 buttons hooked up, either way there are only 5 ‘keys’ used.
- Keys 1 – 4 select the various options displayed on the screen.
- Key 2 is also the ‘UP’ key when entering numbers
- Key 3 is also the ‘DOWN’ key when entering numbers
- Key 5 is the enter key (on the keypad its key 5 get it?)
- Also ‘EXIT or QUIT’ key when indicated on the LCD
- Also ‘NEXT PAGE’ key when navigating menus
- Also moves to next number entry field when entering multiple numbers (times)
When the unit first powers up you are presented with the main menu, this has 2 pages and includes the following items (menu pages will wrap round to the first page):
- Page 1
- 1 Sensor – Runs the 1 sensor mode
- Cross Beam – Runs the cross beam mode
- Directional – Runs the directional dual sensor mode
- Interval Timer – Starts the interval timer
- Page 2
- Manual Shoot – Allows you to manually trigger the outputs via a key press
- Shutter lag – Measures your cameras shutter lag
- Settings – Enter the settings menu
Each of the different modes have different requirements for sensors etc, obviously 1 Sensor mode only needs sensor 1 configuring. Cross beam and Directional will need 2 sensors configuring. Interval timer and Manual Shoot don’t need any sensors and measure shutter lag needs sensor 1 configuring.
The Shutter lag option works by firing your camera and measuring the time to the flash firing, its probably not fantastically accurate but may help when determining delays etc. To use it you need an optical sensor such as laser trip wire in sensor 1 input, configure the sensor to trigger if higher, set the value as low as you can go (use option 4 to check the ambient) Then connect up the camera (or set it up for infra red control), manual focus, flash on (preferably manual lowest power), aim the flash directly at the sensor from about a meter away and hit 1 to measure.
To configure the sensors (and other settings) you enter the settings menu which has the following items:
- Page 1
- Sensor 1
- Trig if higher / Lower
- Determines whether the sensor value has to be higher or lower than the trigger value. The current setting is enclosed in [ ] brackets
- Value
- This is the trigger value, should be set close(ish) to the non triggering value
- View realtime
- Displays the lowest, current and highest sensor values detected, use this to determine what value needs to be set above, or to ensure sensor/ reflector are lined up correctly etc
- Trig if higher / Lower
- Sensor 2
- Same as sensor 1
- Output 1
- Delay
- This is the delay between the sensor detecting something and the output firing. For example when photographing water splashes you would enter a delay here that gives the drop time to hit the water and splash back up before taking the photo.
- Time
- This is the duration of the output in hours, minutes, seconds and milliseconds with a maximum time of 12 hours. You can use this to take long exposure shots with camera in bulb mode, or you could set your camera to continuous shooting mode and take several rapid shots.
- Delay
- Output 2
- Same as output 1
- Sensor 1
- Page 2
- Number of frames
- The number of frames to be shot, you can exit before by using ENTER/ EXIT key
- Direction time
- The maximum time allowed between sensor 1 detecting and sensor 2 detecting. The direction mode works by waiting for a trigger on sensor 1 and then checking sensor 2 for a trigger, if sensor 2 is triggered within the set time then the outputs are fired otherwise it goes back to waiting on sensor 1. This allows you to set up 2 laser trip wires parallel to each other some distance apart, the camera will take a picture when sensor 2 triggers but only if sensor 1 was tripped first and therefore the object is moving in the direction of sensor 2 from sensor 1.
- Interval time
- The time between frames and is active in all the modes except manual, so if you set this to 1 minute even sensor modes will not take more than a maximum of 1 frame per minute. The interval time is in hh:mm:ss:ms format up to 12 hours all but 1 ms.
- Offset Delay
- This delay (0-1000ms) is added to the output delay for each frame. It will allow you to create animations of things like water splashes by taking successive frames at a slightly later time each frame.
- Number of frames
- Page 3
- Output 1 mode
- Sets the way output 1 works with the current option enclosed in [ ] brackets
- Wired – using a wired lead to fire camera (or flash)
- Infra red – Using Nikon IR remote emulation
- Sets the way output 1 works with the current option enclosed in [ ] brackets
- Backlight
- Lets you set the backlight mode with current option enclosed in [ ] brackets.
- Off – No backlight used
- On – Backlight is permanently on
- Timed (5-60s) comes on for the set time when any key is pressed then goes out.
- Lets you set the backlight mode with current option enclosed in [ ] brackets.
- Main Menu
- Returns to the main menu.
- Output 1 mode
There are a couple of things to be aware of:
When using Infra Red control mode you cannot use bulb mode on the camera, you should set the camera to a manual or auto exposure otherwise the camera will open the shutter and not close it again. So at the moment at least you cannot do long exposures with IR
Both outputs are fired every trigger event, although not necessarily at the same time nor for the same duration. You can use a camera or flash on either or both outputs so you could for instance use 2 cameras take stereo photos or 2 flashes to create double exposures with very small time differences etc
If your flash has a strobe effect (Nikon SB800/ SB900 etc) you can set the output to a longer duration to take strobe effect photos.
If an output with a flash has too short an Output Time the flash may not fire, use trial and error to find the minimum duration needed for your flash.
Cameras should preferably be set to manual focus, the controller has no means of detecting if auto focus has finished so for autofocus use you will need to increase the Output Time to allow the camera enough time to focus. Given that the controller is geared toward detecting an object at a specific place I don’t think autofocus is really an issue.
Some flash guns can have very high voltages on their PC sync/ hot shoe connectors and if so could fry the 4N35 opto coupler, if this is an issue contact me and I will try to sort out a more robust output isolator for you.
Next version of the software will hopefully save all the settings to Flash memory to cut down the workload setting it up each time
Finally, I am by no means a expert programmer as you will probably be able to tell from the spaghetti code, if you are (or at least better than me) and have any suggestions for improving the code PLEASE do let me know.
Well that’s about it for now, next part I will cover connecting cameras and flash guns to the outputs so you can really start to use the thing in anger.
Part Seven – Outputs is coming soon, watch this space..
Tags: Arduino, DIY, Electronics, Photography








Great work, congratulations and thanks for sharing it with us.
Jesus: You are welcome, it’s not over yet though. I will be covering putting this together on veroboard with Arduino pro mini so you can put it all in a project case next, also a sound sensor circuit for balloon bursting type photos.
Watch this space
This is great , I have already built one project with the ardunio using a photogate , and also built the Hi-viz light and sound unit before that , and I was looking for a decent laser system , looks like I have found it. Have you thought about making a PDF file , black backgrounds play havoc with my eyes lol
thanks for your hard work
Thanks, the laser detector works very well. I originally used an LDR to detect the reflected light which worked quite well also but the photo transistor response is obviously way faster.
As for the colours, I haven’t any plans to produce a PDF but there is a solution to 99% of dark backgrounds if you don’t like them.. Get firefox browser; go to Tools menu, options; select the content tab; click colours; select your preferred text and background colours and remove the tick from ‘Allow pages to choose their own colours’ and voilà, no more dark background
You could also just highlight the text and copy & paste it into a notepad/ wordpad file
Hi
I stumbled into your Website a few weeks ago,whilst researching a controller for my son.
After reading your instructions I decided to give it a go
Ordered everything as per your instructions, then when everything arrived set about building the unit
3 days later and wooohoo it works
He is now the envy of all his pall’s at college
Crackin project, with clear instructions
Big thanks
Alan H
Fantastic
You are the first person to let me know you have re-created the controller and I am really pleased you found it worthwhile.
The project is not complete yet and I am hoping to get the next stage, the portable version, done early in the new year. Building the portable version using the Arduino pro mini will involve a bit more electronics as the on board regulator is not quite up to the job of powering everything, I now have all the components needed but I have just changed address so they are temporarily lost in the piles of yet to be unpacked boxes and with Christmas approaching fast I don’t have time at the moment.
Ask your son to pass on the website URL to his pals
Thanks to Barry for pointing out a bug in the program.
When changing backlight mode the program hung. To fix it re-download the program which is now fixed or if you want to change it manually, find the following line (near line 440):
if (page>=21 && page< =29) page=int((page-21)/4)+10;
and change it to:
if (page>=21 && page<=30) page=int((page-21)/4)+10;
Then upload to the Arduino.
Amazing! Was really wanting to dabble with droplet photography and other perfectly-timed subjects. Anxious to dust off my soldering/electronics skills and build this puppy! Thanks so much for sharing your project, and your test photos are wicked!!
Just to say thanks for publishing such a great project. I have just finished the main box and 1st sensor and need to get my head round the cross beam sensors. I have adapted your sketch to make use of a 4×3 keyboard and made it more menu based.
Photos of my work so far at http://www.flickr.com/photos/15498653@N08/sets/72157623843176383/
You are welcome.
Actually my design used the 3X4 keypad, but I wanted to fit it all into as small a box as possible so decided to use push buttons instead.
Well done! Did something similar myself using microchip PIC and found your page while I was thinking of revisiting the project. I used opto isolators on my version too and found that I had to add diodes to stop them blowing due to the voltage spikes when turning them off. Have you had this problem?
Anyway I never did get round to writing a progressive delay program to add to my chip so I better get back to it
Did you ever write section 7 and did you make up the kit of parts? I think the project looks great, just what I want but a bit beyond my skills!
No I didn’t write up section 7, I have moved house 3 times since then and have had too many things going on to spare time on it.
I have not really had that much interest shown in it, in fact you are the first person to ask about part 7, so it is not exactly a high priority for me and there is little chance of me making a kit of parts without there being a fair bit of interest – I would have to buy in bulk and split the lots, I don’t want to end up with loads of components I will never use
Sorry
Hi Louise
Interesting project!!
I couple of questions if I may:
- The setup of the LCD includes LCDi2cR lcd = LCDi2cR(4,40,0×63,0); but it looks like you have the same LCD as me i.e. 4 x 20 characters. Any reason for the reference to 40?
- I am using the same LCD library as you. This library includes a command to obtain a value from the keypad – lcd.keypad() – but I see that you have included your own code in the sketch. Was there a reason for this?
I ask because I am having problems with false characters being read when no key is pushed – I might try your code if that is OK.
Cheers
Hi Shane,
I have not worked on this project for quite a while so it is not fresh in my mind but I would say the setup is just a typo – although it does not appear to make any difference.
As for the key reading, I used my own code in order to incorporate a debounce and custom repeat. If the key is held down it goes into repeat mode for increasing/ decreasing the values quickly.
The code is rather untidy, it was the first project I have done with the Arduino so I was learning the syntax & language as I wrote it, if you wish to make use of any of the code and/ or modify it then please feel free to do so.
Thanks Louise, I am also learning the programming language for the first time, although I have done some Pascal programming many years ago.
I can learn a lot by looking at existing sketches and using bits that fit my needs – yours has been very helpful. I also like the ‘get_value’ routine for increasing/decreasing numbers!!
Cheers
My programming days were a long time ago, I used to program 68000 assembly language back in the days of the Amiga 500, not exactly much in the way of any similarities to programming the Arduino LOL
I see that you have had a lot of other things to do since you posted the last post, and that you have had very few requests about the following chapters, but I am wondering if you are at least thinking about publishing the final parts of this excellent build?
I may do so, but at the moment I do not know when.
The internet is a wonderful thing…
I have been looking for someone to share how to build something just like this. I have just ordered myself one of the kits supplied by hi-viz, but I can see myself upgrading to your design. I am guessing it would be possible to add some code to also control a solenoid to do timed water drops for some perfect collision shots
Thanks for taking the time to post these excellent articles, I will let you know when I have built my own
It would not take a huge amount of work to add in a double trigger – I assume that is what you are referring to in order to create collision drops.
There is two timers running as it is so you could modify one of those to a double trigger without much effort
By the way, SUPERB website, and some truly spectacular photographs!
Its finished, and what’s more it works!
I got a collision shot on my 2nd photograph, and 2 more very similar ones with the next two shots taken. I have only had about half an hour to play with this with my full setup, but I have managed to shoot a little sequence of shots to make a very simple animation on a water drop collision.
http://www.flickr.com/photos/bambi72/5252290531/
My edited version of your script is now up on my website, although I have added a new ‘drain water reservoir’ option to help reduce the mess in the kitchen, this version isn’t uploaded yet but will be soon.
Fantastic Bambi!
I am so pleased you got it working, and the results are pretty awesome already, I can’t wait to see the results when you start working on composition etc.
You have done a superb job updating the code and I am sure there will be plenty of people who will appreciate everything you have done
great project. I am just getting started with arduino, and have been photographing for years. Hope you get time to work on part 6 and more.
Check out what Bambi has done with the controller http://bambi.ws/
He has modified the program to allow control of a solenoid valve and create timed drops for collision shots as well as a few other refinements, there are some absolutely superb examples on his website
I have been tweaking again, and have yet another re-write of the script purely for water drops.
the script will now send the settings for each frame taken via the COM port, and with the help of a great little program, Gobetwino, save this data to a .csv file to be imported into excel. You should be able to match up nice looking shots to settings now, without having to write them all down on post-it notes. Louise, you really unleashed the inner geek in me with this project.
Added individual settings for each drop from the solenoid for size and delay before the next drop, which can be incremented with every frame. An automatic mode for taking long sequences of shots. There is no need to use a sensor with this re-hash of the code, although I do want to put it all back together again with your original script. I have added a mirror lockup feature for canon cameras, which now works as it should. Finally I have added DropExif
P.S I now have close to 2000 drop shots on my pc and most of them are collisions, so your kit definitely works.
Excuse me, but was it not you who was unsure if you could do anything with the code when you first contacted me?
It would seem you have been bitten by the arduino bug LOL You have to admit they really are quite amazing little gadgets
Have you seen the price of the commercial controller capable of timed drops and collisions – I think the time invested in finding your way around the arduino is a much better investment
Google knows all…..
Just go’s to show that you shouldn’t be daunted by this project, if you can solder two wires together, you can do it. It does look very scary when you first start it, what with programming, lcd displays, compiling and uploading. At the end of the day its just following instructions and clicking a mouse. You will also learn so much in doing it yourself.
One thing I keep forgetting to mention is, if you are doing water drops and want to use a sensor to to detect the drops, use one of Louise’s laser trip wires. I had way more luck than with a IR photo-gate. Just point the laser direct at the detector rather than bouncing it. (Check e-bay regularly for laser modules, I paid £3.99 for two inc postage)
Hi
Iam new to all this emailing (as a siver suffer) but love Photgraphy and came agross your site Lovvvvvvvvvve IT, Iam starting to Collecting all the parts and if it ago to plan it will be great . But reading the comments I should be ok and the instruction are very will written.
I have also been looking for the one on the veroboard with Arduino pro mini so you can put it all in a project case, but no luck in finding the website or have I missed it.
if someone gets this ! Can anyone let me know