How can i get One-Wire Temp-Sensors to Openhab the best way?

Hi, i want to use some One-Wire Temp Sensors ans humidity sensors around my house. I have KNX-wiring on all places and i can use the unused white/yellow wires for one-wire.

But what´s the best (and a cheap) way to get one-wire to my home automation?

I know this usb-dongles to connect one-wire-sensors.

But what do i need too? I don´t want to buy a one-wire-server for some 100 euros.

Or is it a better way to connect the sensors directly to a raspi?

I´m not a electronic expert, so soldering is not the best thing i can do.

1 Like

You can attach it to the Pi’s GPIO pins.
Haven’t tried myself and a couple of people reported problems doing so.

I guess you need to google a bit more for ‘w1-gpio’ than I just did.
See e.g. (sorry, German only, use the babelfish to translate …)
http://www.fhemwiki.de/wiki/Raspberry_Pi_und_1-Wire#RPI2-Modul

That´s ok, i´m from germany :slight_smile:

I have read that it´s better to use a bandpath filter with gpio, but i´m no soldering expert… So i think usb-dongle would be better for me - and it´s not so expensive.

I currently use an odoid u3 (like raspi) with ubuntu, there i can use this stick. In future it´s planned to move to a dell t20 server with esxi - there i can use the usb dongle also…

If i buy this usb dongle and somoe sensors, do i have to install a one-wire server or someting like this or can i simply read out the values with openhab 1wire-binding — with no extra 1wire software?


I saw many 1wire-things on busware.de - there i need a raspi and the busware-modules - but what do i need also? I think there must bee some software on raspi to control 1wire? And after that i can read out the 1wire-software with 1wire-openhab-binding - right?

1w-gpio will work with Pis and GPIO only.
And if I am not mistaken, the 1wire OH binding requires you to operate a 1wire server (which is $$$).
So you would probably be “out of software” if you went the USB dongle path.

For the GPIO solution, see http://www.msxfaq.de/sonst/bastelbude/raspi-1wire.htm
Also see bottom of that page for more links.

There’s also alternative solutions. Some zWave devices allow for attaching 1wire temp sensors, and I read about someone to use (I believe) a Pokeys57E with Modbus binding instead of a Pi to connect several 1 wire lines.

Hm, that´s not good, if openhab requires a 1wire server…

I don´t want to use wireless sensors, i don´t want changing batteries all the time. There are wires all around the house already, so i want to use them.

ESP8266 module with espeasy firmware:

http://www.esp8266.nu/index.php/HumiditySensor

Power can be established through a 5V smartphone power supply, data is sent through wifi, openHAB is connected through mqtt.
All together around 15 Euros …

So i would have to install many usb-smartphone-power-supplys around the house… big power consumption.

And i´m no soldering expert. So i can´t solder the small boards with sensors on it.

All i can do is soldering a wire to a sensor… I hope i can :wink:

What about the following:

Raspi as 1wire-Server
wiregate USB-Dongle (Busmaster)

There i can simply add sensors around the house.

Will this work good?

You may connect several (I think up to ten or even more) sensors to one esp8266 module. And if you buy a nodemcu version of the esp8266 or something similar you just have to connect one (good) power supply and buy preconfigured strip wires to attach the sensors. Almost no soldering required … cheap AND no need of soldering will be quite difficult to find. :grinning:

Ok, so i can place the nodemcu in the middle of my house, and i need cables with 4 wires to all the sensors?

And nodemcu is connected with usb to the rasperry?

There won’t be any need for the Raspberry Pi. ESPEasy is a firmware for the ESP8266 (NodeMCU) that supports many different sensors and protocols. You can use it to send your sensor data over wifi directly to OH using MQTT or HTTP.

I don’t have any experience with one wire sensors, so I don’t know how long your wires can be and still report reliably. That’s going to be the limiting factor with “home runs” like you want to do, regardless of what they are connected to.

I have two DS18B20 temp sensors connected with each 10 meters of cabling: no problem.

I2C needs four wires, 1-wire needs three wires (Voltage, Ground, Data).

Hi,

