Shop OBEX P1 Docs P2 Docs Learn Events
OW-Demo for DS18B20 — Parallax Forums

OW-Demo for DS18B20

KenFordhamKenFordham Posts: 12
edited 2008-07-19 12:37 in Propeller 1
Does anyone know if this object will work correctly for a DS18B20?

I was able to get the OW-SearchDemo to recognize it by adding the line to the PUB Main code as noted below:

$01: term.str(@ds2401_name)
'$05: term.str(@ds2405_name)
$10: term.str(@ds1820_name)
$22: term.str(@ds1822_name)
$28: term.str(@ds18B20_name) 'added this line
other: term.str(@unknown_name)


And I added the one line as noted below:

DAT
ds2401_name byte "DS2401 ", 0
ds2405_name byte "DS2405 ", 0
ds1820_name byte "DS1820 ", 0
ds1822_name byte "DS1822 ", 0
ds18B20_name byte "DS18B20 ", 0 'Added this line
unknown_name byte "Unknown ", 0


However, when running OW-Demo, it constantly reports a temperature of 85 C and 185 F no matter what. Has anyone else experienced this problem?

The 18B20 is connected to Pin 15 (yes, I changed OW_DATA to 15) in the parasitic power mode. GND and Vdd on the 18B20 are connected to Vss on the Propeller Proto board. DQ on the 18B20 is connected to P15 which is also connected to Vdd on the Proto board through a 4.7K resistor.

Comments

  • BradCBradC Posts: 2,601
    edited 2008-07-19 05:04
    Here is a spin-only object I knocked up to talk to the sensors in my thermostat.

    Includes full CRC checking of the communications and extended precision output on top of the standard 9 bit output.

    It's also non-blocking, so you start the conversion and then poll for completion.

    It detects the power method (3 wire or Parasite) and adjusts the conversion completion accordingly.

    However, its only built for a single sensor on a pin. Could be modified otherwise I guess, but I did not need it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Pull my finger!
  • KenFordhamKenFordham Posts: 12
    edited 2008-07-19 12:37
    Thanks very much BradC. I'll give that a try as soon as I get the time.

    Ken
Sign In or Register to comment.