433Mhz half duplex between 2 arduinos with virtual wire

1,025 views
Skip to first unread message

Johan Pollet

unread,
Jul 16, 2013, 7:08:19 AM7/16/13
to virtu...@googlegroups.com
The setup:

RX and TX module (simple 433Mhz RX and TX) on arduino 1.

The antenna is switched between RX module and TX module with a MAX4544 by means of the PTT pin. This means when not in TX mode
the antenna is connected to the RX. When going to TX the activation of PTT connects the antenna to the TX module.

Same Hardware setup on Arduino 2.

When I use the client and server sketches that are comming with virtual wire. I see that msg is send from arduino 1 to arduino 2.
arduino 2 replies but arduino 1 never sees the msg comming.

What i saw was that the PTT was still on 1 for arduino 1 when the PTT on arduino 2 went active. Debugging showed the correct msg recieved in
arduino 2 and going to send mode, activating PTT. But in the mean time arduino 1 still had PTT active, altought the msg was sent from arduino 1 and received in arduino 2

Any ideas or somebody seen similar behaviour ?

Rgds
Johan

Mike McCauley

unread,
Jul 16, 2013, 7:59:21 AM7/16/13
to virtu...@googlegroups.com, Johan Pollet
Hello,

I would expect the PTT pin to go inactive as soon as the message was
transmitted.
Clearly this is happening as expected on Arduino 2, but not on Arduino 1. I
suspect a hardware problem on your Arduino 1.

Cheers.
--
Mike McCauley mi...@airspayce.com
Airspayce Pty Ltd 9 Bulbul Place Currumbin Waters QLD 4223 Australia
http://www.airspayce.com
Phone +61 7 5598-7474 Fax +61 7 5598-7070

Johan Pollet

unread,
Jul 16, 2013, 8:49:36 AM7/16/13
to virtu...@googlegroups.com, Johan Pollet
Hello Mike,

It seems to me that the PTT is release a while after the complete msg was send and thus preventing the receive of the incomming msg from the other one.
I saw in the code you waited some time(after waiting one bit period since the last bit) then vw_tx_stop is called.
But in the meantime the other device went from rx into tx .

I changed software from arduino 1 to arduino 2 and vice versa, same result, seems HW is ok.

I have checked it with a scoop on both PTT pins and could see that the second went into TX after receiving msg from 1 while the first one was still in TX mode.

So it means that we are missing a part of the msg because both are in TX mode.

73 and Cheers
Johan

Op dinsdag 16 juli 2013 13:59:21 UTC+2 schreef mikem het volgende:

Mike McCauley

unread,
Jul 16, 2013, 4:24:11 PM7/16/13
to virtu...@googlegroups.com
Hello,

how long after Ardiono 2 starts transmitting does Ardiuno 1 PTT stay on?
What speed are you running?

Cheers.

Johan Pollet

unread,
Jul 17, 2013, 2:28:43 AM7/17/13
to virtu...@googlegroups.com
Hi Mike,

I have to check it with the scope, as soon I have the results i will post them.

I was running at 2000 bps and even with slower rates the behaviour was the same.
I actually saw it when checking the communication with my SDR that arduino 1 sends out and that arduino 2
replied but no receive in arduino 1 of the send msg from arduino 2.

73 cheers
Johan

Op dinsdag 16 juli 2013 22:24:11 UTC+2 schreef mikem het volgende:

Johan Pollet

unread,
Aug 18, 2013, 7:08:55 AM8/18/13
to virtu...@googlegroups.com
Hi Mike,

Sorry for the late reply, but the weather was good around here so had many things to do in the garden -;).
As the RX and TX are on the same board, while doing TX the same data is coming in on the RX, meaning he is busy
with the reception of the data for the second arduino.

Is there a place to implement an IO pin for switching ON/OFF the RX module, so we can power off the RX module when going
into TX.

Of course you can use the PTT pin but then you need extra HW.

73
Johan

Op woensdag 17 juli 2013 08:28:43 UTC+2 schreef Johan Pollet:

Johan Pollet

unread,
Aug 18, 2013, 8:05:09 AM8/18/13
to virtu...@googlegroups.com
Hi Mike,

Just took a spare pin for powering the RX module.
At startup put the pin high so the RX module receives power supply.

  digitalWrite(enable_rx_mod,false); //switch power off rx module
  vw_send((uint8_t *)txbuffer, strlen(txbuffer)); //Send the data
  vw_wait_tx(); // Wait until the whole message is gone
  digitalWrite(enable_rx_mod,true);

Now the ack is received from the second arduino.

We where to busy receiving and decoding our own send msgs.
Before we go into TX switch off the RX module and after TX is done switch the
RX module back on.

Cheers and 73
Johan
Op zondag 18 augustus 2013 13:08:55 UTC+2 schreef Johan Pollet:

Nong Dan

unread,
Aug 27, 2013, 9:42:20 AM8/27/13
to virtu...@googlegroups.com

Fig. 30

unread,
Aug 28, 2013, 1:46:45 AM8/28/13
to virtu...@googlegroups.com
Hi Johan,

I just saw your post while searching for help for using VirtualWire, and I was wondering if you could clarify some questions about your solution to your problem.

So if I understand correctly, what you saw was this:

- Arduino 1 starts transmitting to Arduino 2, asserting its PTT
- At the same time, Arduino 1's receiver is picking up a signal (from Arduino 1's transmitter), and is passing the data back to Arduino 1
- Arduino 1 responds by trying to decode the information that is being sent out (i.e. trying to decode its own data)
- This attempt to decode ties up CPU cycles and thus causes a delay
- As a result, Arduino 1 turns off its PTT pin late, and misses the message being sent to it by Arduino 2
- Your solution is to shut off power to Arduino 1's receiver whenever you are trying to transmit data

Is that right? Because it seems odd; the VirtualWire interrupt handler specifically checks that the transmitter is not enabled before sampling data from the receiver's output pin, and so whether the receiver is powered on or not shouldn't matter?

Thanks,
Fig.30

Johan Pollet

unread,
Sep 3, 2013, 5:09:55 AM9/3/13
to virtu...@googlegroups.com
does not suits my requirements -;)

Op dinsdag 27 augustus 2013 15:42:20 UTC+2 schreef Nong Dan:

Johan Pollet

unread,
Sep 3, 2013, 5:26:36 AM9/3/13
to virtu...@googlegroups.com
Well I have left this path of design and went off to plan C:

Those cheap radio's are not suitable for this purpose of design, if you want to have half duplex use a more expensive
RFM22 module (25 EURO) on both sides.

As it was the intention to control 2 servos that are located in a box of an "army loop" remotely from the shack.
So now i will take an SWR bridge measure forward and reflected power and cycle from 0 degrees up to 180 degrees and
measure the SWR for each step and at the end of the cycle position the servo's on the best SWR.

Op woensdag 28 augustus 2013 07:46:45 UTC+2 schreef Fig. 30:

From yahoo

unread,
Sep 3, 2013, 3:23:44 PM9/3/13
to virtu...@googlegroups.com
I'm a bit puzzled here as to what you are doing .Where are you measuring SWR ? On such a high frequency and with such small devices I can only see you measuring SWR at the base of the antenna wire and the feed in and out of the meter would stuff that up surely?


On Tue, 3 Sep 2013 02:26:36 -0700 (PDT)
Johan Pollet <on3...@gmail.com> wrote:

> As it was the intention to control 2 servos that are located in a box of an
> "army loop" remotely from the shack.
> So now i will take an SWR bridge measure forward and reflected power and
> cycle from 0 degrees up to 180 degrees and
> measure the SWR for each step and at the end of the cycle position the
> servo's on the best SWR.

--
From yahoo <tyt...@yahoo.com>

Johan Pollet

unread,
Sep 4, 2013, 2:15:27 AM9/4/13
to virtu...@googlegroups.com
Hi Ty,

It is for controlling a magnetic loop on HF for HAM use. Not the SWR on those 433Mhz devices.
As you maybe know the voltage generated on those caps can easy go up to 3KV, so i'm not so fund
of turning those caps by hand.

The first idea was to use the 433Mhz half duplex, between a controller box on my desk and a second controller
at the base of the magnetic loop.

Even with a cable between the two controllers the tuning and matching of the loop is cumbersome.
So that is why i go over to plan C. Put the Arduino in the box of the SWR bridge controlling the servos and
reading out the SWR and control the tune and match capacitor till best SWR is found.

Hope this makes it clear.

73
Johan

Op dinsdag 3 september 2013 21:23:44 UTC+2 schreef Ty Tower:

From yahoo

unread,
Sep 4, 2013, 3:39:02 PM9/4/13
to virtu...@googlegroups.com
OK thanks . Being a ham myself I'll now have to go find out what a "magnetised loop" is

On Tue, 3 Sep 2013 23:15:27 -0700 (PDT)
> > From yahoo <tyt...@yahoo.com <javascript:>>
> >
>
> --
> You received this message because you are subscribed to the Google Groups "virtualwire" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to virtualwire...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.


--
From yahoo <tyt...@yahoo.com>
Reply all
Reply to author
Forward
0 new messages