If you wish to avoid soldering, then I’d look at ready made alternatives, such as Z-Wave.
DIY wireless sensors, such as designs based on the ESP8266 are 1/4 the cost, but you do need some software and hardware skills. The learning process is more fun, IMHO.

I’ve used 1-Wire devices for many years, but to drive long lengths of wire (e.g. >10m), used dedicated host adaptors.

Many projects use Raspberry Pi IO pins to ‘bit-bang’ the 1-Wire protocol to DS18B20 which are VERY close to the Pi (e.g. 1-2m) and may only have one or two sensors. The CPU load of directly controlling IO pins is also much higher than relying on a dedicated hardware interface.

I have been testing a RPi2 with a DS9490R USB Host Adapter plugged directly into the Pi USB ports. As it is a dedicated interface, it can drive longer cable lengths and is simpler to use in software.

You can install owfs-server, configure with owfs-shell and link to OpenHAB with the onewire binding very quickly. It looks like ofws-server can use bit-bang IO interfaces via the Linux kernel driver, but I’ve not tried.
http://owfs.org/

To avoid any soldering, the USB or dedicated Raspberry Pi interfaces and pre-made cabling can be bought from several sources, including:
http://www.sheepwalkelectronics.co.uk/index.php?cPath=22&osCsid=024863af86f68b7df0c41d7335b7922a

This company illustrates the options to connect 1-Wire devices well - they offer:

  • RPI1 - passive ‘bit-bang’ host adapter using kernel based 1-Wire drivers
  • RPI2 - uses a dedicated Maxim DS2482-100 I2C to 1-Wire IC
  • RPI3 - uses a larger dedicated Maxim DS2482-800 8 channel I2C to 1-Wire IC

Their pictures of the PCBs show the difference in complexity between a IO pin interface, and a dedicated interface chip.

Note: most 1-Wire sensors (like the DS18B20) are bus powered, so need two wires - 0V and Data. Some 1-Wire devices need additional power (e.g. switches, humidity sensors, etc) so add 5V or 3.3V giving three wires.
The DS18B20 device and sealed probes on eBay have three wires, but two are usually connected together in use (parasitic power mode).

Can i use Temp Sensors like DS18B20 only parasitic or can i use them with extra power too?

There are lots of examples of using 1-Wire parts in designs - and this temp sensor has been in use for at least 20 years!

Rather than quote a random site, here’s the manufacturer data sheet:

This may look complex and imposing at first, but look at the circuit diagrams at the bottom of page 7.

(Spoiler - you can use external power with 3 wires, or parasitic power with two wires. I personally use two wires with the TO-92 package.)

I can vouch for both the ESPEasy solution and also a USB adapter plugged into the Pi. Both can be fiddly to get running.
A kind person on here helped me with OWServer in the past so a site search should show you the way. If you go the USB route you also have to set the port the device uses in Raspbian so it doesn’t occasionally move if you plug something else in later.
The ESP is easier to get going but does involve soldering, I have one USB adapter and a couple of ESP’s with 2 more ESP’s in development

I found this ow-Server: http://www.fuchs-shop.com/de/shop/17/1/13372381/

Looks good and not to expensive. If i have to buy a raspi with all parts i need, then i will pay the same price. And this works out of the box. May be i will try it.

There is also a library/utility for reading 1-wire called digitemp. Imo a bit easier to use than owfs.

https://www.digitemp.com

I am using this method: 1-wire, rpi. Does not need ow-server, just a script and the exec library on OH:

Works like a treat.

I ordered a modbus temperature and humidity sensor from Aliexpress. I will post some reviews when that arrives. That is not cheap ($30-35 a piece) and will take 4 wires.

Can I suggest you use a Sonoff to achieve this - flashed to use ESPEasy.

https://www.itead.cc/sonoff-wifi-wireless-switch.html

It is essentially an ESP8266 with a built in power supply and relay… I am using them to control lamps etc, but if all you needed was the temperature logging, you could just connect a cable to it. No need for batteries.

They are unbelievably cheap and the quality is definately there.

I am going to use the DHT22 humidity and temperature sensors on these units.

Edit* They have a new product that is even more useful for you

https://www.itead.cc/smart-home/sonoff-th.html

Comes with a nice case, and a dht11