nRF24L01 wireless sensor interface.

I am wondering how to use a pair of nRF24L01 transceiver modules with a motion sensor at one end and the arduino at the other end for wireless motion detecting. But as I am reading the nRF24L01 manual it seems I need an arduino at each end :S. Otherwise, it looks as if I may be able to set the "transmitter" , and then just feed information from the sensor into the nRF24L01 TX FIFO and it will hope fully loop itself, sending a packet each time the TX is upated.

But my question is how to accomplish this? What can I use to write a packet to the TX FIFO when the sensor is activated?

hi
The nrf24l01 (+) chips have only SPI intrface. There is no uart/serial.
Consider using standalone atmega328 chip instead of full Arduino board.

What would be the advantage to using a standalone Atmega over a full board? After I incorporate the voltage regulator, crystal, and SPI interface is it simply like an arduino where I can read input/output directly from the designated Atmega pins? Or are there further discrepancies to account for? I am a beginner and admit I'm not sure what most of the components on the arduino do, it seems most of them are necessary for basic function?

Then I see I will need to change some registers for pinouts and power consumption... but I guess this can all be done with arduino via a pre loaded bootloader.

Then its just a matter of providing power via a regulator, and integrating the SPI interface to talk between the Atmega and the nrf24l01?

tock:
hi
The nrf24l01 (+) chips have only SPI intrface. There is no uart/serial.
Consider using standalone atmega328 chip instead of full Arduino board.

Look at buying on the of the cheap Arduino Mini Pro from Ebay - around $6 - just need a FTDI programmer for it.

Craig

I took craig's advice and my pro micro finally arrived today and is the last component needed for my wireless driveway alarm system, comprising of two IR sensors, two NRF24L01 + SMA Antenna, and of course the micro.

Here are some features of the NRF24L01 + SMA Antenna.

NRF24L01 Basic characteristics:

  1. 2 Mbit / s rate of the peak current of 12.5mA received
  2. In the 2Mbit / s rate @ 0dBm output peak current of 11mA
  3. 400nA power down mode
  4. 32uA standby mode power consumption
    5.130us fast switching and wake-up time
  5. With on-chip voltage regulator oltage regulators
  6. In the 1.9 to 3.6V low voltage operation
  7. MultiCeiverMT hardware provides simultaneous six receiver functions, 2Mbit / s high-quality VoIP makes it possible to
  8. 130 us quickly switch and wake time
  9. Has the on-chip voltage regulator oltage regulators
  10. Can work at 1.9 to 3.6 V low voltage

PRO micro

Features:

ATMega 32U4 running at 5V/16MHz
Supported under Arduino IDE v1.0.1
On-Board micro-USB connector for programming
4 x 10-bit ADC pins
12 x Digital I/Os (5 are PWM capable)
Rx and Tx Hardware Serial Connections
Our Smallest Arduino-Compatible Board Yet!

IR BEAM SENSORS

Technology:Infrared
Receiver range : <20m,Maybe range can be reduced to 30% in bad weather conditions:fog,rain,dust,etc
Infra-red frequency:1.92KHZ
Power supply:12V DC
Wavelength:940nm
Input:RX 15mA-TX 30mA
Operating temperature:-20-70 °C
Relay output:1A max 30V

However I obviously don't have direct access to power at the end of my driveway and need some help with the power distribution. I thought of using a car battery because I have a car battery charger available, maybe I can incorporate sending of the available voltage too. All the devices seem to require 12v, which is perfect for a car battery I guess.

