Showing posts with label 1-wire. Show all posts
Showing posts with label 1-wire. Show all posts

Sunday, May 5, 2013

Arch Linux Iomega IConnect

I got an iConnect a few years ago. 1 Ghz processor, 256 MB RAM, Gigabit Ethernet, Wireless Card, 4 USB Ports (3 Usable).

Quite a good machine to run embedded Linux on. I had it running various services such as OWFS 1-Wire, XRF Wireless from Ciseco and other testing projects.

Anyway, one day I was tinkering and I broke it. It had to do with the bloody Arch Linux updates and Kernel modules. It was in a heap and was useless. I was busy being distracted by other projects, so the iConnect was put offline and joined the grave yard of stalled/unfinished projects.

One day, recently, I talked to Dr Google about hacking the iConnect.

I came across a couple of interesting links dealing with installing Debian on the iConnect.

http://scriptkiller.de/en/a54/computer_electronics/hacking_the_iomega_iconnect/

http://www.kroonen.eu/wiki/Debian%20iConnect

Really excellent links. You should have a read if you are interested in this type of stuff.

The link that was really the money shot was

http://pawelwozniak.info/index.php/embedded-linux/iconnect/126-install-archarm-linux-on-iconnect

It contains all the information required to install Arch Linux on the iConnect.

I used the Sarkfun FTDI Basic Breakout - 5V which I got from Cool Components to gain console access. I modified it to use 3.3V rather then the hotter 5V. Perfect.

The final update is to set the arcNumber from 1682 to 2870. This gives you access to the specific hardware in the iConnect, such as LEDS and the button.

They are located in:

/sys/class/leds

This is what you get:


iconnect:blue:otb -> ../../devices/platform/leds-gpio/leds/iconnect:blue:otb
iconnect:blue:power -> ../../devices/platform/leds-gpio/leds/iconnect:blue:power
iconnect:blue:usb1 -> ../../devices/platform/leds-gpio/leds/iconnect:blue:usb1
iconnect:blue:usb2 -> ../../devices/platform/leds-gpio/leds/iconnect:blue:usb2
iconnect:blue:usb3 -> ../../devices/platform/leds-gpio/leds/iconnect:blue:usb3
iconnect:blue:usb4 -> ../../devices/platform/leds-gpio/leds/iconnect:blue:usb4
iconnect:led_level -> ../../devices/platform/leds-gpio/leds/iconnect:led_level
iconnect:red:power -> ../../devices/platform/leds-gpio/leds/iconnect:red:power
rt2800pci-phy0::assoc -> ../../devices/pci0000:00/0000:00:01.0/leds/rt2800pci-phy0::assoc
rt2800pci-phy0::quality -> ../../devices/pci0000:00/0000:00:01.0/leds/rt2800pci-phy0::quality
rt2800pci-phy0::radio -> ../../devices/pci0000:00/0000:00:01.0/leds/rt2800pci-phy0::radio



http://archlinuxarm.org/forum/viewtopic.php?f=27&t=2612

Great work. Costs no money, so Woo Hoo!!

I plan to use to use it for Project Janus. It will use an iButton key fob or an RFID card to control some devices. There will also be other sensors in the loop for status updates, PIR and perhaps some audio component. Cool....

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.

Tuesday, July 31, 2012

Raspberry PI Arduino Shield - Cheap Option

I have a project on the go which I call Project Doorman aka Carlton. It will involve a Raspberry PI, I2C connections controlling a 1-Wire controller which will be connected to a DS2408 switch. I will use an iButton ID keyfob and sensor i got from http://www.homechip.com a few years ago. So, keybob, open the door and Bob's your auntie.

I wanted to have as much of the electronics mounted on the RPI. I have a Slice of PI by ciseco.co.uk but the prototyping space is too small.

I was also looking at the Adafruit Prototyping Pi Plate Kit for Raspberry Pi but that would cost €20 landed. I was going use it, so all the fancy connectors etc., would end up not being used. Feck that, I said. I know the bits would be used on other projects. A penny saved is a penny to squander.

I read about a fella who was talking about using an Arduino Prototyping Shield on the RPI. That sparked an idea.

In my previous researching/playing with Arduinos, I got Budget Proto Shield (x3) from Oomlaut.com. I had one I hadn't used.

So I desoldered the headers, and soldered one on the other way.

Presto Chango, I had a Cheapo Raspberry PI Prototyping Shield/Plate


Here is the Protoshield attached.

it only uses a single line header, which provides access to the I2C pins (3 & 5). I also get 3.3V on pin 1. I will also need access to the 5V pin (2) and Ground pin (6). I probably will put a small header piece to accomodate this and solder some pieces of wire and connect it to the Shield. I don't care really, whatever works.

It is a nice size and definately has the real estate I need.

From the side. I used the space to have it fit on top of the other bits of hardware, in this case, the composite video connector. Everything has to be nice, after all.


