Issues with recognizing a signal

Hello all,
I am attempting to send a signal to my arduino to then execute a method. Here is the issue I am currently having. The wire coming into the arduino is constantly .5 volts (or roughly that amount.. .47 to .53). The "signal" is when the voltage drops to .3 volts. I tried to measure this with a digital reader, however since the voltage goes above and below .5, the result seems to go back and forth between 0 and 1.
With an analog reader, it will read something like 20, 20, 19, 20, 500.... and when i press the button it drops to 19,18 ish, but it is hard to really tell the difference.

Any advice?

Please show us a schematic of your circuit.
A good photo of your wiring and any links to components, will get responses.

I am attempting to send a signal to my arduino to then execute a method. Here is the issue I am currently having. The wire coming into the arduino is constantly .5 volts (or roughly that amount.. .47 to .53). The "signal" is when the voltage drops to .3 volts. I tried to measure this with a digital reader, however since the voltage goes above and below .5, the result seems to go back and forth between 0 and 1.
With an analog reader, it will read something like 20, 20, 19, 20, 500.... and when i press the button it drops to 19,18 ish, but it is hard to really tell the difference.

Your method is all wrong. No doubt due to inexperience. No one with any electronics experience would try to read analog signals that small using an ADC with a resolution of 0.00488 V. If you had a 16-bit ADC it might be possible but this is not how this is done. You must first amplify the signal using an op amp non-inverting amplifier such that the voltage is higher but does not exceed 5V . By powering the op amp with 5V you can guarantee it will not exceed 5V (the max allowable voltage you can read with an arduino).

by setting the amplifer gain to 8 you can amplify the voltage to about 4V.

Use 18 k for R1 (input resistor) and 120 k for R2 (feedback resistor).
I have a feeling your circuit has other issues (and I think Larry thinks that too).
Please follow Larry's request to post the schematic and your code.

LarryD:
Please show us a schematic of your circuit.
A good photo of your wiring and any links to components, will get responses.

Will have to take pictures tomorrow, it is currently in a locked building. However I will try to describe it as best I can.

There are four parts to this circuit.
Battery / CSE
Receiver
Arduino Mega
Servo
The battery connects to the CSE, which then powers the receiver unit. The receiver unit sends out 3 wires to the mega. Power, Ground and Signal.
On the controller, when a button is pressed, the receiver will send a signal to the mega.
The signal sends .5 volts all the time, and .2 volts when the button has been pressed.
The mega then sends signals to the servo.

Battery +/- to CSE
CSE +/- to Receiver
Receiver +/-/Signal to the Mega
Mega +/-/Signal to the servo

Hopefully this is a decent description of the schematic.

raschemmel:
You are correct, I am inexperienced with both arduinos and electrical work in general. I am a software guy who has been brought into a project who has no coders and no electrical people. I can handle one part, but I obviously need help on the other.

The battery connects to the CSE, which then powers the receiver unit. The receiver unit sends out 3 wires to the mega.

What's a CSE?

Can you give a link to the receiver specs/datasheet so we can figure out what kind of "signal" this is?

With the default 5V reference 1/2 volt should be reading around 100. 0.3V should be reading about 60.

A 10-bit ADC reads 1023 at the reference (5V) and those numbers are simply proportional to 1023 at 5V.

If you switch to the optional 1.1V reference the readings should be about 5 times higher.

With an analog reader, it will read something like 20, 20, 19, 20, 500....

Does it really read 500 sometimes? That might imply the input is floating (not connected to anything). Or, maybe there is no ground reference between the signal and the Arduino.

I tried to measure this with a digital reader, however since the voltage goes above and below .5, the result seems to go back and forth between 0 and 1.

With the normal 5V power supply, anything more than 3.5 is a logic 1 (high). Anything less than 2V is a logic 0. In-between is undefined.

If it's jumping between 0 and 1 with about 1/2 volt, again the input is probably floating or there is no common ground.

Or, your "signal" is not what you think it is.

