EmbDev.net

Forum: µC & Digital Electronics Ds18b20 Problem


Author: Sappy M. (sappy)
Posted on:

Rate this post
0 useful
not useful
Hello,

I am trying to use a DS18b20 sensor with a STM32 Discovery board. 
However, I did the mistake of trying to connect the sensor to the PC 
using a RS232 to USB converter instead of TTL to USB. I know that the 
voltage levels for the normal RS232 is way higher than the 3.3-5V range 
of the sensor. I cant find any problems with the Simulink program that I 
am using, but don´t seem to get any response from the sensor. I also 
tried using a program from the following website:
https://www.seanet.com/~karllunt/onewire_stm32f4.html
The scratchpad shows only a sequence of "FF"s. Is it possible that the 
sensor is damaged? Is there any sure way to establish that? I would 
really appreciate if someone can help.

Author: Lothar M. (lkmiller) (Moderator)
Posted on:

Rate this post
0 useful
not useful
Sappy M. wrote:
> I am trying to use a DS18b20 sensor with a STM32 Discovery board.
> However, I did the mistake of trying to connect the sensor to the PC
> using a RS232 to USB converter instead of TTL to USB.
How did you do that? The DS18B20 has no matching serial interface...

> Is there any sure way to establish that?
Take a scope and measure whether any kind of communication happens at 
all. and post a schematic of your wiring.

Author: Sappy M. (sappy)
Posted on:
Attached files:

Rate this post
0 useful
not useful
Hello Lothar,

Thank you for your reply. I used a STM32 board in between, but I was 
trying different things, so I am not sure whether I have already exposed 
the sensor to the overvoltage.
I have attached a schematic of the current wiring, along with the 
simulink programs that I am using. The ´Target´ refers to the 
microcontroller and the ´Host´ to my PC.
I tried with a scope to check the communication, but can´t find 
indication that the communication is running.

Author: c-hater (Guest)
Posted on:

Rate this post
0 useful
not useful
Sappy M. wrote:

> I am not sure whether I have already exposed
> the sensor to the overvoltage.

If not shure (and not able to perform a "cross-check" with code, known 
as "did work previously"): assume you did kill the sensor by 
overvoltage.

->Buy a new one.

Maybe, that is a mistake and you wastes the money for one sensor. But 
the effort is much less in comparision to the case you actually killed 
the sensor...

Author: Lothar M. (lkmiller) (Moderator)
Posted on:

Rate this post
0 useful
not useful
Sappy M. wrote:
> I tried with a scope to check the communication
Between what? The STM32 and the DS18b20?

> but can´t find
> indication that the communication is running.
Is the STM32 running as expected? Then at least you should see a 
one-wire reset pulse on the data line..

Author: Sappy M. (sappy)
Posted on:

Rate this post
0 useful
not useful
Thanks for the replies. So I tried using the scope again. I am indeed 
using it in between the STM32 and DS18b20. It seems last time the time 
scale was too short to see that. I can see that the STM32 is running 
fine. It sends the reset pulse and it reads the sensor as well. But it 
reads only "FF"s and if I convert it to temp I get a value of 32767.5 
degrees. Is this an indication of some fault? Can't find anything in the 
datasheet or in other forums though.

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig