Search This Blog

Showing posts with label diy. Show all posts
Showing posts with label diy. Show all posts

Thursday, 25 March 2021

 Using a Thermal Printer Mechanism

 Using a Thermal Printer Mechanism

The Casio CP-10 is a neat calculator that has a thermal printer attached. The calculator also has a built-in clock and can do useful tasks such as printing this month's calendar. The date range is also useful as it ends in 2099. The printer is a small mechanism that take standard 38mm thermal paper. I found out that the mechanism is the same one that the FP-12 printer uses. This is a small printer that is designed to attach to a variety of calculators and pocket computers.

I bought a CP-10 to see if I could re-use the printer mechanism instead of the receipt printers that I have bought off ebay in the past. They are relatively expensive (over £20) whereas the CP-10 can be had for half the price, if the CP-10 is listed as non-working. Unfortunately the CP-10 has a NiCd battery pack, as the printer mechanism take a fair current when running and the pack is used to supply that. This means that a lot of CP-10s have suffered battery leakage and failed. This is what had happened to my example. After a brief attempt to revive it I cut off the printer mechanism and attached a blue pill and some extra circuitry.


There's seven transistors, one for each thermal element, and one transistor that drives the motor. There's an input for the home position switch as well. The mechanism has a tachometer output that gives a series of pulses as a magnet rotates near a coil. The magnet is attached to the motor, so this arrangement gives a reading of the motor speed. The pulse may also be used for dot timing. Unfortunately my mechanism seems to have a broken tachometer output. The coil reads 25M resistance, which is a bit high for a coil of wire. (I have since bought a second CP-10, this one shows signs of life and its coil reads 82R, so is much healthier). After trying my own tacho circuit, then copying the CP-10 circuit, then building a higher gain circuit with an op-amp I decided that the tacho output wasn't reliable enough to use. This may not be too much of a problem if the motor is run off a stable supply as the speed of the motor should be fixed. I should be able to time the motor moving from home position back to home position and scale the dot timings appropriately if need be.

The output from my working CP-10 is like this:


That's the calendar printout from the CP-10. The FP-12 has a print width of 20 characters, the CP-10 also seems to have a print width of 20 characters.

My first attempt at printing was a little more basic than a calculator. I turned the motor on and fired one element of the print head repeatedly:


This is a start, at least I'm getting dots. The motor drive also performs line feeds and the dots show that. The horizontal dots are the feed across the paper. the sloping dots are where the head is returning and the paper is being fed. After some work with the code, including adding a font table and using the input from the home switch, this is the output:


This is a test printout that is printing the parameters of the code that printed that section. I am also using 20 characters as the width here, simply because the mechanism is set up for it. There's a row at the top of the characters that is faint, I think this is to do with the ground wiring I have used.

There is also an interesting effect which is best shown in the lines of asterisks. They are darker on the right hand side of the line. I'm pretty sure this is down to the heating of the printhead as elements are turned on. Every time a dot is printed, the printhead warms up a bit. This means that to get an equivalent dot, you don't need to turn the element on quite as long the next time. In the printout above, I have a parameter called 'DEC_PERIOD' which controls part of my correction for this thermal heating effect. You can see that the second from bottom section has a DEC_PERIOD of 1 and the asterisks are darker to the right hand side of the line. The section above it has a DEC_PERIOD of 2 and the asterisks are printed more evenly.  The correction code counts the number of elements that have fired, accumulates those counts and uses them to create a 'temperature' for the printhead.  The DEC_PERIOD value controls the cooling of the printhead. This does lead to a working correction as can be seen above.

I think the CP-10 code must also be doing something similar, as the calendar printouts above show an even darkness across all the lines.

The CP-10 must also be correcting for supply voltage variations. It runs off four NiCd cells which will present a range of voltages to the motor and hence different speeds of printing. I have attached my working CP-10 to a power supply and varied the voltage. The time to print a line definitely changes, but the characters printed remain in the correct positions. The printout is fainter when the voltage is lower. The code could be using the tachometer signals from the mechanism. I can't do this but I could measure the time taken to print a blank line and use that to adjust the dot timings. Interestingly it appears that the CP-10 does print one blank line after it is powered on. I wonder if that is a timing line and the CP-10 is doing what I will probably have to do if I want to correct for voltage?

