Pages: [1]   Go Down
Author Topic: How do I read RC receiver for RC Paintball Marker?  (Read 900 times)
0 Members and 1 Guest are viewing this topic.
Wappingers Falls, NY
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am currently working on a RC paintball gun turret.  I have 2 servos controlled by a 3ch Hitec Aggressor for the tilt/pan.  I want to use the 3rd channel (intended for a gear shifter on an RC car) to shoot the gun.  

The gun is a Tippman A5 w/ egrip.  Ive already hacked the gun and can shoot it via my Arduino Duemilanove.  All I have left to do is figure out how to read the output of the Hitec receiver and convert that to something I can use (input from the 3rd channel = gun shoots).

I would greatly appreciate any help.  Thanks.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 632
Posts: 50182
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

From what I'm reading, all 3 channels are designed to operate servos. If you've got 3 wire servos on channels 1 and 2, the servo control wire on the third channel should go HIGH when you push the button, and LOW when you release it. Connect that wire to a digital pin (after verify that that is indeed it operates, and that it only outputs 5 volts), and use digitalRead to read that pin.
Logged

Wappingers Falls, NY
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the reply. Unfortunately that was the first thing I tried.  When the third channel is connected to a servo, a press of the button causes the servo to rotate 90 deg. Another press causes the servo to rotate 90 deg in the opposite direction.  When I read the signal using the analogRead() function it gives me random values unrelated to my RC input.  When I use the pulseIn() function, again I get seemingly random values independent of RC input.

I need to decode the RC receiver output but can't figure out how.    
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 632
Posts: 50182
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You could make the servo push a button...
Logged

Wappingers Falls, NY
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I thought about that but I wanted something a bit more elegant, for lack of a better term.  Surely there must be some way to have the Arduino sense a change in the RC receiver output when the 3rd channel button is pressed and then send the signal to the marker to shoot.

I wonder if the word elegant has ever been used in terms of paintball...  
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 632
Posts: 50182
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you had an oscilloscope, you could look at the signal sent to the sensor, and probably make some sense of it.

But, I'm thinking that the signal is a PWM signal switching from 0 to +5V very quickly. The duration that the signal is HIGH is what holds the servo in a particular position.

Elegant and paintball can go in the same sentence, as long as there's a not in there somewhere. smiley
Logged

Wappingers Falls, NY
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If that's the case, how would I decode the PWM signal?
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 309
Posts: 26485
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If it's not too fast:

http://arduino.cc/en/Reference/PulseIn
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Wappingers Falls, NY
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ive tried using the pulseIn() function but I don't think I know how to properly use it.

 I think I need it explained to me in terms of apples, i.e., if Bob has 0 apples and Sally gives Bob 5000 apples per second...

I've look in the Arduino Reference section and have been reading about it for days but its not making sense.
Logged

Pages: [1]   Go Up
Jump to: