Translate

Saturday 8 July 2017

Classic Mini 1275GT Electronic GPS Speedometer and multifunction display.

The Mini 1275GT is fitted with a mechanical speedo. It's driven from an output on the gearbox via a cable, which wings it's way across the back of the engine bay, through the bulkhead and into the speedometer itself. The cables always seem to get cooked by the heat from the exhaust manifold, and fail fairly often. I've got sick of changing them ....

The 1275GT's speedo reads (rather enthuiastically) to 120 MPH.....


..... and is expensive due to it's rarity


Surely there's a better way to drive it??


Plan A...

Get a broken speedo cable and harvest the speedo drive fitting, attach that to a small electric motor, and use that to spin the speedo drive to show the correct speed. Get the speed from a GPS module, PWM the motor to show the correct speed. Even the odometer will run correctly.

Brilliant... 

The speedo is marked 1248 TMP on the dial... this means it needs 1248 turns per mile.. So at 60MPH that's 1248 RPM, and at 120 MPH, 2496 RPM... so a 2,500 RPM motor would be excellent.

A small motor and gearbox was procured from eBay...

oh it IS small!

The end was removed from a speedo drive cable ....
... and attached to the shaft of the motor's gearbox...
Running some tests showed the motor would drive the speedo, but it was going to need some sort of feedback to stabilise the speed... and then it became very obvious that this tiny motor was not going to be man enough to drive the speedo for any length of time at any speed... it was VERY hot.

I looked in the junque box and found a few other motors....

This looked promising, but was too lumpy at low speeds... a similar motor was also tested with similar results. Shame as the torque provided by these motors was good enough that speed control would not be required.




I then found this beauty, with a tacho so I could create some feedback to accurately control speed...