On the controller, when a button is pressed, the receiver will send a signal to the mega.
The signal sends .5 volts all the time, and .2 volts when the button has been pressed.
The mega then sends signals to the servo.

What kind of signal is the receiver sending ? Why is it so low instead of 0 to 5V digital ?
We need to know why it is going to the mega and where on the mega.

Your wrong about the receiver voltage . It is NOT 0.5 V. It is 0 to 5.0 V. You must have misunderstood the information given you. ALL RC receivers use the same PPM 5V signal protocol.
Some people call it PWM , but this is incorrect. While it is simlilar to PWM it is referred to as PPM (Pulse Position Modulation). If the signal comes from a receiver it CANNOT be measured with a VOLTMETER ! because it is a PPM signal ! Voltmeters AVERAGE voltages. If you try to measure a receiver 5V digital signal with a voltmeter it will display the voltages you mentioned but THAT IS NOT THE VOLTAGE OF THE SIGNAL !
The signal is SWITCHING FROM 0V TO 5V very fast .It is CALLED A TTL 5V SIGNAL. (REGARDLESS OF WHAT YOU METER DISPLAYS).

I am trying to get the full spec sheet from the team lead. However I do know the reciever (which then in turn sends signal to the arduino)
Its the spektrum AR6210 ---- AR6210 6-Channel DSMX Receiver (SPMAR6210): Spektrum - The Leader in Spread Spectrum Technology

I am using the AUX pins on the AR6210 to connect power/ground/signal the arduino

I am using the AUX pins on the AR6210 to connect power/ground/signal the arduino

WHY ?

Are you trying to power the arduino from the receiver or are you trying to power the receiver from the arduino ?

Recievers usually get their power from the ESC. I assume you are doing what you are doing because you have NO ESC ?

raschemmel:
What kind of signal is the receiver sending ? Why is it so low instead of 0 to 5V digital ?
We need to know why it is going to the mega and where on the mega.

Your wrong about the receiver voltage . It is NOT 0.5 V. It is 0 to 5.0 V. You must have misunderstood the information given you. ALL RC receivers use the same PPM 5V signal protocol.
Some people call it PWM , but this is incorrect. While it is simlilar to PWM it is referred to as PPM (Pulse Position Modulation). If the signal comes from a receiver it CANNOT be measured with a VOLTMETER ! because it is a PPM signal ! Voltmeters AVERAGE voltages. If you try to measure a receiver 5V digital signal with a voltmeter it will display the voltages you mentioned but THAT IS NOT THE VOLTAGE OF THE SIGNAL !
The signal is SWITCHING FROM 0V TO 5V very fast .It is CALLED A TTL 5V SIGNAL. (REGARDLESS OF WHAT YOU METER DISPLAYS).

That would make a lot of sense, can you recommend how to accurately see this with the Mega? I will obviously try to google based upon the info you've given me.

This does lead me to a question however, when I am using a press switch (0 or 5v) it works fine, however it does not work with just going from receiver to mega.

raschemmel:
WHY ?

Are you trying to power the arduino from the receiver or are you trying to power the receiver from the arduino ?

Recievers usually get their power from the ESC. I assume you are doing what you are doing because you have NO ESC ?

We do have an ESC, the ESC is powering the main motor for the prop, and powering the receiver, hence my effort to power the Mega off the receiver. (This way allows the receiver to allow send throttle signals to the main motor)

Without a schematic there is not much we can do but I can tell you that the stsndard method to read PPM signals is the PulseIn() function. ( google it:"arduino pulseIn()")

raschemmel:
Without a schematic there is not much we can do but I can tell you that the stsndard method to read PPM signals is the PulseIn() function. ( google it:"arduino pulseIn()")

Any information is helpful! I do have a question, about pulseIn() after reading the api.

As stated earlier, "The signal is SWITCHING FROM 0V TO 5V very fast .It is CALLED A TTL 5V SIGNAL"
So when reading this value using pulseIn(), would the duration be measuring the time between it "switching very fast" (frequency?)? Or would the duration be the time the button is held down?

I told you we can't answer any questions without a schematic. The button makes no sense. If you were a technician you would know how to explain the button. With no electronics experience you can't help much unless you can post a schematic.
The explanation of PulseIn() explains what it does.
Whst don't you understand ? Post a link for what you read using the LINKS toolbutton. ( chain link symbol,) This whole post is like trying to understand a child trying to explain a technical message relayed by an adult. Posting about a .02V signal because you know nothing sbout electronics of recreivers sends the thead spinning off in the wrong direction . Is there anyone there who knows how to explain what you are doing ?
If not, we can't help without a schematic. There's probably a simple explanation for the "button" but so far it is not forthcoming. We want to help but when tge information you give us is garbage ( 0.2V signal comes from receiver when actually it is "servo signal" ) it is very hard to help because it is like talking to primitive natives about a cell phone.

Post a schematic so we can untangle this mess.
I don't want to waste any more time trying to decypher nonsense.

Case in point (DvdDoug), OP referring to somrthing called the "CSE" when actually he is trying to say ESC !

Somebody PLEASE tell the OP you CAN'T read a PPM SERVO SIGNAL using analogRead !!!!!!!

PODT YOUR CODE AND SCHEMATIC

raschemmel:
I told you we can't answer any questions without a schematic. The button makes no sense. If you were a technician you would know how to explain the button. With no electronics experience you can't help much unless you can post a schematic.
The explanation of PulseIn() explains what it does.
Whst don't you understand ? Post a link for what you read using the LINKS toolbutton. ( chain link symbol,) This whole post is like trying to understand a child trying to explain a technical message relayed by an adult. Posting about a .02V signal because you know nothing sbout electronics of recreivers sends the thead spinning off in the wrong direction . Is there anyone there who knows how to explain what you are doing ?
If not, we can't help without a schematic. There's probably a simple explanation for the "button" but so far it is not forthcoming. We want to help but when tge information you give us is garbage ( 0.2V signal comes from receiver when actually it is "servo signal" ) it is very hard to help because it is like talking to primitive natives about a cell phone.

Post a schematic so we can untangle this mess.
I don't want to waste any more time trying to decypher nonsense.

Case in point (DvdDoug), OP referring to somrthing called the "CSE" when actually he is trying to say ESC ! ( primitive savages tryng to describe a cell phone)

I stated that I am not an electronics person. I am trying to learn, and piece things together. I understand it can be frustrating to try and help someone like me who does not understand. I am not forcing you to help me and I am trying to get answers to the questions you have asked me back. I don't see my inexperience in this particular field as a reason to insult me. I am just trying to understand something that is completely new to me.

The comment about savages is not meant literally. It's obviously an exageration. It's the same concept. For you to post about a receiver signal issue because you have no clue about receiver signals ( or ucontrollers) is essentially the same thing as the analogy. You should have started your post by being honest and telling us you have no clue WHAT KIND OF SIGNAL COMES OUT OF A RECEIVER or HOW to measure it. Instead, you post "as if " you where haviing "signal issues" when in fact the issue was you have no business messing around with this technology until you learn the basics.. What are you doing with this equipment anyway if you have no clue how it works ? How did you wind up in possession of it ?

I'm not insulting you. I am stating a fact.
Post the code and a schematic.

Is there no one else we can talk to ?

I think you are in over your head. You lack the basic knowledge to complete this project.

1- you're using an ESC , telling us it is a CSE.
2- your connecting a PPM signal to an analog pin and trying to read it as an analog signal.
3- I asked you to google PulseIn and your asking me about the frequency.

You need to start convincing me there is some chance you are going to get a handle on this situation because right now it's looking a lot like a trainwreck. Nothing you have said has been correct. It has taken me this long to figure out that if I listen to you all I will get is nonsense because while you are trying, you are not even in the right ball park. You don't know analog from digital. How are we supposed to communicate ?
Electronics is a language, like English or Spanish but you don't speak Electronics. How am I supposed to communicate ? You need to learn electronics before attempting a project like this.
I suggest you start with the Blink Example.
If you post the code and schematic we'll see if we can get to the bottom of this.

