0
\$\begingroup\$

Could someone help me with something like this? I wanted to add DS18N20 thermal sensor (http://datasheets.maximintegrated.com/en/ds/DS18B20.pdf) via 1-wire interface and when I'm trying to connect it to ATZB-24-A2 (http://www.farnell.com/datasheets/1738045.pdf), which is using ATMEGA 1281 processor, this way 1st connection scheme
(source: tushev.org)

or this way

2nd connection scheme

I'm receiving random bytes on COM terminal (I'm using FTDI chip). What could happen and how to fix it?

EDIT: I'm not even configuring anything in my software, it just starting mess without my interfere.

\$\endgroup\$
0
\$\begingroup\$

According to the datasheet, if you are powering the temperature sensor from an external supply, that supply must be connected to VDD. In your case you would wire directly from your 5V supply to pin 3 of each temperature sensor, bypassing the 4.7k resistor.

However, leaving the devices unpowered should not cause random bytes to be received. There are three possibilities I can think of:

  1. Wrong encoding: Your computer's serial monitor probably expects ASCII characters to be transmitted over the COM port, not raw byte values. You must convert your numbers to strings before transmitting them.
  2. Bad program: make sure that your device is being programmed correctly by uploading a program that blinks an LED or sends a short string to the COM port repeatedly. If you are using a library for 1-wire communication, double-check the pin assignment in your program.
  3. Wrong serial settings: if you are, as I assume, using the FTDI device to transmit messages between your computer and microcontroller, make sure that it is connected to the correct pins on your microcontroller and that both are using the same speed and settings. Most devices operate at a speed of 115200 baud with 8 data bits, 1 stop bit, and no parity.
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.