Display and change variable with hardware - high speed drip photography


I'm building a small device to control a solenoid valve (by reed relay), flash trigger and camera (both with opto-couplers). Its all controlled by a Nano Every. The idea is that two drops are released milliseconds apart and the flash and camera are triggered a few milliseconds later to capture the point at which the two drips collide (one bouncing up from the surface to hit the other which is still on its way down.

At the moment I have to keep going into the code to adjust the number of milliseconds multiple times during every photographic session.

Ideally I would like three 'knobs' that could be twiddled to adjust the millisecond timings of drip, flash and camera and I'd love to be able to display the settings on a nice little colour (oled?) screen.

BUT ... I'm a relative newbie and don't know where to start with the controls or the display.

Help most gratefully received!


You could use an encoder like the commonly available KY 040. Google search for "ky 040 arduino" for pages on its use. Write a program to read the encoder and output to serial monitor.

Once you have a program to read the encoder and display the result in serial monitor, pick out the display that you want. Find a library for the display and get it to work with example code from the library.

Then you should be able to incorporate the encoder and display code with your existing code.

control a solenoid valve (by reed relay)

So... The current to the solenoid valve is controlled by a reed relay? What controls the reed relay? Sounds like you can remove at least one 19th centruary mechanical device there, which should increase response times and timing accuracy significantly. A transistor such as a MOSFET should be far superior to a reed relay for this. It would respond in microseconds rather than milliseconds. Plus it won't wear out.

While a colour oled screen might sound cool, it won't actually do a better job, in any important way, than an ordinary LCD character display, which will be easier for you as a beginner, and put less strain on your Arduino's resources.

What you need to do next is show us a schematic. Hand drawn on paper is actually fine, and better than trying to use something as unsuitable as windows paint, for example. Fritzing is popular in the Arduino community, but not so popular here, but that's mainly because so many beginners use its "breadboard view" and call that a schematic, which really winds up the forum members! Use Fritzing's schematic view and you can draw a pretty good schematic.

Also, links to the various components you are using, showing their specs in terms of voltages, currents etc. Please use the insert link icon so your links can be clicked. Test your own links after posting to avoid embarrassment!

Finally, your code. Whatever you have that works so far. But use code tags please! Most forum members use smartphones and tablets and can't open a .ino attachment.

Most forum members use smartphones and tablets and can't open a .ino attachment.

Most? :astonished:

Fiddly little displays, yecch! :roll_eyes:

More to the point, if you have the IDE operating, clicking on a link activates the painfully slow IDE startup. This is nice if you seriously want to work on the code, but mostly when one looks at foreign code, it is far more convenient just to inspect it in the browser. So it needs to be in the discussion thread. :sunglasses: