Go Down

Topic: DS18B20 multiple sensors (Read 8 times) previous topic - next topic

GoForSmoke




Time to look at the datasheet, it tells all.  The only difference is that you have to supply extra power when a temp conversion (or EEPROM write) is in progress.  The datasheet shows how to do it, it's simple; it takes an extra i/o pin though.  You just enable the pin after issuing the conversion command.  That in turn bypasses the pull-up resistor on the data line (Q) so that the device has plenty of power to do the temp conversion or write to its EEPROM.  Look at the datasheet, they have a nice write-up on how it all works.


Is that for parasite mode only?



Yes it is.


Then a common power line could save an I/O pin ... is that per device?

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

afremont

I don't know if you can save an i/o pin, but you can sure save running an extra wire to all the devices.  In parasite mode, the device draws power thru the data pin.  The Vcc pin of the device is tied to ground so that the device "knows" that it is in parasite mode.  Enough power can be drawn thru the pullup resistor to do most things.  However, temp conversions and EEPROM writing need more power than can be sucked thru the resistor in a short time.  This is where the microcontroller toggles a pin connected to a transistor that "pulls up" the data line to Vcc bypassing the resistor.  Now the sensor on the other end of the wire has all the juice it needs to do the conversion.  The datasheet for the sensor goes into great detail about all this.
Experience, it's what you get when you were expecting something else.

GoForSmoke

I would rather the wire than a pin and a wire or many pins and many wires. Using the pin for extra power only when the device works will need a wire regardless and might need many of both.

Why would you need a pin to supply power if you're not running off a pullup?

Is the point of parasite power to reduce power consumption for battery operation?

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

afremont

The dallas 1-wire bus is made up of either 2 or 3 wires with the sensors attached along the bus.  One bus wire is ground and one is the data line.  The third (optional) wire is to carry a full 5V to the devices.  Since the data bus uses a pullup resistor, power can be sourced from the bus by the device.  If you ground the normally 5V supply pin on the device, it will draw power from the data line.

Since the data line on the bus has a pullup on it, only a limited amount of current can be supplied to the device.  This is fine until the device needs to execute a CONVERT command to sample the temp and measure it.  This requires more current than can be drawn thru the data line.  So back at the head end of the bus (where the microcontroller is) after issuing a CONVERT command enables full power to the data line by bypassing the pullup resistor.  The device can then draw as much current as it needs.  After the CONVERT command is finished, the microcontroller disables the pullup bypass so that communications can take place on the data line.  This saves running the 5V power wire to each device.

I don't know what you mean about many wires, all devices can reside on one bus.  Please just download the document, it explains it all much better.
Experience, it's what you get when you were expecting something else.

GoForSmoke


The dallas 1-wire bus is made up of either 2 or 3 wires with the sensors attached along the bus.  One bus wire is ground and one is the data line.  The third (optional) wire is to carry a full 5V to the devices.  Since the data bus uses a pullup resistor, power can be sourced from the bus by the device.  If you ground the normally 5V supply pin on the device, it will draw power from the data line.

Since the data line on the bus has a pullup on it, only a limited amount of current can be supplied to the device.  This is fine until the device needs to execute a CONVERT command to sample the temp and measure it.  This requires more current than can be drawn thru the data line.  So back at the head end of the bus (where the microcontroller is) after issuing a CONVERT command enables full power to the data line by bypassing the pullup resistor.  The device can then draw as much current as it needs.  After the CONVERT command is finished, the microcontroller disables the pullup bypass so that communications can take place on the data line.  This saves running the 5V power wire to each device.

I don't know what you mean about many wires, all devices can reside on one bus.  Please just download the document, it explains it all much better.


I see that no extra pin is needed. The data pin goes OUTPUT HIGH during the conversion only.

If the device has a conductive chassis you would only need 1 wire.
I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

Go Up