XBEE how does it work?

Today I discovered the XBEE and since I play with RC cars I asked myself how it works.

Can I make a panel with a joystick, potmeters and so on and control my car with it? I would need one Arduino board with a XBEE on it and another XBEE in my car. Or do I also need another Arduino board in my car?

It would be nice if I could use the remote XBEE to give the PWM signals to the car and give sensor data (if applicable) back to the base where it can be processed and be turned into steering commands if needed. This way a second board isn't necessary. (it would be a wireless extension of my Arduino pins)

Leo

Today I discovered the XBEE and .. I asked myself how it works.

60 seconds google: (some are theroy other more practical)

As it happens I'm just playing with an arduino/xbee controlled car. Mine was not originally radio controlled so the arduino is driving the motors through a motor driver board. On the car are the xbee, arduino, motor driver board and a couple of ultrasonic ranging sensors.

The car is meant to be autonomous so the xbee is just sending sensor data back to a terminal screen and test commands to the on-board arduino. If you were going for remote control it's possible that the processor in the xbee could do it all.

You need two Xbee modules - always. One for sending and one for receiving.

As the XBees are clever, you don't actually need an arduino on one end. They have digital (and analog) pins which you can poll for changes and send via the wireless link (i.e. your controller could just contain an XBee, battery and buttons).

Most people use an arduino on both ends as it's easy and you can do more with it then but it is not always necessary.

It would be nice if I could use the remote XBEE to give the PWM signals to the car and give sensor data (if applicable) back to the base where it can be processed and be turned into steering commands if needed. This way a second board isn't necessary.

I'm not quite sure what the limits of the basic XBee i/o protocol is but I you would at least need a motor driver board on the other end so you might as well stick a cheap ATtiny chip on there too.

Mowcius

Ok, thanks. Would it be possible to keep the Arduino in the controller so it won’t be bashed around in the car?
The XBEE in the car would only have to give PWM signals to the servos and controller and send back info from sensors or maybe other things.

I would like to extend the Arduino pins wirelessly.

Ok, thanks. Would it be possible to keep the Arduino in the controller so it won't be bashed around in the car?

What exactly do you mean?

I would like to have an Arduino in the controller (stationary) with an XBEE on top.

In my car I only want an XBEE, battery, esc, motor and servo and maybe sensors (have to think of a use for sensors)

Can I use the XBEE in the car to generate the PWM signals for the servos and motor and send back data from the sensors to the controller?

The Arduino in the controller can process the sensor data and send new PWM commands to the car.

Hmm, not sure about the pulses for the servo(s) and motor. The sensor data you can do. I think you would probably be best off sticking another microcontroller in the car. You can buy cheap bare bones boards which would do the job nicely. Depending on the intended speed of the car, the XBee may not be a good option due to latency.

Mowcius

Thanks, didn’t think about latency. I was thinking about an Emaxx type vehicle with an aluminum/plastic sheet on top to put all the stuff on.

Getting somewhere however would be more important than getting there fast. (fortunately in this case)

There is no real goal in building the car other than learning from it.

I made a mistake in my previous post. I meant the esc has to receive a PWM signal from the XBEE/board like the servos do.

(I’m getting there slowely, tonight I managed to make a walking string of 8 leds with a potentiometer :))

I meant the esc has to receive a PWM signal from the XBEE/board like the servos do.

You can't get an XBEE to feed PWM into an esc, it simply will not go fast enough. You will have to have a processor that takes a number from the XBEE and converts it into a PWM signal. It will keep on sending that PWM value until the XBEE gives it another value to set the PWM to.

Ok thanks,

That's a good reason to buy me an Arduino Uno :).

You can’t get an XBEE to feed PWM into an esc, it simply will not go fast enough. You will have to have a processor that takes a number from the XBEE and converts it into a PWM signal. It will keep on sending that PWM value until the XBEE gives it another value to set the PWM to.

Well it can also be “way too fast” in the sense that it is possible to program the other end XBee to generate PWM signals but the period is typically way too high frequency (microseconds) at least for regular RC servos that typically need appr a 50 Hz cycle or so.

Those excellent tutorials explain that an XBee can be programmed from another XBee to set or return the status of its pins. What you want to have happen can be remote controlled from the other end.
So if there is no additional Arduino board locally, then there is no local autonomous control logic, decisions must be made at the remote end and have take effect by programming IO pins of the opposite end XBee.

In contrast there exist a fun asian module, the RFBee, which makes use of just about the same pinout as XBee, features a simpler radio transceiver, but instead of the extensive “remote control” AT command set of an XBee it allows the user to reflash its internal ATMega168 with user extended versions of its open source firmware, and thus extend the serial functionality with whatever local Arduino IO control operations that can apply to the mapped IO pins. About 30% of flash memory is free for additional code. I figure that particular module could be programmed to generate servo friendly PWM using timer interrupts in addition to functioning as a basic serial radio bee. But again that´s not an XBee, basically only has the same pinout as one.