Pages: [1]   Go Down
Author Topic: Arduino as 1-wire slave/device  (Read 1615 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 91
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Has anyone done any work on adapting the 1-wire library to allow the Arduino to act/respond as a 1-wire slave/device? While searching I found a few old short posts inquiring about this but no replies or follow ups.
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The 1-wire master is implemented entirely in software, so conceivably you could do a slave that way as well. It is fairly timing-critical. Why not just use 2-wire or serial comms? According to tests I did, 1-wire is somewhat slower than async serial. And I think someone recently was playing with doing bi-directional serial using only 2 wires (you had to switch between sending and receiving, I forget how they did it right now). Of course, the 1-wire interface is really 2 wires (data and ground) so if you only want a single direction, then normal serial would be fine (like an RFID reader) and if you want bi-directional, look up the 2-wire serial approach.
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 91
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My reason for wanting to use the 1-wire protocol is that we are currently monitoring/logging a 1-wire bin temperature setup and it would be nice to emulate the 1-wire slave protocol with an Arduino to monitor non-temperature related items with our existing software. This is a bit of a hack as the software is designed to read DS18B20 compatible sensors, but I figure it should be possible to submit any data I want as long as the existing hardware/software thinks it's a DS18B20.
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It's probably possible. I have some timings shown here from the logic analyzer:

http://www.gammon.com.au/forum/?id=10902

You can probably emulate one with careful attention to timing. The specs for the DS18B20 describe the timings in some detail.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for sharing the link to your website, it is helpful to understand the timing issues.
Has anyone actually emulated an Arduino as a slave device then?
Cheers
Logged

West Yorkshire, UK
Offline Offline
God Member
*****
Karma: 17
Posts: 721
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I agree with Gareth. It would be really handy to be able to use an 8 pin ATTiny to interface with various types of sensor and enable them to be connected to a 1-wire bus. For example, humidity sensors, which are quite expensive to buy with 1-wire interface.

I did find this...
http://hsbp.org/owslave

Paul
« Last Edit: November 16, 2013, 04:54:25 am by PaulRB » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Does that code essentially make the AVR microcontroller act as a slave device?
I would like to use a Mega2560 to emulate a 1 wire EPROM..
Logged

West Yorkshire, UK
Offline Offline
God Member
*****
Karma: 17
Posts: 721
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I believe that's the idea, yes. Now you know as much as I do...
Logged

Pages: [1]   Go Up
Jump to: