I want to connect a magnetic door open/closed sensor to a device that can transmit (or be queried for, whichever) the state of the door to a hub inside (probably RaspberryPi). The outside unit should...

  1. Operate on as little power as possible (outside unit will consist of board, open/closed sensor, power, and transmitter)
  2. Be able to transmit from my back yard to inside my house (~15 meters to house & 1 or 2 walls).

I am new to this and pretty confused as to whether I should use BLE, Zig/xbee, or 2.4ghz rf (is that different? I am not even sure...).

Other considerations are cost (of course) and ease of use. I am a novice with hardware & want something easy to get up and running.

  • Had been looking at this when I asked the question: nordicsemi.com/eng/Products/2.4GHz-RF/nRF24LU1P – Stop Slandering Monica Cellio Aug 10 '15 at 16:52
  • NRF24L01+ would be more appropriate, unless you want to go program the 8051 processor that is inside the UL1P (which is not as easy as programming and arduino). Alternatively go with some 433mHz transmitter receiver pair. This frequency is used on most wireless doorbells, and wireless power outlets. – Gerben Aug 10 '15 at 17:58

I agree with @Gerben - the nRF24L01+ would probably be the most suitable for your application. It should have enough range to go 15m through a few walls, and the cost is about as cheap as you can get.

You can pick up cheap Chinese clone modules (not real nRF24L01+ but another chip that operates exactly the same) for around $2 each on eBay. I by them by the bag full.

There are a few good libraries around for controlling them with an Arduino so programming really isn't much of a problem.

They even have the advantage that they can operate in a mesh network mode if you ever expand your system to incorporate other things.

The connection to the module is a simple 5-wire SPI interface - SDC, MOSI, MISO, Chip Enable and Command Select pins, so you don't even need to mess with lots of wires.

You can read more about using them here: http://playground.arduino.cc/InterfacingWithHardware/Nrf24L01

The best library in existence is the RF24Network library: https://github.com/maniacbug/RF24Network

If you are looking for something more self-contained and stand-alone, you might look at the ESP8266 modules which are a programmable WiFi module. They can either interface with an Arduino to be controlled through AT commands, which is quite nasty, or they can be programmed directly using an Arduino-like API which can be obtained here: https://github.com/esp8266/Arduino

These modules are a little more expensive, but that cost is offset by not then needing an Arduino in the mix as well. The NodeMCU is probably the easiest to work with since it contains the USB serial interface on board like an Arduino. It also has its own Lua based programming environment if you don't mind learning another new language, but you can use it with the Arduino API for ESP8266 above.

The ESP8266 is also supported by the beta version of UECIDE

| improve this answer | |
  • So I could use this to a) read sensor state b) transmit directly to raspberrypi (or would it need to go thru router?) and c) run for days/weeks without needing recharge? It looks like there are only 8 pins and I assume a couple are for power? Sorry, I'm still pretty confused :( – Stop Slandering Monica Cellio Aug 10 '15 at 20:40
  • Two are power and ground. Some are special purpose and need to be placed in a specific state to get it to run (or other states to enter the bootloader, etc), and others are digital IO to do with what you want. It can connect to a WiFi access point (router) or it can be a WiFi access point for the Pi to connect to, or the Pi can be an access point for the ESP to connect to (hostapd). Can it run for weeks without recharge? That depends on a) how you program it (sleep modes etc) and b) what your power source is. – Majenko Aug 10 '15 at 21:09
  • The smaller modules like that, though cheaper, are much harder to work with. I'd seriously recommend working with the NodeMCU as your first foray into the ESP8266 since it is so much easier to work with. Yes, it's a little more expensive, but is a great board to develop with. You could then migrate to a little ESP-01 to build your finished device though. – Majenko Aug 10 '15 at 21:11
  • Alright. Upvoted but upon further consideration this does not answer my question. There are two (plus) alternatives listed and no clear path with regards to power... I appreciate your help but I need "Use X because Y, it has the following API to sleep/wake your unit" etc.. I need a bit more specific guidance. :) – Stop Slandering Monica Cellio Aug 10 '15 at 21:34
  • incidentally this unit will be dormant 99% of the time and only really need to transmit when the sensor's state changes. Is wifi as fast-to-connect/low-power as BLE here? – Stop Slandering Monica Cellio Aug 10 '15 at 21:35

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.