Hi
I am building some small wireless sensor-modules based on an atmega328P and a nrf RF24l01+ radio module.
I made a prototype on a breadboard which worked great, so i ordered some custom made pcb's for my project. However when i solder my components together on the pcb, it dosn't work. Maybe 49 of 50 packages are lost in transmission.
But here comes the strange part.
If tuch and hold my finger on the trace-antenna for the transceiver, it starts working again and none of the packages is lost. the same happens if I connect to transceiver to the pcb through some 20 cm long wires instead of just plugging it in the socket on my pcb.
In other words:
This works.
This dosn't.
At first i thought it was something wrong with my radio transceiver, but I have tried three modules now. none of them worked on my pcb, but all of them worked fine on my breadboard.
What is causing my problems? What is tuching the antenna doing with my circuit? Why is adding more lenght to the SPI lines make it better?
Is there some design-rules for laying SPI-lines on a pcb? Do i need some series resistors or pull-ups or something?
Here are the schematics of the pcb
I am running the mcu on the 1Mhz internal ocilator, and using the Maniacbug's RF24-library.
Wow that workes. Thanks HugoPT XD (karma+1)
I attached a crocodile-clip on the end of the antenna, And now it is much more realiable.
Would this mean that the module was made with a too small antenna?
Do I have to solder a piece of wire to every module?
Looking at the datasheet of the nrf24l01, it looks like you can adjust the radio frequency from 2.4 to 2.525 GHz. would using a higher frequency counteracting the need of a longer antenna?
Do I have to solder a piece of wire to every module?
2.4GHz band antenna is difficult to design, every mm plays a role. So wiring a random wire to it is not the best approach.
The signal power the modules use is weak, so when you put the antenna close to the pcb (with copper on it) or to a metallic object (the head of the screw there) the antenna radiation diagram changes heavily and you may loose connectivity. Best would be to keep the distance from antenna to the closest metallic objects at least few centimeters apart.
Experts say the distance of an antenna from a closest metallic object shall be bigger than "lambda/4".
LEGO-lars:
But here comes the strange part.
If tuch and hold my finger on the trace-antenna for the transceiver, it starts working again and none of the packages is lost. the same happens if I connect to transceiver to the pcb through some 20 cm long wires instead of just plugging it in the socket on my pcb.
It's not really very strange. Every conductive body near an antenna will affect it.
OTOH, if you're seeing this behavior then you must be right on the limit of transmission range of the modules. Ive used modules like that and they really can't transmit more than a few meters. If you need more range then get modules with built-in antennas, like this one: http://www.ebay.com/itm/300895308631
Try to remove the screw (the one near the antenna), or do use a plastic one. Maybe it helps.
PS: the length of the metallic screw might be important too - with a length like lambda, lambda/4, lambda/2, or multiplies of, you may get strange results
oric_dan:
How far apart are your nodes? These modules have a usable range of only about
10m.
qurrently they are 1m apart. It looks like the distance between the nodes dosn't matter as long their inside a radius of 10m.
pito:
Do I have to solder a piece of wire to every module?
2.4GHz band antenna is difficult to design, every mm plays a role. So wiring a random wire to it is not the best approach.
The signal power the modules use is weak, so when you put the antenna close to the pcb (with copper on it) or to a metallic object (the head of the screw there) the antenna radiation diagram changes heavily and you may loose connectivity. Best would be to keep the distance from antenna to the closest metallic objects at least few centimeters apart.
Experts say the distance of an antenna from a closest metallic object shall be bigger than "lambda/4".
I tried raising the module another 1.5 cm, and now it works without the crocodile clip
The problem now is that it won't fit in the enclosure anymore
fungus:
LEGO-lars:
But here comes the strange part.
If tuch and hold my finger on the trace-antenna for the transceiver, it starts working again and none of the packages is lost. the same happens if I connect to transceiver to the pcb through some 20 cm long wires instead of just plugging it in the socket on my pcb.
It's not really very strange. Every conductive body near an antenna will affect it.
OTOH, if you're seeing this behavior then you must be right on the limit of transmission range of the modules. Ive used modules like that and they really can't transmit more than a few meters. If you need more range then get modules with built-in antennas, like this one: http://www.ebay.com/itm/300895308631
(Or add crocodile clips and hope for the best...)
I actually got two of those modules with a real antenna, and I have testet the range against the ones with just a trace antenna(both mounted on breadboards). when I set the transmission speed to 2Mbps and transmission power on the lowest setting, I got about 6m line of sight range from both modules. I don't know what range I could get on other settings, because my appartment is only 8m long, and I'm too lazy to go outside
Strangely the range was best when the transmitter had a trace antenna, and the reciever had a real antenna.
Just testet the range of my raised pcb-mounted module. It went from not beeing able to transmit 10cm, to transmitting 5m through two walls, just by raising the module 1.5cm
lambda=c/f right?
Then lambda is 12,5cm, which means that i have to look for objects with a lenght of 6.25cm(lambda/2), 3.12cm(lambda/4) and 1.56cm(lambda/8). Right?
LEGO-lars:
lambda=c/f right?
Then lambda is 12,5cm, which means that i have to look for objects with a lenght of 6.25cm(lambda/2), 3.12cm(lambda/4) and 1.56cm(lambda/8). Right?
No, only wires that are (very slightly longer than) multiples of lambda/2 will act as resonant reflectors. Anything conducting object larger than about lambda/4 will reflect and scatter signal though, and resonance of random shapes will be hard to predict.
Anything in the near field of the antenna will become part of the antenna system - in particular the ground plane of the module
is very important here. And antennas are directional and polarised, so you can lose a lot of signal through bad placement.
A little uppdate
I have removed all the screws on the board, I have removed the pin header for rx and tx which was next to the screw, and I have removed the batteries and powering the board through the ICSP header. And the results are... Still the same =(
I guess the only thing left which can steal my radio-signals, is the ground-plane on the pcb. There is no ground directly under the radio module though.
I also tried to solder a small piece of wire to the antenna. That made the module working, but the range is decreased to about the half, compared to raising the module from the board.
There is unfortunately not enough space to mount the module vertical, but there is possible space to tilt it 45-50 degrees, or mabye 90 degrees sideways. I will try this tomorrow.
MarkT:
LEGO-lars:
lambda=c/f right?
Then lambda is 12,5cm, which means that i have to look for objects with a lenght of 6.25cm(lambda/2), 3.12cm(lambda/4) and 1.56cm(lambda/8). Right?
No, only wires that are (very slightly longer than) multiples of lambda/2 will act as resonant reflectors. Anything conducting object larger than about lambda/4 will reflect and scatter signal though, and resonance of random shapes will be hard to predict.
Anything in the near field of the antenna will become part of the antenna system - in particular the ground plane of the module
is very important here. And antennas are directional and polarised, so you can lose a lot of signal through bad placement.
I don't quite understand everything you are saying here, maybe to advanced for me But since my module either works and have a range of 20m, or dosn't work at all, and no middle thing. I would think that there is something that reflecting and corrupting the signal, instead of absorbing it.
I have tried to remove the batteries, and power the board with an external supply, without any success.
JB_AU:
Change the screws to plastic & shield the amplifier.
If it is the amplifier on my pcb you mean, it is powered down before the transmission, so I guess there is no need to shield it.
Today I desoldered the the socket for the radio module and replaced it with 4cm of ribbon cable, so I could test the module in differents posisions relative to the board.
Turns out the module now works in every positions, even when I try to hold the module in the old position
But at least it works and and it fits in my enclosure, so It solves my problem.
pito:
The basic rule I would follow is to have the antenna at least 3.12 cm off any conductive material..
I will definitely use this rule in my next wireless project