Which wireless technology to select?

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

I'm working on a project, where I will have a battery driven outdoor unit, and an indoor unit. The outdoor unit will have a button panel, and will transmit which button or combination of buttons that have been pressed to the indoor unit.

I'm a bit unsure on which wireless technology that suits my needs best. Focal points is of course low power consumption and low latency, while high data transfer rate isn't that important. Furthermore, I wish to use modules that can be used in combination with the AVR 8-bit microcontrollers.

I've read about the ANT wireless technology, which sounds interesting, but I'm not sure how well these are usable with the AVR microcontrollers. And it would be nice to get some feedback from the wireless gurus as well. :)

Thanks a bunch for any and all information! :)

Last Edited: Fri. Oct 16, 2015 - 02:26 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The ANT system uses Nordic Semi devices, IIRC. Low-cost modules using the Nordic nRF24L01+ are available from several suppliers on Ebay, and are quite easy to use with any MCU with an SPI port:

http://www.ebay.co.uk/itm/1PCS-A...

Leon Heller G1HSM

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

Thanks. That's an insanely good price for those modules. I've ordered a few of them, and we'll see how it goes.

The Catch22 part of this now then is that I have to build a transmitter to know that the receiver is working. And how do I know if the receiver is working, without a working transmitter...? Ah well... :D

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

The price of those modules is amazing, the chips alone cost more than that in small quantities.

I've been using PICs with them, and there is plenty of code around for them. You should be able to find some AVR code, or you could adapt the PIC code. I'm quite sure that there is some Arduino code, as well.

Get the SPI comms working first - send commands and check that you get back the correct responses. Once that is working things should be quite easy. Here is my PIC test code for that:

/*
** test.c
** SPI test program for PIC18F4520 and nRF24L01 or nRF24L01+
** Checks SPI comms between PIC and wireless chip
** 
** RA0	LED (output)
** RA1	PB (input)
*/

#include 
#include 

//function prototypes
unsigned char spi_Send_Read(unsigned char);
void dly(void);

// Defines
#define SPI_SCK		LATCbits.LATC3		// Clock pin, PORTC pin 3 
#define SPI_SO		LATCbits.LATC5		// Serial output pin, PORTC pin 5 
#define SPI_SI		PORTCbits.RC4		// Serial input pin, PORTC pin 4 
#define SPI_CSN		LATCbits.LATC2		// CSN output pin, PORTC pin 2
#define SPI_CE		LATCbits.LATC1		// CE output pin, PORTC pin 1
#define SPI_IRQ		PORTBbits.RB0		// IRQ input pin, PORTB pin 0
#define SPI_SCALE	4              		// postscaling of signal 
#define LED			LATAbits.LATA0
#define PB			PORTAbits.RA1


// Macros
#define nop() _asm nop _endasm

void main(void)
{
	unsigned char status = 0;
	unsigned char data[5];
	int i;

	// run internal oscillator at 8 MHz
	OSCCON = OSCCON | 0b01110000;
	while (!OSCCONbits.IOFS)	// wait for IOFS to go high
		;

	OpenSPI(SPI_FOSC_16, MODE_00, SMPMID); //open SPI1
	PORTA = 0x00;
	ADCON1 = 0x0F;		// set up PORTA to be digital I/Os
	TRISA = 0x02;		// PORTA<7.2,0> outputs PORTA<1> input
	TRISCbits.TRISC3 = 0;	// SDO output
	TRISCbits.TRISC5 = 0;   // SCK output
	TRISCbits.TRISC2 = 0;	// CSN output
	TRISCbits.TRISC1 = 0;	// CE output
	SPI_CSN = 1;		// CSN high
	SPI_SCK = 0;		// SCK low
	SPI_CE	= 0;		// CE low
	nop();

	//write TX_ADDRESS register
	SPI_CSN = 0;			//CSN low
	spi_Send_Read(0x30);
	spi_Send_Read(0x11);
	spi_Send_Read(0x22);
	spi_Send_Read(0x33);
	spi_Send_Read(0x44);
	spi_Send_Read(0x55);
	SPI_CSN = 1;			//CSN high


	//read TX_ADDRESS register
	//Check that values are correct using the MPLAB debugger
	SPI_CSN = 0;			//CSN low
	status = spi_Send_Read(0x10);
	data[0] = spi_Send_Read(0x00);	// 0x11
	data[1] = spi_Send_Read(0x00);	// 0x22
	data[2] = spi_Send_Read(0x00);	// 0x33
	data[3] = spi_Send_Read(0x00);	// 0x44
	data[4] = spi_Send_Read(0x00);	// 0x55
	SPI_CSN = 1;					// CSN high

	while (1)
		;
}


unsigned char spi_Send_Read(unsigned char byte)
{
	SSPBUF = byte;	
	while(!DataRdySPI())
		;	
	return SSPBUF;
}


Leon Heller G1HSM

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

Thanks a bunch!

This is kind of an advanced doorbell I'm making now, so I planned on hooking the receiving radio module up to an ArduinoUno with an Adafruit Wave Shield. I haven't checked the specs yet, but if I'm lucky, there's a HW SPI interface ready to use on the ArduinoUno.

Thanks for your help. I'll get back with some info once I've gotten the parts. :)