giudan
Posts: 2
Joined: Mon Apr 16, 2018 11:57 am

Simple Input on RS485

Mon Apr 16, 2018 12:03 pm

Dear all,
I'm using Raspberry to control some devices (relays) by means of the RS485 serial bus.
It is quite simple to send a command to the relays through this bus.
My question is: how can I send a simple input to the raspberry. Specifically, I'd like to have a physical switch (like the one that we use to switch on a light in our houses) to send an input to the raspberry.
Are there some off-the-shelf devices to do this? or should I build something from scratch to transform the physical input in a signal on the serial bus, by implementing the required protocol via some integrated circuits?
Thank

scotty101
Posts: 3103
Joined: Fri Jun 08, 2012 6:03 pm

Re: Simple Input on RS485

Mon Apr 16, 2018 12:49 pm

A small microcontroller (ATTiny, PIC etc) is likely to be the best solution here. Each will also require a RS485 converter to convert the signals output by the microprocessor to RS485 compatible signals.

You could for ease of programming consider an Arduino compatible like an Arduino Mini.

If you aren't particularly tied to a wired communication protocol, you could consider WiFi using ESP8266 or ESP32 devices.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

giudan
Posts: 2
Joined: Mon Apr 16, 2018 11:57 am

Re: Simple Input on RS485

Mon Apr 16, 2018 1:53 pm

scotty101 wrote:
Mon Apr 16, 2018 12:49 pm
A small microcontroller (ATTiny, PIC etc) is likely to be the best solution here. Each will also require a RS485 converter to convert the signals output by the microprocessor to RS485 compatible signals.

You could for ease of programming consider an Arduino compatible like an Arduino Mini.

If you aren't particularly tied to a wired communication protocol, you could consider WiFi using ESP8266 or ESP32 devices.
Hi Soctty101,
thank you for your suggestion.
I will try to use a Pic as you suggested.
I hope to find some scheme already available, or maybe some pic that already has the ability to communicate on rs485.

I've already used a WIFI device (a SONOFF 4ch PRO) and it works quite well, since it already has 4 physical switch that you can use.
But for my new project I need to use a on-wire connection.

Thank you again.

Return to “Interfacing (DSI, CSI, I2C, etc.)”

Who is online

Users browsing this forum: No registered users and 11 guests