Hello everyone. I am working with water drop photography. I built a laser tripped camera release, and it works quite well, but am looking to fine tune it. In the code, I originally had a delay ( delay (305) ) before the camera trigger. This worked ok for a while, then while changing drip distance to splash zone, I had to keep running to the computer to change the delay value, trial and error. I finally took out the delay, and put in a 100k potentiometer. While this works...it is very very sensitive to fine tune. I was considering something like a 10 turn vernier pot, with turn counter, instead of the 100k radio shack pot.
Do you think this would be a good idea? any recommendations on any other solutions or type of vernier pot to use?
Thanks for the help.
Steve
Here is my sketch:
/* Laser camera trigger.
*/
int potPin = 2; // pot to adjust splash timing
int val = 0; // variable value coming from the pot
void loop(){
if(analogRead(0) <880){ //set for ambient light was 880
digitalWrite(10, HIGH); // LED
val = analogRead(potPin); // read the value from the sensor this command can be removed
delay(val); // set this delay for drop from nozzle to splash was 305 before pot installed
digitalWrite(12, HIGH);
delay(25); // was 10
} else{
digitalWrite(10, LOW);
digitalWrite(12, LOW);
}
}
Is delay from 0 to 1023 enough for your needs?
Maybe get rid of the pot, and just a couple of buttons to increment/decrement 'val'.
(or, Rotary encoder).
Then 'val' will not be subject to jitters of reading an analog pot.
If you need it more sensitive, you can switch to delayMicroseconds() for finer tuning.
1023 would be more then enough. I was using 305 for the base timing. Push buttons would be good, but I would really like to have something that I can read, to record the setting, such as a counting dial, so when I go back to a particular set distance, just dial in and fine tune.
Thanks
errrr.. I am electronically stupid, and that sounds more involved than I would like to go. But a secondary question...I have a 100k pot in my project, would a pot of a different value, say 100 ohm be any less sensitive to movement?
Thanks...
If you have ground on one side and 5V on the other side with the wiper connected to the arduino the value won't make a difference at all. A 100 ohm pot would use a bit more power, but that is it.
If you want less sensitivity you want to get a pot with more turns. Alternatively you could do the same thing with buttons, or use two pots for a coarse and fine adjustment. You might also consider adding a lock button that locks in the settings so that jitter doesn't throw off a good setting.
Yes 100 K 10 Turn pots with turn counters are available (Not real inexpensive but available surplus) and NO a 100 Ohm pot will perform at about 1/1000th of the 'settability' of a bare 100 K pot. As to the other alternatives there is the thought that when you are a hammer, Everything looks . like a nail. I re-read the OP's description and he asks about a vernier dial for a potentiometer... NOT for idea's for 'alternative' methods
Caps are great for analog filtering. Also Radioshack used to sell Vernier pots at least a few years ago. It would however instead be differently sensitive, depending on where you need your pot to be set. I like linear pots better myself.
But I would go digital. Serial LCDs are really easy to use. You connect them to the serial port and use the arduino libraries, and you just write out strings.
ok, I put in a 10 turn 2k ohm pot, with a 15 turn vernier dial. The sensitivity is much easier to control now, and I have solid numbers to refer to. Thanks for this idea.
Steve