Page 1 of 1

Ds18B20 multiple device problem

Posted: Tue Aug 14, 2012 8:48 pm
by Jordy101091
Hi everyone,

In my current running project I need to interface 5 temperature sensor devices. One of these sensors is in the controller itself to monitor the inside temperature, the other four device are for water temperature monitoring. I started to test the sensors with only connecting one sensor. This sensor is working perfect just the way a suspected.

This sensor has a 4k7 pull-up resistor and is connected directly to the controller board about 3 cm from the microcontroller.
The other four sensors are connected with different cables they are about 3,5 meters long. I have connected on sensor to one of the cables and attached a 2k7 pull-up resistor. Now the problems that I'm experiencing.

1. When only one sensor is attached the sensor count macro tells me that there are 0 sensors attached, that's strange because this sensor is working correctly.

2. When I attach the second sensor and look what the scanbus macro tells me, it's gives me a error code 2. I have read on the forum that this could be
returned when the one wire receives two consecutive logic 1's from the bus during a scan for nodes. This indicates that no node responded to the request.
How can I solve this, is this matter of a wrong pull up resistor also get device count is not working properly with one sensor.
Also it's a problem to share my flowcode because it's about 600kb big and I'm only allowed to upload 256kb.

Hope somebody can help me.

Regards jordy

Re: Ds18B20 multiple device problem

Posted: Tue Aug 14, 2012 9:17 pm
by JohnCrow
Hi Jordy

You could use something like Dropbox to share your larger files.
This is free for 2GB.
You can set a public folder and just use this for sharing openly or setup a private folder and just give access to selected people
This is how I have mine set up

https://dl.dropbox.com/u/75488299/RGB_Single.fcf

Re: Ds18B20 multiple device problem

Posted: Tue Aug 14, 2012 10:05 pm
by kersing
Jordy101091 wrote: This sensor has a 4k7 pull-up resistor and is connected directly to the controller board about 3 cm from the microcontroller.
The other four sensors are connected with different cables they are about 3,5 meters long. I have connected on sensor to one of the cables and attached a 2k7 pull-up resistor.
Hi Jordy,

One-wire uses a bus structure, a star configuration will not work reliable in most situations according to the original 1-wire design engineers. The bus needs one pull up resistor (1K according to Maxim) at the micro controller to provide power for parasitic powered devices. No other pull up or pull down should be used.

For longer (over a 1m) cables it is recommended to use good quality twisted pair. I've successfully used cat5 for a 15 meter bus.

Regards,

Jac

Re: Ds18B20 multiple device problem

Posted: Wed Aug 15, 2012 3:19 am
by Jordy101091
So what I need to do, is get the 2k7 out and replace the 4k7 with a 1k resistor.
And check the system again if I get time I will upload me program today.

Regards Jordy

Re: Ds18B20 multiple device problem

Posted: Fri Aug 17, 2012 3:01 pm
by Jordy101091
Hi all I have changed the pull-up resistor and the result remains the same.
I have discovered what the problem was I will explain this and hope this would help other people.

The first thing did was checking the signals with my scoop, on the scoop image a saw that there was some spikes. These spike were on the I2C bus and the 1-Wire bus. when I disconnected the output and sensor box from the main controller the spikes disappeared. so is there something wrong with the cable :?:

When connecting the cable to the main controller leaving the other end unconnected the spikes returned, but when I pushed down on the Main PCB this forces the BNC Connectors to the casing, the spikes disappeared. Soon it was clear to me that this was a grounding problem.

This is what I have done:

I have connected the aluminum casing to the 0V rail.
I have connected the shielding of the cable at one end of the cable the other end not.
I have connected the aluminum casing of the sensor box to the 0V rail

I havent connected boh ends of the cable to the shield is, this creates a loop. This loop can make it worse then it already is.

Now I can read the sensor connected to my sensor box as aspected but my program still tells me that there are 0 sensors connected, this part I don't understand.

To be honest I'm not eager to put my program online so it can be downloaded to every other person, The other problem is that I cannot attach my program wit a PM because my program is to big.
You can give me your email by PM or something and I will mail it to you.

Sorry for the cumbersome way of doing things.

Regards Jordy

Re: Ds18B20 multiple device problem

Posted: Tue Aug 21, 2012 7:45 pm
by Jordy101091
Nobody that have the same kind of problem,
I'm trying to get this to work but I cant if somebody can help please,

Regards Jordy