Let's Make Robots!

Remote Control Can Talk to a Picaxe

Takes servo outputs and sticks them in a Picaxe

I had asked in a forum post if a picaxe could "read" a servo output comming from another source... Thanks to the OddBot, as he nailed it. By the way, O.B. I simply ran the receiver off the same 5V supply I was using for the Picaxe board --No resistor bridge needed, everyone was happy with the same 5 volts. Here is the original post.

 

In this case I am using a VEX brand transmitter, but understand, really it is exactly the same as a RC car or model airplane transmitter --All outputs from the receiver are for servos.

I was really quite surprised at how easily this is done. I simply connected the data wire and ground from the receiver servo connector to a digital input pin of the picaxe. I skipped the positive wires, all that is needed is the one data wire and for the grounds to be tied together. Also, on the board, I have a 10K pull-down resistor tied to the input. (I don't know if this is needed or not)

Now for the even easier part!!! (The code I used in the video)

main:

pulsin 5,1,w1

pwmout 1,63,w1

low 0

goto main

That's it! --Really. Using the pulsin command simply sticks a number in to the word variable between 0 and 255 in relation to where the stick on the transmitter is. 

So there you go, folks... It works, its simple and if you buy one of those huge controllers with all the extra switches and buttons and the LCD and all, you will just look that much cooler!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
can you send i2c information through one of the digital buttons of the remote?
I came accross this in one of my zines I read, the whole transmitter/reciever is $30.00 there, not too shabby. It's the exact same as the one you've used here :)

I been working on something like this for the past few months, got a 4 channels RC and trying to hookup together with pic16f84.

Can the code use on this PIC16f84. 

 

 

Lab-tech.blogspot.com

a-tech.deviantart.com

Here's some bits I found and remember about the Vex stuff, pretty cool system. The transmitter and reciever is available new from a number of places for about $130 retail, but the reciever part is actually just a little yellow box that plugs into the silver rounded box that CtC was working with. Inside the silver rounded box are 2 PICs that decode the reciever signal to make the RC servo drive pulses, having the whole system operate in a similar fashion to the normal RC reciever does, as CtC pointed out in the video. That rounded silver control system can be reprogrammed to do other fun things as well, using a special programming cable and I think a Light version of MPLab, though I could be mistaken on the software. Anyway, the Vex Microcontroller runs about $150 by itself, adding up to $280 retail to get a similar setup with just the electronic bits. 

http://www.trossenrobotics.com/store/p/3134-VEX-Transmitter-and-Receiver-Add-on-Kit.aspx   trans/rec only

http://www.trossenrobotics.com/store/p/5676-VEX-Micro-Controller.aspx    Microcontroller

Alternatively, there are some surplus Vex transmitter/reciever sets on sale for a whole $30.

https://www.allelectronics.com/index.php?&page=item&id=JS-6&index=1

http://www.mpja.com/prodinfo.asp?number=17044+MI

Some feedback about the transmitter says that a CirrusMRX-6 reciever can directly convert the PPM signal to RC servo ouputs, without the need for a decoding micro, as long as you use the Vex reciever crystal in the MRX-6. This seems to be a bit difficult to find, but think it ranges between $22 and $30

http://www.hobbypeople.net/gallery/443536.asp

Some info about just the transmitter/receiver combo:

How to decode the receiver signals with the Parallax SX/B  http://www.allelectronics.com/mas_assets//spec/JS-6.pdf

How to decode it with an AVR  http://frank.circleofcurrent.com/vexrx.php

How to decode it with an Arduino  http://profmason.com/?s=reciever

 

 Edit to add: Vex Signal Splitter $19.99, splits out pulses to 6 servo channels

Some info on the picaxe forums delving into this topic.

http://www.picaxeforum.co.uk/showthread.php?t=10033&highlight=pulsout+servo

Been thinking about this, the transmitters for the cheap analog RC systems are really a basic AM transmitter with the stick/pots just varying the width of the pulses in a simple oscillator. It should be relatively easy to hack these, especially if you can find a schematic for the transmitter.

With BOA's idea, because a servo may misbehave if it gets signals outside of the normal range you'll need to have your pic reading the signals from the reciever and then generating valid signals to keep the servo happy while decoding the no-valid signals for additional funtions.

With Rik's idea, sending data, that could be even easier by simply setting up a pic in the transmitter to bypass the stick and send the equivalent of the servo fully clockwise or counterclockwise to represent one's and zero's and values inbetween as normal servo positioning commands. The baud rate would be slow but good enough for most things.

Hmmm.. combine these two ideas, have a pic in your transmitter with the sticks and additional controls connected to it. The stick positions are converted to normal RC pulses, data and other additional controls are converted to serial commands with pulse widths 2.3-2.5ms being ones and 0.5-0.7ms are zeros. I would not go beyond these values to allow for drift in the analog circuitry. The pic connected to the receiver passes on normal RC signals to the servos while decoding the serial data for additional controls/data.

For those of us using picaxes the basic (according to the manual) does allow both pulsin/pulsout command to funtion with the servo command. I mention this because some commands like serin/serout/pwm etc. use the same timing resources as the servo command.

If none of this makes sense then it's because I just woke up, it's early and I'm on my first coffee.

In terms of a data stream from the transmitter, I think it is just a pot inside... It has little springs to return it to center, but really just a pot. I am sure there are many ways to substitute the pot for something else spitting out a given resistance.
Sure is, just use buttons that the axe can see as an input. send a puls signal based on this button. This could allow for quite a few signals to be sent out from the radio.

Nice. Pretty cool that the PWM input is provided for you in BASIC.

Now, you've got a 4 channel system there, which is pretty good, but poor folks like me can only afford 2 channel kit. So, in my RISC assembly implementation (I time the length of the pulse in microseconds, with the result being approximately in the range 900 to 2200), values below 1550 have a different function to tose above 1550.

So, if I push the stick forward, for example, the vehicle goes forward, but if I pull it back, this toggles the headlights on and off. 2 functions per channel!

I'm starting to wonder if a data stream could be sent from the transmitter to teh receiver, where a pic would control the pulse width at the transmitter end...

to hack an RC controller into a serial data transmitter? Hoping to find a way to encode (up to) 256 different messages over one channel?

that would be clever and useful at the same time!