Remote Control Using XBEE and PICAXE 40X2


Here are my main obstacles:

  • What is the circuit used for a programming interface for a PICAXE 40X2 that uses the audio jack? *accomplished
  • What is the PIN connections that I make from the XBEE to the PICAXE 40X2?
  • How do I create a program that computer controls the picaxe (Commands used for communication)
  • Is it possible to use keys on the keyboard (ie an arrow key) to make the picaxe run a command? *accomplished
  • What is the pin connection I would make for the PICAXE 40X2 to the APC220 (433MHZ module)

Here is the XBEE kit I was considering

http://www.jameco.com/webapp/wcs/stores/servlet/Product_10001_10001_2171225_-1

Here is the 433MHZ module I will be using:

http://dx.com/p/arduino-apc220-wireless-rf-modules-w-antennas-usb-converter-143011?utm_source=GoogleShoppingUS&utm_medium=CPC&utm_content=143011&utm_campaign=Arduino%20&gclid=CL7UvsON07YCFYMWMgodbkMAJw


Alrighty, I have decided to go with 434 MHZ and 315 MHZ recievers and transmitter so 2 way transmissions are possible. I also have decided to scrap the whole entire computer and take use of the KBIN command, therefore I will only be hooking up keyboard(s) to a picaxe unit (multicore PICAXE processor haha) which will transmit the data gathered from the keyboard(s) and other inputs to another picaxe unit.

*note: Keyboard(s) will be hooked up to each chip in the transmitter picaxe unit. Each keyboard will have its own variable so u can theoretially have an infinite number of inputs. however, I am planning a more of a Pilot, Copilot scenario.

This is the RF equipment I plan on using:

  • https://solarbotics.com/product/50608/
  • https://solarbotics.com/product/50606/
  • https://solarbotics.com/product/50604/
  • https://solarbotics.com/product/50602/

I will answer some of your questions.

  • The programming circuit for PICAXE chips is found in manual 1.
  • TX/RX + pwr and gnd should be all that is needed.
  • There are any number of serial comm programs that can be adopted to do what you want to do.
  • Keyboard keys all have ASCII equivalents. That being said, any keypress can be sent over the connection, and, used for remote control.

Thanks

Okay I really appreciate the programming circuite :D. I decided to scrap XBEE for 433MHZ after being persauded by an LMRian. haha I think I am going to use this http://dx.com/p/arduino-apc220-wireless-rf-modules-w-antennas-usb-converter-143011?utm_source=GoogleShoppingUS&utm_medium=CPC&utm_content=143011&utm_campaign=Arduino%20&gclid=CL7UvsON07YCFYMWMgodbkMAJw

 

Manual.

  • Serial
  • serin
  • serout
  • hserin
  • hserout
  • hsersetup

Got one!

Pin connectioins

  • APC220 (RX) connects to PICAXE (SERIN and hSERIN)
  • APC220 (TX) connects to PICAXE (SEROUT and hSEROUT)

Major question completed!

Thanks

hmmm after researching the manual, would the SERIN command be replaced with the SERRXD command since I would have everything hooked up to the programming pin (Serial In)? Same for the serout as well? Perhaps using the programming pin would be a bad idea for R/C application because of the long wait period :confused: what pins would be avialable for the SERIN/SEROUT commands if i were to not use the Serial in/Serial out programming pins?

I have devided that for this r/c application it would be easiest to just send variables based on ACII across the link and use IF commands based on the value of the variable sent to the PICAXE.

example algorithm

do

IF b.0 = 0 then

high 8

endif

IF b.0 = 1 then

low 8

endif

loop

the value of one was sent to the PICAXE so pin eight would be connected to the positive terminal.

Commands

I believe I can use Kbin or the Keyin command to get values for the variable I will be sending to the picaxe

KBIN

hmmm it seems that the KBIN Command only works to a keyboard that is directly connected to the picaxe. Is there any way to get the ACII code form the keyboard off of my computer (programming keyboard) that is not directly connected to my picaxe?

From shoutbox

Ok, we need to simplify a bit here. The first place to start is with the Picaxe Terminal (NOT the debug window). This terminal (and really all terminals) let you send data to and from your computer. Anything sent from the picaxe shows up as text in the window, and you have a small box where you can enter characters to be sent. This terminal uses the sertxd and serrxd commands and the “headphone jack” connection. Here is what I would do:

  • Start by sending data from the picaxe to the computer --this is easier and will let you know your connection is correct and at the correct baud.
  • Write a program that sends out a simple count 1…2…3…4… via the sertxd command --Open the terminal window and confirm that you are seeeing your count. Use a 1 second pause so you can actually see the numbers as they are being sent
  • Once you have confirmed this works, you can move on to doing this the other way
  • Start with one character only. Generally, folks send an “A”.
  • Write a program that simply waits for an “A” to arrive (via serrxd) and blink an LED when it does
  • Move on to sending 2 (or more) bytes
  • Learn about using qualifiers
  • Move on to the hser commands and learn how to buffer in the background
  • finally learn Processing so you can write a desktop app to control your robot.

Keyboard control

Perhaps I can use a picaxe 08M2 to interpret a keyboard that is directly connected to the picaxe 08M2 using the KBIN command. The PICAXE 08M2 can then relay the information wirelesly using the SERTXD command to communicate which button was pressed on the keyboard with the PICAXE 40X2 which would be using the SERRXD command to interpret the data from the PICAXE 08M2.

I don’t think I follow

What would be the goal or advantage to doing this KBIN thing?

Also, why are you stuck on this KBIN thing? --It really will not help you with learning serial comms.

Advantage

I would be able to get rid of the computer and it would be replaced with another picaxe. this picaxe would be connected to a keyboard and would communicate via its SERIN and SEROUT ports with a different picaxe that reacts to the data it recieves from the picaxe that is connected to the keyboard. I was also thinking of linking together multiple picaxes together via the SERIN SEROUT ports so the processing and reaction speed would be faster.

 

Doesn’t have to be a keyboard

So, at the end of the day, we are talking about getting two (or more) picaxe chips to talk to each other. One of these picaxe chips will have an input device of some kind and, after accepting data from this device, will transmit that data to the other picaxe chips. 

Awesome.

Now, we have to ask what the end-goal is. I can assume that you are going to want to do some kind of remote control drive. If so, it would simply make more sense to use a joystick on the picaxe instead of hitting AWSD or the arrow keys on the keyboard. On the other hand, the keyboard gives you a ton of “input buttons”, so if you are controlling a lot of momentary (or “toggled”) things, the keyboard might be just the ticket. --Just curious what you are doing with this, there might be simpler ways of doing things.

Joystick and answers

The idea that I have is creating a robot that is used for simple mining (like in a sandbox). It would have two arms, one with a gripper and one with an auger. I was actuallying thinking of using joysticks for the two arms, but i thought of using a pc mouses or is it mice? but I think that a joystick would be easier. also I was thinking about using potentiometer knobs (for gripper, motor speeds) as well. However, when it all comes down, like you said, a keyboard has more than enough inputs and everything being accomplished with the extra “hardware” can be simply accomplished by using a keyboard. So I will stick with the keyboard idea for now, but the nice thing is I will design it so it will be easy to add extra hardware (ex potentiometers, pushbuttons, etc.)

Helpful Link

http://winavr.scienceprog.com/example-avr-projects/running-tx433-and-rx433-rf-modules-with-avr-microcontrollers.html

This is just an example of how to wire the RF equipment to a microcontroller

Did you make it?? Even I am
Did you make it?? Even I am tring to do the same thing. I want to make a remote controlled car using picaxe.