Reading temperature sensors with Perl

HOW COOL IS PERL?

Article from Issue 65/2006
Author(s):

Linux lets tinkerers connect their hardware creations to computers. We’ll show you how you can use a simple Perl interface to check the temperature of your home or office while you’re away.

It’s not so long ago that users had to write their own device drivers to add hardware. But with the standardization of USB, and with fully-functional hot-plugging support in kernel 2.6, things have become far easier. The temperature sensor used in this article, a Dallas Semiconductor DS18S20 ([3]), can be controlled via the one-wire bus, which is driven by a USB dongle attached to the computer. The free owfs control software at [2] can request data via a Perl interface. Instead of one-wire, the bus should really be called two-wire, as two thin copper wires (typically in a single sheathing) connect the sensor to the USB dongle (see Figure 1). At the other end there is a western connector (RJ11), which plugs into the USB dongle.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • SysUsage 3.0 Perl Tool in Thorough Rework

    The SysUsage monitoring tool is available in a new version 3.0 and provides a completely reworked Web interface.

  • Perl: Multimeter to Measure Power Consumption

    Today’s digital multimeters can do more than measure current and voltage. Multimeters also measure capacity and temperature. An inexpensive multimeter can talk to your PC via the serial port, and simple Perl scripts let you read and visualize data in neat charts.

  • Monitorix 1.0.0 Monitors Hardware and Software

    Version 1.0.0 of the Monitorix monitoring program has just been released. It now shows fan speeds, and CPU, motherboard and hard disk temperatures among other system data.

  • Software-Defined Radio

    Armed with a US$ 20 hunk of hardware and a free software-defined radio tool, Konstantin starts the hunt for radio-transmitted data from a weather station.

  • Real-World Raspberry Pi

    The single-circuit-board Raspberry Pi computer, only as big as a credit card, makes it easy to gain experience with embedded Linux systems. We'll show you some hands-on examples of how to use the Raspberry Pi in an everyday environment.

comments powered by Disqus

Direct Download

Read full article as PDF:

Perl_Temperature_Sensors.pdf (306.93 kB)

News