This shows you the differences between two versions of the page.

devices:ds18b20 [2014/12/24 16:35]
jkx created
devices:ds18b20 [2014/12/24 16:47] (current)
jkx [Debug]
Line 3: Line 3:
 ===== Default settings: ===== ===== Default settings: =====
-By default the bugOne use PD5 for this sensors. You can tweak this in <code>devices/onewire.h</code>+By default the bugOne use PD5 for this sensors. You can tweak this in __devices/onewire.h__
 <code> <code>
 #define OW_PIN  PD5 #define OW_PIN  PD5
Line 10: Line 10:
 #define OW_DDR  DDRD #define OW_DDR  DDRD
 </code> </code>
 +The default setting for power supply is parasite. Just power the device through a 4.7k pull-up on pin DQ. You can change this in 
 +int8_t ds18x20_read(struct packet_t *packet) {
 +    uint16_t temperature;
 +    uart_putstr_P(PSTR("ds18x20 read\r\n"));
 +    DS18X20_start_meas(DS18X20_POWER_PARASITE,NULL);
 +    _delay_ms(DS18B20_TCONV_12BIT);   
 +    DS18X20_read_decicelsius_single(DS18B20_FAMILY_CODE, &temperature);
 +    return set_data_int16(packet, temperature);
 +==== Debug ====
 +  * If you receive dumb values from a sensor, usually mean the bugOne can find this sensor. This can be a wiring error, or a wrong power mode (check parasite mode).
 +  * If you receive 850 (85.0°), usually mean the bugOne found the sensor but was unable to read the value. This usually occurs with bad connexion, for example on a breadboard. I spent some time on this error, but it's always a hardware failure not a software bug. 
devices/ds18b20.1419435302.txt.gz · Last modified: 2014/12/24 16:35 by jkx
CC Attribution-Noncommercial-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0