Arduino Forum

Using Arduino => Programming Questions => Topic started by: gerald1234 on Apr 01, 2019, 09:52 pm

Title: RF communication
Post by: gerald1234 on Apr 01, 2019, 09:52 pm
So i have made a very simple arduino rf transmitter and receiver and they are working fine but the result fluctuates. In the image i want it to be the light blue line not the dark blue line is there a quick and easy fix.

Thanks,
Harvey
Title: Re: RF communication
Post by: Paul_KD7HB on Apr 01, 2019, 09:59 pm
So i have made a very simple arduino rf transmitter and receiver and they are working fine but the result fluctuates. In the image i want it to be the light blue line not the dark blue line is there a quick and easy fix.

Thanks,
Harvey
I think you left a few very important facts. Try again to explain what you are doing and what is showing on the graph. Perhaps the problem is in whatever created the graph.

Paul
Title: Re: RF communication
Post by: Geek Emeritus on Apr 01, 2019, 10:00 pm
investigate debounce

get an assortment of capacitors. try an .01 pf, a 1 pf, a 10 pf across the output.... see how that trends
Title: Re: RF communication
Post by: gerald1234 on Apr 01, 2019, 10:07 pm
I am using the 433m transmitter and receiver and they are just wire to the Arduinos with no resistor and I am just using Serial.println(analogread(A9)) on a mega
Title: Re: RF communication
Post by: DrAzzy on Apr 01, 2019, 10:23 pm
433MHz receivers - assuming you're talking about the OOK/ASK ones like those cheap green ones - give digital output, and the signal you're listening for needs to have approximately 50% duty cycle on/off when transmitting (over timescales of a few milliseconds). Those devices use automatic gain control to adjust the gain and threshold to have an approximately 50% dutycycle on the output, and if you leave the transmitter on or off for more than a few milliseconds at a time, the AGC adjusts to where it's amplifying noise so it gets a 50% duty cycle. This also means you need a recognizable pattern sent, that the receiver can pick out when it comes with a background of noise on either side. Often OOK transmission schemes will use a "training burst" of 50% duty cycle at the start of a packet, resend the packet repeatedly - most often both. And the receiver code needs to be clever about interpreting the signal - you end up with something akin to morse code, plus a checksum.

For sending data via those type of modules, use a library like RadioHead, which has done all this hard work for you - don't try to reinvent the wheel from scratch, especially not if you're new, which it sounds like you are.

Personally I made my own scheme for transmitting using them, but I don't recommend that except as an academic exercise. Initially I didn't balance the duty cycle well, sure enough, certain bit patterns would break it.

Also, as I've said here ad nauseum - get the RXB12 or RXB14 receiver modules off ebay if you're going for long range. They're under $2/ea, and get much better range than the cheap green receivers, and work at 3.3v (you would otherwise treat them identically to the green ones - they just get about 10x the range)