Recommendations for sensor hardware and relays

Hi Community,

I already setup OpenHAB on a PI. Currently I am using EnOcean and ZWave devices in my home. Now I am looking foreward to integrate some analogue signals and relays.

I want to read one analogue voltage (0-10V) and ten contacts. Also at least two relays must be switchable. The Problem is, that the devices are located in my cellar and I cannot use any wireless system there. So I thought of a simple “sensor to IP” gateway that can be integrated.

What hardware would you suggest? It would be perfect, if the gateway could be powered by PoE. So maybe another Pi with PoE hat and some other board?

Thanks

[EDIT] I am able to solder and wire things together. So a DIY solution is possible.

Hi

I always suggest the Robot Electronics range of devices.

They sell a great multi io device, which has everything you’ve asked for in a straight forward IP version, or a version with its own scripting language, if you want it to do things without external control, but with a remote control option via UDP.

The IP version can interface with openHAB2 quite easily using the TCP binding.

ETH849 PDF Manual

If you go down the Pi route, you could look at the GPio options and talk to openHAB2 via MQTT?

Or an even lighter device?
I’m sure other people will be able to advise you much more in this direction.

@CrazyIvan359 ???

Is this your area of expertise?

You can use an Arduino with a poe shield. With the number of inputs you require you may need an Arduino mega

1 Like

If you’re looking for an easy solution then the ETH484 will probably be best, but doesn’t have analog in. it has 4 analog inputs (I must be going blind).

Next easiest option would be a Pi, you could use my MQTTany software for digital I/O. The Pi doesn’t have any analog inputs, but you could use something like an ADS1115 (I think that’s the chip) which I’m sure someone sells as a hat and I can add support for that (I was planning to anyway).

No matter what device you use it won’t be able to handle 0-10V analog (or digital) so you will need to scale that down. You might be able to find a hat that has an ADS1115 on it and can scale the voltage down. Or build a circuit to drop the voltage.

@MDAR I wouldn’t say expertise, but I’m good with hardware :stuck_out_tongue:

1 Like

Ahem…

It does :wink:

Digital Switching I/O channels - 8
Analogue Inputs - 4

See page 2 of the PDF.

Analogue inputs
5v = 5v dc output
A = Input (0-3.3v)
0v = 0v ground

Granted you’d need to half / quarter the voltage.

I own one if you’d like me to test something

So it’s definitely the ADS1115. I don’t see any Pi HATs out there with one though, but you could get something like this and build a board around it with voltage step-down on it.

Thanks for the detailed infos and options!
I will go with a DS3484 from Devantech. This board has an additionally RS485 port I can utilize to connect to my heating system via modbus. It seems like the reliable all-in-one solution I was looking for.

3 Likes

Good choice.

The Dscript language takes a bit to get your head around, but if you have ever had dealings with BASIC then you should be able to get started.

Anyone will tell you that I’m no programmer, but even I managed to get my head around DScript to create a bell chiming interface.

I’m not entirely sure how much you can do with the RS485 port, but I guess that depends on your programming skills :smile:

1 Like

I agree with that - Pi with PoE and something like this: https://thepihut.com/collections/raspberry-pi-hats/products/automation-hat

I’ve found this very reliable in a similar setup to yours - indeed much more reliable than zwave.

1 Like

@dan12345 YES! That’s the ticket!

Cool!

Where I don’t need an analogue input I’m now using naked pi zeros. No hat required, just the GPIO pins and a simple python script as follows:

from gpiozero import Button
from time import sleep
import requests


def doorbell_pressed():
        print ("doorbell pressed")
        requests.put('http://192.168.1.53:8080/rest/items/buttonpi_doorbell/state', "ON")

def call_lift_pressed():
        print ("call_lift pressed")
        requests.put('http://192.168.1.53:8080/rest/items/buttonpi_call_lift/state', "ON")

def permit_pressed():
        print ("permit pressed")
        requests.put('http://192.168.1.53:8080/rest/items/buttonpi_permit/state', "ON")


b_doorbell = Button(2)
b_call_lift = Button(3)
b_permit = Button (4)

b_doorbell.when_pressed=doorbell_pressed
b_call_lift.when_pressed=call_lift_pressed
b_permit.when_pressed=permit_pressed

print ("Starting up button reading!")
while True:
        requests.put('http://192.168.1.53:8080/rest/items/buttonpi_heartbeat/state', "ON")
        sleep(60)

so GPIO pins 2, 3 and 4 trigger openhab items buttonpi_doorbell, buttonpi_call_lift and buttonpi_permit, and a command is sent every 60 seconds to buttonpi_heartbeat (so I can use the expire binding to notify me if the pi goes down)

The pi is hidden in the wall and powered from a 15V line that powers the entryphone, via a DC-DC converter (https://www.amazon.co.uk/gp/product/B07DYP6L35/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1) to take it down to 5V. The converter and pi barely get warm.

Perhaps I should have made this a tutorial? But if it’s useful to someone that will be great.

Dan

1 Like

You should checkout MQTTany. It’s quite flexible and uses MQTT instead of HTTP, which I find easier to manage.

I got my hands on the dS3484 and played a bit with it. Then I noticed, that the firmware was outdated (4.3) and so I tried to upload version 4.4 with the supplied dScript IDE. My problem now is, that flashing the firmware completed, but it will not run. The board does not blink the blue led when powered, only one solid green led is lid. The board is only recognized by the IDE when in bootloader mode, but that was already the case with 4.3. Any ideas how to fix this?

The output from the update:
[16:20:51.119] - Searching for module to upload to…
[16:20:53.413] - Updating system firmware.
[16:20:53.413] - Erasing Flash
[16:21:00.830] - Programming Flash
[16:21:00.831] - [****************************************] 100%
[16:21:07.053] - Done!
[16:21:07.054] - Rebooting Module
[16:21:10.136] - Could not find a module to upload code to, Build and run canceled

Flash it again. It has happened to me before where some of the data was not transferred correctly and reflashing does the trick most times.

It’s been a while since I did anything with the board, but I think you’ll find that the Green light is simply a power indicator, whereas the other LEDs are fully programmable.

For example, you can create a heartbeat.

It might be that it’s just waiting for a configuration to be loaded into it?

Have you looked at any of the examples in their Zip file?

I think there is a bug in the timed heater / 7 day thermostat example, but I think I’ve fixed it if you want a copy.

I already did this a couple of times. Now even tried to reflash 4.3, but with the same result.
I will give it a try tomorrow with another computer, as my laptop had some issues with usb connections to other devices in the past. Maybe that is also the problem here?

It could be. Stuart might be right also, I’ve never worked with these devices but flashing firmware does tend to reset to factory default settings.

I tried some examples now (app-dS3484, FlashingLeds, WebsiteSimple) but with the same result. So have to wait till I get to another computer tomorrow.

1 Like

So I tried it with a Win10 laptop and that worked.
The log is similar to that on my Xubuntu notebook, but the device is recognized after the reboot and then the website and application get uploaded. I will dig further into this during the next couple of weeks, but now I am glad, the module is running again.

1 Like