Archive | February 2014

Cylinder Head Temperature Display Unit

In the summer of 2012 I went on a great motorcycle trip. On my trusty old 1981 KZ750, myself and a few friends headed north in the general direction of Sudbury. It was a great trip with a lot of really excellent sights and increasingly twisty roads as you head North. Through about 800 km of riding everything went quite smoothly, but an unpleasant thing happened when we were just north of Barrie on the ride back. I was noticing that something was sounding slightly off, and my suspicions were confirmed when I tried to catch up to the bike ahead of me and there was no power to get me there. After doing some roadside diagnosis, it was clear that I had a dead cylinder. Back at the garage the full tear down showed that one of my exhaust valves had stuck open and got a nasty bend in it. Thankfully it didn’t break right off, so apart from a small dent in the piston the engine was otherwise unharmed. This was likely due to overheating as a result of a low oil condition. I guess all the high RPM freeway riding had eaten though a lot more oil than I was expecting.

Dented piston :(

Dented piston 😦

Anyhow, this was a lousy thing to have happened, and it likely could have been avoided or at least mitigated if the bike had some method of indicating its engine temperature, (this is assuming I’d pay more attention to a gauge than I would to my oil level.. 🙂 ) This seemed like as good a reason as any to build something. I looked through my pile of assorted boards and quickly stuck together a Netduino Plus, a Nokia 6100 LCD Shield, and some TMP102 temperature sensors to do some experimenting.


This was a reasonably good setup, but it would need some changes if it would be useful on the bike.

1. The TMP102 wouldn’t do the job. They’re good sensors, but their temperature limit is much lower than alot of the temps they’d have to deal with in the engine. These will get replaced by a pair of MAX 6675 thermocouple amplifiers and some K-type thermocouples

2. The netduino plus is big. If I wanted something small enough to potentially mount on my handlbars I’d need it shrunk down, so it’ll get replaced by a Netduino Mini stuck on a custom PCB to accommodate some of the additional bits and pieces needed to run this off the bike’s 11-15 volt supply.

Here’s the circuit and PCB layout that I eventually ended up with.

Schematic PCB

There are two voltage regulators, one to bring the bike’s voltage down to the 8v for the netduino, and another to provide the 3.3v needed for the LCD and the sensor digital parts. There are a couple of discrete parts tied to the unregulated input voltage that divide it down and clamp it to a safe level before passing it in to an analog input, this is for showing the bike’s charging voltage while running, an added bonus.

Here’s the final etched PCB with all the components  placed. It ain’t pretty, but hey, it’ll be in a box 🙂


And here’s the whole arrangement with the LCD installed, powered up with the display showing the running info. The silver ring at the top of the picture is one of the k type temperature probes, these ones are meant to fit under a 14mm spark plug.


I did finally end up putting this in a project box and riding around a fair bit with it strapped to my handlebars but eventually it was removed for a few important reasons. One, it’s hard to see in sunlight. That little LCD just can’t compete with a nice sunny day, and as it happens, that’s when I prefer to do my riding 🙂 Two, it’s ugly. The project box I crammed this thin into is quite…boxy,  and there weren’t really any good places on the dash of the bike to clamp it. It rode around in my tank bag window for a while, but that wasn’t the most convenient of places either..

It served it’s purposes though, after rebuilding the engine in the bike I was able to install this thing and monitor for at least the first few rides to ensure that it wasn’t going to blow up a second time, and more importantly it gave me a project to fiddle with in my spare time.

Netduino Weather Board with Humidity and Barometric Pressure

Had a few modules kicking around that I ordered on a whim a while back. Figured it’d be worth making something interesting out of them as an excuse to learn a little more about i2c. Slapped together this board with a couple of sensor breakouts on it and stuck it on the back of a Netduino Plus. I like the netduino boards because they’re hardware compatible with the arduino shields, but being able work in C# makes them a little more familiar. The sensors are a Bosch BMP085 barometric pressure sensor and a HTU21D. The HTU21D is on a Sparkfun breakout board, the BMP085 is a 3$ ebay dealie. Forgive the ugly solder job.


The idea is to stick this board in various locations around the house and see how the temperature and humidity vary throughout the day. Want to get an idea of just how dry it gets in this place during the winter and how well the furnace pushes the warm air around. This board will quietly log all of these items in a csv file on the SD card installed in the Netduino.

It took a fair bit of monkeying around but I managed to get two fairly useful classes for reading from both of these sensors. The I2C methods came from the library referenced in this post. The logic for the BMP085 sensor was modified from this Arduino specific tutorial to create the Netduino version.

I’ve posted the source in a github at for anyone that might be able to make use of it. The code might not be pretty but it might help if you’re trying to deal with either of these two sensor modules on the Netduino platform.

The data logs pretty well, the only thing I might need now is a real time clock module though because right now all I can record is the relative time from the board booting and beginning to log.

Temp Sensor1 23.05 Relative Humidity 29.3546143 Barometric Pressure 97889 Altitude(m) 290.07
Temp Sensor1 23.20 Relative Humidity 28.5993042 Barometric Pressure 97891 Altitude(m) 289.90
Temp Sensor1 23.14 Relative Humidity 27.9889526 Barometric Pressure 97897 Altitude(m) 289.38