Most people will use Lm_sensors with the existing sensors in their computer. While this gives access to machine dependent information some very interesting applications can be done using additional homebrew hardware.
Lm_sensors differs between busses and devices. Devices are the sensors itself your computer has access to (e.g. temperature sensors) while the busses are the part that gives your computer access to the devices. There are basically two general ways to attach additional Lm_sensors supported hardware:
- Attach new devices to existing busses
- Add new busses and use them to connect new devices
If you are successfully using Lm_sensors with your computer then this machine sure has at least one bus. This is usually the SMBus on your PCs motherboard connecting temperature sensors as well as e.g. the configuration eeprom memories present on DIMM memory modules. Other busses already present may be i2c busses on your graphics card or a TV capture card.
It is also possible to add new busses to be used by Lm_sensors. These may either be (part of) a device to be installed internally e.g. by in form of a PCI card. Alternally a new bus may be attached externally to one of your machines peripheral interfaces. These interfaces may not necessarily be designed for the use with sensor chips. But some can more or less be abused for sensor usage. E.g. the most popular abuse is to use the printer port to connect all kind of i2c sensor chip.
If you are unsure where to connect a new device it is probably a good idea to start with something you can attach externally to your machine. This way you don't have to tinker with the innards of your machine and thus greatly reduce the risk of damage. However you can still cause major harm just by attaching weird things to the external connectors of your computer. So proceed at your own risk ...
Adding a new bus to be used for you own experiments is a good idea for at least two reasons:
- You don't have to tinker with vital parts of your computer
- You don't have to care for devices already present on the bus
Another good thing is that new busses are usually attached externally and you very likely don't even need to open your computer. The disadvantage is that these solutions are often quite limited and don't exactly meet the bus specifications. It may therefore be possible that your favorite sensor does not reliably work at a certain kind of interface.
Printer port adapters
Printer port adapters are the classic external i2c solutions. They exist in various flavors and have been developed by various companies including philips who built such an interface basically at the day they invented the i2c bus. The major advantage of this adapter family is their simple design. They are therefore the first choice if you want to make your first steps with sensor hardware hacking.
But these adapters have a set of disadvantages. These are e.g. the lack of a power supply, their low performance and their lack of protocol compliance. An increasing problem is the fact that these can only be used with computers that actually do have a printer port. If you can deal with these limitations a printer port adapter may be a good choice. It's at least a good thing to start with.
... more details to come ...
USB adapters make use of the fact that all modern computers provide a whole bunch of USB interfaces. Using this interface for own experiments is significantly more difficult than e.g. using those printer port interfaces. A USB interface always requires some intelligence in the interface. They are therefore always based on a microcontroller and thus need some form of firmware incl. a way to upload this firmware to the microcontroller. Building such a device from scratch and using it may be quite complex.
These devices have the advantage of being easily powered from the PC. This may even include client devices (sensors). Furthermore the microcontroller used in these devices can easily care for the sensor bus as well. They have thus less impact on the load on the main CPU than e.g. a printer port adapter.
... more details to come ...
Making use of existing busses usually isn't for the faint of heart. You'll likely have to use the solder iron on vital parts of your computer. The advantage will be that you can build upon powerful bus controllers inside your computer. If you succeed you'll probably get a very fast interface and the existing interfaces usually exactly meet the bus specifications and should work fast and reliably with any compliant device.
Warning: Tinkering with the insides of your computer is at your own risk. We do not encourage you or suggesting that you open up your computer to solder stuff if you are unfamiliar or uncomfortable with doing so. Neither the Lm_sensors group nor anyone else associated with the information on this page is responsible for any damage you may do to your equipment'''
First of all, the SMBus originates from either the Intel PIIX4 or the Via southbridge (technically an I2C bus if from the Via chip, but close enough). The SMBus is a two-wire communication bus. One signal is a clock, on the other is data. The clock line tells devices when to latch or send bits on the data line. Without going too much more into detail, suffice it to say that using the SMBus you can communicate with dozens of devices (in theory, close to a thousand). The throughput speed of the SMBus is somewhat slow (clock is about 100kHz), but is more than fast enough for system control/monitoring.
To connect some of your own devices to the SMBus, you need to find a good place to get four lines: Ground, +5V, SMBus Clock, SMBus Data. Some motherboards offer direct access to the SMBus through 4 regular pins. This was seen on various Asus and Abit boards, and could be found on other brands too. This is by far the easiest way, so look for these pins first.
If you can't find them, probably the best place to get the lines is on a SDRAM DIMM. This way you aren't soldering stuff to your mainboard, and a DIMM is easy to take out and tinker with. The SDRAM DIMM has a series of RAM chips as well as a small serial EEPROM used to store timing and other technical information your Bios uses to configure the system to use your RAM correctly at start up. (Note: the lm_sensors package comes with some EEPROM drivers to access these EEPROMs, and a perl script to parse the contents into [slightly better] human readable form.) This serial EEPROM has all the signals you want. To find out which pins the signals/power are on, you need to get the docs for the particular EEPROM from the manufacturer's web site. Once you know which pins have +5V, GND, SMBus DATA, and SMBus Clock then you are in business!
Carefully solder some high gauge (thin) wire to the pins where the signals you need are. Wire-wrapping wire is good stuff to use. Using thin wire makes it easier to solder and if you should short something, you are slightly more likely to fry a wire rather than your mainboard. Be very careful not to use too much solder and accidently put a solder 'bridge' across any of the terminals! You also want to be carefull to never let any of the wires conduct to each other, especially power and ground! Once you've got the wires connected, I strongly recommend using a hot-glue gun to dab a good glob on the DIMM to hold the wires in place. In fact, if your soldering job is good and has been tested, then you may even want to put a glob on all your solder work to ensure things will stay in place and won't short to each other or to anything else in the computer (like the DIMM in the next socket).
Now you can connect these wires to a breadboard or what ever you want:
For example, here is a Linear Technologies LTC1710 which is a dual switch. (It can turn either of two device on or off through simple SMBus commands. A driver for the chip is included in lm_sensors, if interested.) Right now, all it does is turn a couple LEDs on or off, but I'm sure you can think of some better uses... Simply connect +5V, GND, SMBus data, SMBus clock to all the appropriate places as well as what ever else you need for that specific chip, and play! You can connect multiple chips up to the same clock and data lines. The SMBus/I2C protocol takes care of making sure that the chips let each other talk when they need to and operate in a shared bus environment (sorta like ethernet). You do need to be aware that each device must have a unique SMBus address. This can sometimes limit the number of a particular chip that you can use if that chip only allows for a specific number of selectible addresses (usually by hard-wiring extra pins to GND or +5V).
I haven't tried it, but another suggestion is to use something like Linear Device's LTC1694 to provide some 'cleaning' of the signals on your breadboard. It is basically a four pin device which you connect power, gnd, SMBus clock, SMBus data, and it tries to improve signal quality by 'boosting' the signals it senses when needed. Other possible devices to play with include: ADCs, DACs, temperature sensors, voltage sensors, analog multiplexers, LCD displays, etc. Basically what ever is out there for the I2C/SMBus. Using the lm_sensors software package, you should have a huge head-start on writing apps which access these I2C/SMBus chips.
Update (4-29-99): We received an evaluation kit from Analog Devices which connects their ADM1021 evalulation board in the same way that our ad-hoc method does. Notice the 'blank' SDRAM DIMM which is used to 'tap off' the SMBus from the DIMM slot. It also provides a parallel port connection (used with an I2C parallel port driver) for simpler (although, not as realistic) connection.
Lastly, I want to mention that the images on this page were frame-grabs using 3com's "Big Picture" video conferencing kit which is driven by the BT848 (aka BTTV) driver (written by Ralph & Marcus Metzler) and using Gerd Knorr's XAWTV grabber software. Quite amazing to watch 30 fps video in X and to easily take jpeg freeze-frames at the touch of a key!
As an alternative to tapping the SMBus via memory modules, it is possible to use PCI or PCIe riser cards to do the same. SMBus is supposed to be routed over PCI and PCIe slots. Robert Smith gave it a try and reported success.
(29.1 KB) - added by otaku42 <mrenzmann@…>
9 years ago.
(26.6 KB) - added by otaku42 <mrenzmann@…>
9 years ago.
(20.8 KB) - added by otaku42 <mrenzmann@…>
9 years ago.
(22.4 KB) - added by otaku42 <mrenzmann@…>
9 years ago.
(18.9 KB) - added by otaku42 <mrenzmann@…>
9 years ago.
AD Evaluation Kit.