Monday, February 24, 2014

Home Automation Project #4 1-Wire I/O Performance Test

Dallas has a couple 1-Wire I/O chips out there.  I decided to test the one that seemed practical to replace a light switch or plug. The DS2413 was almost perfect.  It has 2 I/O, gets power from the data line, and Adafruit made it easy for me to test by making the breakout board.

Here's what I used for my test:


With these I created a demo to see the read and write speeds through the 1-wire data line.
Source code for benchmark:

As you can see the performance dropped more than half every time I pressed the button.  Not bad if all I care about is whether the light turns on right when I press the button, and it would.
I then ran the loop to see how fast it would go at turning on and off the relay and saw an average of 20.833 requests per second. (Don't worry, the relay wasn't able to click on and off that fast)

Adding a DS18B20 Temperature sensor and requesting it every second I found that when the temperature was requested the requests per second dropped down to 1.950 requests per second and then jumped back up to the 42.27 range until the next second came along.

Requesting the temperature every loop cycle was unworkable.  I had to hold my finger on the button far longer than desired to get the relay to turn on.  I tuned it up by requesting the lesser accurate temperature value "fasttemp".  I also requested it less often (every other second).

t=ow.Sensor('/28.B0A534050000')
t.useCache(False)
print t.fasttemp

The DS2413 datasheet mentions the ability for Overdrive (~10x the communication speed) but I was unsuccessful on getting it to work.  The communication would seize when I tried enabling it on the bus.

Conclusion:
Controlling your lights with the DS2413 is possible, but you are limited on the quantity of chips on the same bus line. If you are able to get the chip's Overdrive feature working then I would suggest getting the 8-port i2c to 1-wire add-on board if you have plans for your whole house.

I'm going to test the DS2408 (8 port 1-Wire I/O chip) soon and am a little more hopeful since you can control multiple rooms and/or lights with one chip.

(Pictures coming soon.)