Troubleshooting DS18S20 and Atmega16: Data Pin Not Pulling Low

  • Thread starter Thread starter digitalblggr
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around troubleshooting issues with the DS18S20 digital temperature sensor when interfaced with the Atmega16 microcontroller. Participants explore potential reasons for the data pin not being pulled low as expected, focusing on circuit connections and component functionality.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant describes their setup, noting that the data pin is connected to PD0 of the Atmega16 and is unable to pull low despite correct code implementation.
  • Another participant suggests disconnecting the DS18S20 and measuring the resistor to ensure it is functioning correctly, as well as checking the voltage at the data pin.
  • A later reply indicates that if the data pin shows ~5V when disconnected from the resistor, it may suggest a faulty chip.
  • Participants discuss the importance of ensuring correct pin orientation and connections, with one suggesting that the chip may be installed incorrectly or could be defective.
  • One participant shares their experience with a similar chip, the 18B20, and notes that it behaves as expected when connected correctly, implying potential issues with the DS18S20 setup.
  • Ultimately, the original poster discovers they had misidentified the orientation of the chip, leading to a successful connection after correcting the wiring.

Areas of Agreement / Disagreement

Participants generally agree that incorrect wiring or a faulty chip could be the cause of the issue, but there is no consensus on the exact nature of the problem until the original poster resolves their misunderstanding about the chip orientation.

Contextual Notes

Participants mention the importance of verifying component values and connections, but the discussion does not resolve the broader implications of potential chip failure or design errors.

Who May Find This Useful

Readers interested in interfacing temperature sensors with microcontrollers, troubleshooting electronic circuits, or learning about common pitfalls in component connections may find this discussion relevant.

digitalblggr
Messages
42
Reaction score
0
Hi,

I am trying to use digital temperature sensor DS18S20(http://datasheets.maxim-ic.com/en/ds/DS18S20.pdf) with Atmega16(http://www.atmel.com/dyn/resources/prod_documents/2466S.pdf). I am using it in a non-parasite mode i.e. Vdd is connected to external power source(Vcc) and Data pin is pulled high to Vcc using 4.7kohm resistor.

Data pin is connected to pin0 on PORTD (PD0) of Atmega16. To reset the DS18S20 I need to pull it low for at least 480 us or more. However , when I define my pin on PORTD as output and pull it low and check it with the scope the data pin still stay high.

Code:

...
DDRD |= (1<<0) //define PD0 as output
PORTD &= ~(1<<0) // pull PD0 low
..

What am I doing wrong? Why is the PDO pin of Atmega not driving the data pin low? Am I not supposed to see data pin go low? Does it happen internally or something?

P.S. I have checked with the scope that I can output high(1) and low(0) on the PORTD, and also tried driving the data pin on DS18S20 with pins of other ports(PORTA etc.) but no success so far.
 
Engineering news on Phys.org
Disconnect the 18S20 from the Atmega.

Check that your 4.7K is actually 4.7K by measuring it with one end disconnected from the circuit.

Disconnect the 4.7 K from the center pin of the 18S20 and measure the voltage at that pin. There shouldn't be any voltage there.

If there is no voltage there, reconnect the 4.7 K and connect that pin to ground via a current meter. The current should be no more than about 1 mA for a 5 volt supply.

If the current is about 1 mA then move on to the Atmega to see why it can't sink 1 mA.
 
Hi,

I checked the resistor to make sure it was 4.7kohms.

So, if Vdd pin is connected to 5v and ground pin to ground , the data pin (center pin) has voltage of ~5v ( after disconnecting the resistor).

Does it mean the chip is bad?
 
It would explain why you can't pull that pin low.

Try putting a 1 K resistor from that pin to ground. If the voltage drops you can estimate how much current is available at this pin.

Don't short that pin to ground in case it is a direct connection to the supply voltage.

Do you have another chip you could try?
 
I have an 18B20, which is a different chip, of course, but it has a similar function and an identical input circuit.

Putting just the ground and plus 5V connections on the correct outer wires, the center wire has zero volts on it but it is a high impedance input because I could get a voltage reading just by bridging the positive line to the center wire with my fingers.

So, I would guess that you either have the chip in the wrong way around or that it is faulty.

The connections for this chip are:
holding it with the wires facing you and the flat part of the case upwards,
ground on the left
data in the middle
plus 5 V on the right.
 
Thank's a lot! Turns out I was using bottom view as top view and messed up Vcc and ground pins. It works fine now. I am surprised the chip didn't blow up.
 

Similar threads

  • · Replies 15 ·
Replies
15
Views
4K
Replies
2
Views
3K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 7 ·
Replies
7
Views
2K
Replies
2
Views
3K
Replies
2
Views
2K
  • · Replies 34 ·
2
Replies
34
Views
5K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K