RFA001 Transmitter from PicAxe to Arduino

msegers

New Member
Hi All,

I'm pretty new to Picaxe but I have some experiance toying around with arduino's.
Myself I'm mainly a software developer who's more into higher level programming than the low level electronics so this might be the reason why I'm having issues.

So I got an arduino Uno (I don't really expect anyone to help me with this but it would be nice). And a circuit with an PicAxe 08M2+ and I'm trying to get some test content over from the picaxe to the Arduino through the RFA001 transmitter and reciever. (so these guys http://www.picaxe.com/Hardware/Add-on-Modules/433MHz-Radio-Transmitter-and-Receiver-Pair/).

I have some dummy code based on the examples from here http://www.picaxe.com/Circuit-Creator/Miscellaneous/RF-Radio-Transmitter/.
Code:
main:	serout C.0, n2400, ( 1, 1, 1, 1, 1, 1, 1, 1 )	; Send the data packet 
pause 5000	; Wait 5 second 
goto main
And I'm trying to make any sense of received values on my arduino following this blogpost http://arduinobasics.blogspot.com.au/2014/06/433-mhz-rf-module-with-arduino-tutorial_27.html

I basically copied the arduino patch and tried to see if anything is happening but I get too much data and it never stops when I put it in the loop which is shouldn't according to this code.
For the record, I'm using the RFA001 Receiver in the arduino, everything is powered at 5V.

Am I at the right place to ask this question?
 

eggdweather

Senior Member
The code for the Arduino is not rerally what you need, it will run once and display the length of the high and low pulses in uSecs. Then you put the same thing in the loop and that operated correctly by repeating itself and so nothing wrong with that. What you need is the basic serial reception programme that receives serial data on a designated Arduino pin and then prints/displays the results, then you would get what you sent. That programme already exists/is written for you in the Arduino library within the IDE. When you have done that and assuming the tx and rx are working correctly and of the correct logic sense, you will have a working system. I would connect the PICAXE output directly to the Arduino input to prove the link before using the RF modules. It helps to get the baud rates and polairy of data correct, which the RF modules shoudl then replicate - BUT

One thing to be aware of with RF modules is their default output is often high and they go low for the duration of an incoming low signal if that makes sense. So if you try and transmit a default low you will get a default high at the receiver end becuase there is no recurring low transition, so you have to invert everything. I found this out when I first got hold of a similar Tx/RX pair and could not understand why it was not possible to send a continous 0 signal when I could successfully send data. When I used my scope it became obvious that these modules only send data on a input transition. SO they are of limited value in static signal conditions, data is just fine.
 

msegers

New Member
But the example you 'based' it on was for the rfout command on a PICAXE, which is really very different to serout.

See Example3 for the Transmitter and receiver on how to make it work with serout. The receiver example 3 code will give you an idea of what is then required at the receiving end.
Yes I'm using the number 3 example rfout is not available for my Picaxe chip.
 

msegers

New Member
The code for the Arduino ... data is just fine.
I didn't even think about directly hooking up the cable for testing first. I'll do this that makes a lof of sense, then I can check if the RF connection is doing fine or what the problems are.

Thanks!
 

hippy

Technical Support
Staff member
It may be worth detailing what you ultimately want to achieve as members may be able to guide you on that. It is not necessary to run the Arduino code you are looking at to analyse the data or discover what is sent as that can be predicted from what the PICAXE code is.
 

msegers

New Member
What I'm ultimatly am doing is very simple, I want to make a simple box with 3 buttons, which you can answer questions with. Like an A-B-C thingy.

Since I'll probably be sending 8 bits, Allthough I see I could easily do more, I was thinking of reserving 2 bits for the answer being posted (00, 01, 10, 11). And use the first 6 to identify the box sending the message.
Then I'll hook up an arduino to a PC and probably use NodeJS to attach it to a PubQuiz based application.

I noted I do get a proper message in the arduino directly connecting it, Now I have to find out how to get the data from the air. Lots of Radio traffic Here I guess.
 

eggdweather

Senior Member
If your Arduino had a Wi-Fi or Ethernet shield connected, you could get it to generate some HTML code to display on a web page some nice graphics showing which button was pressed. The code to do this - take sensor or button presses is in the IDE Examples, it is relatively easy to do.
 

msegers

New Member
Well that'd all be fine I rather not have the arduino do any webserver like, I have a simple Uno. And I want it just to send data to the PC. The PC is powerfull and should be able to handle different applications not changing any arduino code :).
 

msegers

New Member
Question, how import is it to solder an antenna to the transmitter and reader? It seems I only get up to 713 as a read on my arduino and as far as the internet tells me it should be 1000+. Also anyone have any idea how to filter the value because there is so much noise!
 

eggdweather

Senior Member
First off, don't get the Tx too near the Rx as it blocks the Rx front-end and causes distortion in the signal. You should have got antennas with the Tx/Rx pair, usually twisted wire coils about 50mm long, sometimes just a wire. Without an inductive antenna, the length is ~17cm for that frequency. It does help to connect the antennas. Noise can be a problem, which is why most protocols used with these units have error detecting and correcting properties like the Reed-Solomon type. They also include addressing, so the receiver can remove unwanted characters. But for most applications you could add your own simple protocol such as sending #55 or AA as a preamble to each character (55 or AA are alternating 1-0-1-0 bit patterns so get the receiver AGC working before the real character arrives), and if you don't receive your preamble byte say #55 then it's not a valid character the next in sequence - probably. Sending 'A' send #55, #41

What do you mean by 713? Good characters received sequentially without error?
 
Last edited:

msegers

New Member
What do you mean by 713? Good characters received sequentially without error?
Hmm yes, I mean the analog port of my arduino returns this value. I believe that has to do with the strength of the singnal, but I'm not sure now.
Do you have any good reads or links which I should check out to get rid of the distortion? I'll try the preamble stuff this makes sense.
 

srnet

Senior Member
Having played with RF stuff quite a bit, I would suggest its Zillions and Zillions of times easier to get the link working with the same micro type at each end first, and it will be lot easier to get support.

Once the link is working well on one Micro type, you can then try the link between two different types of Micro, knowing that if it does not work, its the new Micro that has the problem ............
 

msegers

New Member
I don't know what you mean with micro type. But I guess that's because I barely ever work with these things.
 

srnet

Senior Member
By Micro, I meant a PICAXE is one type of Micro(controller) and an Arduino is another type of Micro(controller)
 

msegers

New Member
Makes sense that's what I was afraid of, been jerking around with it for a while can't make any sense of the signal in arduino. Also reading it seems to be hard.
 

msegers

New Member
Still can't figure out how to roll with this, I must confess I'm still trying to work with the arduino as receiver. I do get the feeling that the Receiver is not even getting a signal. Maybe the transmitter is not even working I have no clue how to debug it. I do have 2 sets So I can try switching, havent'seen any difference though.
 
Top