Oled Temperature and Tacho Gauges

Examples, screenshots, graphics, fonts...
Post Reply
Posts: 108
Joined: 19 Jun 2019, 04:09

Oled Temperature and Tacho Gauges

Post by bluejets » 29 Apr 2020, 10:37

As mentioned in the lockdown projects, have been working on 2 gauges for a mate of mine who has been building a scale diesel hydraulic loco with a 150cc 3 cylinder 4 stroke water cooled engine.
Gauges are for water temperature and a tachometer.
Both are Oled 0.96" display with Arduino and I2C.
Code is separated out and nailed together from existing code from others so may appear to be a bit rough around the edges and there may well be a better way of doing it, but it does work. Both codes are similar with changes to accommodate the different sensors and changes to the display for the scale and the digital readout.
Short video of the tacho on youtube not the greatest as I was juggling with the sensor, the phone to record the video and trying to shield out some of the 50hz light to the reference optical tacho. As I moved the phone from the Oled to the test bench view, the hall effect I was holding would move and give a different reading on the Oled.


As shown, the tacho was running from a 9V smoke alarm battery plugged into the RAW terminal of the Arduino ProMini. In the final unit on the loco I used a small buck converter to get the supply down to the same 9v level. Didn't want to run the RAW from the 12V battery on the loco as there may be a battery charging circuit added which would take the Arduino RAW over recommended input and the battery runs CDI ignition so a bit noisy.
Pullup resistors for the Oled were already installed on the display so no need for additional resistors.
So parts for the Tacho were.........
0.96" Oled display I2C ( pullups already on the module)
Arduino ProMini
Libraries OneWire, DallasTemperature and U8glib
Original code from here..... second one down..... http://arduinows.blogspot.com/
USBTTL adaptor ....one with the DTR terminal
Mini buck converter....I use the one with the solder bridge for the required voltage. Type with the pot adjuster is a bit tricky to set and could change in use. Follow instruction on the photo of the backside, i.e. solder bridge (in this instance) 9V and cut the track to the adjuster pot as shown.
https://www.ebay.com.au/itm/DC-DC-Buck- ... Sw4i5Zujhj
KY-003 type hall effect module.....like most hall effect switches, output is open collector. This unit has an onboard LED to indicate working. No requirement for any pull up resistor on the module as it uses a 4k7 resistor with the LED. Do need to watch the pin out order on the module, see the circuit diagram.
3mm diameter magnet 1mm thick ...clearance about 20 thou to the switch.... 1 pulse per rev.
Note that I have had this running with a metal vane rotating between the magnet and the hall effect front face with a gap of around 3mm.
Note on the Oled display....some have the power Vcc and Gnd terminals reversed so watch for that.

Parts for the Temperature Gauge
Same as above for display etc. ...plus
Sensor is a DS18B20 digital probe assy.....available in a variety of cable lengths.
https://www.ebay.com.au/itm/1M-DS18B20- ... SwxnVenr69
1 * 4K7 resistor 1/4w
(5.08 KiB) Downloaded 48 times
(4.16 KiB) Downloaded 42 times
Buck Converter.jpg

Posts: 108
Joined: 19 Jun 2019, 04:09

Re: Oled Temperature and Tacho Gauges

Post by bluejets » 08 Aug 2020, 09:28

Installed the two gauges in George's loco today.
After I loaded the correct sketch for the temp gauge at least.
Had originally been using an analog sensor but it proved to be too much all over the place, and no prizes for guessing which one I loaded and then head scratched for 20 minutes trying to work out where I'd gone wrong. :roll: :roll:

Other than that all went well.

If it was a steam engine I'd say he was chuffed but being a loco just have to settle with his being simply on track. :D
I'll get a photo or two as it is quite a long running project.
Must be around 15 -20 years now since first photos were taken of the original machines and drawings started.

Posts: 108
Joined: 19 Jun 2019, 04:09

Re: Oled Temperature and Tacho Gauges

Post by bluejets » 23 Aug 2020, 08:12

A couple of photos of the loco with the new guages.

Loco is run via a 3 cylinder 150cc water cooled 4 stroke engine of George's own design.

All parts including any castings done in his backyard workshop.

In the final units, I combined 2 promini Arduino with one common buck converter and ran the whole she-bang off the main lead acid 12v supply.
Circuit below.
Control Panel.jpg

Posts: 230
Joined: 31 Jan 2019, 11:48
Location: Boskoop, Netherlands

Re: Oled Temperature and Tacho Gauges

Post by MaxZ » 23 Aug 2020, 11:32

Your work but also George's! I love that cabin detail, in particular the fan and the washbasin/water canister. I guess no Australian train driver can do without those, especially on long hauls.........


Post Reply