Cannot get FS1000A / XY-MK-5V pair to work

4,970 views
Skip to first unread message

Simon John

unread,
Sep 28, 2013, 7:36:15 PM9/28/13
to virtu...@googlegroups.com
I've just bought two pairs of these modules: http://www.ebay.co.uk/itm/121117930415

I've wired up the RX to digital 11 on my mega2560 and TX to digital 12 on my breadboard Uno, plus 5V and GND of course.

I simply cannot get them to work with VirtualWire 1.19/IDE 1.0.5 (tried all 4 modules) I've tried the client/server and sender/receiver examples and get nothing but the "setup" text on the serial monitor. I knocked up the following TX code:

#include <VirtualWire.h>

void setup() {
    vw_set_ptt_inverted(true);
    vw_setup(2000);
}

void loop() {
    const char *msg = "hello";
    vw_send((uint8_t *)msg, strlen(msg));
    vw_wait_tx();
    delay(200);
}


And my RX code:

#include <VirtualWire.h>

void setup() {
    Serial.begin(9600);
    vw_set_ptt_inverted(true);
    vw_setup(2000);
    vw_rx_start();
}

void loop() {
    uint8_t buf[VW_MAX_MESSAGE_LEN];
    uint8_t buflen = VW_MAX_MESSAGE_LEN;

    if (vw_get_message(buf, &buflen))
    {
        int i;   
        for (i = 0; i < buflen; i++)
        {
            Serial.print(buf[i]);
        }
        Serial.println("");
    }
}


If I comment out the if() statement, I get the following junk on the serial monitor:

230104000108064001045132037312
552552552552552552552550000001232511262552156168239951562488924620027002192151252512460011980332230104000108064001045132037312
25525525525525525525525525525525525525525525525525525525525500000012325112625521561682399515624889246200270021921512503188011980332230104000108064001045132037312
25525525525525525525525525525525525525525525525525525525525500000012325112625521561682399515624889246200270021921500334160380102221213037192151255184000154066225001252200215
25525525525525525525525525525525525525525525525525525525525500000012325112625521561682399515624889246200270021921500312103101022212130371925025519602077064225001247200215
255255255255255255255255255255255255255255255255255255255255000000123251126255215616823995156248892462002700219215003195561770102221213037192191255192000115066225001241200215

But I get that even if my TX is turned off.

Any ideas what I can check - wiring I've checked of course. I don't have a scope to see if anything is coming off the transmitter.

Mike McCauley

unread,
Sep 29, 2013, 1:43:44 AM9/29/13
to virtu...@googlegroups.com
Hi,

Is there a data sheet for those radios?
What voltages are they compatible with?

Cheers.
--
Mike McCauley VK4AMM 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

James Hamilton

unread,
Sep 29, 2013, 2:08:56 AM9/29/13
to virtu...@googlegroups.com

I have used those exact parts with Virtual Wire successfully. Unless you add an antenna (13cm of wire works nicely), the range is VERY short. Like, a foot or two at most.

Make sure you are connected to the correct pins. On the TX, you have "ATAD" (Data, backwards), VCC, GND. The Antenna is at the top of the chip and is just a hole. On the RX, you have GND, 2 Data pins (shorted together, only connect one of them), and VCC. The hole on the lower corner opposite the pins in the antenna connection.

The PTT setting is irrelevant; these chips have no PTT line.

Good luck!

~James

--
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.

Simon John

unread,
Sep 29, 2013, 8:07:40 AM9/29/13
to virtu...@googlegroups.com
It is very weird. I've removed the PTT setting bits, and have them wired as James says, and they're 5V Mike.

I've not wired up either antenna, but I get nothing even when they're within an inch of each other.

I've tried two different '328p chips and two different breadboards, so its not connections or anything.

Is there any low-level debug code I could run to see if the TX module is actually sending anything out?

Starting to wonder if the modules are duff, seems unlikely all four are though, unless it was a bad batch.

I might buy an Uno clone to test with, maybe the modules don't like breadboards....

James Hamilton

unread,
Sep 29, 2013, 11:51:38 AM9/29/13
to virtu...@googlegroups.com

Even though you're using the default RX and TX pins, you might try using the vw_set_rx_pin() and vw_set_tx_pin() functions to set the pins explicitly and see if that improves anything.

~James

--

Simon John

unread,
Sep 29, 2013, 12:51:35 PM9/29/13
to virtu...@googlegroups.com
On Sunday, September 29, 2013 4:51:38 PM UTC+1, James Hamilton wrote:

Even though you're using the default RX and TX pins, you might try using the vw_set_rx_pin() and vw_set_tx_pin() functions to set the pins explicitly and see if that improves anything.


