DS18B20 & Arduino Uno in Proteus Isis

because the pin is not defined as INPUT/OUTPUT?

No. The lcd is connected but not used by the atmega. Only the sample code for ds18b20.

DS connected to pin d2 - not working.
DS connected to pin d10 (and pin d10 also connected to lcd) - working.
Pin d10 disconnected from lcd - not working.

Now I found the pull-up resistor of the ds is wrong : 4R7 in place of 4K7.
Corrected and ... working.
But if I connect again the pin d10 to ldc, it's not working.
Ok, it's stupid to connect the lcd on the pin. But if I disconnect the lcd and connect the led (on the bottom right) it's also not working.

So I suppose it's a question of value for the resistor. But how to calculate it ?

DS connected to pin d10 (and pin d10 also connected to lcd) - working.

so pin 10 is connected to both the LCD and the DS18B20. (this is not preferred but opens possibilities :wink:

Seems that the LCD has somehow the proper resistor value / behavior

What is the function of the LCD pin connected to Arduino pin 10?

  • data pin
  • ENable pin
  • RW pin
  • ??

What type of communication does the LCD use?

  • Serial
  • SPI
  • I2C
  • parallel (4/8 datalines)
  • other?

so pin 10 is connected to both the LCD and the DS18B20. (this is not preferred but opens possibilities

Ok, I know it's stupid ... I tell it in the post above 8)

The pin d10 is connected to the data pin d7 on the lcd and is using parallel 4 bits.
BUT for the moment it is not used ! No code for the lcd in the atmega. Only for the ds.

Ok, I know it's stupid ..

Maybe, maybe not, it would be great if one could use a single pin for 2 different functions.
The closest I did was to use the serial port for 2 different devices (one input one output) but that are two pins.

OK back to the problem.
The LCD pin seems to act as an additional pull up/down resistor. (I assume the LCD is also connected to 5V and GND)
That is confirmed by the fact that if you remove the LCD the DS doesn't work any more.

What is the length of the cable to the DS? this affects the resistor to choose, the longer the cable the smaller the R.

(not related to DS problem)
looking at your schema, pin 13 is also double used - for the LED and the LCD
That might also cause some interference in the future.

Heu ... I'm only working with isis .... I'll try with my arduino later.

I agree with you for the pull-up from the lcd. So I suppose I have to modify the value of the ds pull-up. But wich value ?
I tried some values but nothing works.

Perhaps for making it more simple, if I disconnect the lcd and connect the led (in place of pin d13). It's also not working.

ps : for the led connected on d13, there is no problem. The lcd works fine. In fact I make like this because it is the way the arduino uno is made (see http://arduino.cc/en/uploads/Main/Arduino_Uno_Rev3-schematic.pdf).

the value of the resistor is 4K7 for short distances. For long distances it depends on the cable used but common values are 2K2 for 10meter (35 feet).

How long is your cable?

I'm not working with real cables, only working with isis.

what is isis? (clearly I missed something :wink:

You clearly missed something ....

http://www.labcenter.com/products/vsm/vsm_educational.cfm

so there is a chance that the simulator has a bug ...

Perhaps, I don't know. The last test to realize : doing it with the real arduino.

Hello everyone ,
i know that this topic is 3 years old but i will geive the answer ,because from 3 days i try to simlate 3pcs of DS18B20 in proteus - 3 days of hard web search and nothing. The simple answer is that in Proteus ISIS all sensors have a same ID`s like the first one, so to make them different you got to:

  1. hit right mouse button over socond sensor (BECAUSE the first one is already unique ROM Number = B8C530)

  2. select "EDIT PROPERTIES" and there will open a window with sensor properties on line 6 "ROM serial number" will be again B8C530 - change the value like B8C531, next one can be B8C532......,3,4,5,6 ......
    And you are ready !

Sorry for my poor english :slight_smile: greetings for Bulgaria !
Ivo

[moderator: added empty lines for readability]

Thanks Ivo,

that info is worth resurrecting an old thread :).

(and your English is no problem!)

Hi,
Since this is one of the major posts to appear on Google about Proteus and DS18b20. I want to share that DS18b20 sensors are very buggy on Proteus simulation.

You may check it yourself. If you try to compile any shipped example from DallasTemperature library, you will almost always get -127 degree and occasional good readings (once every 20 to 30 readings).

If someone has a complete example using the mentioned library and has been tested on Proteus, I would be happy to get acquainted with.

THanks

wbadry:
you will almost always get -127 degree and occasional good readings

I submit that that implies sloppy wiring, and DS18B20 is innocent. It may also suggest inadequate power - caused by something else

Nick_Pyner:
I submit that that implies sloppy wiring, and DS18B20 is innocent. It may also suggest inadequate power - caused by something else

Thanks for your answer. I believe neither of your suggestions is correct. I was seeking assistance from someone who tried that out on Proteus using Arduino and DallasTemperature library.

Hi,

I confirm that this code from https://simple-circuit.com/arduino-ds18b20-temperature-sensor/
is working like charm!

The Arduino Library from Arduino Library for Proteus - The Engineering Projects

Hope it helps

Regards,

Capture2.JPG