During tests it seized up :(







What about a stepper motor? ... nah not at 2,500 RPM :(

It became apparent that this was going to be tricky...

Plan B .....

Strip the speedo down, and replace the mechanical drive with a model servo...

Advantages... Easy to drive.

Disadvantages ...
Odometer won't work (replace with an LCD or OLED display?)
Means gutting an expensive instrument.
Positional 270 (or greater) servos are expensive, and have questionable positional accuracy.

... at least an "ordinary" 90 MPH speedo will be required for practice!

The cheap 360 degree servo shown is no use, it's a "continuous rotation" servo, which has no positional feedback at all. It simply turns one way or the other ad infinitum. To implement a positional servo, we'd need an expensive "boat winch" servo.

I'm not keen on this idea....

Plan C....

A stepper motor to drive the needle.

Advantages...
Easy to drive (may need an H-bridge), inexpensive. Accurate (especially a geared down unit)

Disadvantages...
Will need to get a zero position, something like a leaf or microswitch to set zero. Will need a display for the odometer.

OK, this looks feasible....

I had a nice cup of tea, and a bit of a think .... how does the speedo and rev counter work in Mrs Doz' posh Audi?

When you switch the ignition on in her car, the speedo and rev counter move to the full scale position, and then to zero before settling down to the correct reading .. must be driven by some sort of motor ....

After some googling, it turns out that manufacturers use a special instrument stepper motor to do this!

Vauxhall have one that's VERY cheap!

It's called the X27.168, and I bought 6 (Yes 6!!) for change out of a tenner on eBay! ... and some blue LEDs (not sure what I'm going to do with those!)

Not only that, but there's an arduino library at https://github.com/clearwater/SwitecX25
which will drive the things, and without an H-bridge! Oh joy!

A few feelers were put out for a gash speedo I could use as a test bed, and Tim at MiniMail (a superb purveyor of classic Mini parts) turned up a bit of an oddball speedo.

Look carefully at the picture, the KM/H and MPH scales are the same! It's a continental 1275GT speedo with a UK bezel. An ideal candidate.





I also ordered a 0.91" I2C OLED display to replace the odometer.











The bezel was removed (normally there would be a piece of glass over this, but it was missing)....












... the two screws either side of the speedo drive fitting was removed ....








... followed by the mechanism.







The pointer was carefully eased off the shaft...















... and the two screws holding the face to the rest of the mechanism removed. Note the state of the screws. It would appear I'm not the first to have been here!










Face off....











Remove the two screws each side of the support bracket.











Unsolder and remove the return spring.













Remove the two top and bottom screws and separate the magnetic coupling. The spindle drive and plate can now be removed....










... leaving the odometer digits.












Separate the split washer from the end of the shaft and remove the gears....












... and push the shaft out. Note there will be some resistance here, as there's a nylon split washer between the end of the barrel and the bracket.

Remove the odometer barrel...








Leaving us with a disassembled back plate.












... and a nice blank canvas !













I made a small hole in a cardboard box, so the zero stop pin on the face would sink in leaving me with a nice flat surface to work on. The OLED display is a little short, but otherwise looks to fit superbly. I can make a bezel up to cover the shortfall...







The rear bracket will need the barrel support arms removing or shortening though...










I was hoping to get lucky with the spindle size, but alas no. The mini spindle is a little smaller than the new stepper motor.....


















Thankfully, there's enough meat on the pointer to bore it out slightly with a very fine drill...












Although it's a good fit, a spot of thread lock will stop it moving once final assembly is complete.











Next job is to mount the stepper motor to the bracket. I secured the faceplate to the box to prevent it from moving about.....










and punched a small hole in the dead centre of the display, to centre up the motor shaft...












As there are no mounting holes in the vicinity of the motor mounting holes, I opt to glue the motor to the bracket. Suitable adhesives were considered ... Super Glue (cyanoacrylate), UHU "universal glue", Araldite (Epoxy) ... all of these were rejected. Super glue would be too brittle, and it has a propensity to run where you don't want it. I don't think UHU will be strong enough, and Araldite seems to be a bit "runny" these days.... I looked about for an alternative.... Epoxy car body filler? Strong, not runny, sets quickly if mixed with a touch more hardener than really required... let's give it a go!

Place a small heat shrink sleeve over the stepper motor shaft to prevent it getting stuck in any excess filler. We can remove this afterwards...










Mix up a small amount of filler, and apply to the bracket ...











... and place the motor carefully, so the shaft (and sleeve) push down through the cardboard box.

Hold in place until the filer starts to set (If you make a little too much, you can see if it's set on your mixing board)







Remove the protective sleeve. A little filler has oozed up round the sleeve. I removed this with a sharp craft knife....











... and the pointer test fitted. Looks good (must clean the corrosion off the centre though!) . Don't push the pointer on too hard just yet, we need to make sure the stepper motor is set to zero first.








Next solder some wires to the rear of the motor...


Note the pins aren't numbered on the motor....
Sort of standard convention would make pin 1 blue, pin 2 grey, pin 3 white and pin 4 purple... the colours aren't important, but connecting them up to the correct ports on the Arduino is.







We'll use Digital pins 4,5,6 & 7 as they are default for the library.

Pin 1 of the motor to digital pin 7 of the Arduino.
Pin 2 to digital pin 6
Pin 3 to digital pin 5
Pin 4 to digital pin 4



OK. Now we need to calibrate our pointer.

First off, setting the zero position. I couldn't get the example sketch in the library to run. It would compile OK, but didn't work as expected. So load this into your Arduino:-



This will set the motor to zero, run it round to half way wait for a second, and then back to zero.

Now push your pointer on (after you've polished up the corroded bit!). Hit reset. You should have something like this ....



You'll notice as the motor is finding zero, it jitters about a bit. This is normal.

Now we need to calibrate the full scale deflection, in this case, 120 MPH.

Load up the following sketch ...




... and connect a 10K pot, with the ends of the pot on 5V and GND, and the wiper to A1. Open the serial monitor window.

When you run the sketch, the pointer will zero, move to the halfway point, and then move to a point determined by the position of the pot.

Again, don't worry about the pointer jittering a bit, the sketch and electronics are simple, and there's no averaging on our analogue input, so it moves around.



Turn the pot unit the Speedo indicates 120MPH.












Read the value displayed on the serial monitor, and write it down. We'll need it later. It's 784 in my case.










A little black spray paint hides the blue PCB on the display nicely. The display was wired up and tested...










..and carefully glued into place with a smear of UHU universal glue to the raised part of the faceplate. It was held there until the glue has set.

I briefly added some text into this sketch to write "THIS WAY UP!" to avoid a mistake!







Whilst the glue made a reasonable job of holding the display in place. It wasn't quite up to the job. Another gob of body filler sorted that ...










The speedo could now be reassembled.
















Great, now for some other hardware...


The hardware needs a little explanation. The Arduino is connected to the display and GPS in a normal manner, it's the power supply that's a little odd, and with good reason. 
When the unit is running, we don't want to keep updating the EEPROM with the mileage, as the EEPROM wears out a little every time we write to it, so we need on only write to it every time the car is switched off. Now I did contemplate using an interrupt, writing the data and putting the micro to sleep every time. I decided against this because of the nature of the vehicles supply. During cranking the voltage can be going anywhere ... spikes of 75V, voltage falling to 6 ... generally unpleasant. When the micro wakes up, things need to be steady so everything comes back up in an orderly manner. We can't guarantee this. 

Here's the plan. When the car is initially switched on, The IGN line supplies 12V briefly (for a split second, until the starter is engaged) it then disappears...there's  a 6-second delay at the start of our sketch waiting for the GPS to power up, so nothing happens. The micro will shut down again. Now the engine is running, our IGN line returns, and supplies power to the 7805 via D3. The micro starts up, and runs it's set up procedure. Once that's done, the micro sends D8 high, switching the relay K1 via T1, and the 7805 is now getting it's power from the permanent 12V line. Any nasty spikes on the supply are dealt with by R3, and the two zener diodes, D1 and D2.

So we drive about for a bit, the speedo doing what it should. We stop, and switch the car off. The IGN line goes low, and this is sensed by D9. This runs the shutdown routine, which writes our updated mileage to the EEPROM, and sends D8 low, switching off K1, which kills the power to the micro.

.... then I got to thinking. In the car there's an ashtray in the top dash rail. It did more for non-smoking in the UK during the 1970's than all of the government health warnings put together... What about a nice display there? We already have GPS available, so what about a digital speedo and a clock ? We could easily measure the battery voltage. Outside temperature would be nice to satisfy the love us British have for moaning about the weather... 

 


Battery voltage is read through A0, via a voltage divider formed by R2 and R6. R6 can be used to adjust calibration. Temperature is provided by a DS18B20 temperature sensor. Excellent. I used a separate micro to avoid clashes, and memory issues (and, to be honest, it was all a bit of an afterthought!!) I also added some links, so the serial interface could easily be disconnected when uploading new software during development.

The electronics was built up on a bit of perfboard, and connected to some din plugs to connect to the various components. One each for GPS receiver, speedo (both motor and display), the "multi-function ashtray display", and the temperature sensor.
If you just wanted to add the multifunction display, you could simplify the power supply (no relay or switch-over needed), and just use the second micro. You'd want add the auto-config part at the start of the speedo sketch, and send the arduino's Tx line to the Rx pin on the GPS receiver as well)

Testing shows the speedo to be very accurate against another calibrated unit, so I'm pleased with that. 

OK, so now I've got git, the software (and the required libraries) can be found  at https://github.com/andydoswell/GPS_Speedo It's still here in the little text box too, for all you copy'n'pasters...

Addendum 04-Sept-2017 - get the software from the git hub page above. I've made a few revisions to prevent EEPROM corruption. The latest software will always be available on the git.



Here's the sketch for the multifunction display (also available from  https://github.com/andydoswell/GPS_MFD_for_car )



Here's a wonderful video of it in action!





*** STOP PRESS!!!*** I've now revised the software slightly... check out https://andydoz.blogspot.co.uk/2017/11/classic-mini-1275gt-electronic-gps.html

Thursday 29 June 2017

Mini 1275GT reassembly and electrolysis of rusty parts!



Here's a few pictures of what's been absorbing most of my time lately....






















It doesn't look like much, but there's all new brake lines fitted, lots of parts cleaned and painted and reunited with the car!

To clean up a lot of the metal parts, I've taken to electrolysis...

This involves making a mixture of about 10% ordinary washing soda (you can get this from Sainsbury's in the UK, £1.20 in my local store for a 1kg bag) and tap water.

You'll need a nice clean piece of ordinary mild steel (Don't use stainless). I used a plate, you can see it in the centre of the tank. And you'll need a power supply (I used my adjustable bench supply)

Connect the clean steel to the positive terminal, this becomes our sacrificial anode. You'll probably realise from the name, that this isn't a piece of steel you'll want to use again....



Attach the rusty part to the negative pole, and drop it in the tank.... Keep a small distance between the part and the steel plate.

Switch the supply on, and adjust the voltage until a bit of current flows. Small bubbles will rise to the surface. I found good results with about an amp of current flowing.

You'll want to do this in a very well ventilated area, as the bubbles are hydrogen and oxygen, and PLEASE switch off the supply before adding or removing things from the tank, a spark could ignite the gas.....

After a new hours remove your once rusty part.

You'll need to clean off the solution, dry it and paint it to prevent it rusting rapidly.



What's happened to the rust? It's on the anode ....

This is after just a couple of days of use... you can clean it up with a wire brush or grinder and it'll go again :)

Simple Arduino Thermostat with MAX7219 Display and DS18B20 sensor

Just shows how these jobs snowball....

James had seen Oto's dehumidifer controller, and said "I need something to monitor and control the temperature of my honey warming cabinet" (it's a beekeeping thing!)

A simple thermostat, with a nice clear LED display, and adjustable set point was born ....


You'll see the code, and most of the schematic is very close to the dehumidifier controller, so I'll not dwell too much on that.. the main difference is the use of the MAX7219 7 segment display, previously used on the GPS clock, and the DS18B20 temperature sensor, which I'd previously used in the pond pump controller.

Here's the code:





Ryan built up a nice enclosure....

















... and, in a stroke of genius, added a strip of red PVC insulating tape to improve the contrast of the display!
















Thursday 25 May 2017

Sony Xperia Z5 Compact Camera replacement.

I've had my little Sony phone for a while now, and it has been superb....

... until the other day when the camera started to play up....


Hmmmm, not ideal.

If you put some pressure on the phone, around where the camera lens is, it would come back to life for a few seconds, sometimes with some bizarre effects...

.. not ideal at all....

I thought I could live without it, but after a week or so, I realised how much I used it for taking quick pictures of wiring etc ... I decided
I'd need to investigate, so I googled disassembly instructions, but couldn't find a video or instructions that had the same layout as my phone.

I removed the back of the phone and quickly diagnosed that the camera module itself was at fault (I was hoping some connector had just come lose, no such luck).

A new camera module was sourced from eBay for a princely some of £13.95 delivered... I ordered a replacement adhesive gasket kit as well (£2.45)




So here's how it's done...

Switch the phone off, and gently heat up the back of the phone with the wife's hairdryer or a heat gun set to low.











Get a sucker and a prying tool and gently remove the back. If it doesn't come away easily, heat it up a bit more. Don't risk bending the metal back....









Right, that's good.














Un-latch the NFC aerial connector at the end shown ....











... and lift it out of the way.














Unscrew the small pozi screws retaining the aerial module .....























... remove it, and place it to one side.













Undo all the screws on the plastic frame .....











... gently work a small insulated tool (this is a ceramic screwdriver) under the flash LED (it's retained with a small blob of adhesive) ...










... and hinge it out of the way.













Carefully prize the plastic frame out. The flash LED should slide through the frame.










Excellent.













Just for piece of mind, disconnect the battery.













Now prize up the camera connector....












... and remove the camera.











Worryingly, the new camera didn't come in ESD safe packaging....












... and was supplied with some sort of rubber gasket, which the original camera didn't have, I just slipped it off...










Some careful bending of the camera's ribbon cable, and it all fits in, and the connector is pushed home.

Now put the phone back together again. When fitting the frame make sure the flash pokes back through, and the NFC connector doesn't get trapped.

Replace the adhesive gasket, and replace the back...


... and go and take some photo's !













Got my thumb in as usual .... ;)



Friday 19 May 2017

Return of the Arduino Dehumidifier controller.

My very good friend Oto has a problem.

He's moved into a new house.

He's wanted some space for his lathes & mills etc, which this has.

 After a few weeks, his machines are showing signs of going rusty.... Why is this?

 It's humidity.. after installing a dehumidifier, things have improved dramatically, except his electricity bill...

 It's time for a slightly revised version of the first project I did on this website back in May 2014 (where does the time go??!?)

It's got a similar display, except it's in Czech, but it has an adjustable set point for humidity, and a mode switch to set between auto , whereby it switches on 5 degrees C before the dew point, or manual, where it switches on when the desired humidity set point is reached.

The mode switch is S2 on the diagram below, and S3 is a centre-biassed momentary toggle, which is used to alter the set point up or down.

The set point is stored in E2PROM, and is restored in the event of power failure.


The temperature and humidity is read from a DHT22 sensor, and the dew point calculated.

The dehumidifier is switched on with a suitable rated relay, via T1.

Here's the code:








... hope Google's translate has done a reasonable job!

Saturday 13 May 2017

BSR UA14 "Monarch" Record player repairs and upgrades!!

I had one of these in a record player as a child. It was my father's from when he was young ...

... then my good friend Colin posted one up for sale on facebook.


Nostalgia flooded in and a deal was done....

The one I had as a child was a sort of blue/grey colour...

It's a 4 speed autochanger, made around 1962. At some stage in it's life, the original "flip over" cartidge (to select a stylus suitable for LP (45's and LPs's) and 78) had obviously failed (it was most likely a crystal cartridge), and someone had replaced it with a ceramic cartridge.. all mono of course..

Mechanically it was all complete, and the usual solidified grease problems were very minimal.

Now a ceramic cartridge is a nasty thing. Even the best track heavily, and will chew through records, not good.

Checking the tracking weight with the tracking weight spring on minimum (there's no counterweight here!) gives encouraging results...

(excuse the thumb)








This deck was never designed to track with modern light tracking carts of a few grammes, so a suitable stereo cart would need to be found.... digging around in the box of record player spares turned up a nice Shure SC35C broadcast cartridge, moving magnet, designed to track between 4 and 5g and a nice spherical stylus, so alignment shouldn't be too fussy... perfect... except it has the standard mounting using two holes... the arm on the BSR has one central hole... an adaptor plate would need to be fabricated. Even tracking at 4-5 grammes, the Shure won't damage my precious records because it has a very large diamond.


Thankfully, back in the 60's, the lovely people at BSR had thoughtfully wired the arm for stereo.

Now the cartridge doesn't look central in the arm, does it? I carefully made the adaptor plate, and it's spot on. I checked the alignment to the pivot, and it is spot on!







A quick tweak to the alignment with a "Stupid protractor" and check the weight...

Spot on the optimum weight! It's a pure fluke! One spring hole either way and it's 2g or 6 !!!








Lash the output into an amplifier, out with the K-Tel Rock Classics workshop test record....


Surprise of all surprises, it doesn't sound half bad! .... Then the rest of the afternoon was wasted playing records....




Now I'd better do something with the cardboard box plinth, and make something proper up!