I already tried that thanks, doesn't help. I'm giving up for now, wasted 2 days on this when RF24 worked in 2 hours or less. Its a shame as I prefer the 3/4 pins rather than 7/8 of the nrf24l01+, and 5v is easier than 3.3v of the rf24

It might be an idea to document how to wire these things up somewhere more "in your face" than the connections PDF, e.g. the homepage; also make sure people know its digital pin 11/12 and not IC pin 11/12

James Hamilton

unread,
Oct 1, 2013, 2:31:58 AM10/1/13
to virtu...@googlegroups.com
Is there any way you can confirm that your TX and RX are actually on the same frequency? The TX has a visible crystal with the freq stamped on it. Not sure about the RX. 

~James
--
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.


--

--
The box said, "Requires Windows XP or better"...
So I installed Linux.

Simon John

unread,
Oct 1, 2013, 3:34:38 AM10/1/13
to virtu...@googlegroups.com
On 01/10/13 07:31, James Hamilton wrote:
> Is there any way you can confirm that your TX and RX are actually on the
> same frequency? The TX has a visible crystal with the freq stamped on
> it. Not sure about the RX.
>
> ~James

I can't see anything on the RX - it does have 315/350/433 printed on it
as if there should be a DIP switch or something there, but there's not
even a solder hole. The TX is definitely using a 433MHz crystal.

James Hamilton

unread,
Oct 1, 2013, 7:55:34 AM10/1/13
to virtu...@googlegroups.com
I seem to recall someone posting about using the SoftwareSerial library with an ASK module with some success. You could try that as a troubleshooting step. I think VirtualWire is more robust, but it may provide some additional insight. 

~James
--
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.

Joseph Wan

unread,
Dec 9, 2013, 1:49:48 AM12/9/13
to virtu...@googlegroups.com
I also purchased the same pair from ebay and having the same issue, nothing shows on the receiver side. I wonder someone had a solution for it. how about the SoftwareSerial library with an ASK module? what is ASK module? another h/w?

Thanks,
Joe 


On Tuesday, October 1, 2013 6:55:34 AM UTC-5, James Hamilton wrote:
I seem to recall someone posting about using the SoftwareSerial library with an ASK module with some success. You could try that as a troubleshooting step. I think VirtualWire is more robust, but it may provide some additional insight. 

~James

On Tuesday, October 1, 2013, Simon John wrote:
On 01/10/13 07:31, James Hamilton wrote:
Is there any way you can confirm that your TX and RX are actually on the
same frequency? The TX has a visible crystal with the freq stamped on
it. Not sure about the RX.

~James

I can't see anything on the RX - it does have 315/350/433 printed on it as if there should be a DIP switch or something there, but there's not even a solder hole. The TX is definitely using a 433MHz crystal.

--
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+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

James Hamilton

unread,
Dec 9, 2013, 8:03:36 AM12/9/13
to virtu...@googlegroups.com

ASK is Amplitude Shift Keying, which is exactly what this transmitter/receiver pair uses. It's a generic description of what the radio signal looks like.

As for the problems some have reported, I can't suggest a fix, sorry.

An ASK receiver, if you just do a digitalRead () on its data pin, should give a random, fluttering on/off. It's the equivalent of the snow you get on a TV that's on an empty channel. (This is why the features of the Virtual Wire library are necessary: to differentiate data from random noise.) Make sure you can see this random noise on your receiver without the Virtual Wire library. If not, either your receiver is bad or your wires are not connected correctly.

I seem to recall as well that there are pins that you can't use when you are using Virtual Wire. (They are party of the timer circuit.) Does anyone recall which pins these are?

~James

To unsubscribe from this group and stop receiving emails from it, send an email to virtualwire...@googlegroups.com.

Mike McCauley

unread,
Dec 9, 2013, 4:59:55 PM12/9/13
to virtu...@googlegroups.com, James Hamilton
Hi all,

On Monday, December 09, 2013 08:03:36 AM James Hamilton wrote:
> ASK is Amplitude Shift Keying, which is exactly what this
> transmitter/receiver pair uses. It's a generic description of what the
> radio signal looks like.
>
> As for the problems some have reported, I can't suggest a fix, sorry.
>
> An ASK receiver, if you just do a digitalRead () on its data pin, should
> give a random, fluttering on/off. It's the equivalent of the snow you get
> on a TV that's on an empty channel. (This is why the features of the
> Virtual Wire library are necessary: to differentiate data from random
> noise.) Make sure you can see this random noise on your receiver without
> the Virtual Wire library. If not, either your receiver is bad or your wires
> are not connected correctly.

I agree with James.

