Arduino Forum

Using Arduino => Sensors => Topic started by: tweety on Aug 01, 2013, 10:38 am

Title: DS18B20 & Arduino Uno in Proteus Isis
Post by: tweety on Aug 01, 2013, 10:38 am
Hello.

I'm trying to simulate the use of a ds18b20 in isis.

I'm working with arduino 1.0.5. and I downloaded the latest OneWire library.
In my atmega328p, I put the sample code DS18x20_Temperature just with just replacing the ds pin from 10 to 2.
And it's not working : No more adresses.

Here is my schema.

What's going wrong ?

Thanks.


Edit : it's working using d10 pin.  Why not whith d2 ?
Title: Re: DS18B20 & Arduino Uno in Proteus Isis
Post by: robtillaart on Aug 01, 2013, 09:23 pm
because the pin is not defined as INPUT/OUTPUT?
Title: Re: DS18B20 & Arduino Uno in Proteus Isis
Post by: tweety on Aug 02, 2013, 07:43 am
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 ?
Title: Re: DS18B20 & Arduino Uno in Proteus Isis
Post by: robtillaart on Aug 02, 2013, 08:21 am
Quote
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 ;)

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?
Title: Re: DS18B20 & Arduino Uno in Proteus Isis
Post by: tweety on Aug 02, 2013, 08:51 am
Quote
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.

Title: Re: DS18B20 & Arduino Uno in Proteus Isis
Post by: robtillaart on Aug 02, 2013, 10:02 am
Quote
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.
Title: Re: DS18B20 & Arduino Uno in Proteus Isis
Post by: robtillaart on Aug 02, 2013, 10:04 am
(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.

Title: Re: DS18B20 & Arduino Uno in Proteus Isis
Post by: tweety on Aug 02, 2013, 10:12 am
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 (http://arduino.cc/en/uploads/Main/Arduino_Uno_Rev3-schematic.pdf)).
Title: Re: DS18B20 & Arduino Uno in Proteus Isis
Post by: robtillaart on Aug 02, 2013, 10:36 am
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?
Title: Re: DS18B20 & Arduino Uno in Proteus Isis
Post by: tweety on Aug 02, 2013, 10:48 am
I'm not working with real cables, only working with isis.
Title: Re: DS18B20 & Arduino Uno in Proteus Isis
Post by: robtillaart on Aug 02, 2013, 11:11 am
what is isis?  (clearly I missed something ;)
Title: Re: DS18B20 & Arduino Uno in Proteus Isis
Post by: tweety on Aug 02, 2013, 11:25 am
You clearly missed something ....

http://www.labcenter.com/products/vsm/vsm_educational.cfm (http://www.labcenter.com/products/vsm/vsm_educational.cfm)
Title: Re: DS18B20 & Arduino Uno in Proteus Isis
Post by: robtillaart on Aug 02, 2013, 11:51 am
so there is a chance that the simulator has a bug ...
Title: Re: DS18B20 & Arduino Uno in Proteus Isis
Post by: tweety on Aug 02, 2013, 12:39 pm
Perhaps, I don't know.  The last test to realize : doing it with the real arduino.
Title: Re: DS18B20 & Arduino Uno in Proteus Isis
Post by: IvoPenkov on Jan 24, 2016, 12:48 pm
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 :) greetings for Bulgaria !
Ivo

[moderator: added empty lines for readability]
Title: Re: DS18B20 & Arduino Uno in Proteus Isis
Post by: robtillaart on Jan 24, 2016, 02:44 pm
Thanks Ivo,

that info is worth resurrecting an old thread :).

(and your English is no problem!)
Title: Re: DS18B20 & Arduino Uno in Proteus Isis
Post by: wbadry on Jul 09, 2017, 06:22 pm
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
Title: Re: DS18B20 & Arduino Uno in Proteus Isis
Post by: Nick_Pyner on Jul 10, 2017, 02:55 am
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
Title: Re: DS18B20 & Arduino Uno in Proteus Isis
Post by: wbadry on Jul 22, 2017, 01:42 pm
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.

(https://preview.ibb.co/bOUAC5/test.png)
Title: Re: DS18B20 & Arduino Uno in Proteus Isis
Post by: AbdalrahmanAmer on Jul 22, 2018, 01:13 am
Hi,

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

The Arduino Library from https://www.theengineeringprojects.com/2015/12/arduino-library-proteus-simulation.html

Hope it helps

Regards,