But how will I power all the devices at once? Can I just use a parallel circuit with appropriate resistors before each component? And how can I measure the resistance of the circuit without completing it (So it doesn't blow up when I finally connect it)? The internal resistance of the battery for example. Or wont the resistance change once current is going through it and it heats up etc?

The Arduino Pro Micro has a "raw" power input and a voltage regulator, but what about the sensors and NRF24L01? Do I need to somehow regulate the current/voltage to them as well?

What about the dropping voltage as the car battery drains, how can I compensate for this?

Your answers are greatly appreciated, thanks.

You need to be careful with the nRF modules - they require 3.3V i believe and do not like 5v.

You can just wire your detectors directly to the battery -

make up a monitoring circuit with resistors to let you monitor the battery level and feed that into your Arduino so you can keep an eye on it

Craig

Ah yes... I wonder if the arduino pro micro could provide 3.3V like the uno.

You say I can wire the sensors directly to the battery, but how will I limit the current Input to :RX 15mA-TX 30mA ?

syphex:
Ah yes... I wonder if the arduino pro micro could provide 3.3V like the uno.

You say I can wire the sensors directly to the battery, but how will I limit the current Input to :RX 15mA-TX 30mA ?

Current is how much they need and how much they will draw - as long as your battery can sustain that amount of current (a car battery easily - even a starting battery)

(a car battery is not a good long term solution - better off getting a feel for the current draw over the space of a week or so) and then getting an appropriately sized SLA battery (or better 2) - one on the charger and one in server - swap them over on a weekly basis.

Craig

So you're saying as long as the voltage supply is adequate the devices will draw the correct amount of current without overloading? I thought the current I=V/R, so 30mA = 12V/R , R = 12V/0.03A = 400 Ohms - Meaning that the total resistance if connected directly (or in parallel?) should be RDevice + R1 = 400 Ohms?

But when I try to measure the resistance of one of the 30mA sensors I get a reading of 10.46 Mohms... whats going on here?

syphex:
So you're saying as long as the voltage supply is adequate the devices will draw the correct amount of current without overloading? I thought the current I=V/R, so 30mA = 12V/R , R = 12V/0.03A = 400 Ohms - Meaning that the total resistance if connected directly (or in parallel?) should be RDevice + R1 = 400 Ohms?

But when I try to measure the resistance of one of the 30mA sensors I get a reading of 10.46 Mohms... whats going on here?

If i remember correctly these things only have a tiny current draw when asleep and then when woken up draw their normal amount.

yes if you have a 12v power supply (i.e. battery in this case) - that can provide the necessary current then you are OK. A car starting battery for example is designed to supply a massive amount of current for a short period of time - but is not so good at providing a trickle over a long period (not that it can not do it, just that it will shorten the battery life)

Batteries are typically rated to be used at a C/10 rating - so if the battery has a rating of 100amp/hours - that will be if drawn down at 10amps per hour (you never run a battery down too far though)

You will note car starting batteries typically do not have a amp/hours rating - but rather a CCA (cold cranking amps) rating as thats what they are designed for.

Craig

craigcurtin:

syphex:
So you're saying as long as the voltage supply is adequate the devices will draw the correct amount of current without overloading? I thought the current I=V/R, so 30mA = 12V/R , R = 12V/0.03A = 400 Ohms - Meaning that the total resistance if connected directly (or in parallel?) should be RDevice + R1 = 400 Ohms?

But when I try to measure the resistance of one of the 30mA sensors I get a reading of 10.46 Mohms... whats going on here?

If i remember correctly these things only have a tiny current draw when asleep and then when woken up draw their normal amount.

yes if you have a 12v power supply (i.e. battery in this case) - that can provide the necessary current then you are OK. A car starting battery for example is designed to supply a massive amount of current for a short period of time - but is not so good at providing a trickle over a long period (not that it can not do it, just that it will shorten the battery life)

Batteries are typically rated to be used at a C/10 rating - so if the battery has a rating of 100amp/hours - that will be if drawn down at 10amps per hour (you never run a battery down too far though)

You will note car starting batteries typically do not have a amp/hours rating - but rather a CCA (cold cranking amps) rating as thats what they are designed for.

Craig

Yeah thats why I was worried about using a car battery, since as you say they are designed to provide a burst of current. Yeah they aren't good for trickling and you can't run them down too low, I just thought it a cheap alternative if the current drawn over say a few days was about the same as starting a car and then I can just charge it frequently enough to keep the charge optimal, but after some research I see most car battery chargers dont trickle charge to full capacity (this is done by the alternator I guess once it has enough charge to start).

A deep cycle battery is a bit overkill and expensive/bulky though. I guess I'll just settle for some ordinary rechargeable batteries, but I am still new and not sure how to combine them.

Unless I find a 12v rechargeable battery thats not a car battery I'll have to opt for a bunch of smaller rechargeable batteries, and wont running them in series for a higher voltage drain each battery unequally? Even though the same current obviously has flow through them?

Yeah thats why I was worried about using a car battery, since as you say they are designed to provide a burst of current. Yeah they aren't good for trickling and you can't run them down too low, I just thought it a cheap alternative if the current drawn over say a few days was about the same as starting a car and then I can just charge it frequently enough to keep the charge optimal, but after some research I see most car battery chargers dont trickle charge to full capacity (this is done by the alternator I guess once it has enough charge to start).

A deep cycle battery is a bit overkill and expensive/bulky though. I guess I'll just settle for some ordinary rechargeable batteries, but I am still new and not sure how to combine them.

Unless I find a 12v rechargeable battery thats not a car battery I'll have to opt for a bunch of smaller rechargeable batteries, and wont running them in series for a higher voltage drain each battery unequally? Even though the same current obviously has flow through them?

Actually the other way around - a battery charger (and intelligent one) is designed to do a burst of high current and monitors the voltage of the battery - once it gets to a certain level then it just trickle charges to get the battery to full capacity - most car alternators are stupid and never get a car battery past about 80-85% charge.

What country are you in.

You can get SLA 12v batteries (in Oz) from EBAY for $20 for a 7.2amp/hour - as i say though run the system for a week from your spare car battery and see what the voltages and draw looks like over that period

SLA batteries come in all sizes - but the ones i am talking about are about 1/4 the size of a car battery.

You could alternatively combine multiple smaller batteries such as AA rechargeables - but the cost effectiveness is not there - a good brand costs us abut $20 in australia for 4 batteries at 2500ma - as these are 1.2v - you would need 10 of them - you would need 3 sets of these to come to the same power as the SLA 12v battery above.

Craig

I can get a 12V 7 AH battery.

Here are some specs:

Selaed Lead Acid Battery
7.0 Amp Hour Rated

Voltage: 12V
Capacity: 7AHr
Length: 151mm
Width: 65mm
Height: 94mm excluding terminals
Terminal Height: 5mm
Weight: 2.2KG

But how much will the system use on average? I guess 1.5 Watts... so one battery should power it for about 2 days. But I probably need one battery for each side of the road, meaning four batteries in total. The batteries are $30 each, and I can get two chargers for $30 each. Meaning total cost $180... at least I would only have to change them about every four days, but I was hoping for like a week.

How far from the batteries and the pro micro can I wire up the NRF24L01?

syphex:
I can get a 12V 7 AH battery.

Here are some specs:

Selaed Lead Acid Battery
7.0 Amp Hour Rated

Voltage: 12V
Capacity: 7AHr
Length: 151mm
Width: 65mm
Height: 94mm excluding terminals
Terminal Height: 5mm
Weight: 2.2KG

But how much will the system use on average? I guess 1.5 Watts... so one battery should power it for about 2 days. But I probably need one battery for each side of the road, meaning four batteries in total. The batteries are $30 each, and I can get two chargers for $30 each. Meaning total cost $180... at least I would only have to change them about every four days, but I was hoping for like a week.

How far from the batteries and the pro micro can I wire up the NRF24L01?

Before you go buying batteries try and work out the current draw of your system - if you have to buy a multimeter with current (microamps) on it so you can measure this and then size the batteries appropriately.

Remember with SLA batteries you do not want to drain them more than 50% so you are really looking at a useable 3.6AH out of those batteries.

At that size and price you would be better going to one of your mass retail outlets and buying their cheapest car batteries - they will be around $50 and give you 4 or more times the AH (if you then look after them with a good multistage charger you might get 3 or so years life out of them)

Craig

Maybe it would be possible to repurpose one of those soloar yard lights They seem to usually have 2 AA batteries, at about 1000mAh. Might be able to push that up to 3 cells and have something workable. And you'd get an inconspicuous and weatherproof shell to put the electronic into.

Of course, any of the off the shelf Arduino boards is going to be much more of a power drain than if you roll your own, which doesn't look to be too difficult. I found one variant here:

I have an arduino pro micro.. which is probably gonna be as low current draw as I can get. I read somewhere you can disable everything except for what you need.