ds18b20 onewire

Hi I am building a project where I am going to have 4 temp sensors. I can't figure out why but when I hook them up in a test scenario I can read all the sensors but when I hook it up to my project they don't work. I don't know if this behavior tells you anything but I could find some of the sensors now and then. Kind of like a week signal that fluctuates, but most of the time nothing is found.

In my test scenario I hook them up straight to the arduino mega 2560 with a 4.7k pullup resistor from signal to 5V. And all of them work.

The project has got a bit more wiring so I thought there might be a voltage drop or something like that but I have measured all the cables and they are all 5V at the sensors. All the temp sensors have about 50cm of cable going to the Arduino. At the Arduino I join all the 5V to one wire, and all the ground to another and finally all the signal wires to one with a 4.7k resistor connecting with the 5V. I am using a external power supply in my project but I have everything including the Arduino wired to a common ground so that shouldn't matter. A couple of water sensors and a pressure sensor are also sharing the same power wires but that shouldn't matter neither right?

I also have to mention that all the other sensors are working that is using the same 5V circuit, current sensors, water sensors and pressure sensor.

Any ideas? Thanks for reading

Any ideas? Thanks for reading

Yes, read the "How to use this forum" post and follow the guidelines.

I actually read that post minutes before making a new thread since I haven't been around the forums for a while and I wanted to make it right.

Obviously I failed at that somewhere. I also suggest you read that post, there is a section with the headline "be polite".

I probably did something wrong in my post that you spotted so perhaps you could be a bit more helpful and point that out to me, thanks.

What kind of cable are you using to each sensor? Is it shielded? Is there a lot of interference
around? Are you keeping the sensor wiring isolated (they should only be electrically connected
at the Arduino).

A couple of water sensors and a pressure sensor are also sharing the same power wires but that shouldn't matter neither right?

Well without knowing what sensors the answer has to be "yes or no"

Using a star topology rather than daisy-chained along one wire is unusual, but I don't
think its necessarily a problem with 50cm limbs, I've done something very similar, but the wiring was only
to DS18B20's

Thank you for the reply, interference and shielded got me thinking. I tried the sensors using the external power but with a new exterior signal wire and they where indeed working. That ruled out the external power supply being the issue and pointed me towards the signal wires.

I have previously checked the wiring using my multimeter to make sure none of the wires was touching each other when I cast them in epoxy. I don't know whats it called but the function playing a tone if there is a connection. I disconnected all the signal cables at both ends and checked them again against the negative and positive but no sound.

I don't know why but I figured I could measure the voltage between the disconnected signal cable and the power source to make sure I didn't have a short and it showed voltage, so I guess the wire is slightly touching another wire in my connector. If I put the negative of my multimeter against the signal cable and the positive against the 5V supply it measures 4.25 ish voltage, this would mean the signal cable is touching the negative somewhere right? The strangest thing is that I seemed to have accomplished this on two of the wires measuring almost exactly the same, 4.25 volt, if I measure between the power cables I get exactly 5.0V.

I am new to wiring electronics but this seems to be the case right?

I had some grief with readings in the field. It looked very like it was down to using cheapskate cable. I understand this is not unusual and a common fix is to use CAT5 cable. My sensors came with 3m cable and I wanted to extend by 1.5m, but I solved it by relocating Arduino closer to the job.