Large scale DOT Matrix printer

 

Have you ever wanted to write large letters on a public area such as a pavement or park? Well, if you answed yes to that then you may choose to spray paint your desired sentiment using traditional graffiti artist methods which has two distinct disadvantages. Firstly, unless you are very good at spraying text it will look awful, especially if it is dark and you are doing it by torchlight, secondally it is slow and the risk of getting caught spraying your message is high.

While I dont really have any desire to spray text by torchlight on a public area, I needed a suitably interesting project to teach myself PIC Microcontrollers and decided this was vaguely in the right direction.

After looking into various other versions of this, firstly the infamous "Institute for Applied Autonomy" and their beast - an RC car with 5 spray cans strapped to the back of it. They also produced a trailer version with spray jets poking out the bottom, which is very similar to the design I am going to be showing here. There was also a few other bits I stumbled across, thanks to Hack-A-Day : This one here (Khoa's design).

Anyway, I decided that spray paint was expensive and was also rubbish at spraying downwards as the sparge pipe is not in the paint, thus you get mainly gas coming out rather than paint. Plus, you have to make some convaluted actuation method for the nozzle on top. So, I settled fairly early on to have a central resevoir of paint, pressurised by some means. This can then feed via some kind of solonoid valves to a spray bar with the nozzles on to fire the paint at the ground. This left two problems : Solonoids or some sort of direct acting (quick) valve and a pressurised paint resevoir.

To cut a long story shorter, I had many failed designs of pincher valves, which grip the pipe to stop the flow of paint so I resorted to asking my father, who used to sell industrial valves for a living for advice (a dangerous thing to do generally). He managed to buy, for a very reasonable sum, 8 12vDC direct acting 1/4"BSP solonoid valves from the lovely Tony at Grange Controls (if you want any solonoid valves, ask him!). This was the only part of this project that was bought, the rest is all homebrew of the highest standard.

The next stage was to build a spray bar and back axle affair. I seem to of lost any photos of the construction of this bit, but basically it consisted of buying (yes buying again...) 3 inflatable wheelbarrow style wheels from InExcess - a shop here in Salisbury which deals in all sorts of random crap. They were only £2.95 each though, so fair doos. Anyway, I mounted these on each end of a 3 foot bit of 13mm steel rod, of which I turned each end down to 12mm on our lathe to fit the wheels on (they had bearings in already).

Next I built a cross member and spray bar adjustable mounts. I made the spray bar adjustable up and down by having a parallel set of bars on each end. The final pictures explain all this much better. I spent ages complicating everything by trying to impliment stepper motors to adjust the height of the spray bar. This failed eventually purely due to the small nylon gears I aquired from Rapid ages ago not being up to the task at all.

 

 

I mounted each solonoid valve on an old PCI blanking plate and hung it over the spray bar. I then made up a manifold from block steel, tapping a 1/4 BSP thread into each port. This had 9 ports, 6 on the top, 1 each end and one on the back. The rear one is to feed in the pressurised paint and the other 8 are to feed into the solonoids on the rear spray bar.

So far we have a rear axle with a apray bar on an adjustable parallel set of bars with 8 solonoids hanging off it. I then proceded to build an incredibly heath robinson A frame to the front wheel which had to be powered to pull the whole monstrosity along. This was powered by mouting a geared down motor I had lying around to a piece or wood and the shaft being connected to a piece of broom handle.

 

That then rubbed against the wheel, forcing it around. I made the platform with the motor on sprung towards another bit of wood with the wheel mounted on, see the last pictures for instant understanding of this, I am crap at taking "in progress" pictures and its far harder to explain this, Plus I am sure you would rather look at pictures than listen to me waffle.

Right, to the meat of the project. 2 things left, a paint container and the electronics. Since I was only really building this to perfect the electronics I simply banged a hole in the bottom of a fire extingusher, tapped a 1/4BSP thread into it and called that my resevoir. I mounted another fitting to the top of the extingusher (which have nice screw caps BTW) and fed this into a rather intersting affair:

This monstrosity is actually an old gas bottle and a Acetylene regulator which, by some strange coincedance, fits buitifully into the gas bottle (which was empty btw). Removing a blanking plug on the regulator allowed a new tapping into the high pressure side of the regulator. This is the "Air In" on the right of the picture. This fills the bottle up with compressed air from my main compressor in the garage (110 PSI). Next the regulator can give a perfect 5 - 30PSI output which can be fed into the top of the fire extingusher, pushing the paint or water out the hole in the bottom, which feeds into the manifold above and out to the 8 valves. We now have something which looks like this:

 

Minus the electrics. The piping is 8mm tubing with 1/4BSP push fit connectors which work a treat. I can now fill the extingusher with water, the gas bottle with air and by applying 12v to any of the valves I can jet out water. The thing also rolls along slowlyish by powering the motor on the front. wonderful.

Right, all that mechanical nonsence out the way, time for some electronics (*swaps hats*). I decided that the electronics must do 4 key things: Allow the jets to be primed, Have multiple messages available, be reprogrammable and space the letters evenly (be tied to the motion of the vehicle).

 

I decided to house everything in an old "Z4 Nuclear / Biological / Chemical" test set box which I aquired from somewhere ages ago (ebay at a guess). It adds a nice zany effect to it all. It featured a push button, a 3 position rotory switch and a 12 position rotory switch. It also had 5 screw down terminals and a strange MOD style connector on the side. I quickly rejigged it for my needs, I fitted an equally strange MOD connector in place of the one that was there as I had the matching female version of my one, and another connector at the other end for reprogramming purposes. I decided to use the 12 position rotory switch for message selection and the 3 position for off/prime/message selection. The push button being the GO button. easy.

I was going to use the PIC 16F876A uC for this as I had a few (thx microchip) and it had roughly the correct number of I/O and goodies on board. After a afternoon of etching and soldering I had this sat on my desk:

This works as follows: Port C is the relays (2n2222 transistored and reverse EMF protected) + leds. Port A is disused apart from RA0 which goes into a resistor network switched between by the 12 position rotary switch, being an analogue input I could evaluate the voltage here to deturmine which position the switch was in. 12 selector switch from one I/O! Port B is the other switches and buttons on the box. There is the good old 7805 behind the heatsink there.

For the reprogramming requirement I cheated a bit, the little grey connector is all the ICSP pins, which go to the other connector on the box. In the code I simply laid out a data table with the messages in, you simply changed these, reassembiled and pumped the hex into the pic via that port. it worked a treat and saved on a max 232 and a big headache.

Here is it all mounted in its box and looking pretty:

The lid does close fine, honest!

Now, the next issue was how to get a pulse from the wheels to let the box of tricks know when to do the next line of pixels? Firstly I went down the optical route of mounting a plastic disk to the wheel and using a light gate to detect tape stuck to the disk. this proved highly unreliable and generally rubbish due to the plastic getting easily scratched, and not propagating enough into the sensor:

 

The plastic wheel can just be seen attached to the wheel in the left picture and the sensor in the right picture.

I replaced this with a bigger plastic wheel with 6 small magnet stuck to it and a reed switch in that green box. This worked very well and proved much more reliable.

 

 

Coding this thing in assembily actually proved very enjoyable and not too challenging. I decided not to use interrupts and to simply poll for things to happen. HERE (.zip) is the assembily code and PCB in CIRCAD format. The code is heavily commented if you want to have a perusle and a bitch about my coding practises...

After many a muttering about how to read pixel patterns from a giant data table (which I placed in page 2 of the program memory) which would cause massive problems if I just added the offset in W reg to the Program Counter as that is actually split across two registers (google PCLATH and you will see what I mean, it is one of the biggest problems when working with PICs - jumping across page boundries). Anyway, the 16F876A can read its own program memory, it works like this: you tell it the address you want, activate the reader, wait two cycles and the value pops into a register ready to use. Since I located the table at the beginning of page two, this made doing this really really really easy as the HIGH register for the address (14 bit address split across two registers) was a constant and the LOW bit was the offset.

The other hard bit, apart from debugging, and there was alot of hours spent playing with the MPLAB built in debugger and swearing, was the 12 position switch A-D conversion process. There was uneven gaps between the incriments, I started by simply putting the A-D value out on PORT C (the relay and leds) and jotting down the values. It was horrific, gap of 20 between some, 40 between others and 10 between some. The only way to transcribe the A-D value into 0 - 11 (selector position) was to add little odd bits onto the AD value until the carry bit went high. It worked but was messy.

Finally, a small word about Snubbers. The solonoids had a few tricks up their sleeve. Firstly, if the program opened them all, say for an "H" the PIC would randomly reset. This only happened with the solonoids plugged in, which considering they are relayed and fed independantly really confused me. After an hour of googling, it was suggested that I added a snubber to the relay contacts as the solonoids can add, what I name "bastard currents" which, to be blunt, really mess things up randomly and are a bitch to fix. If you ever switch mains or an inductive load with a realy, make the relay optoisolated - transistors / ULN2003 / anything else will not remove the problem of strange currents. Anyway, I had, for some reason, 10 snubbers in my capacitor bin, which along with reverse EMF diodes I fitted to all the solonoids, seemed to fix this.

Jets: I had many an argument about this, make the jets small and atomise the paint like a spray can (but block easily) or make them big to just dump the paint on the ground. I was in favour of the latter, but either way, it resulted in a huge mess.

The Result:

As can be seen, it works 100%, it just makes a huge mess. Also, emulsion paint is a mission to get off tarmac. I lost interest in this around here as I had perfected the electronics, which is what I had set out to do and I now have a large paint splattered monstrosity in my garage. Plus I bought a BMW and have spent the last week putting a bitchin sound system in that, a teenager has to have his priorities!

What next I hear you not ask? I will definanly be dumping the conviluted and insanely heavy wooden chassis of this, and will most likely try and build a portable device in a suitcase with a trigger leaver in the handle... who knows....

This was my first PIC project (ok i have built some others but with other peoples code) - but expect more - see the todo page for an insight...