I made some fixes to the built-in OneWire module to support parasitically powered one-wire devices. The old code wasn't providing enough power to perform temperature conversions: a DS18B20 uses 1mA-1.5mA during conversion and that's not going to come through a 2.2K or 4.7KOhm pull-up resistor. This change would have no effect on powered 1-wire devices.
There's also a bug in the DS18B20 JS module in that it doesn't wait for the conversion to finish. I'm pretty sure that the effect is that one gets the result of the previous conversion, which may be why people have not noticed.
WRT the DS18S20 the temperature format is slightly different from the DS18B20, so some adaptation of the code is necessary. I believe that multiplying the result by 8 will so the trick, but I'm not sure.
If anyone has trouble with parasitically powered DS18B20's and wants to try my esp8266-12 firmware let me know. I'll create a pull request for master in a few days as there are a few more improvements I'd like to make to the code.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I made some fixes to the built-in OneWire module to support parasitically powered one-wire devices. The old code wasn't providing enough power to perform temperature conversions: a DS18B20 uses 1mA-1.5mA during conversion and that's not going to come through a 2.2K or 4.7KOhm pull-up resistor. This change would have no effect on powered 1-wire devices.
There's also a bug in the DS18B20 JS module in that it doesn't wait for the conversion to finish. I'm pretty sure that the effect is that one gets the result of the previous conversion, which may be why people have not noticed.
WRT the DS18S20 the temperature format is slightly different from the DS18B20, so some adaptation of the code is necessary. I believe that multiplying the result by 8 will so the trick, but I'm not sure.
If anyone has trouble with parasitically powered DS18B20's and wants to try my esp8266-12 firmware let me know. I'll create a pull request for master in a few days as there are a few more improvements I'd like to make to the code.