How do I read from the Data pin?

Hellllllo all.

I have this TDL-9921 RF Receiver: TUODIRF superregenerate receiving modules;TDL-9921;TDL9921,RF transmitting modules;RF

It has a Vcc, Data, and Gnd pin. I have Gnd hooked to gnd, Vcc to +5v, and and then Data to a SoftwareSerial pin on the Arduino. (Does it have to be a PWM or something? I have it on pin 4 for receiving.)

Should I be looking at 1-Wire? or something else?

I am reading every few seconds and it will return a 0 - 255 DEC but it just keeps doing this. When I push one of the buttons on the transmitter, the numbers decrease, and reach 0 but they are inconsistent and don't seem to differentiate between the two buttons.

? Thanks.

A little more poking around and what I think the thing is spitting out is TTL data.

But it's like it's in a constant loop. I'm wondering if it expects a startup signal or something.

Oh I don't know.

what are you trying to receive?

I'm wondering if it expects a startup signal or something.

No, where your you send the signal to, you just have a simple receiver.

It depends on how the transmitter is being modulated. It could be serial data but most RC systems do not transmit data in this form.
So you need to look to your transmitter.

The data sheet speaks of ASK/OOK modulation. See Wikipedia's article on OOK, identified as the most common type of ASK modulation...

My guess? The receiver isn't doing anything more clever than bringing the output pin high when an RF signal is being detected. And the transmitter is essentially sending "Morse", or some other, similar, code. If you could get a look at what the output signal does with an oscilloscope, you'd be a long way forward.

Tell us more about the transmitter?

Awesome. I didn't think of the transmitter... I'm still looking at this stuff as magic and I'm learning... haha

I'll take a look at the transmitter tonight. I have the datasheet for it somewhere.

And the transmitter is essentially sending "Morse", or some other, similar, code.

No nothing will ever send Morse, it will be some radio control multiplexed signal, or encoder chip. Something similar to this one:-
http://uk.farnell.com/analog-devices/ad1970jstz/encoder-codec-smd-1970-lqfp48/dp/1078402

or even:-
http://www.google.co.uk/url?sa=t&source=web&ct=res&cd=1&ved=0CAsQFjAA&url=http%3A%2F%2Fwww.rfsolutions.co.uk%2Facatalog%2FDS800-4.pdf&ei=JguyS8m-DJv40wSK5vGzBA&usg=AFQjCNH8oc2ql3R2Tz3wmnCj2lL3tqrXdg&sig2=7jFhkm_3euI3oCokA_EQQQ

Alternatively it could be a simple PWM signal or PPM signal.

Ok, the transmitter is a Tuodi TDL-9911A-2

http://www.k6271.com/product/product3/TDL9911A-2.htm

With Google translator:

Oscillation Mode: SAW Resonators
Modulation: ASK
Encoding: PT2260

Looks like it's rolling code with this chip in it:

Hmmm... what to do now.

There is a library called Vitualwire that works with simple ASK transmitters and receivers :

http://www.open.com.au/mikem/arduino/

It is just glorified morse code, since the radio gear is just on/off keying (or close to it)

You all are really helpful. Thank you. I'm having fun with this. I tried the VirtualWire library and can't seem to get it to work...

#include <VirtualWire.h>

  int DoorClosedState = 0;
  char inString[32];
  int inCount;

void setup() 
{
   
   Serial.begin(9600);
   Serial.println("setup");
   
  vw_set_ptt_inverted(true);    // Required for RX Link Module, tried commenting out, no success
  vw_setup(2000);  // Bits per sec, tried 1000, 2000
  vw_set_rx_pin(11); //tried different pins
  vw_rx_start();      
  
   
 }


 void loop(){
  
    char text [50];
    uint8_t buf[VW_MAX_MESSAGE_LEN];
    uint8_t buflen = VW_MAX_MESSAGE_LEN;
    inCount = 0;

   if (vw_get_message(buf, &buflen)) // Non-blocking
    {
      int i;
      // Message with a good checksum received, dump it.
      Serial.print("Got: ");
 
      for (i = 0; i < buflen; i++)
      {
          Serial.print(buf[i]);
          //Serial.print(" ");
 
            inString[inCount] = buf[i]; 
            inCount++;
      }

        Serial.println("");
    }
    else
    {
      Serial.println("I got nothing.");
    }
  
  delay(1100);

 }

Any other suggestions? I'm thinking about a USB Oscilloscope.

It is just glorified morse code, since the radio gear is just on/off keying

You can't say that. Don't mix up the modulation method with the encoding technique.
The problem, and unique point, with Morse is that it is a relative encoding technique. That is there is no fixed time for the two states, dot or dash. Rather it uses the relative time between these two states, that is a dot is three times longer than a dash. Even that is not very tightly enforced.
While it can be transmitted using a continuous wave (hence the slang CW) it can also be modulated in any number of ways, like FM, FSK and AFSK all of which are used.

Turning a carrier on and off is simply a bi state amplitude modulation method. There are lots of different amplitude modulation systems of varying complexity all the way up to COFDM which is used to transmit digital TV.

To the op,
Yes getting a scope is going to allow you to make progress with this.

I didn't say it was Morse code, I said it was glorified Morse code. A crude analogy for turning a carrier on and off, which is what ASK amounts to. It wouldn't be recognised as Morse code to the trained ear (I was once able to read 5wpm Morse when I was studying for the Class A RAE so I do have a small claim to know what I'm talking about).

The virtualwire library attempts to balance ones and zeros to keep the crude AGC the receivers have in-line, so its a little more sophisticated than PWM and Serial (and Morse).

What you could do to test the radio end of the system is wire a button to the TX pin (Data) of the transmitter and stick a voltmeter on the RX pin (Data) of the receiver and see if you can change the reading on the voltmeter by pressing the button. This is all the Virtualwire library does in effect except at a higher speed, dare I suggest you could even use it for morse code ? :wink:

PS, GM, you can't use simple radio kit like this for FM, since by definition FM needs to alter the frequency to modulate the carrier. CW/ASK etc is fixed frequency.

Hmmm.

If I hook my DMM up to the RX Data pin and push the button on the transmitter the voltage does drop, but I still don't know what it's doing...

Gonna have to splurge on a USB Oscilloscope.

Does t/he RX pin follow the TX pin ? (ie high when tx is high, low when tx is low ?. Its conceivable that it works the opposite way and the virtualwire library won't work. It worked well enough for me provided I turned the speed down in the software. I ran it at 500 I seem to remember, which wasn't too hot if you had a lot of data to shift but it improved the reliability of the transfer. Its a while since I last played with it and the radio kit isn't to hand.

Thank you, (not)Grumpy-Mike.

I always learn from your posts! As the "guilty" party for introducing the "Morse" analogy, I appreciate your clarification. But for people just getting to grips with this, I hope the idea that the transmitter/receiver pair may be using a simple "sometimes there/ sometimes not" thing may be useful, too! As a starting point! Of course the details of what's there and not are important too, once you've made the start!

Plese don't worry: I'm not downhearted... just wanted to SUPPORT your elevation of the discussion to more exact planes.