Tag Archives: 1-wire

How to make the 1-wire bus more reliable on a Raspberry Pi

Thermal sensors, such as DS18B20 can be connected to the Raspberry Pi via 1-wire bus. However, the 1-wire bus is not implemented in hardware, but only as software emulation on GPIO4, which has some major disadvantages. The 1-wire data link is acting as a very long “antenna” which catches interferences. All GPIO pins of a Raspberry Pi are directly connected to the CPU. So every interference cought on 1-wire bus is transported directly to the Broadcom SoC. Furthermore, the 1-wire protocol needs a very tight and time-critical signal generation, so it’s resource-consuming to communicate with 1-wire slaves and therefore highly unreliable if running on a non-real-time operating system.
I noticed that the DS18B20 sensors, which I have wired to my Raspberry, return at least once or twice a day bad temerature values, making it impossible to retrieve reliable max/min temperature data.
I recently stumbled upon a DS2482S-100 1-wire master breakout board that allows to control one or many 1-wire slave devices by simply sending I2C commands, relieving the task of generating the time-critical signals the 1-wire protocol requires. It provides bidirectional protocol conversion between an I2C master and 1-wire slave devices. The breakout board makes use of a DS2482S-100 converter, that is exclusively sold in a SO-8 package which doesn’t fit onto a breadboard.

Continue reading How to make the 1-wire bus more reliable on a Raspberry Pi

Raspberry Pi to Banana Pi migration

You might have noticed that my site was down for maintenance on Wednesday, 2014-09-17. For better WordPress performance, I decided to migrate my blog to a brand-new Banana Pi server, featuring a Cortex-A7/ Allwinner A20 Dual-core CPU with Mali-400M2 GPU — that’s cheating — I know 😀.

Let’s go bananas … !

It took me a couple of hours and some tinkering to move my WordPress installation including the MySQL database onto the new server. So here are my first impressions:

Continue reading Raspberry Pi to Banana Pi migration

Connecting a DS18S20 temperature sensor to RasPi

I’ve been a little reluctant to connect a DS18S20 temperature sensor to my RasPi, since there were rumors that the w1_gpio.ko kernel module exclusively requires a connection to GPIO #4, because of being hard coded. At least that’s what Lady Ada’s tutorial says about it and what one can read in several user forums. Unfortunately GPIO #4 was already occupied on my Pi. Therefore I searched through several Blogs for advice how to change the hard-coded GPIO in the kernel module. It turned out that I wasn’t the only one – so here’s the good news: In Raspbian Wheezy with Kernel 3.10.25+ it is possible to pass the desired GPIO in /boot/cmdline.txt to the kernel using the option:


To be able to read temperatures from the sensor, modprobe the wire, w1_gpio and w1_therm kernel modules. The temperature can be read from /sys/bus/w1/devices/<device_serial_number>/w1_slave.

I’m using the the sensor for outdoor temperature measurement. I soldered about 1 m wire to the sensor (TO92 housing), insulated the solder joints with heat shrink tube and embedded the sensor into an old metal ballpoint cap using epoxy glue.