The DHT range of sensors provide a cheap way to grab temperature and humidity information. The sensors are not fast, (250ms per query) but have a good price and require only a single digital pin to use. Kyle had a few sitting around, so I added loguino support for them.
The Maxim DS18B20 digital thermometer provides 9-bit to 12-bit Celsius temperature measurements over a 1-Wire interface providing accurate and inexpensive temperature readings.
Now you can enable the DS18B20Poller and loguino will capture temperatures from any attached DS180 series sensors.
Whilst I originally designed Loguino to pull data from the MegaSquirt ECU in one of my cars, as a tool its grown way beyond that. Something I always wonder (Usually just after I’ve checked in on the ferry, or crossed into spain…) is ‘did I close the garage door?’ the door is electric, and its easy to forget to close it properly as depending on the state of the door, pressing the close button doesn’t always mean the door will close fully. To quench my paranoia I installed a web cam and used a 3G router and VPN to connect back to my private network. This means I can visually check the state of the garage door from anywhere, whilst I rarely leave the door open, the peace of mind is a wonderful thing.
Now that I also have a network connection to the garage, it gave me an opportunity to add some additional monitoring, whilst security is important, there are easier things to rob in the neighborhood, and that’s what locks, alarms, and security guards are for, however with the various leaks, fires, and other disasters that can happen in a garage, I thought it interesting to be able to monitor the temperature, (too cold – I need to turn off the water, too hot – I need to call the fire brigade) humidity, (leaky pipes?) and gas. (Interesting to know what I’m breathing in.)
Up until now I’ve been relying on the Arduino Mega, this is great for standalone logging as it has many pins, lots of memory, and is very forgiving, however for monitoring a remote site with a few sensors, it is somewhat overkill and lacks an ethernet controller built in. I could of used an Ethernet Shield, however since I don’t need the pins, the Arduino Ethernet makes much more sense, its relatively cheap, small, and has more than enough pins as well as a built in Ethernet controller.
This meant doing some work for Loguino, as whilst its modular and doesn’t assume anything in the code about the board, it always had the Arduino mega in mind, since I recently moved to CMake from ARSCons, I decided to get to grips with dependencies a little, and made it easier to use different boards, features which require a specific board are no longer included for other boards. This means selecting Arduino Ethernet as the target will disable things that require second serial ports etc.
From there it was onto the sensors, Antratek are based nearby, so I decided to give them a shot, they had a bunch of interesting sensors mainly from Parallax, for humidity I used a HS1101 which forms an RC circuit and is very easy to use, a CO2, and CO sensor which I haven’t got working yet, TMP102 temperature sensor, and BMP085 barometric pressure sensor, which also has a built in temperature sensor, together making a very nice package. In addition I added a motion sensor.
For the temperature, pressure and humidity sensors it was easy to write a simple poller plugin for each of them, the motion sensor was already supported by the Digital Poller, so required no extra code, however I added the ability to name the output from the digital poller to my todo list.
The ethernet controller required some work too, I made the decision that this would be a server rather than a client, and simply open a socket and print the metric values down the wire to any connected clients, this was easy to code, and works in the same way as the Serial Output Logger, only over a TCP connection. It would be fairly easy to write a client that pushes data to a server using a web service call, but this fits my immediate needs.
Soldering it together was also fairly simple, the BMP085 and TMP105 use I2C and just require a few wires, and the HS1101 uses a simple RC circuit. Once built, it looked like this:Connecting to the device gives the usual loguino CSV output, I wrote a small script that polls the data and puts it into a database which can then be queried with flot. The TMP102 reads over temperature, so i need to do some work there but its consistent and has been up for about a week in the living room now.
I’ve been working on Loguino for a few months now, and the first stable release is now available. Loguino is a data-logging solution based around commodity(Arduino) hardware. Underneath is a powerful data-logging framework that can be adapted to log just about anything. Loguino focuses on data capture, rather than analysis or visualization. It was born out of the need to capture data from a Microsquirt ecu without a laptop connected, but has evolved into a more generic tool.
Loguino can log from the following inputs:
- Megasquirt Automotive Engine Control Units
- LIS331 Accelerometers
- ITG3200 3 Axis Gyro
- NMEA Compatible GPS Devices
- Analog Pins (Voltage)
- Digital Inputs (High/Low)
Loguino writes output to the following outputs:
- SD Cards
- Serial Devices
Each poller and logger is optional, enabling and disabling features is easy using a configuration file at build time.
Loguino is built using cmake, and is designed around the arduino mega, although other boards will work just fine.
There are a few of us using it now, and I feel its stable enough that others might also find it useful.
I have a few code improvements I want to roll out in the coming weeks to make things more pluggable as per the design, then I’ll focus on the following features:
- Download from SD via Serial
- Add a lifetime to metrics
- Add throttling
- CANBUS Support
Loguino is hosted on google code at: http://code.google.com/p/loguino/
I hope some of you find it useful, and I’d be delighted to hear from anybody who is interested in using loguino.
Jonathon Oxer and Hugh Blemings describe an excellent power regulator for Arduino in automotive applications in their book “Practical Arduino Projects”. Loguino doesnt need to be notified about a power failure, but it did seem sensible to be able to provide a buffer which may help when the car is being started.
- IC1: LM294OCT-5 – An automotive grade 5v regulator
- D1: 1N4001 Diode
- F1: 3A Fuse
- C1: 100uf Capacitor
- C2: 47uf electrolytic capacitor ideally rated to 16v max
- C3: 47000uf capactor, rated to at least 60v
I’ve been interested in capturing data from the seven since the moment I could drive it. I’ve looked at commercial data loggers, and there are plenty of good options, I use the ETB Digidash on the Fury, and it’s very competent, not least in the analysis software.
For the seven though, I didn’t feel there was a good fit for a number of reasons:
- not many data logging tools support reading data from the megasquirt ECU, which is critical to get any information about the engine at runtime.
- Many data loggers are geared towards providing an in car display system, but I already have a working dashboard that I like.
- Usually they are limited to a number of channels, each channel having a predefined function or purpose.
- Is the engine temperature hot because of the outside temperature, speed, or a fault?
- Is the oil pump failing or was i just not driving hard enough?