[plug] Linux real-world measurement.

Bernd Felsche bernie at innovative.iinet.net.au
Thu Jul 1 17:40:46 WST 2004


On Thursday 01 July 2004 16:22, Michael Hunt wrote:
> On Thu, 2004-07-01 at 16:09 +0800, Bernd Felsche wrote in reply to

> Michael Hunt's earlier post:
> > > To bring this post back on topic I'm trying to figure out a way I
> > > can log (preferably to my Linux laptop) my engines oil temperature
> > > (say 30 sec intervals) over a long journey (say an 1 and half
> > > hours). VW motors are supposed to run optimally at an oil temp of
> > > about 125 C, but I think mine is running hotter. (At the moment
> >
> > NTC sensor, stuck to the end of the dip-stick or the sump-plug.
> > Connect up to a small micro-controller like an Atmel ATTiny2313 (or
> > smaller if you want to bit-bang UART) and shout serial at whatever's
> > listening. The µC can handle the calibration, linearisation and
> > conversion of sensor resistance to temperature.

> Sounds good. Do you know what a rough cost / local source might be ???

Rough cost; about $50 to $100 if you're hardware-handy. Budget $15
for the µC which has in-built ADC and UART. PSU doesn't have to be
fantastic as there's "12V" available; just a linear regulator and
trans-sorb in addition to the usual stuff. If you're not connecting
to a tolerant "RS-232" port then a driver chip is recommended.
Metal box and connectors will probably be the highest-cost
components.

I erred in component selection.. the ATTiny2313 won't do ADC... the
ATTiny15L is the next-best fit with 4 ADC inputs, but no UART. The
latter can be done in software so no problem there...

There's a gcc compiler for the AVR. A programmer that's driven off a
parallel port can be made from cheap parts (<$30) for flashing the
device if you don't want to shell out about $150 for a development
kit. Cadsoft Eagle (free for non-profit) will help with PCB layout
under Linux. Or a simple gadget like that can be built on Veroboard.

These costs don't include your programming and hardware hacking
time!

Dontronics carries the ATTiny15L - at about $11 a pop.
NTC thermistors are about $1 from Jaycar. Operating range is
typically up to 125C. An alarm if you exceed this by much for a
minute or more would be advisable, least of all to preserve the
thermistor, but to save the oil from breakdown! 

If it really bothers you that the thermistor is at the top of its
range when the oil is at the top of its range, then you can splash
out on a more-sophisticated type.

At the Linux end, just read the data packets; log and perhaps draw a
pretty graph; with RRDtool and friends.

Just be aware that unless you have a real-time priority on the Linux
side, it's possible to get "skew" in the times of the samples. It
could be several indeterminate_ seconds between a packet being sent
to the laptop, and the laptop actually reading and processing the
data.

Should this all appear a bit daunting; I've seen a few sub-$100
digital multimeters with RS232 port, but you'd still have to add
your bits for the temperature probe.

Of course, the µC has more flexibility in that you can connect
it to the ignition system with a few more passive components, change
the firmware and measure/log engine speed as well. Which may be
useful to figure out why the engine gets hot. If that doesn't tell
you enough, add a few mechanical bits to the transmission casing and
get vehicle speed from a Hall sensor's pulsing.

-- 
/"\ Bernd Felsche - Innovative Reckoning, Perth, Western Australia
\ /  ASCII ribbon campaign | I'm a .signature virus!
 X   against HTML mail     | Copy me into your ~/.signature
/ \  and postings          | to help me spread!






More information about the plug mailing list