-1
\$\begingroup\$

EDIT: Schematic updated to show multimeter test point as requested. Altered test points for first 3 questions.

EDIT: Added scope picture for Q4/5.

I have created the following test circuit to confirm a number of questions around current flow and voltage in a 1-wire network. At the end, although the network functions, I have some questions that I would appreciate either confirmation or clarification on.

enter image description here

Schematic

In building the network, I first tested the use of the ATMega328p pin 16 (PB2) as an open drain output. This is accomplished by setting the port to an input (internal pull-ups disalbed) to allow the line to be pulled high by R1 or alternatively set as an output and pulling the line low.

When PB2 is set as an input, I read 3.339V between PB2 and GND and measure no current as expected.

QUESTION 1: DELETED

When PB2 is set as an output and pulled low, I read 40mV between PB2 and GND measure ~1.5mA of current. According to Ohm's law, this is the expected amount of current that PB2 should sink given a 3.3v power source and a 2.2k Ohm resistor.

QUESTION 2: DELETED

QUESTION 3: I believe that in this case, PB2 sees 40mV, not 3.3V. In other words, there has been ~3.3V dropped, thus registering a low on the bus. Is this correct?

The schematic shows the use of a DS1822 in parasitic power mode. This means that it will draw power from the 1-wire bus in order to power the part for normal operations as well as specific operations such as a temperature conversion. In the case of the temperature conversion, the part needs to see at least 2.8V and up to 1.5mA of current at the DQ pin. This would not be possible with the schematic if PB2 was purely an open drain output. To compensate for this, one can either create a strong pull-up or pull PB2 high, thereby supplying the voltage level and current required for the operation.

When performing a temperature conversion (the operation that would require the higher current and voltage), I have looked at the voltage and current characteristics both when pulling PB2 high and when not.

When PB2 is set as an input and a temperature conversion is in progress, I observe that .66mA is drawn between (Test Point A) and DQ. I do not see noticeable current drawn between PB2 and DQ. I read a voltage between DQ and the DS1822 GND of 1.88. This would imply a voltage drop of 1.45. Again using Ohm's law this indicates ~0.66mA of current are in use, which is what was observed. I am also able to confirm the voltage level using a scope.

(Drop to 1.86-1.88V as viewed on scope, continues for ~750ms) enter image description here

QUESTION 4: Is it accurate to say the DQ pin now sees 1.88V?

QUESTION 5: DELETED (this question was asked in error)

When PB2 is set as an output and pulled high and a temperature conversion is in progress, I observe that 0.65mA is drawn between PB2 and DQ. I observe that 0.05mA is drawn between (Test Point A) and DQ. I measure a voltage of ~3.0V between DQ and GND. I am not able to correlate that with Ohm's law. I am not able to see the voltage drop of ~0.03V using the scope.

QUESTION 6: Has a parallel circuit been created? Is the DS1822 DQ pin drawing current from two sources?

QUESTION 7: How can I use Ohm's law (or can I) to correlate the observed current draw to the voltage level?

Thank you for your assistance. It has been a challenge to take some of my readings and apply them accurately to this particular circuit.

Note, my prior investigation into 1-Wire circuits: [DS1822 1-Wire Sensor, Parasitic Power, and Strong Pull-Up Circuit] (DS1822 1-Wire Sensor, Parasitic Power, and Strong Pull-Up Circuit)

Karl

\$\endgroup\$
  • \$\begingroup\$ What do you mean "between R1 and PB2" vs "across R1 and PB2" \$\endgroup\$ – Passerby Feb 2 '14 at 3:28
  • \$\begingroup\$ @Passerby Meaning that one probe of the multimeter is on resistor leg that's leading into the circuit rather than the resistor leg that's connected directly to 3.3v. \$\endgroup\$ – Karl_34 Feb 2 '14 at 3:30
  • \$\begingroup\$ Mark the points that you are measuring to/from/at with letters so you can say "measuring between A and C...", the we will know exactly (hopefully) what you are measuring, and will then be able to answer your questions. As passerby indicates, "between R1 and PB2" and "across R1 and PB2" don't really tell us what you are measuring. (My mindreader's license has expired) \$\endgroup\$ – Peter Bennett Feb 2 '14 at 8:05
  • \$\begingroup\$ @PeterBennett Apologies. I have added (Test Point A) and (Test Point B) to the schematic and reference them throughout the questions now. \$\endgroup\$ – Karl_34 Feb 2 '14 at 9:49
  • 1
    \$\begingroup\$ Measuring between PB2 and Point A is meaningless - those points are both on the same wire, so should have the same voltage at all times. To get meaningful measurements you should measure between Ground and the point of interest. \$\endgroup\$ – Peter Bennett Feb 2 '14 at 19:34
1
\$\begingroup\$

Re Question 4 and 5:

When data is being transferred between the DS1822 and the ATMega, DQ will be switching between Ground and +3 - under these conditions, your meter will read an average voltage which won't be a particularly meaningful value.

Likewise, the current measured between DQ and the pull-up resistor will be flowing alterantely into and out of DQ - the meter will average these + and - currents, and likely read something near zero.

To see what is really happening during a data tranfer you really need an oscilliscope.

\$\endgroup\$
  • \$\begingroup\$ The unique quality of the reading being done during Q4 and Q5 is that the DS1822 is no longer performing the 1-wire protocol but is instead drawing power for 1 second for the temperature conversion. The bus is pulled-up to 3.3v across the 2.2k resistor during this time. I was able to observe for Q4 and Q5 through both a meter and scope that the voltage was at 1.88V. For monitoring the protocol itself, I've used a logic analyzer and the scope. To your point I've never seen the DMM register anything during normal protocol operations. \$\endgroup\$ – Karl_34 Feb 2 '14 at 21:43
  • \$\begingroup\$ @Karl_34 are you zoomed into the scope right? What's the voltage curve for DQ looking like during those operations? Are you taking into account the internal capacitor for the parasitic power? \$\endgroup\$ – Passerby Feb 2 '14 at 22:26
  • \$\begingroup\$ @Passerby The Rigol I have has a long history so I can go back to the 1 second block to see the voltage drop from ~3.34V to ~1.88V during the attempted temperature conv. If it's accurate to say that the DQ sees 1.88V, then this looks right for Q4/5. DQ needs to see around 2.8V during the conversion which is the reason behind using the uC pin and my questions in Question 6/7. When I use the uC pin as a strong pull-up, the temperature conversion is successful and scope shows it holding around 3.3V. I don't see a drop at that point though. Will add scope picture. \$\endgroup\$ – Karl_34 Feb 2 '14 at 22:33

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.