The whole premise of this forum is you ask a question and we answer it. If all we get is bad Intel then garbage in, garbage out. If you don't know what a receiver does then you need to learn that before trying to use one. Is there not a reasonable expectation that if you are using a receiver that you know something about it ? Who designed
this project ? How did you get it and why do you think you can pick up a piece of complex equipment you don't understand and post on the forum expecting us to bridge a gap in understanding the size of the Grand Canyon ? If you had started by telling us you don't know HOW to connect a receiver to an arduino it would have been different but not necessarily practical. You need to find out where you belong in the learning curve . If your at Blink a led level , does it make sense to ask us why a mega can't read a receiver connected to an analog input ? At what point will you admit this project is too advanced for you ?

How can we help someone who is not honest enough to say " I've never done this before. I don't know what I am doing. I don't know if anything is connected correctly, I don't know what to look for and I don't even know if the code is vaguely correct ?

Reread your initial post.

Did you bother to mention you don't know electronics, don't have a clue what you are doing, where to connect anything , how anything works , the difference between analog and digital,or how to write the code ? Did you mention that you have never connected a receiver to an arduino before and ask us HOW to do that ? Did you mention that you didn't even know WHAT KIND OF SIGNAL comes from the receiver ?

Did you mention that ? Don't you think we would need to know that to help you ?

Did it occur to you Google "RC receiver output signals"

If you scroll down that list of links you'll find this

Note: It recommends using interupts instead of PulseIn()

Sparkfun has a tutorial here

I would recommend this tutorial

Rob, it's a given that first-time posters here are very low on the scale of electronics knowledge. You don't really need to ask. And don't abuse them for not telling us that - they know so little, they don't even know what they don't know.

However, the OP's refusal to give a schematic is also confusing. Maybe it's time to lock this thread?

Rob, it's a given that first-time posters here are very low on the scale of electronics knowledge. You don't really need to ask. And don't abuse them for not telling us that - they know so little, they don't even know what they don't know.

I agree with you to some extend but I don't agree that they don't know that when they are doing something they have never done before that they don't know that they don't know. Obviously someone on the OP's team made a wrong assumption that the receiver output is analog but not having any experience with receivers does not excuse the OP from revealing that fact. His post would have been a slam dunk if he had started it with:

"Hi, I need to interface an RC receiver to an arduino. Never done that. Can you tell me how to go about this ?"

I feel that anyone who has a clear awareness of lack of knowledge of how to perform a task is obligated to disclose this in their first post. How would WE possibly know how he hooked it up except for the fact that he was using the words "receiver" and "analog " in the same paragraph ?

MorganS:
You don't really need to ask.

But then he doesnt get to massage his ego.

Wasn't the whole point of Arduino to introduce n00bs to electronics?,

MorganS:
Maybe it's time to lock this thread?

Its time after time, thread after thread yet hes just allowed to crack on, I wonder what the Arduino creators think about him constantly abusing n00bs? Do they even care?

It gets mentioned on other forums

All I can say about the Arduino forum is there are helpful people but also there are definitely a significant number of a#*holes. I can only guess those ones are wannabes

Surely this isn't what we want people to say?

You don't really need to ask.

I disagree. I think Noobs have an obligation to disclose inexperience in their original post, especially if they are attempting a task they have never done before using technology they have no knowledge of or experience with. Resinator , (with his all of 4 karma points in 5 years) doesn't care because he has never really gone the distance on a difficult long thread. It's stupid to think that we should assume every noob is an idiot with no experience whatsoever or that he shouldn't disclose his inexperience because it might embarrass him.
If they come here asking for help I think it is perfectly reasonable to expect them to disclose when they have no clue. Otherwise we would wind up playing 20 questions on every post.

All I can say about the Arduino forum is there are helpful people but also there are definitely a significant number of a#*holes. I can only guess those ones are wannabes

We get those too. We have people who are wannabe members who never help anyone and only criticize those who do.