Kist the header from different angles.



Here we have the major components that will be used for this project. The red guy is a Logic Level Converter I got from CoolComponents.co.uk. Very cheap and useful. It ensures that I only have 3.3V connecting to the RPI.

The next girl is the Dallas DS2482-800 the I2C 8 Channel 1-Wire Master Controller. I used the Tirna SMT SMD DIL adaptor SOIC 16 PIN NARROW  to mount the DS2482-800. Very Handy and fairly cheap.

The final good buddy is a Dallas  DS2408 a 8 Channel 1-Wire Adressable Switch. Very handy. Again I used the Tirna adapter.

That is about it. I will probably reorganise the layout to facilitate adding extra components. I might add a couple of light sensors, while I am at it.

So, what are the benefits? Cheap and Useful. I don't really need a prototyping board. It is going strainght into production.

Thursday, July 5, 2012

Raspberry PI 1-Wire I2C OWFS

I wrote this a few weeks ago and forgot to post it.

I received a Raspberry PI recently. It looks great, nice and small.

I have been playing with PlugComputers, such as the SheevaPlug and the Seagate Goflex series for a few years. They form the basis of my low power computer systems that are on 24x7. The Raspberry PI is just like one of them but with a few extra facilities.

Getting up and running was a breeze. I simply downloaded the image, by bittorrent, if I remember correctly. It only took a few minutes.

I blew it onto an SD card and powered it up. Hey Presto! it worked. I was able to determine it's IP address and ssh in to have a look around. Perfect.

I didn't have a HDMI cable to hand, so I used a composite cable to connect it to the TV. It worked but the quality was not the best. Moved on.

I was wondering what to use the PI for. I still don't know.

I came across an article talking about using the PI with OWFS. http://raspberrypi.homelabs.org.uk/


OWFS stands for One Wire File System. 1-Wire is a technology developed by Dallas Semiconductor (Maxim-IC), that actually uses 2 wires to communicate with devices such as temperature sensors, switches, voltage detectors, a/d converters and so on. I use it extensively throughout the house to measure temperature and control things. One of the great things about the 1-Wire devices is that they are pretty cheap.

On the Raspberry PI, there are a number of input/output pins. The ones of interest in relation to 1-Wire stuff are the I2C pins. I2C is basically a serial protocol. It is the building blocks that USB and SATA are built on.

The good thing is that Maxim-IC make a number of I2C to 1-Wire controllers. These are the DS2482 and DS2483. There are probably others also.

So, the possibility to connect the chips directly to the PI was real.

I was able to acquire a couple of DS2482s from a friend of mine. I had to mount them on a 16 way SOIC to DIP converter.

The OWFS system was easily compiled from source on the Raspberry PI and installed.

I then began the search for the I2C drivers.

This was a hard one. I found many forums that resulted in a dead end. Many kernels were compiled and failed. I couldn't get/build a kernel that would work with the drivers installed.

I found a fella that had a pre-built kernel built for Debian. I use Arch, which is pretty different in it's config, even though it is Linux.Here is the link I used http://www.bootc.net/projects/raspberry-pi-kernel/ I also installed the latest firmware.

Anyhoo, I was able to install the new kernel and modules and boot a workable system. Cool.

All the quick checks were good.

I then wired up the chips, DS2482, and started  the main program owserver. Hey presto, it worked.

I wired a couple of DS18B20's and could see them and read temperatures. Success.

I love this embedded Linux crap.

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, July 21, 2010

Homeasy Remote PC Control - Linux & 1-Wire

As discussed previously, I am a big fan of the Homeeasy range of products.

I have quite a few in use around the house. 16 in total.

My first adventure in home automation involved some X10 devices. These were OK but were slow to respond and overall unreliable.

I had appliance and lighting modules, some bayonet modules, pir and remote controls. Also some wireless transceivers and a controller. Now all unused.

I then came across the Homeeasy range of products. I think my brother Peter introduced me to them. Fairly cheap, so I got a few of them.

Came across James @ Notes from a small field, who was talking about setting up an arduino to operate like a Homeeasy remote control.

After a bit of work and revision, I was able to get a working arduino/homeeasy rig working. Here is a link to that particular project: Simple/Manual Protocol Arduino/Homeeasy

The final version also contained an Ethernet shield and operated as a web server. Various commands were sent to the web server using the URL to pass parameters, which were picked up by the arduino. Very good actually. It has been running for almost a year now. No crashes.

So, it worked fairly well. It is about 80% effective. It was mainly used in the kitchen and there were some dead spots that were only about 10% effective. Don't know why. Swapped modules, etc., still dead spots. This would have been OK for me but not acceptable for SWMBO and the other house inhabitants.

As hinted above, this set-up only accounted for the transmission of the Homeeasy Simple Protocol. This is not compatible with all the Homeeasy range of products. They also use an Advanced Protocol for some of their devices, such as sockets and wall switches.

