Pages: [1]   Go Down
Author Topic: Using PWM for Radio Coomunication  (Read 564 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
hope this question has not been asked thousand times before. Here it comes:

I have used the salaea analyzer (excellent piece of engineering) to decipher the radio protocol of the radio controlled plugs used at home. I have found out that a 1 is transmitted as 0.25ms high and 0.25ms low and a 0 is transmitted as 0.5ms low. The prologue, command and device bytes have been found, so basically all I have to do is hack the code.

First I wanted to use the VirtualWire, but it seems to bring its own protocol, so this is  a no go. Do I really need to fiddle around with custom PWM registers to achieve radio communication? Is there some library I can use to help me on this?

Stefan
Logged

UK
Offline Offline
Shannon Member
****
Karma: 223
Posts: 12579
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You would need a radio transmitter which your square wave signal could be modulated on using whatever type of modulation the plugs use. The Arduino could probably generate the square wave signal to control the modulation, but it wouldn't generate the RF output.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
a 1 is transmitted as 0.25ms high and 0.25ms low and a 0 is transmitted as 0.5ms low. ...

Do I really need to fiddle around with custom PWM registers

How did you go from there to needing PWM?

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
thanks for your responses. To your first question:

I wanted avoid using the main loop for timing sensitive code blocks. So my first ressort was use a customized PWM "algorithm". But this has proven to be overly complex.

To your second question:
There is a tone method, but it doesn't quite hit the spot for what I am doing. It has the same shortcomings as the shiftOut method. For neither solution can I naturally deal with that a 1 is a 25 ms HIGH and a 25 ms LOW pulse. I would have to model a logical 1 as a physical 10 and a logical 0 as a physical 00. This just seems to be wrong according to my gut-feeling. And yes I have a 434 MhZ transmitter attached to the arduino.

My current approach is, that I have setup a 555 timer, which is attached to an interrupt. I got this working this morning. This evening I will attempt to use the interrupt to clock the  HIGH, LOW pulses to the transmitter. If that works I might attempt to use the on-chip timer for this, but I am not really sure. Is it feasible?


Stefan
Logged

UK
Offline Offline
Shannon Member
****
Karma: 223
Posts: 12579
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This just seems to be wrong according to my gut-feeling. And yes I have a 434 MhZ transmitter attached to the arduino.

It seems right and inevitable, to mine. The buad (signalling) rate is twice the bit rate with this signaling scheme so you need to output two signals per bit. I would have thought you could do this handily with a timer interrupt triggering twice per bit and a FIFO buffer of signaling states waiting to be transmitted. Perhaps you could use SoftwareSerial as the basis for this. Using the 555 timer to trigger the interrupt save needing to understand how to configure timer interrupts but there are tutorials that explain how to do that and it should not be necessary to use the 555 timer kludge long term.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
This just seems to be wrong

Why?

You can code a send1() / send0(), and shift out a byte, or you can code a char2word() to turn a byte into a word and use other ships (hardware spi or shiftOut()) to send it.

Logged

Pages: [1]   Go Up
Jump to: