Showing posts with label sensor. Show all posts
Showing posts with label sensor. Show all posts

Thursday, June 6, 2013

Arch Linux Iomega IConnect I2C Sensors

I recently wrote about installing Arch Linux on the Iomega IConnect.

This shows how to get the I2C interface working and have a look at the built in LM63 temperature sensors.

Install lm_sensors.

pacman -S lm_sensors

Have a look and see what the package gives us, binary wise.

pacman -Ql lm_sensors

/usr/bin/fancontrol
/usr/bin/healthd
/usr/bin/pwmconfig
/usr/bin/sensord
/usr/bin/sensors
/usr/bin/sensors-conf-convert
/usr/bin/sensors-detect


We need to load a few kernel modules. i2c-mv64xxx is the driver for the I2C bus and lm63 for the sensors.

[root@biggles ~]# modprobe i2c-mv64xxx
[root@biggles ~]# modprobe lm63
[root@biggles ~]# lsmod
Module                  Size  Used by
lm63                    5257  0
hwmon                   1187  1 lm63
i2c_mv64xxx             4121  0
i2c_core               15344  2 i2c_mv64xxx,lm63
rt2800pci               7802  0
rt2800lib              39393  1 rt2800pci
rt2x00pci               3661  1 rt2800pci
rt2x00lib              30207  3 rt2x00pci,rt2800lib,rt2800pci
eeprom_93cx6            1150  1 rt2800pci
mac80211              170543  3 rt2x00lib,rt2x00pci,rt2800lib
cfg80211              143659  2 mac80211,rt2x00lib
rfkill                 14400  2 cfg80211
ds2490                  6254  0
wire                   15857  1 ds2490
ipv6                  259694  10
mv_cesa                 9128  0
autofs4                22074  2
[root@biggles ~]#
[root@biggles ~]# sensors-detect
# sensors-detect revision 6170 (2013-05-20 21:25:22 +0200)
# DMI data unavailable, please consider installing dmidecode 2.7
# or later for better results.

This program will help you determine which kernel modules you need

------------------------ snip -------------------------------------------

Some boring text and all negative, so skipping it

------------------------ snip -------------------------------------------

Module i2c-dev loaded successfully.

Next adapter: mv64xxx_i2c adapter (i2c-0)
Do you want to scan it? (YES/no/selectively):
Client found at address 0x4c
Handled by driver `lm63' (already loaded), chip type `lm63'

Now follows a summary of the probes I have just done.
Just press ENTER to continue:

Driver `lm63':
  * Bus `mv64xxx_i2c adapter'
    Busdriver `i2c_mv64xxx', I2C address 0x4c
    Chip `lm63' (confidence: 6)

Do you want to generate /etc/conf.d/lm_sensors? (YES/no):
ln -s '/usr/lib/systemd/system/lm_sensors.service' '/etc/systemd/system/multi-user.target.wants/lm_sensors.service'
Unloading i2c-dev... OK

[root@biggles ~]# sensors
lm63-i2c-0-4c
Adapter: mv64xxx_i2c adapter
temp1:        +38.0°C  (high = +70.0°C)
temp2:        +38.2°C  (low  =  +0.0°C, high = +70.0°C)
                       (crit = +85.0°C, hyst = +75.0°C)
                      
All Done

Friday, August 10, 2012

USB Temperature Sensor and Linux (Part 2)

I wrote on this a quite a while ago and it seems very popular, so I thought I would write an update

I decided to include some of the files, to make it easier to use.

The first file is temper-1.0.tgz. I got this from the good looking guys over at www.relavak.com.

Here it is here temper-1.0.tgz

I downloaded it, and extracted it with 'tar zxvf temper-1.0.tgz'

Then I downloaded temper.c, which is my modified code.

I copied the temper.c file into the temper-1.0 directory.

Then I ran 'make'.

It produced and executable called 'temper'

Here is the compiled 32 bit version temper_32bit