I wanted to use some of these switches and sockets, so I had to get a method to remotely control them.

Around that time, there was a lot of activity in the adruino homeeasy controller area.

There were a number of options available for Homeeasy Advanced Protocol programming on the arduino.

I tried many of them but found less then 100% reliability. Again some dead zones or sometimes it would work and sometimes it wouldn't. Definitely not acceptable.

During this journey, I noticed that the hand held remote was very reliable. I presume it was something to do with my implementation. Personally, I think there is an aerial issue. I don't know anything about that, so I parked this project and moved to another approach.

I read about using the actual Homeeasy hand held remote wired up to an arduino on Instructables and something similar in the Practical Arduino book.

Easy enough. I put it together and it worked perfectly. 100%

So, then I thought, the arduino is all very good, but all I am doing is using the arduino as a smart relay controller.

I have been using the Dallas 1-Wire devices for a number of years to read temperature and other weather readings. I also use a 1-Wire relay to control my boiler.

Using a schedule stored in a database, the boiler goes on and off as required. This is the subject of another post, I think.

I decided to use 1-Wire switches to control the hand held remote.

I got myself a breadboard some wires and a couple of DS2408 chips and my trusty USB 1-Wire controller.



Again following the wiring layout on Instructables - Arduino Home automation, got it all up and running in no time.

There are 4 on and 4 off buttons and the DS2408 has 8 switches.

To utilise the 4 zones, I needed another 4 switches. I used the other DS2408 for this.



The 1-Wire system is controlled from a Linux box on the network. I wrote a PHP script that presented me with various devices and On/Off buttons to control them.

I used OWFS (One Wire File System) suite of programs to talk directly with the 1-Wire switches.

Happy days.

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.

Friday, November 6, 2009

Sinead's 1-Wire Alarm Clock


My daughter Sinead has a problem getting up for college in the morning.

She finds standard alarm clocks do not work for her. Too easy to turn off and go snoozing again.

We investigated a number of solutions, such as louder alarm clocks etc, but nothing really provided a complete solution.

I have been involved, some people would say obsessed, with Home Automation for a while now. One of the technologies that I use is called '1-Wire'.

1-Wire is basically a 2 wire network, that can be used with a number of components supplied by Dallas Semiconductor Co (now Maxim) to perform a number of functions, controlled by a computer for example.

They are probably best known, in geekdom, for their DS18S20 temperature sensor. I use these throughout the house to measure the temperature in different rooms.

They product other chips that do different things. The one I used in this case was a DS2405 addressable switch. It is an oldish device that has been superseded by the DS2406 and DS2408.

Anyway, it can be used as a switch and as a sensor to detect voltage. Pretty useful.

When the alarm goes off, the patron will need to get out of the scratcher, go to where the computer is, bring up a web page and click 'OFF'. She has an iPaq which is connected to the network. There will be a block on using an iPaq to turn off the alarm. Hehe! Evil, evil, evil.

My design is as follows:

1. Use my existing 1-Wire network to control the DS2405.
2. Use the DS2405 to control a relay.
3. Use the relay to switch on and off a sound source.
4. Use a PHP web page to interface with the set-up, i.e. turn on/off, set-up schedules, etc.
5. Use bash scripts to manage the schedule automatically.
6. Cost me nothing, except time.

List of materials:

DS2405 (or DS2406 or DS2408)

Some relay. I used a Opto-Isolator, which I already had. I used Opto-isolator,ISD74 5300Vac/50mA DIP8 which I got from Radionics.ie

A door /window alarm I got from Lidl a number of years ago. There is a small siren, that is loud enough for this application. I shouldn't wake people in other rooms.

5V Transformer. I used one from an old Sony walkman.

Various cabling, cat-5 and phone cable.

Some heat shrink sleeving (to make it all neat-o)


Construction:

Prepare the alarm. Strip out the button batteries, remove the battery contacts. You are left with a red and black wire. I also removed the reed relay sensor.

Connect the 1-Wire cable to the GND and 5V of the DS2405.

Connect the PIO and GND of the DS2405 to the appropriate pins. See spec sheet for this chip.

Connect the output pins to the 5V+. One to the walkman and the other to the 5V on the alarm siren (red wire).

Connect the black wire from the alarm to the gnd on the transformer.


I was able to fit all the components in to the alarm, after removing the batteries and cutting a plastic separator.


Wired it up to the 1-Wire controller and tested it. Worked perfectly.

Patched it through from where the main computer is to Sinead's bedroom.


Next Step:

Write the PHP script to provide an interface to turn it off, when the patron has arisin.

Put together a bash script to automate the switch on and off of the alarm. I think 30 mins on would be sufficient. I you can't get up in that time, you are not there or there is a serious problem.

This will be the easy part.