As my second project, I would like to receive a RF signal from a remote, and send out a new RF signal using one Arduino Uno.
For background, I have a remote outlets with a finicky remote. I have a new RF remote that was never meant to talk to these specific outlets. I purchased those cheap 433Mhz RF transmitter and receivers. I am able to pull the signal details from both the old, finicky remote and the new remote using the RC-Switch library, but it seems unable to receive then transmit in the same program.
I think that the answer to this, is that you can't receive and transmit on the same frequency.
Think about it, if your circuit receives a signal then re-transmits it on the same frequency, that re-transmitted signal will be picked up by your receiver, and be re-re-transmitted. This will go on ad infinitum.
Are you old enough to remember the effect that Jimi Hendrix, et al, obtained by placing their guitar pickups directly in front of their speakers?
To clarify, (I'll use the decimal values I recorded with rc-switch as an example)
I will press the on button on the new remote, sending 351491
The arduino sees this specific value and sends the code the outlet is waiting for (Decimal: 5357900 (24Bit) )
and so on for the all the on and off buttons on the remote
Changing the code numbers is not the same as changing the frequency.
Can you successfully send the 5357900 code directly from your Arduino with the finicky remote turned off and the number hard-coded into your Arduino program - perhaps to be sent every time you press a button connected to the Arduino.
I have gotten the button working, each press turned the outlet on or off depending on its state. I was thinking about building a remote but thought this way to be better suit for everyday use.
I have used the RecieveDemo from RCSwitch library to see all the codes I need. I am able to uses those codes in the SendDemo from RCSwitch successfully controling the outlets, but it seems you can't use RCSwitch to do both in the same program.
Even with two different RF frequencies a receiver will not work properly while a transmitter beneath it is sending. You risk full or partial data loss from other (remote) senders while re-transmitting.
And you've got it successfully receiving the transmissions from the other one?
Using serial debugging, does the sketch think it's sent the value?
You need a delay after you receive the transmission, before retransmitting it. If the two signals are both being sent at once (note that most cheap RF devices send the signal several times in rapid succession to ensure receipt), it won't work. Also, you may need to send your message a few times right after eachother for it to work, to give the receiver's gain adjustment time to lock onto your signal.
Re DrDiettrich:
Hmm.. so is there any way to receive the signal, shut off the receiver, turn the transmitter on, send the signal, turn the transmitter off and the receiver back on...?
Re DrAzzy:
It does think it sent the value, though with no response from the outlet indicates it was never received.
I will try adding delays to see if that helps.