+ Post New Thread
Results 1 to 5 of 5
  1. #1
    Member level 1
    Points: 2,366, Level: 11
    Achievements:
    Created Blog entry 7 years registered

    Join Date
    Apr 2007
    Posts
    36
    Helped
    1 / 1
    Points
    2,366
    Level
    11
    Blog Entries
    2

    USART transmission through OOK RF Module and MCU ADC as noise rejection filter

    Hi,

    Just wanted to share my project and solution for coping with the noise in OOK RF modules. Not sure if this was discussed before and certainly someone thought of this long before me
    but I couldn't find much of information on-line, so it still might be useful to someone.

    I had a project that needed an RF transmission (1000 bps) through an OOK module. What I found out is that the receiving modules adjust their gain too fast and start picking noise
    when the carrier is off for transmitting two or more consecutive 0s. Where 1s are being received without problem as long as there isn't another transmitter in the immediate proximity.

    So instead of reading in the middle of the transmitted bit I coupled the module output to the 12 bit ADC input of the MCU and I read approximately 80% -90% of the bit length. With 5 uSec
    acquisition time I can average 16 readings per bit for 1000 bps transmission. So I give an arbitrary threshold value where everything less than it is considered 0s and more than that as 1s.
    Since false positive in a "0" is much more probable than a false negative in a "1" you should calculate the value closer to the "1".

    In my case this is 780 bits (I invert the module output through a MOSFET for voltage conversion) as it corresponds to 2.5 false negative readings for every "1" transmitted and 13.5 false positive
    readings for each "0" in a 12bit ADC.

    This of course will require higher speed MCU and better timing synchronization but it is easily achievable with modern MCUs.
    In my project I used Lynx Technologies OOK module and PIC MCU.

    Tips:
    - The subroutines for this are quite fast - and don't require much of a processing time. To avoid division simply accumulate 2n ADC readings and right shift n bits.
    - Don't use faster ADC times and/or higher number of ADC readings but spread the readings through the entire bit length so you can have better chance to catch the noise.
    - An appropriate preamble and MCU hardware timers give excellent timing
    - Instead of an ADC port you can use any digital port and check the state several times but with an ADC port and longer acquisition times you have better chance to pick up
    level transitions, hence better chance for noise rejection.

    Hope this helps in your projects.

    Regards
    Last edited by trastikata; 23rd October 2013 at 07:44.

    •   AltAdvertisement

        
       

  2. #2
    Full Member level 5
    Points: 2,342, Level: 11
    Jigar 4 Electronics's Avatar
    Join Date
    Apr 2011
    Location
    Hamilton, ON, Canada
    Posts
    313
    Helped
    40 / 40
    Points
    2,342
    Level
    11
    Blog Entries
    2

    Re: OOK RF Module USART transmission and MCU ADC as noise rejection algorithm

    Thanks for sharing.
    You can put it as blog so that people can go through this even after a long time.
    Never Leave it until you did it.
    Every time you fails go for one more time :)



    •   AltAdvertisement

        
       

  3. #3
    Member level 1
    Points: 2,366, Level: 11
    Achievements:
    Created Blog entry 7 years registered

    Join Date
    Apr 2007
    Posts
    36
    Helped
    1 / 1
    Points
    2,366
    Level
    11
    Blog Entries
    2

    Re: OOK RF Module USART transmission and MCU ADC as noise rejection algorithm

    NP but it seems that I am not allowed to use this function yet. I will post it as soon as I can.



    •   AltAdvertisement

        
       

  4. #4
    Advanced Member level 5
    Points: 20,490, Level: 34
    Achievements:
    7 years registered

    Join Date
    May 2009
    Location
    Prime Meridian
    Posts
    3,056
    Helped
    893 / 893
    Points
    20,490
    Level
    34

    Re: OOK RF Module USART transmission and MCU ADC as noise rejection algorithm

    Hi,

    Seems a novel way of getting around the rf problems.

    However the standard way is with the micros software by using whats known as Manchester Encoding.

    These are two of many links on the subject http://www.winpicprog.co.uk/pic_tutorial12.htm
    http://www.embedded.com/design/embed...coding--Part-1



  5. #5
    Member level 1
    Points: 2,366, Level: 11
    Achievements:
    Created Blog entry 7 years registered

    Join Date
    Apr 2007
    Posts
    36
    Helped
    1 / 1
    Points
    2,366
    Level
    11
    Blog Entries
    2

    Re: OOK RF Module USART transmission and MCU ADC as noise rejection algorithm

    Thank you wp100.

    I am aware of the advantages of Manchester Encoding. However these receiving modules have very short recovery time and adjust the gain too fast.

    I've tried Manchester Encoding but the noise starts to interfere too fast. At 9600 bps I pick up noise in the 0s, at 1000 bps more than the last 2/3rd of each 0 is noisy,
    so it is hard to get reliable transitions. In my trials the above mentioned method proved to have much better noise resistance because of its logic. The main "disadvantage"
    is that you can't recover the clock.

    Probably a combination of both methods (didn't think of it until now) would give the bests noise resistance. I will modify my code and make more
    tests in the next day.
    Last edited by trastikata; 23rd October 2013 at 12:07.



--[[ ]]--