DS18S20 interfacing....
Mikael S
Posts: 60
Hi,
I'm trying to interface a DS18S20 with the OW_demo for DS1822. My problem is that i get the result with the first number missing. I just get 3.0, but i think the correct temperature is 23.0.
I know that it is a difference between 18S20 and 1822 in the conversion, but i just can't find it...
I get the sensor react when i warm it with my fingers.
Or does someone have a simple code for getting the temperature from just one DS18s20, and want to share it?
Thanks!
/Mikael
I'm trying to interface a DS18S20 with the OW_demo for DS1822. My problem is that i get the result with the first number missing. I just get 3.0, but i think the correct temperature is 23.0.
I know that it is a difference between 18S20 and 1822 in the conversion, but i just can't find it...
I get the sensor react when i warm it with my fingers.
Or does someone have a simple code for getting the temperature from just one DS18s20, and want to share it?
Thanks!
/Mikael
Comments
Any help would be appreciated
Well what have you done with the Vdd pin on the 18S20 then?
Surely the pull-up resistor must go to the Propeller's Vdd and the OneWire driver must pull the output pin actively high during temperature conversions (which take too long for the on-chip decoupling capacitor to hold out (whatever the value of pull-up resistor). The Vdd to the temp sensor should be the same during quiescent (pull-up resistor) operation as during active powering or it'll upset all the analog circuitry I fear.
If the driver code isn't pulling the pin HIGH during conversions then it won't work (also you cannot poll for end-of-conversion either because the bus is frozen - you cannot communicate on the bus during a temperature conversion).
I'd never buy that version since the generic version can do either parasite power or normal power mode so its more flexible.
I disagree; though the 5v I mention must also be tied to the same ground as the Propeller. The "parasitic" devices have an internal diode that has to be overcome and 3.3v just may not provide enough voltage downstream of this diode for the device to operate properly. The 3.3k resistor to 5v protects the Propeller IO pin.
DQ-->3.3k--5v and to pin 0 GND-->GND. I've tried some other programs i found on the Object exchange. Some of them give me outputs but they are constant values that are VERY large. Also i found one that is supposed to give you the ID #. When i run that it says my ID # is 000000000000 and it is an unknown device. I'm going to call the company i got the sensor from and ask them some questions also.
Thanks for any help
The easiest way to achieve this is to follow Mark_T's suggestion and set the propeller pin connected to DQ as output (and high) after issuing the Convert Temperature command - see also Figure 10.
The pull-up resistor can be directly connected to your propeller's 3.3V. If you're not issuing Convert Temperature or Copy Scratchpad commands, the current draw will be very small. The typical DQ input current is in the electrical characteristics table - multiply this by a safety factor of your choice to get the maximum current. You only have to make sure that DQ stays above 3.0V between conversions with this current flowing through the pull-up resistor causing a small voltage drop. All the values mentioned in this thread should be small enough for that.
I disagree on this one. The internal makeup of the device is irrelevant. The datasheet clearly specifies VPU lower bound as 3.0V. IMHO, together with note 2, that only means one has to keep the voltage at the DQ pin above 3.0V in every possible state (during and also between conversions).
Is it possible to parasite power the DS18S20? Has anyone got success with that?
-- http://datasheets.maximintegrated.com/en/ds/DS18S20.pdf
Page six shows how to connect for parasitic power. You'll need a second pin to charge the data line through a FET. Again, it's spelled out in the documentation.