Next step? probably a PCB. But do I use a blue pill or STM32 chip? Given the size of the mechanism, a blue pill is a bit on the big side, so I think a chip would be better. The only problem is that there is quite a shortage of STM32s at the moment. I've got a few so that is probably OK.

There's a video here of the prototype:

 


 



Thursday, 23 April 2020

Water Level Monitor

Water Level Monitor

We've got a rainwater harvesting system that consists of a tank holding rainwater and a pump that supplies toilets and the washing machine. The system came with a mechanical water level meter which is fine, but it requires a trip to a cupboard and some hand pumping. The pumping creates high pressure air which runs in a pipe to the tank. The higher the water level in the tank, the higher the pressure. A pressure gauge in the meter shows the capacity in percentage capacity.

The reading is the height of water in the cylindrical tank. As the cross section of the tank is circular this doesn't quite represent the amount of water in the tank, but it's fairly close.

I started looking at an electrical version a few years ago. Using a pump instead of the mechanical hand operated piston was an obvious way to do this.You could then have a pressure sensor which gives you the same reading as the mechanical system.

The first problem was the pressure involved. The tank is about a meter and a half high and that leads to quite a pressure. The pump needs to generate at least this pressure and the pressure sensor needs to be able to read that pressure. I couldn't find either a pump or a pressure sensor that would work at the pressure I needed.

I left the project for a while, then I came across a cheap blood pressure monitor. This has a pump and a pressure sensor and performs a very similar task to the water level meter I wanted to create. The pressures involved looked promising as well. I dismantled the monitor and extracted the pressure sensor and pump. I reverse engineered the circuit for the sensor and recreated it on an arduino Uno format shield.



You can see the sensor below the IC, it attaches to plastic tubing.The pump drive is a power transistor driven with a PWM signal so I have speed control. If the pump is driven at full speed then it is a bit noisy. Running at a lower speed still gives a high enough air pressure and it's much much quieter.

The final system is mounted in the same cupboard next to the manual meter:



The electronics are in a 3D printed case,  the pump is on 3D printed brackets. The manual meter reads the air pressure when the pump is energised, so you can use it instead of the manual pumping system.

The manual pumping system (below the electronic system) still works exactly as it did before, so there's a backup in case the electronics fails.

The code is set up to energise the pump once an hour, it then stores up to 1000 samples which are offloaded to my laptop using a cron job. I can then graph the samples as needed.





Monday, 6 April 2020

Dehydrator Knobs

Dehydrator Knobs

To go with the new front panel, some knobs:


3D printed and then hand drilled to size so it fits nicely on the shafts. The printer didn't seem to be able to print the splines that were on the model. They stiil fit though as the hole was snug.

Saturday, 4 April 2020

Dehydrator Update

Dehydrator Update

It was time for an update to a couple aspects of the dehydrator. Firstly, the trays I made to hold the stuff to be dried needed to be replaced. they were wooden and had warped really badly:



The replacement is a metal rod and 3D printed tray which hopefully won't warp. It also has a handle in the middle of the tray so lowering it into the dehydrator is going to be a lot easier.

Whatever is being dehydrated sits on a plastic mesh so that air flows easily through the trays:


The trays look a lot better than the wooden ones and I hope they will work a lot better as well.

The second update is an engraved front panel.


Which potentiometer controls what is now obvious, as is the function of the LED. This is engraved white on black plastic sheet. I need to make some nice knobs for the pots next...


Sunday, 22 March 2020

DIY "Digital" Watch

DIY "Digital" Watch

OK, it's digital in that it's made of bits. From ebay. It's actually mechanical and uses a movement, case and strap from ebay and a couple of 3D printed movement rings to hold it all in the case. The current setup is this:



