Pages: [1]   Go Down
Author Topic: DS18B20's powered by shift reg?  (Read 1320 times)
0 Members and 1 Guest are viewing this topic.
Wiltshire, UK
Offline Offline
Newbie
*
Karma: 0
Posts: 48
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi All

I'm embarking on a project where I have a central unit with sockets where you can plug in DS18B20 sensors. Obviously the 1-wire search will let me know how many I have attached, but I want to know the port number that each one is plugged into. It seems the best way to do this would be to supply power to each port individually on boot, and check what addresses are on each port. I've been trying to think of a way to do this, and it seems that a shift reg which powers each port individually during boot and then all together during operation would be the best way to go. So 2 questions really...

1. Will the DS18B20 chips that are *not* powered definitely not respond to the 1-wire search? My concern is that they may "try" to power by parasitic power on the data bus, but from the datasheet I don't think this will happen. Wanted to check though.

2. Assuming I'm fine on the above point, is a shift reg the best/simplest way to go?

Thanks

Olly
Logged

Oxford, UK
Offline Offline
Newbie
*
Karma: 0
Posts: 41
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm not really clear on your hardware set-up but can't you plug each sensor into a port, run the one wire sample sketch and get the address of the sensor on that port? You communicate with the devices on the bus by their address rather than any position on the bus.
Logged

Wiltshire, UK
Offline Offline
Newbie
*
Karma: 0
Posts: 48
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, thanks for the response.

My intention is that the end user of this device wouldn't know anything about the underlying hardware or addresses. All they would know is that the sensor in port 1 leads to their living room (for example). So when viewing the data, via a webpage probably, the user will be going on port number. That's why I need a mapping of hardware addresses to ports on the device when the system boots, so that when readings are taken going forwards, they can be associated to the port and therefore the location of the sensor.

Cheers

Olly
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 227
Posts: 14048
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Interesting problem:

If I understand your idea correctly the shift register is used to select only one DS18B20 to get its number. Then why not using this same shift register to get the temperature of the right sensor every time. You can skip the whole internal DS number administration, but it depends a bit on how fast things must go and the resolution needed. If you need one reading per minute it should work.

pseudocode:

setshift(bathroom);  // make only the bathroom pin high.
startConvert();
Cbath = getTempC();
....
setShift(living);
startConvert();
Cliving = getTempC();
....
etc

probably making a function that does it all

float readRoomTemp(int Room)
{
  SetShift(2^Room);
  startConvert();
  return getTempC();
}

Is this an option?

Rob







Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Wiltshire, UK
Offline Offline
Newbie
*
Karma: 0
Posts: 48
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Nice idea Rob, thanks for that! Certainly the resolution won't need to be any higher than once perminute, so it's definitely an option to consider.

Cheers

Olly
Logged

Netherlands
Offline Offline
God Member
*****
Karma: 7
Posts: 670
A naughty mind is a joy forever.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm curious and have no experience...

Would it be possible to use one or more analog de-/multiplexers like the CD4067 in combination with 1-wire?
One would give you the possibility to check a 16-room house and the next layer (if possible) a 256-room castle.


Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 76
Posts: 7306
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

How much current is the sensor rated at? My typical shift register can do maximal 20mA on its output. Make sure the device won't need more than what the shift register can supply.
Logged


Cumming, GA
Offline Offline
Edison Member
*
Karma: 20
Posts: 1663
Ultimate DIY: Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

There already are 1 wire chips designed to "switch" the 1-wire bus. DS2409 MicroLAN Coupler does what you describe
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 227
Posts: 14048
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

just checked - http://datasheets.maxim-ic.com/en/ds/DS2409.pdf - and it states "not recommended for new design" over it.

But still an interesting option.
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

North Germany
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Abacom Board user.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

the sensor only needs about 1mA while measuring. You could check the "device parasitic power" flag wether it is directly powered or not
I think the multiplexer will be the best job since the other sensors are completly ignored. The only 'problem' is that you can't use parasitic power (the sensor needs about 600-800ms for the first measurement)
Logged

Chips: Atmega 168 / Atiny 2313
SPI+I2C Port expander (MCP23S17+MCP23016)
1-Wire Temperature sensor (DS18S20)
RFID reader
DCF-77 receiver
3 P

Pages: [1]   Go Up
Jump to: