Advanced search FAQ Register Login

It is currently Mon Jan 22, 2018 1:34 am

 

Postby mavricmavric » Mon Oct 12, 2015 8:48 pm

I'm currently building a droid and some of the functions are controlled by my Pi2. What I was looking at doing is using my Spektrum 6200 radio-controlled receiver to start and stop a python script.
The receiver, on each channel, has 3 wires, a positive, a negative and a signal wire. Not sure what voltage, if any, the signal wire carries, but would it be as simple as connecting the 3 wires from the receiver to the 5v, GND and a selected GPIO pin on the Pi and have the script run when that specific GPIO pin is high?

mavricmavric
n00b

Posts: 3

Joined: Mon Oct 12, 2015 8:32 pm

Postby Dave » Tue Oct 13, 2015 9:03 am

I doubt it'll be that simple.

I've had a quick look on the net to see what sort of data is transferred on that wire but couldn't find anything. Probably digital data which you'd need some sort of software designed for the Pi to be able to read it. That is a complete guess though.

Maybe someone else has better knowledge of this?

Dave
ModMyPi

User avatar

Posts: 2078

Joined: Wed Jul 22, 2015 11:36 am

Forum Administrator & Technical Support

Postby Jake » Tue Oct 13, 2015 10:27 am

Measure the voltage of the signal wire - you should be able to use it as a dummy input, as long as it's 3.3V. If it's 5V, you could always shift it with a logic converter - http://www.modmypi.com/raspberry-pi/bre ... converter/

Jake
ModMyPi

User avatar

Posts: 1396

Joined: Thu Aug 27, 2015 3:57 pm

Forum Administrator & Technical Support

Postby BMS Doug » Tue Oct 13, 2015 10:50 am

If its standard radio control gear then it will be a standard servo signal. you won't be able to accurately measure the voltage with a multi-meter (turning on and off too quickly) but it'll probably be between 0.3V and 0.7V less than the positive.

Receivers usually need 5V to operate (you can test it at 3V3 and see if it works, don't be surprised if it becomes unreliable).
If connecting positive to 5V then use a voltage divider or logic level converter to drop the signal down to 3V3 before connecting to your GPIO.

You will be getting a PWM signal from the receiver at a 50Hz frequency (20mS) the pulses should range from 1.0 mS long (full reverse) through 1.5mS (Neutral) to 2.0mS (full forward).

BMS Doug
31337

Posts: 273

Joined: Tue Sep 08, 2015 3:55 pm

Location: London

Doug.

Volunteer Moderator.

Postby Dave » Tue Oct 13, 2015 12:11 pm

D'oh, completely missed the part that said "on each channel" thought it was 1 wire to control 6 servos!!

Yeah guess it would just be a PWM signal.

Think you should be able to read the voltage using a multi-meter as you'll read the "average" voltage.

Dave
ModMyPi

User avatar

Posts: 2078

Joined: Wed Jul 22, 2015 11:36 am

Forum Administrator & Technical Support

Postby AstroDesigns » Tue Oct 13, 2015 12:43 pm

One thing that might work, two actually...
First make sure it's reduced to 3.3V for the Pi's GPIO...

1) Configure two interrupts on the Pi to trigger a script to measure time on both the rising edge and the falling edge of your PWM signal. If the Pi is quick enough (it should be...) and the code is efficient enough (that's the bit I'm not to sure about with Python...) the you could take the difference between the two times to determine the approximate pulse width and use that to trigger your script. A bit wacky but it may work...

2) I'm a bit rusty here, it's been over 20 years since I last used one but I think you could use a 555 timer to detect if the pulse goes above or below a particular width. It'll need some careful setup using some resistors & a capacitor but I have a gut feeling that might do the job...

3) I could recommend using a not-too-well-known add-on board for the Pi that can accept PWM inputs and turn them into numbers but i haven't quite finished it yet ;)

Hope that helps :)

Mark

AstroDesigns
n00b

Posts: 1

Joined: Tue Oct 13, 2015 9:25 am

Postby BMS Doug » Tue Oct 13, 2015 2:39 pm

if the peak voltage is too much higher than 3v3 then it could kill the GPIO it's connected to. safest to use a level converter or voltage divider before connecting it to a Pi GPIO.

BMS Doug
31337

Posts: 273

Joined: Tue Sep 08, 2015 3:55 pm

Location: London

Doug.

Volunteer Moderator.

Postby mavricmavric » Tue Oct 13, 2015 8:24 pm

Thanks for all the replies guys but I think we may need to go back to the drawing board with this one. I connected the receiver to a 5v supply and checked the voltage between the ground and signal wires on one channel and it fluctuates between 0.18v (throttle down) to 0.3v (throttle up), not quite what I would have liked.
Any other suggestions on how we can resolve this?

mavricmavric
n00b

Posts: 3

Joined: Mon Oct 12, 2015 8:32 pm

Postby Jake » Wed Oct 14, 2015 2:56 pm

AstroDesign's add on board sounds like a the easiest solution ;)

Could you use a transistor to act as a switch for a 3.3V line?

http://www.allaboutcircuits.com/textboo ... ansistors/

I don't know if 0.3V is enough to trigger a transistor, but there must be one out there. . .

Jake
ModMyPi

User avatar

Posts: 1396

Joined: Thu Aug 27, 2015 3:57 pm

Forum Administrator & Technical Support

Postby mavricmavric » Thu Oct 15, 2015 1:46 pm

Thanks Guys, I'll go down the transistor route and see if the 0.3v is enough to trigger it, hopefully.

mavricmavric
n00b

Posts: 3

Joined: Mon Oct 12, 2015 8:32 pm

Next

Who is online

Users browsing this forum: No registered users and 1 guest

Board index

The teamDelete all board cookies • All times are UTC [ DST ]