>
> I seem to recall as well that there are pins that you can't use when you
> are using Virtual Wire. (They are party of the timer circuit.) Does anyone
> recall which pins these are?

I dont think there are any limiations on that.
VW does use a timer, but I dont think that limits use of any arduino pins.

Cheers.
> >>> an email to virtualwire...@googlegroups.com.
> >>> For more options, visit https://groups.google.com/groups/opt_out.
> >>
> >> --
> >>
> >> --
> >> The box said, "Requires Windows XP or better"...
> >> So I installed Linux.
> >>
> >> --
> >
> > 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.

James Hamilton

unread,
Dec 9, 2013, 8:43:24 PM12/9/13
to Mike McCauley, virtu...@googlegroups.com

I think I was thinking of some combination of the unspecified problem reported by Johann on Nov 14 with using pins 9 and 10 and the problem reported by Matt on Oct 7 with using SPI. Perhaps also some of the other reported problems using libraries that also use TIMER1.

Suffice it to say, the AVR platform has many interconnected pieces that demand careful attention be paid when choosing libraries and pins.

Cheers,

~James

Mike McCauley

unread,
Dec 9, 2013, 9:01:55 PM12/9/13
to virtu...@googlegroups.com, James Hamilton
Hi,

On Monday, December 09, 2013 08:43:24 PM James Hamilton wrote:
> I think I was thinking of some combination of the unspecified problem
> reported by Johann on Nov 14 with using pins 9 and 10 and the problem
> reported by Matt on Oct 7 with using SPI. Perhaps also some of the other
> reported problems using libraries that also use TIMER1.
>
> Suffice it to say, the AVR platform has many interconnected pieces that
> demand careful attention be paid when choosing libraries and pins.

Couldnt agree more.

Cheers.

Joseph Wan

unread,
Dec 10, 2013, 12:43:38 AM12/10/13
to virtu...@googlegroups.com
James,

Thanks for your info. I tried to read from the pin where the receiver's data output and did see random 0/1, w/o the ground pin, it reads high, w/o the Vcc, it reads low. I think it is normal. if that proved the receiver is good, is it a way I can verify the transmitter? 

Thanks,
Joe

James Hamilton

unread,
Dec 10, 2013, 5:41:37 AM12/10/13
to virtu...@googlegroups.com

Good question... I would use my ham radio to listen to it transmitting, but I don't think there is a radio receiver in the average household capable of receiving on that frequency. If you have a portable AM radio, you could try this: set it for an empty channel, hold the antenna very near the transmitter, and listen for interference when the transmitter is transmitting.

The other thing I would worry about is your transmitter and receiver being for the same frequency, but I'm not sure how you'd measure that, either, without a frequency counter. I have the same pair of modules, and mine aren't marked particularly well.

Lastly, what are you using for an antenna with your modules? The range without an antenna is a several inches (tens of centimeters) at best.

Good luck!

~James

Saima Ahmed

unread,
Feb 20, 2014, 10:55:04 AM2/20/14
to virtu...@googlegroups.com
 Hello, I am a beginner. I have got to use XY-MK-5V  TX/RX Module in my project of "room automation system using RF technology". I am using pic microcontroller and C programming language. I need to ask that will this RF module will on/off a 220V bulb and fan?? will it need encoder/decoder or just pic uC will be sufficient??

Saima Ahmed

unread,
Feb 20, 2014, 11:32:14 AM2/20/14
to virtu...@googlegroups.com
Does any one have datasheet of xy-mk-5v RF module? If yes, then kindly provide it.

Mike McCauley

unread,
Feb 20, 2014, 3:01:55 PM2/20/14
to virtu...@googlegroups.com
This forum is for users to ask questions about the virtualwire library.
You should address your query for datasheets to another forum.

Cheers.

On Thursday, February 20, 2014 08:32:14 AM Saima Ahmed wrote:
> Does any one have datasheet of xy-mk-5v RF module? If yes, then kindly
> provide it.

Simon John

unread,
Oct 4, 2014, 7:03:47 PM10/4/14
to virtu...@googlegroups.com
As an update to this, I've tried again. This time I've soldered on 17cm antenna's to both modules (and tried a MK-F01 transmitter too) and made a basic circuit of transmitter with a button and receiver with an LED. This works in as much as the LED is almost constantly on, but when I push the button it definitely flashes off. So it seems data is getting through but there's a massive amount of noise. At least it proves they're all 433MHz modules.

Still can't get any VirtualWire or rc-switch Arduino sketches to work though, and I've bought some "Status" remote controlled mains sockets, which the Arduino can't read from or write to: http://www.amazon.co.uk/gp/product/B003XOXAVG/

Reply all
Reply to author
Forward
0 new messages