And the compiled 64 bit version temper

Have fun.

Thursday, July 5, 2012

Raspberry PI Stuff and Building a Case

My Raspberry PI arrived a few weeks ago.

I tried both the Debian and Arch Linux boot images.

I don't have a convenient HDMI TV to play with, so I settled on the Arch version.

It suites me better, as I really wanted to use it as another Plug Computer, to do something with.

What to do with it? I am not sure yet. There will probably be something Home Automation related.

I am a big fan of the 1-Wire technology, for temperature sensors and control, so I compiled the latest version of OWFS on it. It worked fine with the USB 1-Wire controller.

The RPi has an I2C interface, so I decided to get my hands on a couple of  DS2482-100s and DS2482-800s. These are I2C to 1-Wire controllers. After a bit of messing about, I was able to address the conrolllers using OWFS.

That will be a furure post, hopefully.

I was looking for a suitable plastic case fir the new toy. There are quite a few about and rather pricy for what they are. I liked the one on SKPANG. Including postage and VAT, it would come in at about €20.  As my friend Ber would say 'Balzac' to that.

I came accross a post by Pecker Dunne on raspberrypi.org http://www.raspberrypi.org/phpBB3/viewtopic.php?f=40&t=9165&e=0

I was able to get a small sheet of perspex. Using youtube, I was able to determine that the 'score and snap' method was the best and cleanest way to get the pieces I wanted.

I made a few attempts. Two sheets of perspex and some No4 screws and nuts. I got some plastic washers to hold the board. It was just the job.






Attempt 2. In the presious version, I had put the screws too close to the IO header.



I also decided to make a breadboard version of it, to add breadboards and a USB hub.

I found that 3 screws would hold the RPi quite tightly and was easier to position the top piece.




Add a 10 port powered USB Hub


Some Breadboards
 

A Nanode and Xino Basic Arduinos for completeness.


I plan to use the slim breadboard for connections from the RPi headers and the larger one for the various components.

I sized the main plate, based on a plastic box with cover I have. Everything fits in and can be safely stored between project activity.

The next investigation will involve the Ciseco Slice of PI and the XRF radio module.





Wednesday, November 18, 2009

USB Temperature Sensor and Linux

I picked up an USB Temperature Sensor on eBay a few weeks ago. Total cost just over 4 Euros. It would have been rude not to get one. It is a HIP TEMPer model from http://www.pcsensor.com/. They have a few mad products such as a three foot switch. I like it.



I took quite a while to actually arrive.

It arrived today, so I plugged it into a Windows XP machine and installed the software. Yep, worked fine. The software that comes with it is basically crap. The colour scheme is way ugly.

This is not a problem at all as I planned to use it on Linux. I wanted to be able to poll the device and pull a temperature reading off it, stick it in a mySql database and present the data via a PHP web page. Bob's your aunty.

After consulting Dr. Google for a while, I came across this site, that had what I was looking for. http://relavak.wordpress.com/2009/10/17/temper-temperature-sensor-linux-driver/

I downloaded the driver and ran it. Perfect, almost.

It ran in a loop with lots of other data being shown. The default executed in a debug mode.

So, I had a look at the source code. I am not a C programmer but it was easy to follow.

I changed a few settings, commented out a few lines, compiled and tested it. Wash, rinse and repeat.

After a very short period of time, I had what I wanted.

The program just reads once and outputs the temperature in centigrade.

Done.

Just the thing to use in a script and automate.

I think I will get a few more. Very cheap and useful. Brilliant piece of kit.

I use 1-wire sensors for a lot of my temperature measurements. This is another tool for the toolbox. This is all due to the Linux drivers provided by http://relavak.wordpress.com/2009/10/17/temper-temperature-sensor-linux-driver/.

He is the hero.

I have added an update to this blog   - USB Temperature Sensor and Linux (Part 2)  on 10/08/2012. Included come compiled code.