Home
Login / Signup
 di 

OWFS: a Linux application targeted for 1-Wire

OWFS: a Linux application targeted for 1-Wire

What is 1-Wire

1-Wire bus is a communication system developed by Dallas Semiconductor. It is quite similar to I2C, except for the data rate, which is lower, the costs, which are very low, and the range, which is higher. The 1-Wire protocol allows the communication among several devices produced by Dallas Semiconductors/Maxim, such as:

  • temperature, humidity, and pressure sensors, thermocouples
  • LCD, counters
  • eeprom and rom memory, encryption (IP protection)
  • identification devices (electronic keys)

The main applications of 1-Wire devices are as follows:

  • Print Cartridge ID
  • Medical Consumable ID
  • Rack Card Calibration and Control
  • Printed Circuit Board (PCB) identification and authentication
  • Accessory/Peripheral Identification and Control
  • IP Protection, Secure Feature Control, Clone Prevention
  • Consumer electronics
  • Access control
  • Electronic cash
  • Gaming devices

1-Wire is a half-duplex, bi-directional bus, and the communication is established among a device, the master, which controls through the bus one or more slave(s). The following figure shows the block diagram of the 1-Wire communication bus, with a detail of the master (HOST in the picture) and a generic slave.

The master device is connected to the bus through an open-drain configuration and to the supply power (Vcc, which ranges from 2.8 to 5.25 V) through the pull-up resistor R (normally its value is 4.7 Kohm). On the other hand, the slave receives all the power it needs from the bus, which is the only wire present. As visible in the above figure, the capacitor inside each slave (usually it is a 800 pF capacitor) will be charged when the bus is in the idle state (corresponding to a high or positive level of the 1-Wire bus). When, instead, the bus is at a low level, that is when the communication between master and slave is taking place, the slave uses the energy stored in the capacitor to power itself. Differently from other bus protocols such I2C or SPI, the 1-Wire bus requires that each slave be physically connected to the bus: if a slave is disconnected, it cannot be operative any longer, thus entering a reset state; when it is connected again to the bus, it wakes up and, receiving the supply power directly from the bus, can declare its presence to the bus controller (the master device).

The principal advantages of the 1-Wire technology are:

  • Inexpensive devices, simple wiring, parasitic power
  • Unique addresses, individually addressable
  • USB, serial and i2c adapters
  • Mature technology, consulting and aftermarket support
  • iButton steel sealed devices
  • Single Contact Sufficient for Control and Operation
  • Unique ID Factory-Lasered in Each Device
  • Power Derived from Signal Bus ("Parasitically Powered")
  • Multidrop Capable: Supports Multiple Devices on Single Line
  • Exceptional ESD Performance
  • IP Protection, Secure Feature Control, Clone Prevention

Each slave connected to a 1-Wire bus has a unique and unalterable serial number: through this ID, it can be univocally selected and addressed by the master device. The 64-bit ROM number is written during the manufacturing process and it includes the following fields: an 8-bit Family Code which identifies the slave type and functionality (up to 256 slave types are supported), a 48-bit Serial Number, an 8-bit CRC. No clock is necessary in 1-Wire bus, since time synchronization is performed by the slaves on the falling edge of the bus wire controlled by the master. There are two kinds of data rate: standard, with a transmission speed up to about 16 Kbps, and overdrive, which increases the speed by a factor of 10.
The first operation to be executed by an application on the 1-Wire bus is the selection of the slave device. Once a slave has been selected, the master sends specific commands on the bus to write data to or read data from the slave. The reset command is accepted by all the slaves connected to the bus.

OWFS: a nice open-source project related to 1-Wire

