27Mhz Receiver -> Arduino Uno...

Hello and first, thank you for taking the time to read my post.

A little bit of background, necessary to understand what I am trying to do. My friend built an RC boat out of a barracuda kit and balsa wood, mounted an air cannon on it and challenged me. So, I have taken it as a good opportunity to learn. Consulting Jaycar Electronics, they advised me that Arduino Uno v1.0 would be a good starting point. After ripping my hair out trying to connect it to Windows 7, I finally conceded to Linux. Upon re-visiting my friend I acquired a an AM transmitter and bought a 27mhz Christal for it. I also tried to buy a 27mhz receiver but the arduino one they have is FM so I decided to try and build one. After an extensive search, I finally came across the Talking Electronics website and proceeded to build the front end of their 5ch receiver on a solder-less bread board. Not really understanding about the 70t resistor, I called the inventor and found out that it needs to be a tight circuit, which means my bread board design wont work. However I am still optimistic and would like to try it, as is and before I go soldering things together.

Now on to my problem. I would like to start off simply by connecting it to the Arduino and getting the onboard led to flash but I dont know what pins to connect it to or what the program should be. Can anyone help me get started?

My design includes the 10u 22k, 2M2, 10n and BC547 as seen in the image bellow. I have one signal wire leading from the 10n and one earth wire.

Thanks in advance...

Next step would be a detector and amplifier and a comparator. View the recieved transmission and obtain details such as mean pulse width, frame size, and channel window size.

The following are all expressions of units of time. frame size = time from the beginning of a sequence transmission until the beginning of the next. mean pulse width= average length of a channel's pwm signal. channel window size= time between the beginning of a channel pwm signal to thebeginning of the next channel

Stuperfied:
I also tried to buy a 27mhz receiver but the arduino one they have is FM so I decided to try and build one.

This bit I don’t understand.

I can’t imagine why you want to build your own RC receiver, unless your challenge was specifically to build the electronics yourself.

What are you actually trying to achieve?

Peter: I see this as a good oportunity to learn, also I am restricted on finance. Since the remote control he gave me is AM and the Arduino receiver in the store is FM, I decided to build it myself.

ajofscott: Ok, I dont really understand but im assuming that the amplifier is to boost the signal so it can be picked up by the detector, the detector is to check for a signal and the comparator is to decifer what the transmitter is telling us. Is this correct?

The person I talked to at talking electronics said that the 22k, 2M2, BC542 and 10n are a stage designed to reduce noise and boost the signal in order to increase range. He said I should duplicate this combination as many times as required. Is this the same as what the amplifier you refer to would be doing?

Can the Arduino be used to do these things or do I need to buy more components?

Pin4 lbel GP3 is the rf input to the decoder ic that I presume you don’t have. so you will make one with a 1
N60 Ge diode, a .001uF cap and a 10k resistor, the amplifier is 1/2 of a LM358 or equivelant, the other half will operate as a voltage comparator to produce a clean squared off pulse the arduino can easily time off of. I am suspicious that your transmitter isn’t a proportional unit and will produce a simple 4 bit seral stream relating to 2 motors with 2 directions. Do you have an oscilloscope to determine the data format?

so you will make one with a 1 N60 Ge diode, a .001uF cap and a 10k resistor, the amplifier is 1/2 of a LM358 or equivelant, the other half will operate as a voltage comparator to produce a clean squared off pulse the arduino can easily time off of.

Will look into this in a min. I have a HSP Digital Proportional system remote control my friend gave me. Dont have any access to any equipment so no oscilloscope, sorry. Friends dad has one if it really is necessary I might be able to use his if I ask very nicely.

Dont have LM358 handy, might have to see about stealing one of a motherboard or something. Otherwise, can we tap into this one on the Arduino board? (Note: this is not a picture of my Arduino, I have the Uno.)

358’s are common, and you can find them in many vcr,tv, microwave oven controllers. as for the Proportional radio, it is likely going to be 72 Mhz FM, or 49 Mhz FM if it is a surface vehicle remote.

The sticker on the side of the remote says AM Proportional Radio and then under it another sticker says Digital proportional system.

Data format will be 20ms frame time, with ~2000us per channel. 2 edge triggered event routines are required, a rising and a falling, and a state routine to time the 20ms frames. 2000us*number of channels is all the time we will care about for now, but you will want to expand the capability to the full allocated frame so that other transmitters you may use in the future with more proportional channels don't make your boat go all squirrely. You don't want wrap around ie you allocated for 5 channels but recieved a 7 channel stream, channels 6 and 7 get processed as a new frame on channels 1 and 2, which would be bad juju as the higher(later in the sequence) channels are generally toggle switch functions.

Found 297 393 but no 358 yet. Still looking.

The 393 is a dual comparator and will work for this purpose. The 393 has an open collector output and requires a pullup resistor to Vcc+. Pin 1 output 1, pin 2 inv input 1, pin 3 non inv input 1, pin 4 gnd, pin 5 non inv input 2, pin 6 inv input 2, pin 7 output 2, pin 8 Vcc+.

Here is the code to process the ISR events.

void EdgeTrigger()
    {
        static boolean SignalState;
        static long UpTime;
        static long DownTime;
        if (!SignalState)
            {
                //It is our rising edge and we need to record time and set the state flag HIGH
                UpTime = millis();
                SignalState = true;
            }
        else
            {
                //It is our rising edge and we need to record time and set the state flag LOW
                                                         DownTime = millis();
                SignalState = !SignalState;
            }
                            //Add code to test to see that DownTime is != 0 And UpTime != 0 and to calculate the time difference between them.
                            //add code to handle the low to high at the end of a PWM cycle. It will be similar to the inital if statement but will also account
                            //for the rising edge being the end of down time and the beginning of the next channel.
    }

Read up on attachInterrupt(), use this function as the Interrupt service routine. Meanwhile I'll put a bit more spit and polish on this.

Stuperfied: Peter: I see this as a good oportunity to learn, also I am restricted on finance. Since the remote control he gave me is AM and the Arduino receiver in the store is FM, I decided to build it myself.

The sort of RC system that would work on 27MHz in the UK is AM, and I assume that yours is something similar. Back when I used to play with these, the 27MHz systems were all 2-channel (the more expensive 4+ channel systems were working at 35 MHz). Receivers are relatively inexpensive and I'd expect an old 27MHz 2 channel receiver to be extremely cheap compared to the cost of an Arduino and so on. Even the cost of a 5 channel receiver wouldn't be significant unless you were literally trying to buy it with pocket money. Unless building your own receiver is something that you want to do for its own sake, it seems to me that you're looking at a heck of a lot of work just to save a few bucks.

You should be able to get a simple working solution using a conventional transmitter/receiver pair. I'm not clear what you plan the Arduino to do, but if you intend the Arduino to be involved in controlling the model (or whatever this project will be) then you can feed the PWM signal from the RC receiver into the Arduino, manipulate it any way you want and generate your own PWM signals to drive the usual RC system type of servos and controllers, or just about any other type of actuator that you can imagine.

This might take some time. Tried desoldering but didnt work. Will have to cut the solder off with a knife.

Peter: I admit that with a little bit more effort in looking on ebay or something, I might have found something cheap that would do the job but that would negate the educational experience. Miniture Electronics is something I have allways been interested in learning and this is a good oportunity for me to start.

Went back to desoldering but couldnt get an aligator clip in there as a heat sink so I might have fried the chip. Wont know till we try it I guess.

Will a 1N4148 or a 1N4004 do the job? Dont know if I have a 1N60

Just read up on attachInterrupt() and I got some idea of what its about.

int pin = 13;                   // We will want pin 8 I assume as I read from previous posts.
volatile int state = LOW;

void setup()
{
  pinMode(pin, OUTPUT);
  attachInterrupt(0, blink, RISING);            // Using interrupt 0 call blink function when rising, I think this is correct???
}

void loop()
{
  digitalWrite(pin, state);
}

void blink()
{
  state = !state;            // Does this change state from LOW to HIGH and back again???

}

OH YEAH!! I got 'hello world' by the balls...

Oh, and dont know if this is what you had in mind but I had a quick go at it. Sorry if the syntax isnt correct, I know too many languages and they tend to get mushed together, lol.

//Add code to test to see that DownTime is != 0 And UpTime != 0 and to calculate the time difference between them.

If DownTime !=0 and UpTime !=0 {
    If UpTime > DownTime then {
        Diference = UpTime - DownTime;
    }
    else {
        Diference = DownTime - UpTime;
    }
fi

state = !state;

Is a toggle, in other words if high then make low, if low then make high. You need another interrupt to capture the falling edge of the high.

Stuperfied:  state = !state;            // Does this change state from LOW to HIGH and back again???

It looks as if that is the intention, but it is not a safe way to do it. The code would work if you assume that the constant values HIGH and LOW correspond to the language defined values true and false. However, that's not a safe assumption.

There are two ways to do it:

Either make your state variable hold a boolean value (true or false) and explicitly convert that to HIGH/LOW when you write the output value:

digitalWrite(ledPin, state?HIGH:LOW);

Or do the conversion here and explicitly toggle the state variable between HIGH and LOW. I'd be inclined to use the ternary operator here, but you might find it clearer to express the logic using an if/else clause:

if(state==HIGH)
{
    state = LOW;
}
else
{
    state = HIGH;
}

1N60 not available at jaycar. Will a 1N4148 or a 1N4004 do the job?

Peter: That code came directly from the Arduino.cc language reference library.