BeagleBone and W1 temp sensor

I recent got a BeagleBone A5 running the default Angstrom and I am trying to play with 1-wire devices. I hooked up a DS18B20 using parasitic power to header8 pin6 and header9 pin 1 for ground (so GND and Vdd on device to ground and DQ to pin 8_P6). I am running the BeagleBone off of USB power.

It seems to find the device and labels it by its internal ID such that the following command generates the results below:

more /sys/devices/w1_bus_master1/28-000001396518/w1_slave

50 05 4b 46 7f ff 0c 10 1c : crc=1c YES

50 05 4b 46 7f ff 0c 10 1c t=85000

Note that the temperature comes back as 85c - which is the default power up value for this 1-wire device. I am not able to get any other result. It seems that it is not getting a signal to reset the device. When I look with a voltmeter, it seems to sit at 3.1v and then every 10 seconds it bounces to a lower voltage and back up - which is when I assume it is trying to read the device.

Is there something I can do to control when and/or how it reads the device? Can I set the resolution of the device? Overall just wondering how to control the W1 bus. I see various setting files under /sys/devices/w1_bus_master1 and the sub-directories - some seem obvious but I don’t know the possible values to use and/or how to set them. If someone could point me to any documentation for this it would be great.

Where can if find the source for the W1 code in the kernel that is being used for this? Hoping that could at least give me something to look at.

I also tried installing the owfs package and was able to run ‘owfs --w1 /w1’, but it was not obvious to me how to make it see the devices, and they did not show up under the mount point that I created.

So any suggestions for documentation that I can reference or pointers would be appreciated. Thanks!

I strongly suspect you can only use parasitic power with an open-drain gpio, which we don't have. A second concern is that the DS18B20 uses a lot of power during conversion cycles, which the GPIO might not be able to provide. So I decided to power it using one of the powerrails:

http://dominion.thruhere.net/koen/cms/using-1-wire-on-a-beaglebone

regards,

Koen

Instead of patching the kernel, could one instead just use an EEPROM to switch the pins into the correct mode?

-ken

Yes and no. For any eeprom action involving more than pinmux you'd need to patch the kernel to add the platform data. Having said that, the current kernel on beaglebone will allocate one gpio for w1 all the time.

regards,

Koen

I already have a string of temp sensors wired up using parasitic power, so I was hoping to leverage those without adding in a new wire to the chain for power. I do have a DS2482S-100 (I2C to 1-Wire bridge). Would it be reasonable to try adding this as an I2C device and have it provide the parasitic power to the chain of sensors instead of coming from the 8_P6 pin directly on the header? I have seen some postings about using this interface. Would I be able to address the bridge through the owfs --i2c command with the current kernel?

Any suggestions or feedback would be appreciated. Thanks!

>>
>>
>>>
>>>
>>> I recent got a BeagleBone A5 running the default Angstrom and I am trying to play with 1-wire devices. I hooked up a DS18B20 using parasitic power to header8 pin6 and header9 pin 1 for ground (so GND and Vdd on device to ground and DQ to pin 8_P6).
>>
>> I strongly suspect you can only use parasitic power with an open-drain gpio, which we don't have. A second concern is that the DS18B20 uses a lot of power during conversion cycles, which the GPIO might not be able to provide. So I decided to power it using one of the powerrails:
>>
>> http://dominion.thruhere.net/koen/cms/using-1-wire-on-a-beaglebone
>>
>
> Instead of patching the kernel, could one instead just use an EEPROM to switch the pins into the correct mode?

Yes and no. For any eeprom action involving more than pinmux you'd need to patch the kernel to add the platform data. Having said that, the current kernel on beaglebone will allocate one gpio for w1 all the time.

Thanks, and so it does!

Alas, I am also seeing the 85-degree error code problem.

50 05 4b 46 7f ff 0c 10 1c t=85000

I am powering the sensor off of the 3.3V_EXT rail, because the input GPIO pin can only handle 3.3v. The sensor says its rated input voltage is 3.0-5.5v.

The databook also says that I need to send an 0x44 to the sensor in order to start a conversion (then wait 750ms before reading). But I can't seem to figure out where in the GPIO sysfs interface I would send this byte.

Perhaps that's why I'm getting this error code?

-ken

I have the ds2482 on the i2c bus and owfs happily talks to it with the latest kernels. I used a level translator from SparkFun so I could power it at 5 volts, but that may not be required.

Regards,

Wayne

Any idea why I'd be getting 85 degree celsius responses from it?

I've tried it with two sensors, same results.

I'm powering it off of the 3.3v rail, not even trying to use parasitic power.

-ken