ds18b20 filtering?

I had two ds18b20's on my one wire bus, then one crapped out for sone reason, ni big deal, the next day tho my other was reading 0c constanly
Then i found out it worked fine if it was powered from usb, even tho 5v regulator wasnt good enough my 4.1 v usb worked?? And the onboard 5v line wouldnt work it when i powered from 12v vin
so i put a 10uf cap by the sensor and now its all good from eirher power
Can anyone explain why this happened?

I suspect you might have over-voltage on 5V - this would explain the destruction of one device and general unreliability. You say the onboard 5V regulator isn't working, so powering from Vin is not a great idea. But if the Arduino is working at all then there must be some voltage on the 5V...

The decoupling capacitor on the sensors might be reducing spikes/noise and helping stabilize the supply but if the regulator is blown it needs replacing before using Vin.

I'll theorize that at the 4.1V USB could supply, the 1-wire device was able to output a high enough logic "1" to satisfy the Arduino at 4.1V VCC. However, at 5V VCC, it was not able to do so. Putting the 10uf cap on the 1-wire buss stored enough energy to allow the DS18B20 to run at full spec and therefore satisfy the input requirements of the Arduino.

This is if you were running the DS18B20 in parasitic mode, i.e. without a separate 5V power supply. Otherwise, I have no theory. :slight_smile:

Yeah I was using it without parisitic mode : /
and I didn't mean that the 5v reg wasn't working but that the sensor was not working when the arduino is supplied with the 12v, the reg does put out 5 v pretty accuratly, but I think it doesn't regulate the usb in so I thought it may be related

The DS18B20 shouldn't have any problem at 5V, its rated for 3.0 to 5.5V.

Perhaps the pullup isn't strong enough (4k7 is the nominal value, and I've had the working fine with 12 sensors on the same bus (short bus and 0.1uF decoupler shared between sensors).

Does the 12V supply have a lot of ripple perhaps? It needs to be above about 6.5V all the time to keep the +5V line happy.

I have a 4.7 k resistor on it, and right now the distance is about 6 inches lol
maybe i got a faulty part?

Yes, perhaps that's it. If you can test in normal power mode rather than parasite power that's worth doing maybe?

MarkT:
Yes, perhaps that's it. If you can test in normal power mode rather than parasite power that's worth doing maybe?

Yeah I was using it without parisitic mode : /

I took this to mean that OP was operating in normal power mode.