Pages: 1 2 [3]   Go Down
Author Topic: Best cheap and simple 433MHz modules with good range  (Read 11015 times)
0 Members and 2 Guests are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Antenna for 433MHz can be simple. Just 17 cm "micro whip" of wire will get you started.
That's the problem: on the emitter, the antenna doesn't seem to improve the emission by much. But I soldered it to a pin (which is a bit complicated to remove) rather than the PCB itself.

Quote
Try powering the Tx with a +9V battery (if it's specs allow it) and keep the Arduino on the 3x1.5V =4.5V.
I thought about that but it implies more maintenance afterwards (I'm building the project for my parents) the ATmega will have to monitor the voltage of both sets of batteries so that the RPi will tell which ones to change. I'd prefer to improve the antenna. I don't need much range: about 12 meters through one wall.

Quote
there are many well written examples in tutorials and libraries to learn from.
That's why I got VirtualWire working nicely while RadioHead wasn't a succes.

Quote
I think you will enjoy the journey.
I already do. More than the Pi journey to be honest!


Thanks for your support.
Logged

Lake Tyers Beach
Offline Offline
Full Member
***
Karma: 3
Posts: 145
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The 9V battery was suggested just for an experiment to see what more Tx power might do. I can understand you might not want to make it permanent. 4.5 V is getting low for a 433MHz. You may need to search the web for a dedicated 4.5V version.
Soldering to the pin is good. Its the 17cm that is the most critical. Make the Rx & Tx parallel as well. Try adding a second wire on each from earth pin same length but in opposite direction for a dipole effect.
What are you aiming to build?

Cheers,
Rob
PS I meant align the antennas parallel to each other if possible to begin with. Especially if you know it is a fixed situation eg both vertical.

Logged

Learning Flute and C++, heading for a meltdown.

Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The 9V battery was suggested just for an experiment to see what more Tx power might do. I can understand you might not want to make it permanent. 4.5 V is getting low for a 433MHz. You may need to search the web for a dedicated 4.5V version.
I think mine (http://goo.gl/iexuSl) is supposed to start working at 3V.

Quote
Soldering to the pin is good.
I don't know, that really looks weird to me.

Quote
Try adding a second wire on each from earth pin same length but in opposite direction for a dipole effect.
So 90° between the "ANT" antenna and the "ground" antenna?
Quote
What are you aiming to build?
A nail mail notifier.
Logged

Lake Tyers Beach
Offline Offline
Full Member
***
Karma: 3
Posts: 145
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

First, I have found the data sheets for your Tx & Rx and they are attached.  Note the Rx has several connections to both +5V and the Ground.  I have also added my own circuit I have used, and it tallies with these data sheets as well.  I think these multiple connections are important to get the best from the Rx.

The specifications show the range of Voltages is from 3V to 12V, and the current consumed is shown to about quadruple as well.  So it would be fairly safe to assume that going from 4.5V to 9V will close to double the power of the Tx'er.  So trying 9V on the Tx board (only) could help you decide if it is just a power/sensitivity issue. 9V batteries are just easy to obtain.

Soldering to the pin should be simple, if you have doubts post a close up photo of what you have done.  If it is working to some degree, I doubt though you have an error here.

Last... A dipole has either side of the antenna 180 deg apart ie in a straight line, but with a small gap in the middle where the Rx or Tx is connected between the two. One side to ANT, and the other to G(round).  The two antennas (Rx & Tx) would then to be aligned parallel to each other to maximise each other's effect.  Not so good if the two RF circuits are not fixed in position, as the dipole does increase the directional sensitivity  at 90 deg to the antenna.  (However even only using one dipole (I suggest making it vertical), say on the Rx, may improve things eg the Tx is mobile or hand held).

Quote
A nail mail notifier.
  I don't mean to make fun of you, but that must be a typo?  smiley Did you mean "snail mail"? Or am I not with it?  smiley-confuse  How will it work?
Cheers, Rob

* MO-SAWR_433Rx.pdf (114.46 KB - downloaded 11 times.)
* MO-SAWR_433Tx.pdf (131.16 KB - downloaded 7 times.)

* 433MhzRx.png (28.36 KB, 512x336 - viewed 10 times.)
Logged

Learning Flute and C++, heading for a meltdown.

Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

First, I have found the data sheets for your Tx & Rx and they are attached.
That's really nice.

Quote
 Note the Rx has several connections to both +5V and the Ground.  I have also added my own circuit I have used, and it tallies with these data sheets as well.  I think these multiple connections are important to get the best from the Rx.
I had no idea! I was using one ground, one VCC, one DATA and one ANT.

Quote
The specifications show the range of Voltages is from 3V to 12V, and the current consumed is shown to about quadruple as well.  So it would be fairly safe to assume that going from 4.5V to 9V will close to double the power of the Tx'er.  So trying 9V on the Tx board (only) could help you decide if it is just a power/sensitivity issue. 9V batteries are just easy to obtain.
I'll give it a go but just for diagnosis sake.

Quote
Soldering to the pin should be simple, if you have doubts post a close up photo of what you have done.  If it is working to some degree, I doubt though you have an error here.
Well, the part of the pin that isn't aligned with the antenna could disturb the signal I guess.

Quote
Last... A dipole has either side of the antenna 180 deg apart ie in a straight line, but with a small gap in the middle where the Rx or Tx is connected between the two.
Alright.

Quote
Quote
A nail mail notifier.
  I don't mean to make fun of you, but that must be a typo?  smiley Did you mean "snail mail"? Or am I not with it?  smiley-confuse  How will it work?
A snail mail notifier yes, excuse me.

French mailboxes have a plate in front of the letter hole, a front door (for packages) and a back door (for the owner to retrive letters and packages). That doesn't always make sense to foreigners. When the mailman arrives, there are three scenarios:
  • He's got letters: he lifts the letter plate and put them in the box through the rectangular opening there is behind said plate;
  • He's got registered mail/registered parcel or he's Fedex/UPS: He rings the doorbell and the mailbox is of no use in this case;
  • He's got an unregistered parcel/package: he opens the front door (of the mailbox) with his master key and put it inside if it fits. If it doesn't, he makes it fit and breaks everything there is in the parcel.

Then, the owner uses his key to open the back door to get his mail.


I'll use two limit switches (for the doors) and a reed switch (for the plate in front of the letter hole) to monitor the openings of the box.

The ATmega will wake up with interrupts and run something like that:

Code:
#include <avr/sleep.h>
#include <VirtualWire.h>


int pinPlaque = 2;
int pinPortes = 3;
int pinAv = 6;
volatile int int_flag = 0;

const char *lettre = "Lettre";
const char *av = "Colis";
const char *arr = "Relève";


void ouvrePlaque() //A letter has arrived
{
  int_flag = 1;
}


void ouvrePorte()
{   
  if(digitalRead(pinAv) == LOW) //That's the front door
  {
    int_flag = 2;
  }
  else //If pinAv satys high, it means the back door was open.
  {
    int_flag = 3;
  }
}


void setup()
{
  vw_set_tx_pin(12);  //Pin d'émission
  vw_setup(2000);      //Vitesse en bps
 
  pinMode(pinPlaque, INPUT_PULLUP);
  pinMode(pinPortes, INPUT_PULLUP);
  pinMode(pinAv, INPUT_PULLUP);
  digitalWrite(pinPlaque, HIGH);
  digitalWrite(pinPortes, HIGH);
  digitalWrite(pinAv, HIGH);
 
  const char *set = "Prêt !";
  vw_send((uint8_t *)set, strlen(set));
  vw_wait_tx();
}


void loop()
{
  ADCSRA = 0;
 
  if(int_flag==1)
  {
    detachInterrupt(0);
    vw_send((uint8_t *)lettre, strlen(lettre));  //Sending via RF.
    vw_wait_tx();  //Waiting for message to be sent
  }
  else if(int_flag==2)
  {
    detachInterrupt(1);
    vw_send((uint8_t *)av, strlen(av));
    vw_wait_tx(); // Wait until the whole message is gone
  }
  else if(int_flag==3)
  {
    detachInterrupt(1);
    vw_send((uint8_t *)arr, strlen(arr));
    vw_wait_tx(); // Wait until the whole message is gone
  }
  int_flag=0;
  set_sleep_mode(SLEEP_MODE_PWR_DOWN); 
  sleep_enable();
 
  attachInterrupt(0, ouvrePlaque, FALLING);
  attachInterrupt(1, ouvrePorte, FALLING);
 
  MCUCR = bit (BODS) | bit (BODSE);
  MCUCR = bit (BODS);
 
  interrupts();
  sleep_cpu();
}
(I guess I should send the message two or three times a few seconds appart to be sure the Raspberry receives it at last once)


When receiving "Lettre" or "Colis", the Raspberry Pi will emit a sound and wait for five minutes. If mail has been retrieved (i.e. reception of a "Relève") within these 5 minutes, it will shut up until the next day. If mail hasn't been retrieved, it will send an e-mail.
Logged

Lake Tyers Beach
Offline Offline
Full Member
***
Karma: 3
Posts: 145
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The French postal system sounds well run.  In Australia our national postal carrier is losing heaps on letters (mainly bills sadly) and making heaps on parcels from on-line shopping!!  We have very few locked personal letter boxes on houses, and we usually just get a slip of paper to let us know to go to the post office and pick it up ourselves!!  Almost never crushed, so I suppose that is better, but not so convenient!!

Connecting all the pins on the Rx could make a big difference.  The soldering does not have to be perfect which is why people don't usually quote the length of the antenna to less than a cm.  I was surprised the  Rx's worked in prototyping boards as good as they do.  They have the hidden connectors coming off them that I would have thought RF would have not liked.

I can see why you need a RF decent connection.  As it is only one way, it needs to be reliable as the Tx does not know if the packet has been received. ie no handshaking.   Can I suggest that you include a byte in the transmission that increments each time you send a re-broadcast.  So when the letter arrives and you choose to, say, send 5 notifications.  Include in each notification a number incrementing each time.  This way your Rasberry Pi can be programmed to report the number of Transmissions it successfully got through eg 5/5=very good, 1/5= something wrong.  This way you can monitor if there might be a drop off of signal etc if the first broadcast is not picked up each time.  It could also help monitor flat batteries as well.

We have a saying in Australia that has become popular over the years eg "I am going to nail it this time!" meaning it is going to be permanently fixed (eg giving up cigarettes on one of our tv ad's).  So "nail" mail had a sort of curious ring to me because of that, quite a cute idea!!  Permanently fixed!!

I like your programming style as it uses interrupts confidently and I am hoping to learn more about these soon.  They are my blind spot! Is that what you can use to do the wake up call for the Arduino?  I am currently experimenting with an Arduino Micro to drive a 433MHzTx to reproduce the same signal protocol as my Oregon Scientific weather station sensors (I have wind, rainfall and temp/humidity) and I want to add my own design for a detector of sunshine to indicate potential solar power.  It will be battery driven and should be asleep most of the time and only woken on interrupt.  So your design could help me also.  The Micro is a neat little board.

Cheers, Rob



 
Logged

Learning Flute and C++, heading for a meltdown.

Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Connecting all the pins on the Rx could make a big difference.
I just have a problem with the DATA lines, I'll have to check whether or not their voltage adds up before frying my Pi's GPIOs.

Quote
Can I suggest that you include a byte in the transmission that increments each time you send a re-broadcast.
That's a good idea.

Quote
I like your programming style as it uses interrupts confidently and I am hoping to learn more about these soon.  They are my blind spot! Is that what you can use to do the wake up call for the Arduino?
When really asleep, the ATmega uses very very little power (we're speaking a fraction of µA). Interrupts can wake it up.

Everything (nearly) you need to know about sleep is here: http://www.gammon.com.au/forum/?id=11497
I think you should consider using a barebone chip rather than an Arduino board if it's battery powered.

Everything you need to know about interrupts is...well...I've no idea. The Arduino reference guide will tell you that delay() and millis() do not work inside an Interrupt Service Routine but I discovered by myself it's the case with VirtualWire as well (it wasn't with RCSwitch). I guess you can have many more surprises.

Quote
Micro is a neat little board.
I'm thinking mini, micro or nano to put in my dryer (to get a notification when it's done drying).
Logged

Lake Tyers Beach
Offline Offline
Full Member
***
Karma: 3
Posts: 145
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

All you would need is a 1k Ohm resistor connecting the Rx output to the GPIO of the Pi's input.  This would allow the signal to be received from the 5V supplied Rx and not have any dangerous currents flowing into the Pi's 3.3V input.

I have done much programming over the years and used many routines designed by others that use Interrupts, but I have designed very few original programs that depend on them.  I must cross that bridge soon.  Too many projects...

Cheers, Rob
Logged

Learning Flute and C++, heading for a meltdown.

Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

All you would need is a 1k Ohm resistor connecting the Rx output to the GPIO of the Pi's input.  This would allow the signal to be received from the 5V supplied Rx and not have any dangerous currents flowing into the Pi's 3.3V input.
Why precisely 1000 Ω? What's the current limit for the Pi's GPIOs?

It seems to be 0.7*VCC anyway, so 3.5V. The Pi can accept that.
My "second DATA" line (called "DER") isn't connected to the first one (continuity test failed). I'll have to plug everything back and check if something is coming out of that pin.


The datasheet closest to my receiver I found is this one (see pin 6):
http://www.jmrth.com/en/images/proimages/RXB6_en_v3.pdf

Not a 100% match, I either have an older version or a (bad) clone.
Logged

Lake Tyers Beach
Offline Offline
Full Member
***
Karma: 3
Posts: 145
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

1k Ohm is a rough, but safe guess you could use 10k if you really wanted to be cautious.

I have found a contradicting, but possibly more high quality data sheet RXB6EN_(1).pdf (NB RF_Rx.png is is the older info)

Using the pdf data sheet attached I think the pin 7 is a power enable and the circuit diagrams both of us previously found where they give where pin 6&7 are connected together, is wrong.  Try just connecting pin 6 as the data to the Pi and leave pin 7 completely alone.  I think it is hinting that the default setting is to power up and work, whereas if you pulled the pin 7 low it would go into a low power state?

You could try either one 6 or 7, on their own as the data pin and it will not hurt.  But I reckon both together is definitely wrong. My money is on 6 as the data at the moment  smiley

This data sheet also explains the multiple earths, some are RF earths and some are power earths.

What do reckon?

Cheers, Rob


* RF_Rx.png (22.81 KB, 284x248 - viewed 7 times.)
* RXB6EN_(1).pdf (121.94 KB - downloaded 4 times.)
Logged

Learning Flute and C++, heading for a meltdown.

Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have found a contradicting, but possibly more high quality data sheet RXB6EN_(1).pdf (NB RF_Rx.png is is the older info)
The same I posted but for a previous hardware version. Still differs a bit from my module.


Quote
Using the pdf data sheet attached I think the pin 7 is a power enable and the circuit diagrams both of us previously found where they give where pin 6&7 are connected together, is wrong.  Try just connecting pin 6 as the data to the Pi and leave pin 7 completely alone.  I think it is hinting that the default setting is to power up and work, whereas if you pulled the pin 7 low it would go into a low power state?

You could try either one 6 or 7, on their own as the data pin and it will not hurt.  But I reckon both together is definitely wrong. My money is on 6 as the data at the moment  smiley
There's no output from pin 7. I guess it's set up as the shutdown pin.

Quote
This data sheet also explains the multiple earths, some are RF earths and some are power earths.
Very interesting this electric earth vs RF earth !



I retried RCSwitch over VirtualWire (and its Python pendant on the Pi): I have a much more stable RF Link.
« Last Edit: September 09, 2014, 06:03:06 pm by Bianco » Logged

Pages: 1 2 [3]   Go Up
Jump to: