Printing an Image in water: Programming

I'm not sure if this is the right place to put it, but my specific question is how i'd go about a little idea I had.

I would have water falling down from a height of 6 feet or so, but the water would be passing through 20 or so individual micro solenoid valves in a line. These valves would open/close to create an image within the falling water. Kind of like an inkjet printer, with the paper being replaced with water, and the print heads would be the solenoid valves.

I could analyze an image myself and write a bunch of commands to activate the solenoids to produce an image in the water, but I was hoping I could write a program that would take am image and boss the solenoids around for me.

Well, I was wondering how I'd go about writing a program to take a bitmap image, and "read" each row or so of resolution and send it to the arduino via serial link to the solenoids?

My thoughts are that I'd "map" an image with as many vertical columns as i have solenoids, and as many horizontal rows as i need (depending on the rate of the falling water and the responsiveness of the solenoid valves) and "assigning" a solenoid to each column to "print" each row as necessary, with the delay between each print-row at a reasonable rate.

I've seen things like this done, where a programmer can use an image to manipulate hardware.


Can somebody point me in the right direction as what programming language I'd use and what forum to bother?
The sketchduino was written in, and I was also thinking of talking to the people over at Processing, as many of them interface with the arduino.

Other than pointing me in the right direction, can anybody agree that this idea is feasible? (I'm not extremely experienced with development programming and I'm not sure if "mapping" an image like this is even possible.

Thanks for reading.

Processing is probably a good choice since a lot of graphics analysis is involved, graphics is one of the strong sides of Prosessing.

Yes, it is possible, and I would investigate using Processing to do it; I am sure there is a way to do it using Processing (how, I don’t know - I do most of my development work in either PHP, Perl, or Python).

Something else to keep in mind is how you are going to see the droplets - you might want to put a dark background behind the droplets, then use backlighting or a strobe light (properly timed, of course).

This project will get complex pretty quickly! Good luck! :slight_smile:

then use backlighting or a strobe light (properly timed, of course).

If you use RGD LEDs, you could synchronize the color to the image, and reproduce the color, too.

That's a neat idea. If I have it right I'd be more concerned about the physics than the graphics processing.

As a thought experiment think of it as 22 nozzles across the top of the frame maybe an inch apart and the frame 24 inches high. A drop of water would take about 1/3 sec to fall from top to bottom so you'd have to paint your picture over a period of 1/3 sec and then allow 1/3 sec for the frame to clear.

Sticking with the 20-ish for resolution you'd have to switch the valve every 18ms. You also need your drop or stream to start within the 18 ms.

I dunno, I love the idea but the timing seems tricky.

can anybody agree that this idea is feasible?

Certainly feasible.

The other thing to keep in mind is that as the drop is falling, it is accelerating as well - so the "pixels" will spread vertically toward the bottom of the display (catch basin - which, btw, should be a trough with mesh screening to lessen splashing and water loss).

I bet you could also space the holes closer by using a piece of pipe (3/4 inch pipe) with the holes drilled in it about 0.5 inch apart; drill each hole with a smaller diameter drill (say 0.125 inch) completely thru the pipe, then on one side only, widen all the hole with say a 0.25 inch drill. Install into each 0.25 inch hole a small bit of steel tubing, that extends thru the pipe wall and comes within 0.0625 inches of the opposite side, while leaving a bit outside the pipe; solder or jb-weld the steel tubing in place (don't get any solder/jb-weld inside the tubing, it must be clean). Cap off one end of the pipe, and add a fitting to the other end to hook up tubing to your water pump.

Now what you need is some flexible PTFE rod the same diameter as the tubing. Trim up one end of the rod so that it is chamfered, nearly a point. Insert this end into the tubing. The other end should be connected to a solenoid (with a very short stroke, less than 0.5 inch), and the solenoids should be mounted such that every other one is on the opposite side of the pipe, and not interfering with each other (I leave this mounting exercise to the builder).

Basically, you should end up with a (probably leaky!) multi-valve tube; energizing a solenoid briefly will unseat the chamfered end from the smaller hole, allow water (under pressure from the pump and height) to exit. Driving these solenoids wouldn't be easy with an Arduino, but it should be possible (lotsa shift-registers and latches?).

Certainly feasible.

stunnig. The “resolution” is best at the top and they deal with that creatively. I think this would be great fun.

There are lots of image manipulation libraries. But if you do not want to bother with them, use a graphics program (like GIMP) to convert your pictures to PBM

P1 is most probably the most simple to parse format. Since you most probably can switch the "pixels" only on and off it also is a perfect match for your "color" space.

Cheers, Udo

Thanks for suck great help, guys!

To Udo: You idea seemed simplest, but that would be an assumption because I don't follow completely. After I convert the image into pbm, how would I view it in it's format (i.e. plain text)? Of course, I can open it with GIMP but it would show the image as an image and not in text.

A small kink, hope you can help me iron it out.

To all: does anyone know how responsive an ordinary micro solenoid is? Anybody know where I can buy them in bulk? :slight_smile:

You open it in gimp and save it in the PBM format. Then you can view it with a text editor or push it through the serial interface into the Arduino.

Instead of Gimp you could use any other converter that supports this format.

Cheers, Udo

I've tried using gimp, with very limited success.

When I try to open the newly created .pbm file with a text editor such as notepad ore notepad++, it seems as if the rows and columns don't come out in the correct fashion.

Have you had success with this, and if so, care to share a quick little shorthand how-to?

I use Gimp 2.6.6. When I save a PBM file it asks if I want to save “raw” or “ascii”. If I chose ascii it looks as expected in a text editor.

Cheers, Udo

Great, I'm tearing my hair out now for something that should be so simple.

I've converted it to pbm format:

save a black and white file in paint, I simple wrote "HI" in black
Opened with GIMP, saved to pbm, acsii.

I open it in notepad and the rows and columns don't align accordingly, but using the first two set of numbers given by the pbm format (rows/columns) I "format" the "pixels" manually. I see 1's, I see zero's. But the arrangement in illegible. I've tried to open with open office, and it recognizes the pbm format as something else and in turn, I get a weird photo.

Which text editor do you use?

Linux: kate / kwrite / gedit / vi
Windows: notepad++

Sorry for the bombardment of questions. I use notepad ++, is there a certain settings/preferences you have to change? (in truth, I want to see if i can widen the #characters per line or something.

In any way, would it be possible for you to e-mail me an example .pbm file? I'm trying to comb through each step of my process to figure out where things are going wrong.

If you do, I'll e-mail you a funny picture in return :smiley:

Did you read the documantation Netpbm - Wikipedia? Did you ever try it with a small picture? (Say 20*20 pixels)

If so: what exactly is "illegible"?
What exactly do you mean with "widen the #characters" per line?

Cheers, Udo