Go Down

Topic: How to wire multiple sensors - D18S20 (Read 1 time) previous topic - next topic

FleaBit

I have a small project and I'm trying to create a small board that will allow me to take 4 sensors off in 4 completely different directions. Otherwise, I'd just try and daisy chain them. I have a small prototyping board and (4) 3 wire terminal blocks.

I know you have to use the 4.7K pull up resistors on these, so on my diagram, you can see my thoughts. The positives and negatives are common, on rows. The data has 3 holes, all together, so I planned on picking the data up from that. With 4 different sensors, and using 4 different data lines (1 positive, and 1 negative on the common buses), can I put the 4.7K resistor from the common positive to the data line on each one, knowing that there will be (4) 4.7K resistors all on the same positive?

As you can see from this, my electronics knowledge is non-existent. But my gut told me to stop and ask because it might not be right or even worse, it might do damage to the Arduino.

Can I do it like shown, or do I need to back up and regroup?

Thanks!

afremont

#1
Mar 07, 2013, 02:45 am Last Edit: Mar 07, 2013, 02:47 am by afremont Reason: 1
If you are going to have your data lines connected to different pins on the micro, then you need four resistors.  If you bring all data lines to the same i/o pin, then you need only one resistor. 

That's the way I understand it anyway, but wait there may be other experts wanting to comment.  They know far more about the right way to wire your bus than I do.
Experience, it's what you get when you were expecting something else.

FleaBit

Thanks, I'm going to use 4 different I/O pins for this if that helps any. My concern was just putting 4 resistors all on the same positive, but it might be perfectly acceptable to do that.

Nick_Pyner

#3
Mar 07, 2013, 04:11 am Last Edit: Mar 07, 2013, 08:55 am by Nick_Pyner Reason: 1
If you use the one wire system, in the manner that god and Dallas intended, one pullup will suffice. If you use separate data, you need a 4k7 pullup for each.  

But before you go out and buy the extra 4k7s, you might consult the aforementioned gut, and write down very clearly why you would want to make up a proto board that runs counter to the way god and Dallas intended the sensor to be used. I say write it down, because it is surely going to be something you later regret.

FleaBit

Thanks Nick! So what you are saying is that even if I have 4 separate wires, going in 4 directions, I should still pull all 4 data wires back into 1 I/O on the Arduino, correct? I can do that, it's not a problem. Is that what you're saying?

Thanks for the input!

afremont


Thanks Nick! So what you are saying is that even if I have 4 separate wires, going in 4 directions, I should still pull all 4 data wires back into 1 I/O on the Arduino, correct? I can do that, it's not a problem. Is that what you're saying?

Thanks for the input!


Yes, that's what he is saying.  You would only use one resistor then.
Experience, it's what you get when you were expecting something else.

FleaBit

Great, thanks! Glad I asked. This place is great for helping people like me that just don't know what we don't know!

I appreciate the help from all that gave input!


Nick_Pyner



Is that what you're saying?


Yes, that's what he is saying.  You would only use one resistor then.


Indeed I am. Not only do you save resistors but, far more importantly, you save Arduino pins! Having the cable going in different directions is hardly material. You bring them back to individual terminals on your proto board and have them straddling three rails - 5v, gnd, signal, rather like you originally intended, but with only one resistor.


Go Up