My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
USBTemp  
Updated Feb 4, 2010 by dalhei...@gmail.com

USBTemp measures the temperature and connects via USB to your computer.

Introduction

USBTemp provides a thermometer. It is based on the DS18S20 digital thermometers. In addition, the thermometer connects to an USB port - you can read the temperature using a commandline tool. In combination with RRDTool you can easily create temperature graphs:

This is a live graph of the temperature in Kaiserslautern, Germany - at least if my server at home is up and running. I describe my setup at home here: USBTemp: Continuous Temperature Monitoring.

Features

At this time, USBTemp provides these features:

  • Attaches to USB, powered over USB
  • Cheap hardware
  • Based on an ATMega168 (although an ATMega8 should work also)
  • No SMD components
  • Simple commandline tool for querying the sensors
  • Support for five DS18S20 temperature sensors (extensible)
  • Parasite-power mode for the DS18S20 - a single 2-wire cable is sufficient to connect all sensors

Download

The current version can be downloaded from the "Download" page. The tarball contains the firmware, the host software and the schematic.

Hardware

The hardware consists of an ATMega168, the DS18S20 temperature sensors and some support elements. It is described on the USBTempHardware page.

Software

The host software uses libusb to connect to the hardware. You can query the device for available temperature sensors:

$ ./usbtemp sensors
2 sensor(s) found, querying
sensor 0: ID 9F17A5010800 type: (DS18S20)
sensor 1: ID B46865010800 type: (DS18S20)

The IDs are the actual unique hardware IDs of the DS18S20 sensors. Afterwards you can use the ID to query a sensor:

/usbtemp temp B46865010800
searching sensor with id B46865010800 - using sensor handle 1
reading sensor 1 (°C): +1.1875

If you want to use the raw temperature value in a script, simply discard stderr:

$ ./usbtemp temp B46865010800 2>/dev/null
+1.0000

The host software only depends on libusb and has been tested on Linux and Mac systems. With libusb-win32 it should be possible to compile it on Windows as well - but this is currently untested.

Building the software

TODO.

Credits

The microcontroller firmware uses several libraries:

  • The AVR-USB software-only USB driver from Objective Development
  • The DS18X20 code example of Martin Thomas which in turn uses code of Peter Fleury (uart-library) and Colin O'Flynn (CRC-code).

Comment by josh...@gmail.com, Aug 11, 2009

so did you get the mega168 working? Would the new arduino mega3xx work it is similar to the 168? If so is it a usb keyboard? that would be easy to get keys in c. What speed logging? I have a 24 bit adc at 10ksps

Comment by ceagl...@gmail.com, May 1, 2010

do you know any one who use c++ builder to program conection with PC?, i just know this code.. i hope for your help, my mail is ceaglios@gmail.com


Sign in to add a comment
Powered by Google Project Hosting