Saturday, 24 June 2017

rf - Low-power wireless module strategy


I'm designing low-power sensor modules which will be spread over a reasonably small area. The modules are all battery powered and should operate for a decently long time without having to recharge/replace the batteries (the longer the better, think at least a few weeks if not months or years). The idea is that every half hour or hour the module will wake from low-power mode, take some samples, and transmit the data to a central data-logger. The central data-logger will likely be wall-powered so low-power consumption isn't as necessary. I don't expect any modules to be any further than 100m from the central logger, likely much less.


I've identified some possible transceiver modules that potentially could work:




  1. ALPHA-TRX433S, 433 MHz

  2. ALPHA-TRX915S, 915 MHz

  3. Microchip MRF89XAM8A, 868 MHz

  4. Microchip MRF89XAM9A, 915 MHz


From what I've read, these modules all operate in FCC unregulated bands and should be safe to use. The Alpha modules advertise 300m range, but I can't figure out what the expected max range of the Microchip modules would be. How would I go about calculating this?


Also, since I do have my choice of bands, which should I pick and why (i.e. what do I get from 915 MHz over 433 MHz and what do I lose)? In order of what parameters I would consider most important:



  1. Low-power


  2. Transmission range (more is better, within reason)

  3. Immunity to other environmental factors (i.e. wifi/cell networks, running microwave ovens, walls/physical obstacles, temperature, etc.). The target use is in a residential environment and there will likely be significant temperature variations (say -20C to 50C).

  4. Data rate. This isn't terribly important as I'm expecting very little data per sample (few bytes at most).


Another question I have is how to handle multiple modules trying to transmit data at the same time. I have a few thoughts about how to mitigate this, but I'm not sure which solution to proceed with:




  1. Use a random time offset for when data is transmitted. The hope is that collisions will simply be avoided. This would probably be the simplest to implement and potentially will use the least power. However, this doesn't guarantee that there will be no collisions. Also, getting a good randomness source or unique pseudo-random seed may cause problems, though not unsolvable.





  2. On wake-up and attempting to transmit, check to see if there are any transmission currently in progress. Just wait for the end of the transmission before sending data. The problem then becomes how do I handle multiple sensors in the wait state, as they could potentially both decide that the last transmission has ended and both begin transmitting at the same time.




  3. Some other solution.





Answer



I have open source and open hardware sensor that would give you a working starting point: it is internet connected and transmits its temperature, humidity, and battery voltage every two minutes an will last for 3-5 years on 2xAA batteries. It is based on the M12 6LoWPAN module.


I'll try my best to grab touch on all of your questions:


Regarding band tradeoff:



433MHz, 915MHz, 2.4GHz


Range vs. antenna size is the clear tradeoff here. Free-space path loss is a function of wavelength so lower frequencies travel much farther for the same attenuation. BUT, in order to capitalize on this you'll also need a suitable antenna which also scales with wavelength. The 2.4Ghz antenna on the M12 takes about 2 sq. cm of PCB area.


A second factor is licensing. 2.4GHz can have unlicensed stations worldwide. 915MHz is only unlicensed in US (it's a GSM band everywhere else). I'm not sure the restrictions on 433MHz.


Data rate is also effected by frequency choice according to Shannon–Hartley theorem; you can cram more data into a higher frequency band. This isn't always used for more final data rate though. 802.15.4, for instance, has 4 bits of redundancy for every real bit seen at the data layer. The 32 symbols are pseudo-orthogonal so you have to corrupt several low level bits to cause an error. This allows 802.15.4 to operate under the noise floor (research suggests at -5dB SNR) and makes it relatively robust to interference.


Now on to the next hard topic,


low-power radio operation:


Compared to household battery sources (e.g. AA alkalines), even the "low-power" SoCs such as the mc13224v aren't very low power. The transmitters are around 30mA at 2-3.5V and the receivers are 25mA or so. Without turning the radio off and putting the CPU to sleep, this load will drain 2 AAs in a few days. The high power consumption of the receiver is often surprising to people and probably the biggest pain in developing low power radio systems. The implication is that to run for years, you can almost never transmit or listen.


The goal to get "year long" operation from 2xAA alkalines is to get the average current of the system to be < 50uA. Doing so puts you at years and up against the secondary effects from the batteries such as self-discharge and the 7 year self life for household batteries.


The best way to get under <50uA average is if your transceiver doesn't need to receive. If this is true, then you can "chirp" the data as quickly as possible and put the system into a low power mode (say approx 10uA) for most of the time. The TH12, for instance, transmits for about 10ms, but there is other overhead in the system regarding processing time and setup times for the sensor involved. The details can be worked out with a current probe and spreadsheet:




From that type of analysis you can work out what the run-life is going to be (assuming you have an accurate discharge curve for your battery).


If you do need to receive data on the low power side (e.g. to make a sleepy router in a mesh network) then the current state-of-the-art focuses on time division techniques. Some tightly synchronize the network, such as 802.15.4 beacons, and others use a "loose" system such as ContikiMAC (which can be easier to implement esp. if your hardware doesn't have a stable timebase).


Regardless, my experience shows that these methods are around 400uA average which puts you in the "months to maybe a year" run-time with 2xAAs.


Collisions:


My advice: don't worry about them for now. In other words do "aloha" (your option #1) where if you have data send it. If it collides then maybe resend it. (this depends on you goals). If you don't need to ensure that every sample is received then just try once and go to sleep right away.


You will find that the power consumption problem is so hard that the only solution will be a network that isn't transmitting much at all. If you just try, it will probably get through. If it doesn't, you can always try again later.


If you do need to make sure every datagram gets through then you will have to do some kind of ACK scheme. In the 6LoWPAN world, you can use TCP which will keep retrying until your battery is dead. There is also CoAP which uses UDP and has a retry mechanism (but doesn't promise delivery). But every choice here will impact run-time. If you are operating for years, the impact will be in months.


Your option #2 is built into 802.15.4 hardware as CCA. The idea is that receiver turns on for 8 symbols and returns true or false. Then you can make a decision about what to do next. You can play with these schemes all day/week. But every time you do something like this you shave more weeks off the run-time. That's why I suggest to start simple for now. It will work quite well if you are trying for long run-times.


No comments:

Post a Comment

arduino - Can I use TI&#39;s cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...