Need help - Just want to make a simple switch using RF Modules


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Exclamation

    Thanks for the answers guys, few questions:
    I only have two buttons on Tx as an option. I am sorry if I failed to explain that the process has to work with one button only, i.e. if button 1 is pressed relay one should activate and when it is released relay should stop, same with the button 2 and relay 2.

    I added gpio=0 at after start to make sure the relays are off if no valid signal is comming otherwise before that statement relay was just left on.

  2. #2
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    Your transmitter, when you release the push-botton, should Tx ascii(100) or "d" then reciever will reset to zero both relays

    Code:
    start:                                                          
    serin GPIO.2,N2400,["pl65"],w1
    if w1=24 then gpio.5=1
    if w1=51 then gpio.1=1 
    if w1=100 and gpio.1=1 or gpio.5 = 1 then gpio = 0 
    goto start
    Al.
    All progress began with an idea

  3. #3


    Did you find this post helpful? Yes | No

    Question

    Problem is that the Tx only gets power while the button is pressed once button is released, power is also removed from the pic. Is there any way I can achieve my goal using an capacitor or somthing at the output in the hardware as I dont seem to figure out an solution with software (Unless someone comes up with somthing I can try on my exsisting setup). I already tried using an 470uF at the output pin + replacing 1K wih an diode. I am having problem with timings now BUT flickering seems to have been absorbed by the capacitor. If possible any sugesstion about the cap values I can try to have instant responses by the receiver PIC?
    Last edited by financecatalyst; - 24th October 2009 at 17:23.
    ___________________
    WHY things get boring when they work just fine?

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Might be able to do what you want by counting. Keeping track of the last push...

    But you will only have to count to one. The count VAR could start at 0. When the button is pushed...
    IF COUNT VAR = 0 THEN
    TX XYZ
    COUNT VAR = 1
    ELSE
    IF COUNT VAR = 1 THEN
    TX ZYX
    COUNT VAR = 0

    EEPROM may be required...

    Something like that
    Dave
    Always wear safety glasses while programming.

  5. #5


    Did you find this post helpful? Yes | No

    Question

    Quote Originally Posted by mackrackit View Post
    Might be able to do what you want by counting. Keeping track of the last push...

    But you will only have to count to one. The count VAR could start at 0. When the button is pushed...
    IF COUNT VAR = 0 THEN
    TX XYZ
    COUNT VAR = 1
    ELSE
    IF COUNT VAR = 1 THEN
    TX ZYX
    COUNT VAR = 0

    EEPROM may be required...

    Something like that
    Thanks for the answer, but I am sorry I couldnīt get your point how this will help. Could you explain a bit more please.
    ___________________
    WHY things get boring when they work just fine?

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by financecatalyst View Post
    Thanks for the answer, but I am sorry I couldnīt get your point how this will help. Could you explain a bit more please.
    Well I miss read what you are wanting to do... If I am reading it all correctly now just have the receiver activate the relays only if there is a valid RF signal with the correct data coming in. If the data is not correct the relay stays off or goes off....

    Sorry to confuse things... It is time for my nap...

    BTW you is that in post #4?
    Dave
    Always wear safety glasses while programming.

  7. #7


    Did you find this post helpful? Yes | No

    Question

    Quote Originally Posted by mackrackit View Post
    Well I miss read what you are wanting to do... If I am reading it all correctly now just have the receiver activate the relays only if there is a valid RF signal with the correct data coming in. If the data is not correct the relay stays off or goes off....

    Sorry to confuse things... It is time for my nap...
    That is correct. Sorry for the mixup in post #4, its two of us working on the same thing and using the same computer. Hope to find the solution soon to this problem.
    ___________________
    WHY things get boring when they work just fine?

  8. #8


    Did you find this post helpful? Yes | No

    Default

    I did a design a while back where the TX needed to be completely off for max battery life. I used a n-channel FET and I/O pin to enable the pic to strap itself on while the tx button was pressed, once released the code saw the falling edge and transmitted the off data. After that the pic turned itself off.

Similar Threads

  1. Simple RF remote control code
    By Bruce in forum Code Examples
    Replies: 13
    Last Post: - 22nd January 2014, 10:45
  2. RF Modules (Zigbee)
    By Chris Barron in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 4th March 2010, 18:28
  3. RF transmission and FSK modules
    By boban in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 8th May 2009, 07:19
  4. RF Transceiver modules help
    By davewanna in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th May 2008, 14:54
  5. Help with CC1100 RF Modules.
    By charudatt in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 27th November 2006, 20:58

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts