Go Down

Topic: Xbee Outputting Help (Read 1 time) previous topic - next topic

New-Kid

COMPLETE NEWBIE
You can ignore the commented portion if you're in a rush.
/*
*My current project is to make a robot arm mounted to moving chassis and controlled through a master slave *system, The chassis is complete and all that is left is the master slave system for the arm, and the building of *the arm.
*
*The slave of the system will consist of four potentiometers attached to a moving frame. The potentiometers *will be placed to allow for four degrees of rotation. The first potentiometer will be placed at the base of the *arm and will servo as a sort of a shoulder, allowing for horizontal rotation. Two other potentiometers will be *placed on the arm to serve as elbows and wrists, changing the vertical positioning of the arm. The last of the *potentiometers will be used to control the opening and closing of a claw on the front.
*/

ACTUAL PROBLEM:
I am going to be using a pair of Xbees to read 4 analog potentiometers and transmit the values to an Arduino, where they will be used to control several servos.

My system will consist of an Xbee S2 on the master side and an Xbee S2 and Arduino Uno on the slave side. My four potentiometers (5v, 10k, rotary) will be wired to 4 of the 6 analog inputs on the master S2. This is when things get confusing. Because the recieving S2 cannot output analog values and only has 2 PWM output, I'm in a bit of a plight because I won't be able to read the values using an Arduino. The only solution I see to this is using the Rx and Tx pins to serially interface with the receiving S2. Here, I need to read the 4 potentiometer analog values uniquely.

To summarize my questions:
1. Will reading the analog values through serial work? Are there any other methods of achieving the exchange?
2. What is the basic framework for this method if it is feasible (i.e. what libraries should I use)?

Please question me further if you find this confusing in any way or require more information.

Help much appreciated.

PaulS

Quote
My system will consist of an Xbee S2 on the master side and an Xbee S2 and Arduino Uno on the slave side.

Why use mesh network models for point to point communication?

Quote
Because the recieving S2 cannot output analog values and only has 2 PWM output, I'm in a bit of a plight because I won't be able to read the values using an Arduino.

If the XBee is supposed to be controlling things, what is the Arduino doing? Since the Arduino is more capable, in terms of controlling the hardware, it seems to me that the XBee on the Arduino should be doing nothing more than receiving data over the air, and passing it on to the Arduino.

Quote
1. Will reading the analog values through serial work?

Of course.

Quote
Are there any other methods of achieving the exchange?

What other methods do you need?

Quote
2. What is the basic framework for this method if it is feasible (i.e. what libraries should I use)?

Andrew Rapp's XBee library.
The art of getting good answers lies in asking good questions.

New-Kid

#2
Jan 13, 2014, 08:55 pm Last Edit: Jan 13, 2014, 08:58 pm by New-Kid Reason: 1
Quote
Why use mesh network models for point to point communication?

I am using Xbees to pass values from point A to B wirelessly, and see no other way of doing this. Do you know of another (cheaper?) way to pass points from point A to B wirelessly that doesn't use Xbees. If so, I'd entertaining the possibility of using them.

Quote
If the XBee is supposed to be controlling things, what is the Arduino doing?

I am using the Arduino to accept my values, originating in my potentiometers, mapping the values down, and sending them to servos.

Quote
...it seems to me that the XBee on the Arduino should be doing nothing more than receiving data over the air, and passing it on to the Arduino.

That is where my problem stands in this project. I am unsure of how to pass the four analog values from the receiving Xbee to the Arduino.

Quote
1. Will reading the analog values through serial work?
Of course.

I am quite unsure as to how to read the values once they pass through serial. From what I gather packets of data are sent through serial with all of the information needed. Two bytes are sent for every analog value. The problem is that I have 4 analog values and don't have any way of differentiating them as they pass through serial. Th only logical system I can think of is that the analog values come in an order, but if they do come in an order, do they come in the same order every time (i.e. Run 1: Analog 3, Analog 1, Analog 0, Analog 2; Run 2: Analog 1, Analog 2, Analog 0, Analog 3). In this scenario is paramount that the values are assigned to the correct variables, or the values will be given to the wrong servos.

Please question me further if you find this confusing in any way or require more information.

Help much appreciated.

PaulS

Quote
I am using Xbees to pass values from point A to B wirelessly, and see no other way of doing this. Do you know of another (cheaper?) way to pass points from point A to B wirelessly that doesn't use Xbees. If so, I'd entertaining the possibility of using them.

There are two kinds of XBee - mesh network models and point to point models. Using mesh network models to do point to point communication is possible, but nowhere near as easy as using the point to point models.

Quote
I am unsure of how to pass the four analog values from the receiving Xbee to the Arduino.

It's serial data. The XBee will simply put the data it gets on the serial port pins (whichever pins it is connected to).

Quote
The problem is that I have 4 analog values and don't have any way of differentiating them as they pass through serial.

All 4 values will be in each packet. In the correct order.
The art of getting good answers lies in asking good questions.

New-Kid

#4
Jan 14, 2014, 10:26 pm Last Edit: Jan 15, 2014, 09:34 pm by New-Kid Reason: 1
Quote
All 4 values will be in each packet. In the correct order.

Great, that's was my essential questions with a bit of salt on top. Thank You for the help, this will most certainly make my project much more clear.

Go Up