Owfs (acronym of One Wire File System) is a project created by Paul H. Alfille and The Owfs Team (Owfs homepage: http://owfs.sourceforge.net/). It is an open-source project developed under Linux operating system with the following purpose: access any 1-Wire device as if it were a regular file belonging to the file system. So, to perform a read operation from all 1-Wire temperature sensors connected to the bus, a shell command like "cat */temperature" would be enough. For instance, the collection of temperature sensors above are all on one bus, individually addressable, and will reconfigure on the fly as items are added or removed. OWFS is an original and useful way to work and experiment the powerful 1-Wire devices of Dallas Semiconductor/Maxim. Moreover, shell commands are powerful and can be organized in script files to be executed (also automatically or on a batch basis) during the development, testing, and validation phases of a 1-wire application.

The main characteristics of Owfs are:

  • Filesystem access
  • Web access (through the application owhttpd)
  • Remote network access (through the application owserver)
  • Direct language support for perl, python, php, tcl, C (libow, ownet)
  • Bootable CD
  • Support for many processors and OS
  • Free under GPL license

Universal 1-Wire COM Port Adapter

Dallas Semiconductor-Maxim offers an interesting tool (DS9097U) for 1-Wire testing and debugging. It connects to the RS232 serial port of a PC (both DB-9 and DB-25 connectors are supported) and, together with a TMEX software driver, allows reading and writing on 1-Wire devices which are connected through a RJ-11 port; both regular and overdrive data rates can be used. With the DB-9 connector it is possible to communicate only with non-eeprom 1-Wire devices, whereas the DB-25 connector allows also to write on 1-Wire eeprom even though an external power supply is requested in that case. The DS9097U adapter is based on the DS2480B Serial 1-Wire Line Driver chip.

Drivers can be freely downloaded from: http://www.ibutton.com/software/tmex/index.html.

Read the Italian version: OWFS: un file system Linux per i dispositivi 1-Wire

Awesome

Found this on the main page of Digg. That's so cool man.

True

True, 1-Wire devices are now mature enough, and I would not contest any of their qualities. There are, however concenrs about the price, I hardly believe though that Maxim advertises them as "inexpensive devices"because they are not. What I would believe is that there are instances where using such a device which is more expensive than its conventional counterpart from other manufacturers, might save you cost in another part of the project. Actually this is what this concept targets: less pins on micros (so cheaper micro), less tracs on the PCB (so smaller and cheaper PCB) etc.

But making an analysis whether it is useful to use 1-Wire or not is not trivial; however I love this concept.

Regards,
Cristian

USB to 1-wire

1-wire protocol is used to communicate with small inexpensive devices such as temperature sensors, weather instruments, counters and ADCs. A network of 1-Wire devices is called a MicroLan. The interface between these devices is through RJ-11 or RJ-45 ports connected with CAT-5 cable. What if you would like to interface devices with USB ports to the MicroLAN? There are companies like ElbaTech, which developed solutions for this requirement. They have a USB to 1-Wire Adapter Board (www.elbatech.com/s4_optional.htm), which is perfect for 1-wire developers. It can be programmed by using the standard 1-Wire software development systems. The board is based on the Dallas-Maxim USB driver chip and can supply power to the 1-Wire MicroLAN either with USB or with an external +5V power supply.

1-wire = closed bus protocol

I certainly like the idea of 1-wire.

Unfortunately... there aren't that many devices capable of 1-wire though and I also think they're not cheap.

RS232,RS485, I2C and lots of other communication protocols are also described in great detail.
It's not hard to create your own device using these protocols when you know a little about micro controller-Ic's and ready built devices aren't capable of doing what you want. 1-Wire uses a "closed" bus protocol in that matter, it's quite hard to create your own devices since there's almost no official info about creating such a device. If you want to, you'll have to do it by reverse engineering.

1-wire uses a 48 bit address-system however which ensures the possibility of 281.474.976.710.656 different addresses/devices. With almost 7.000.000.000 people worldwide that's about 40.210 devices for every person. I certainly wouldn't mind being able to create a thousand or two by myself without having to reinvent the wheel.

Who's online

There are currently 10 users and 7 guests online.

Online users

  • lf25yy06
  • Qui93rrma
  • Qui73ppbr
  • podcfou3
  • lalluneno
  • SypeGrearce
  • shadlight
  • QAdazkik7
  • Pypernpsype
  • yichedd3n8z8

Recent comments