I bought really cheap parts, and had a few adventures along the way but I have finally got somewhere. I started by buying a Chinese movement that might be based on the ETA 2824, or not. I also bout a case which is better than I thought it would be, and a bracelet. I also bought some hands to fit on the movement. For some reason that I can't remember I part dismantled the movement, I can't remember why. There must have been a reason as I intended to just fit the movement in the case. Anyway, in the process I managed to shear a screw (left and thread, I though they were marked with three slots?) and lose a click spring. I have subsequently managed to make a click spring and replace the sheared off screw with a new one, and the movement works again.

While I was wondering if I'd ever fix the movement I bought another one (even cheaper than the first), as a replacement for the broken one. It was about £11 on ebay and I found out that that isn't really enough money to make a decent movement. The move expensive movement was £22 and that does seem to be enough, just). The cannon pinion never worked properly and the movement kept awful time, simply because the minute and hour hands weren't moving. I eventually gave up on this movement, I may have another go at getting it to work sometime.

At the same time as buying the second movement I bought a correct sized dial, which was very nice. Unfortunately the dial doesn't fit the dial mount on the first movement so I can't use it. I may get another one if I feel like it.

The dial is held in the case with a 3D printed ring, you can see it in the photo above. The movement is also held in place with a 3D printed ring. The case has a clear back, which I didn't deliberately look for, but turned out to be useful when I was sizing and adjusting 3D printed parts:



The movement is automatic, so should and does appear to wind itself.

So, this is an alternative to the digital watches I've been trying to make, and stalled on for the time being, it tells the time, doesn't need batteries and shows the date. That covers most of what I want it to do.



Friday, 26 April 2019

Coffee Machine Update

Coffee Machine Update

The coffee machine works. It's good for single cups of coffee, as you don't have to stand there too long pouring water. The old coffee machine is definitely dying, it now takes about an hour to run a pot of water through it.

To investigate how easy it would be to automate the new machine, I set this up:




There's a peristaltic pump:



which pumps water from the kettle to the filter. The power supply is adjustable, which is important to ensure the water flow isn't too fast as it will overflow the filter. For the pump I have the suitable voltage seems to be around 4V, which is pretty low. Usefully the power supply seems to remember its setting when it's off so you don't have to set it up every time you turn it on. A simple voltage regulator circuit and a knob would be equally and probably more suitable.


This arrangement also means you can replace the peristaltic pump pipe if it is dirty or damaged. You can also clean the pipe. We've never cleaned the insides of the old machine.


Thursday, 25 April 2019

Can Transformer

I was thinking about the battery connections on my DIY digital watch and how tricky it was for me to create things out of thin metal. Either I cut it by hand, which always results in less than perfect parts, or I spend quite a while setting up my CNC3020 and cutting it on that. That gives better results but can be fiddly.

Then I made the link between the problem and the drinks cans that I melt down for raw material. Drinks cans are made of aluminium or steel and come in a nice uniform shape. So I decided to make a machine that can turn these cans into useful stuff. And the CanTran was born.


It's actually a sort of CNC lathe that is designed to chop up drinks cans, transforming them into useful things. Putting a can in the machine is a simple matter that takes just seconds, using a spring loaded tail holder and a 3D printed part that engages in the can top at the other end.
 
It's got three stepper motors and a Proxxon rotary tool to do the cutting. The controller is a Duet:

 
 
which has a nice web interface and accepts gcode. I've always had a problem finding a tool to generate gcode, so I created a small simple script to convert DXF files to gcode. This isn't too complicated a task as the CanTran has 3 axes, but in reality is a 2D machine. The script converts just lines and arcs from DXF (LibreCAD) into gcode with just 2 Z depths at the moment. Any tool that generates gcode should work.

I use a D bit cutter, the same type I use to mill PCBs.


There's a little tour of the prototype here:



This is the machine cutting some test slots into a can. This is sped up by a factor of 20:


You can make labels with it:






You can cut letters into the can and then illuminate  it:


Or, cut abstract patterns and do the same:


I've put the 3D files here:

https://www.thingiverse.com/thing:3570030

We'll have to see how useful it turns out to be...

And the there was what went wrong.


Friday, 12 April 2019

Coffee "Machine"

