Low cost GPIO over RF - Page 1
Forum section: electronics / general

author: crispus
author_rank: Regular Contributor
timestamp: April 06, 2016, 11:00:04 pm
content: Hi,I want make a custom smart remote switch network. I need to switch on/off a relay and to be able to read 2 GPIOs.It may be up to a couple of tens of such as "switches".As RF protocol can be anything if is duplex: WiFi, BT, Zigbee, 433 Mhz, etc. As response / communication time per device 200-300ms it would be more than enough.Right now I see 2 solutions:1. Small MCU + RF module2. RF with MCU integrated.I would prefer cheapest chip/solution. Is there any part out there that would work of the shelf?I saw some of nRF/Microchip MiWi/ESP8266 that might fit.Any ideas?Thanks

author: rstofer
author_rank: Super Contributor
timestamp: April 07, 2016, 12:02:01 am
content: Networks have been done, why do it again? Any of the ones you listed will work. Zigbee is very interesting.OTOH, almost every micro with ethernet capability has an example project where it sets up a web server and responds to commands/queries from a browser. But a browser just sends text strings so the actual application can be anything that can read/write to the TCP/IP stack of the 'boss'. I would use something like a Raspberry Pi. What do I care if it has to run Linux as long as it boots up sooner or later. WiFi is built in, the web server is built in, the board has IO pins and Python is the language of choice.I was thinking about adding more automation to my sprinkler system. I was looking at Zigbee because it is a mesh protocol and signals to the far end of the property (not all that far) can be routed through other nodes. This is very cool. I could use any uC that came along and there would be no massive overhead like with the Pi.Really, the big part is at the client end. How does the data get presented? How does the user cause something to happen? If a web interface is adequate, any uC that presents a web server and USB (for the WiFi dongle) will work. It might even be possible to use the web server/browser approach over a Zigbee network. There used to be a SLIP protocol (Serial Line Internet Protocol). I haven't thought about it in years but ethernet wasn't always at gigabit data rates.

author: crispus
author_rank: Regular Contributor
timestamp: April 07, 2016, 07:24:27 am
content: I don't need anything fancy. I don't care if it is http, raw TCP/UDP, anything. I just need to a command which reads or writes some GPIOsThe brain would on the "master".I think right now the main criteria would be price... I was hoping someone used something cheaper

author: ealex
author_rank: Frequent Contributor
timestamp: April 07, 2016, 07:59:23 am
content: Hellothe cheapest could be some ESP8266 module - you have a lot of support for it and you can upload your own code.Also, if you need to keep the relay powered for a significant amount of time, you will have to search for bi-stable relays, otherwise you will draw a lot of power. More important if you want to switch mains voltage.there are some ready-made solutions but i have no idea on how much they cost, see this guy's clip:

author: obiwanjacobi
author_rank: Super Contributor
timestamp: April 07, 2016, 08:27:02 am
content: ATtiny + NRF24L01+ ??

author: hendorog
author_rank: Super Contributor
timestamp: April 07, 2016, 08:51:16 am
content: Much simpler: Not cheap per unit, but very simple. IIRC These can do transparent I/O and transparent serial over 2.4GHz using some example code.Since you mentioned very low volume it may actually be cheaper overall.https://www.pololu.com/product/1337Justified by using the same costing logic, however these are capable of significant range.http://www.hobbyking.com/hobbyking/store/__27096__OrangeRx_Open_LRS_433MHz_9Ch_Receiver.html

author: Porch
author_rank: Contributor
timestamp: April 07, 2016, 08:53:42 am
content: I use ZigBee to do what you are doing for my home security system. The ZigBee handles reading the sensors for door/window/motion, then turn on lights or do other things. Also have an Arduino reading serial from a device, then spits it to a ZigBee for broadcast on the network. A Beagle Bone Black has a ZigBee connected to it's serial port and works as the master controller for the entire system.Wish the ZigBee stuff was cheaper, $20-$50 per radio depending on type, but it just works.

author: macboy
author_rank: Super Contributor
timestamp: April 07, 2016, 04:17:36 pm
content: ESP8266 would be my default for this.If you have ever used Arduino, then this would be crazy easy. Otherwise, just merely really easy.There is a add-on for the Arduino IDE that lets you program the ESP8266 microcontroller directly. Examples are included from which you could quickly cobble together a working solution. This application, monitoring a couple I/O pins and activating a relay, is not a demanding one so all the people screaming about the overhead and inefficiency in Arduino need not bother. Besides, you can run this 32-bit MCU at 160 MHz if you want to.Even the smallest $2 ESP-01 module has enough I/O for this task,providedthat you don't use the serial port so that you can re-use those pins as I/O. Otherwise look into one of the other slightly bigger variants, or add a I2C I/O expander like PCF8574, which has the added benefit of protecting the MCU I/O pins from damage.Since these are WiFi, you have the choice of using a central node as a task-dedicated access point, or just configure them all as clients and connect to your existing WiFi LAN. A major drawback to consider is power consumption. The ESP8266 is power hungry particularly when communicating over WiFi.NRF24L01+ are also nice ... available, powerful, and cheap, and have much lower power consumption. But you need an external MCU to control it.

author: crispus
author_rank: Regular Contributor
timestamp: April 07, 2016, 09:47:33 pm
content: Thans guys for your answers.For this very project I will stick with ESP8266, it seems to be easier to debug. I don't care about power consumption, or distance because all of the switches will be in same room.nRF seems to be interesting for a low power project.