Troubleshooting DS18S20 and Atmega16: Data Pin Not Pulling Low

  • Thread starter Thread starter digitalblggr
  • Start date Start date
AI Thread Summary
The user was troubleshooting a DS18S20 temperature sensor connected to an Atmega16, facing issues with the data pin not pulling low as expected. They confirmed the resistor was correctly rated at 4.7k ohms and checked the voltage levels, suspecting a faulty chip. After suggestions to measure current and verify connections, it was discovered that the user had incorrectly oriented the chip, reversing the Vcc and ground pins. Once corrected, the sensor functioned properly, indicating the importance of verifying pin configurations in circuit setups. The discussion highlights common troubleshooting steps for interfacing sensors with microcontrollers.
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.
 
Thread 'Weird near-field phenomenon I get in my EM simulation'
I recently made a basic simulation of wire antennas and I am not sure if the near field in my simulation is modeled correctly. One of the things that worry me is the fact that sometimes I see in my simulation "movements" in the near field that seems to be faster than the speed of wave propagation I defined (the speed of light in the simulation). Specifically I see "nodes" of low amplitude in the E field that are quickly "emitted" from the antenna and then slow down as they approach the far...
Hello dear reader, a brief introduction: Some 4 years ago someone started developing health related issues, apparently due to exposure to RF & ELF related frequencies and/or fields (Magnetic). This is currently becoming known as EHS. (Electromagnetic hypersensitivity is a claimed sensitivity to electromagnetic fields, to which adverse symptoms are attributed.) She experiences a deep burning sensation throughout her entire body, leaving her in pain and exhausted after a pulse has occurred...
Back
Top