connecting AVR to nrf24l01 wireless modules

Go To Last Post
11 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've been trying to come up with a simple and cheap way to connect an AVR to nrf24l01 modules to make coin-cell powered wireless sensor nodes. By cheap I mean < $1 for the interconnection parts. After mulling over lots of ideas my first actual attempt is attached. Sorry for the poor focus - my phone camera doesn't have macro mode.
It's a picture of an ATtiny88-AU hot glued on top of the module. Soldering the wires to the qfp has been a lot harder than expected, espectially since the soldering iron tends to melt some of the hot glue near the leads which gums up the leads. My plan was to hot glue a CR2032 holder on top after I finish connecting the leads, and solder the + and - from the battery holder to Vcc and Gnd. Here's the cost breakdown:
nrf module: 93c (qty 10@aliexpress)
CR2032: 22c (qty 25@fasttech)
2032 holder: 10c (qty 1@tayda)
ATtiny88-au: 56c (qty 25@newark)
total: ~181c
(wire and hot glue are cheap enough not to count)

I could go with a slightly more expensive but easier to solder ATtiny85-SU, and hot glue it upside down so the glue doesn't get on the leads.

Another idea I thought of was to unsolder the 8-pin header, hot glue an ATtiny to the bottom of the NRF module with wires going to the solder pads where the 8-pin header goes. I could get the pins pushed flush to the PCB, but even wit some solder wick I couldn't get the pins out.

Another idea I have is to make an adapter out of perf board and an 8-pin female header, with an ATtiny85-PU on the perf board.

Another idea is to solder wires from the nrf header to the pins on an ATtin85. Given the differences in the pin order, I think it will be a bit of an octopus.

My last idea is to go pro, and design a PCB for an ATtiny88-AU with a breakout for the nrf 8-pin connector. I've designed & etched simple through-hole boards before, but never designed a PCB from scratch with a cad package. For this reason and because of the cost overhead, I think this is the least feasible of my ideas.

I stared at pinout diagrams for hours now looking for ways to line up the pins of the nrf module with the pins of an AVR. The closest I can come up with is an upside-down attiny84. The problem(though I guess not that bad) is the SPI pins wouldn't line up with the USI pins, so I'd have to bitbang the communication to the nrf module.

So what way do those of you who have done more than a couple circuits think? If you were doing it and only had a budget of a few dollars, how would you do it?

Attachment(s): 

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Use the nrf51822 chips. $3 in one offs. Cpu and radio. As used in the rfduino.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How is the power usage on the nrf24l01?
Specifically, can they sleep and still be discoverable?

There are Arduino libraries for that chip that do mesh networking but power usage is a concern for a project I've had on the back burner for some time.

The nrf8001 might be a better choice for a radio + Arduino but I haven't done the research yet.

You might consider making a PCB, in 10qty from Seeed Studio, you are looking at $1.50 or something per board. Less if you panel the board and cut it apart yourself.
EagleCad is free for non-commercial projects.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
Use the nrf51822 chips. $3 in one offs. Cpu and radio. As used in the rfduino.

I looked at those and the nrf24le1's. I want to stick with an AVR-based solution though, since I'm already setup for AVR development (programmers, compilers, etc.)

I also did a quick pricing check, and at mouser they're ~$3@qty100. For a full module, the cheapest prices I can find is ~$7.

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

krazatchu wrote:
How is the power usage on the nrf24l01?
Specifically, can they sleep and still be discoverable?

In full sleep mode (no Rx) they're around a couple microamps (less than an AVR in power-down mode with the watchdog running). I specifically decided against mesh since due to power issues. Initially what I have in mind are environmental sensors that could do things like measure air temperatures, light levels, humidity, etc. every few minutes and send it back to a collector, which could be an nrf USB stick in a server, or maybe an AVR with an ethernet module.

krazatchu wrote:

You might consider making a PCB, in 10qty from Seeed Studio, you are looking at $1.50 or something per board. Less if you panel the board and cut it apart yourself.
EagleCad is free for non-commercial projects.

I may end up doing something like that in the longer term. I have played with Eagle and KiCad, but find them overly complicated when I wanted to start off with making a simple breakout board for a surface-mount part. Diptrace was suggested to me - supposedly it allows laying out a PCB without making a schematic first.

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

They'll connect directly to the SPI pins of an avr. I've even connected them to Tiny 45s.

The only annoying thing I've found with them is they use 14 or 15 mA watching for a signal, so if you want your battery operated device to sit quietly waiting for a signal, you're a little out of luck.

Since I have a remote control I'd probably have turned on for a couple minutes before I want to work any of these low power battery thingies, I have them wake up every minute or so and send a message, "Anybody there?" If they don't get a response, they go back to shut down mode for a minute. When I turn on a remote and start playing with a loco, all the other devices turn themselves on in a minute or so and are listening when I want to work them. Batteries seem to last nicely this way. For a loco, I don't bother with sleep as the 15mA for the module is nothing compared to lights, smoke, drive motors, sound and so on, so I put these to receive mode as soon as I connect the battery.

My first outing with one of my own remotes:

http://www.youtube.com/watch?v=C...

For PC layout, I've been using "Freepcb" from http://www.freepcb.com/ I've thought for a long time I should learn to use KiCad like a big boy.

If you don't know my whole story, keep your mouth shut.

If you know my whole story, you're an accomplice. Keep your mouth shut. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

something similar to this might make several prototypes easier and faster to make before you design your own pcb..even if not using the pre-programmed SPI to TWI interface firmware
http://www.ebay.com/itm/NRF24L01-Wireless-Shield-SPI-to-IIC-I2C-TWI-Interface-for-Arduino-good-/121278490688?&_trksid=p2056016.m2516.l5255

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Initially what I have in mind are environmental sensors that could do things like measure air temperatures, light levels, humidity, etc.

Yes, same here, except I want a solar powered mesh which requires some low power RX state. It's a two part project, the second part is a specific sensor application, I'm aiming for spring.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You can reduce idle rx power by an arbitrary amount and still get real time response by waking the radio for W microseconds every N seconds and doing two clear channel assessments at the start and finish. If either detects a signal the radio stays on to receive the packet.

This requires that the transmitter continuously strobes the same packet for N seconds, and that the rf gap between packets is less than W microseconds. Search for the contikimac radio duty cycle, e.g. http://core.kmi.open.ac.uk/displ...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Torby wrote:
They'll connect directly to the SPI pins of an avr. I've even connected them to Tiny 45s.

So how do you hook them up? Wires soldered from the Tiny45 pins to the NRF module? Custom-made breakout PCB?

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

bluegoo wrote:
something similar to this might make several prototypes easier and faster to make before you design your own pcb..even if not using the pre-programmed SPI to TWI interface firmware
http://www.ebay.com/itm/NRF24L01-Wireless-Shield-SPI-to-IIC-I2C-TWI-Interface-for-Arduino-good-/121278490688?&_trksid=p2056016.m2516.l5255

Yes, something like that would be perfect. They sell for ~$7ea, which is quite expensive considering Atmega328p pro minis go for ~$3ea.

I have no special talents.  I am only passionately curious. - Albert Einstein