2

I'm working an a home automation project, using a Raspberry Pi. What I want to do is connect an RF 433 MHz transmitter to control RF-controlled light switches, and a ZigBee/XBee module to connect to other devices such as curtain rails. I will probably be programming in Node.js, as I am already familiar with JavaScript.

Both of these modules (RF and ZigBee) need to be connected to the Pi's UART pins, correct?

If so, is it possible to connect both modules?

If so, how would I go about doing that? Perhaps using GPIO's as UART?

I am quite new to electronics so, if at all possible, please keep your answers simple.

Thanks!

  • My guess it that bitbanging the 433Mhz RF will work just fine. – Gerben Feb 13 '14 at 19:10
  • How would I go about 'bitbanging'? Can you provide a tutorial? – PeterH Feb 25 '14 at 9:24
  • Can't find anything someone has already done on the Pi. You could just port the RemoteSwitch library Or reuse the existing remote; instructables.com/id/Raspberry-Pi-GPIO-home-automation/… – Gerben Feb 25 '14 at 17:06
  • Thanks Gerben, I will take a look at that library! It looks similar to what someone did for the Pi here: weejewel.tweakblogs.net/blog/8665/… (the page is in Dutch unfortunately). I would just use that one but it needs the UART pin, and so do XBEE modules – PeterH Feb 26 '14 at 9:47
  • 1
    Thanks @Gerben! If you post that comment as an answer, I'd like to mark it as the accepted answer. (you're right by the way, my Dutch is fine, but others who read this question may have more trouble with it ;)) – PeterH Feb 26 '14 at 15:03
1

The RF-module doesn't require the UART pin. You can use any GPIO pin you like. So the library you are using (found at http://weejewel.tweakblogs.net/blog/8665/lampen-schakelen-met-een-raspberry-pi.html), can easily be modified. Just change line 14 in kaku.ccp to int pin_out = <<some-other-pin>> and recompile.

1

The Zigbee module will need a UART connection, but the RF module likely will not. Although simple RF modules do use a serial protocol, it's usually done in software and wrapped in Manchester encoding to make the transmission more robust.

  • I would prefer to use the RF module on the UART pins, that would be easier. It has been suggested to use I2C for the ZigBee module, could that be an option? – PeterH Feb 25 '14 at 9:23
  • Xbees are usually serial, and if it's a simple transmitter, they don't work from a UART directly. – scruss Feb 26 '14 at 12:34
  • I think I will be able to use the library mentioned in the question comments for the transmitter from a GPIO, so the UART will be free for the Zigbee module. Thanks! – PeterH Feb 26 '14 at 15:07
0

Idleman did a very nice tutorial about that where he uses the pi the remote activate power plugs :

frame formatting : http://blog.idleman.fr/raspberry-pi-10-commander-le-raspberry-pi-par-radio/ php interface : http://blog.idleman.fr/raspberry-pi-12-allumer-des-prises-distance/

The page is in french, though.

The global idea is you just need to send real-time frames containing an opening sequence, a Manchester coded frame and a closing sequence.

Bottom line, except for a line in his code calling a sequencer, you don't need anything.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.