The old coffee machine that we use is probably going to fail soon, it's second hand and pretty old. I saw a simple Japanese design a while back and decided to have a go at something similar. My version uses cheap Chinese components sourced from Ebay and some recycled  bits and bobs.






There's a filter in a funnel that direct coffee into a jug below. The funnel, filter and jug are ebay items. The stand is made from part of an old chair frame and some wood from a tree we had taken down in the garden.

It makes pretty good coffee, but has the downside that you have to pour the water through the coffee over a few minutes, it's not very automatic. It does have the advantage that you can quickly make a single cup of coffee, probably quicker than the automatic machine can manage.

The filter is metal, I had to cut a handle off it so it had a circular outline and would fit in the funnel.




Saturday, 16 March 2019

Plantation Shutters

Plantation shutters (I'll use shutters from here on) are fairly popular here

in the UK. They are expensive, though, so when we were looking to put them on our windows (a few years ago now), the price was around £1000-£2000 per square metre. With thirteen windows, each about 2 sq m, the bill was getting quite large. So, I had a look at making them. This turned out to be a long process, and the shutters weren't fully complete until a couple of years later. This post is an attempt to document the process i went through to make these shutters. Is it worth the effort? Well, I was happy with the result (people have commented on them) and I worked out that the cost in parts was around the £25 per sq m mark. That's a lot cheaper than bought in ones (although I think the price may have dropped a bit over time from when I first looked). Of course, it takes time and effort, but that was mostly fun. It got a bit wearing around window 6, but things like a patio door double decker version made things a bit more interesting. Of course the 8 panels I had to do for that (the equivalent of 4 windows) tempered the excitement a bit.

What do they look like? Well, like this:


That's a standard sized window, we have several like that. The shutters are in four panels, pairs of panels bi-fold on hinges so you can open them and get full light from the window.


You can open and close the slats with a central control rod;


The slats must be closed when folding the panels back to the fully open state.
The patio doors have a double decker arrangement, so you can open the top or bottom independently.


 The panels latch into place with magnets set into the panel edges:
 

There are quite a few of these per panel.
Some of the windows required a frame that was surface mounted


 and some required other arrangements:


The control rods are attached to the slats using staples which I hammered in by hand. After a couple of hundred staples I got the hang of it.


The slats are elliptical on profile, I used a router bit to shape them on a router table from rectangular stock. All of the shutters and frames are in pine. It is finished in Osmo wood wax which is a stain, rather than paint. This means it doesn't affect dimensions after it is applied. It also allows the grain of the wood to be visible.

The windows didn't have window sills so I added some where needed:


Of course, there was a window that required three panels rather than four:


And the one odd sized window:


That is a single panel, which is hinged so you can open it if needed. It's also the last window I fitted shutters to.

These are the pins and router bits that I used:

https://gb-woodline.glopalstore.com/products/plantation-shutter-set






Wednesday, 1 March 2017

Latest OLED Watches


The latest iterations of the OLED watch are finally approaching wearable. Well, the first of the two is wearable but a bit thick. The second is much more wearable size.

The first iteration is the smallest PCB so far fitted into a 3D printed case and mounted on a cloth strap latched with velcro.


The switches are mounted on the top and the clear front flexes when they are pressed.


The overall thickness is 15mm, which is a bit too thick to wear comfortably. It gets caught on sleeves and catches easily on fabric.


The latest iteration is a one that doesn't use a PCB. This removes 1.6mm of thickness immediately, but makes the construction more manual.


The wiring is manually laid out and not very tidy. the thickness is much less, at 9mm, or 10mm to the tops of the front cover screws. Compared to my main watch this is very similar.

The components are mounted in a 3D printed frame like this earlier version:






The minimum thickness is fixed by the switches that I have used. The wiring adds a millimetre or so to the thickness, that could be reduced by inlaying the wires into the frame. More use could also be made of the 3D space in the frame. At the moment there are no components on top of components.

Using a PLA 3D printed frame is useful as it is possible to heat components and wiring up with a soldering iron and push it into the PLA. This then holds the component firm when the plastic cools.

There may be a better way to wire the components, maybe using a smaller PCB that just has the surface mount components on it.