1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Cheap ebay RF modules made easy... (and fast!)

Discussion in 'Electronic Projects Design/Ideas/Reviews' started by Mr RB, Apr 23, 2013.

  1. meggyhimself

    meggyhimself New Member

    Joined:
    May 31, 2012
    Messages:
    2
    Likes:
    0
    Hi,

    I'm testing a transmitter-receiver circuit using the low-cost RF ones mentioned in this thread. I'm a little bit confused regarding how to configure the pins of the ATtiny 13 as input. Normally, when the pin is configured as input, without pull-up resistors enabled, it is tri-stated in High Impedance state.

    So my question is: Do I have to connect a pull down resistor to the input pin of the microcontroller to make sure that it is at logic "0" when there's no data from the receiver ? From the circuits you've worked with, how do you connect the pins of the microcontroller which is to receive data from the receiver: pulled-up or pulled down with a resistor?

    Thanks.
     
  2. NorthGuy

    NorthGuy Well-Known Member

    Joined:
    Sep 8, 2013
    Messages:
    1,218
    Likes:
    206
    Location:
    Northern Canada
    Most likely, the digital output from the module is push-pull, so you simply connect it to the MCU input with a straight wire with no resistors (may be a resistor in series for protection). But, of course, you should read the data sheet for the specific module to know for sure.
     
    • Like Like x 1
  3. Miervaldis

    Miervaldis New Member

    Joined:
    Sep 3, 2014
    Messages:
    3
    Likes:
    0
    Thanks for tutorial, I like it :) I hope to see more tuts from you :)
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. MOR_AL

    MOR_AL New Member

    Joined:
    Aug 7, 2011
    Messages:
    16
    Likes:
    1

    First of all, I apologize for my bad English. I will try to make small sentences.

    Sensitivity or noise. What happens?

    I bought some same kits from Ebay as shown on Mr RB's site.
    I did not use it yet but I turned on the receiver. Frequently I receive some noise at the output.
    I tried to understand what was going on, so I made a search on web and finally I found the circuit of the receiver.
    [​IMG]
    I compared the amplifier and the comparator of the circuit with the receiver's kit. Pins 2 and 3 of U1:A (On R12)
    [​IMG]
    I analyzed the diagram and I measured what was going on the comparator’s input.

    I found those signals showed bellow.
    [​IMG]
    Normally the instantaneous voltage of noise almost reaches the reference voltage. Occasionally it goes beyond the reference voltage and the output of comparator goes high.
    I changed the value of R12 from 220k to 470k. See below.

    [​IMG]

    Now the difference between the instantaneous voltage of noise and the reference voltage is bigger. I monitor the output of the receiver for 10 second and did not find any noise.

    The value of R12 can be changed to 330k, if the earlier change was too much.

    Thank you.

    MOR_AL
     
  6. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    11,094
    Likes:
    561
    Location:
    AZ 86334
    You have reduced the sensitivity of the receiver to valid signals as much as you have reduced the propensity for no-signal noise.

    To get the best performance on weak valid signals, the no-signal noise must be symmetric with respect to the ref voltage at pin 2. The fact of life with a super-regenerative receiver is that it puts out noise when it isn't receiving a signal, ergo, you must validate the output signal by using a preamble with a known pattern to validate what follows...

    As a valid signal gets weaker, it will decode incorrectly, and begin to mimic the no-signal noise, so the messages must be short, and contain redundant information so the message can be recovered, or at least validated (ECC or Parity).
     
  7. MOR_AL

    MOR_AL New Member

    Joined:
    Aug 7, 2011
    Messages:
    16
    Likes:
    1
    Yes!

    I know that I reduced the sensitivity. But what would be the best signal to noise ratio of a data receiver?

    Many years ago I projected a fiber optic receiver to receive weak data signals. As I had not experience, the gain of the receiver was big and noise signals became present.

    In other words my receiver had much sensitivity but had much noise too. When I reduced de gain I could measure the error. During one month I sent and received (two transmitter-receiver modules) more than 5.e12 (2e6 * 60 * 60 * 24 * 30) pseudo random bits without one error.

    I know that I reduced the sensitivity, but if you have sufficient signal you may reduce the gain.

    I know that with super regenerative (SR) receivers is necessary to transmit a preamble right away before data to adjust the operation point of the RF transistor.

    Below you can see the preamble changing the operation point of the RF transistor in a SR receiver that I projected.


    [​IMG]


    The 433MHz part of the receiver which catches the preamble.


    [​IMG]


    The diagram of the receiver until the point (V01) which I measure the preamble.(Ref. http://www.eix.co.uk/Articles/Radio/Welcome.htm )


    [​IMG]



    In my application I want to receive one byte per hour (it is a water level system) or always its level changes one step.
    I have to keep my uC as much as I can at sleep state until it receives data, not noise. With the presence of noise the uC awakes many times and it consumes a lot of electric energy.

    PS. I will not continue with my receiver project. I will try to use the kit.

    MOR_AL
     
    Last edited: Apr 3, 2015
  8. JIFERECO

    JIFERECO New Member

    Joined:
    Jun 5, 2015
    Messages:
    1
    Likes:
    0
    hello is a pleasure to be part of the forum, I am new to electronics, I'm trying to understand the code of RomanBlack friend, this code can decode reception sender and image control ??

    [​IMG]

    I do not much code, if this recepciona the input states TX (transmitter) where I see this recepcionando data ?? or that port pic I can see the codes obtained ?? Im really confused, try to redirect the code obtained an LCD does not work me, if someone help me, thanks


    Code (text):
    (PIC 18F2550 ---- Xtal 8Mhz)

    sbit LCD_RS at RA5_bit;
    sbit LCD_EN at RA4_bit;
    sbit LCD_D4 at RA0_bit;
    sbit LCD_D5 at RA1_bit;
    sbit LCD_D6 at RA2_bit;
    sbit LCD_D7 at RA3_bit;

    sbit LCD_RS_Direction at TRISA5_bit;
    sbit LCD_EN_Direction at TRISA4_bit;
    sbit LCD_D4_Direction at TRISA0_bit;
    sbit LCD_D5_Direction at TRISA1_bit;
    sbit LCD_D6_Direction at TRISA2_bit;
    sbit LCD_D7_Direction at TRISA3_bit;

    char texto2[10], texto1[]="Data Receiver";

    unsigned char rxdat[10]; // (global var) holds received RF bytes

    //=============================================================================
    // RECEIVE_RF_PACKET
    //=============================================================================
    void main(void)
    {
    //-------------------------------------------------------
    // This function receives an RF packet of bytes in my pulse period
    // encoded format. The packet must have 10 valid contiguous bytes
    // or the function will not exit. There is no timeout feature, but could be added.
    // global variable; unsigned char rxdat[10] holds the 10 byte result.
    // Note! TMR0 is running at 500kHz, so 200uS = 100 TMR0 ticks
    //-------------------------------------------------------
    unsigned char rrp_data;
    unsigned char rrp_period;
    unsigned char rrp_bits;
    unsigned char rrp_bytes;

    TRISC.RC6 = 0; // TX pin, works fine with/without setting this I/O in proteus
    TRISC.RC7 = 1; // RX pin, works fine with/without setting this I/O in proteus
    CMCON = 0x07;
    ADCON1 = 0x0F;
    Lcd_Init(); //Inicializa el LCD.
    Lcd_Cmd(_LCD_CLEAR); //Borra el display.
    Lcd_Cmd(_LCD_CURSOR_OFF); //Apaga el cursor.
    Lcd_Out(1,6,texto1); //Escribe el texto1.

    rrp_bytes = 0;
    while(rrp_bytes < 10) // loop until it has received 10 contiguous RF bytes
    {
    //-----------------------------------------
    // wait for a start pulse >200uS
    while(1)
    {
    while(!PORTC.F7) continue; // wait for input / edge
    while(PORTC.F7) continue; // wait for input \ edge
    rrp_period = TMR0L; // grab the pulse period!
    TMR0L = 0; // and ready to record next period
    if(rrp_period < 100) rrp_bytes = 0; // clear bytecount if still receiving noise
    else break; // exit if pulse was >200uS
    }

    //-----------------------------------------
    // now we had a start pulse, record 8 bits
    rrp_bits = 8;
    while(rrp_bits)
    {
    while(!PORTC.F7) continue; // wait for input / edge
    while(PORTC.F7) continue; // wait for input \ edge
    rrp_period = TMR0L; // grab the pulse period!
    TMR0L = 0; // and ready to record next period

    if(rrp_period >= 100) break; // if >=200uS, is unexpected start pulse!

    if(rrp_period < 61) rrp_data.F0 = 0; // 61 = 122uS
    else rrp_data.F0 = 1;
    rrp_data = (rrp_data << 1); // save the good bit into rrp_data
    rrp_bits--; // and record 1 more good bit done
    }

    //-----------------------------------------
    // gets to here after 8 good bits OR after an error (unexpected start pulse)
    if(rrp_bits) // if error
    {
    rrp_bytes = 0; // reset bytes, must run from start of a new packet again!
    }
    else // else 8 good bits were received
    {
    rxdat[rrp_bytes] = rrp_data; // so save the received byte into array
    rrp_bytes++;
    // record another good byte was saved


    bytetohex(rrp_data,texto2);
    lcd_out(2,1,texto2);
    delay_ms(50);

    }
    }
    }
    //-----------------------------------------------------------------------------



    or I can redirect data to hyperterminal?
     
    Last edited by a moderator: Jun 6, 2015
  9. AnalogKid

    AnalogKid Well-Known Member

    Joined:
    Sep 22, 2011
    Messages:
    1,125
    Likes:
    161
    Location:
    Ohio - GMT-5
    ONLINE
    I just saw this thread and have a comment. On the project page, about 1/4 down from the top, are scope shots of the receiver output for three different modulating frequencies. The conclusion is that there is a receiver problem causing duty cycle distortion at higher data rates. I respectfully submit an alternate interpretation of the data.

    At 1.00 kHz, the output duty cycle is 47%, a 3% distortion. But that also is a 30 us distortion. At 10 kHz it looks like the duty cycle is about 25%. But, if you measure the positive pulse width, add in the 30 us distortion from the slower waveform, multiply by 2, and invert, you get 9.1 kHz. This suggests to me that the duty cycle distortion is caused mostly by the startup time delay of the transmitter, which is completely off during zero states, and is a constant that is relatively independent of the modulating frequency. I suspect that there is a similar constant time delay distortion caused by the receiver at the end of a received pulse.

    In no way do I think that this is the whole answer, both because RF never is simple and because cheap parts are, well, cheap. But I wonder what the modulated RF envelopes look like superimposed over those three input data waveforms with the scope triggered on the data, and superimposed over the output waveforms with the scope triggered on the RF. They might show the two processing delays I'm theorizing, and suggest a pre-distortion that can be calculated automatically for any input data rate to improve system reliability.

    ak
     
    Last edited: Jun 16, 2015
  10. gary350

    gary350 Well-Known Member

    Joined:
    Dec 28, 2005
    Messages:
    1,097
    Likes:
    53
    Location:
    Murfreesboro, TN 37129 USA
    What every day life purpose is the transmitter & receiver good for? What is 433 MHz and 315 MHz used for in every day life? What distance will it transmit?
     
  11. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    11,094
    Likes:
    561
    Location:
    AZ 86334
    key fobs, garage doors, gates, remote doorbells, remote temperature/weather stations, remote telemetry, dog training, etc

    They are license-free (ISM) bands for just this purpose. Only infrequent, very low power, short duration transmissions allowed, no voice, no continuous broadcasts.

    With good antennas, a few hundred feet. With crummy or no antennas, a few feet.
     
    • Informative Informative x 1
  12. throbscottle

    throbscottle Well-Known Member

    Joined:
    Feb 1, 2012
    Messages:
    1,802
    Likes:
    113
    Location:
    Nuneaton, Warwickshire, UK
    I thought those were the CB radio bands?
     
  13. schmitt trigger

    schmitt trigger Active Member

    Joined:
    May 24, 2009
    Messages:
    911
    Likes:
    85
    CB radio is roughly the 11 meter band. 27 Mhz.
     
    • Like Like x 1

Share This Page