You can't. The sensor needs to be turned on for a period of time, then turned off, and then the pins switched from output to input so that the time to receive the echo can be measured. The radio won't do that.

The art of getting good answers lies in asking good questions.

husein06

You can't. The sensor needs to be turned on for a period of time, then turned off, and then the pins switched from output to input so that the time to receive the echo can be measured. The radio won't do that.

Sorry I did not clarify, I just want it to transmit. Not receive or anything.All I want the ping)) sensor with the wireless xbee is to transmit when the xbee on the arduino tells it to.

draythomp

So, you just want to send the pulse using an XBee. I haven't used a ping sensor, so I don't have any built in prejudices, but I have a bunch of XBees. First, the XBee is 3V, so if that is enough to trigger the ping, you can hook it to a digital out pin on the XBee and set it high, then low in two different transmissions (or the other way around). The problem is that you have to be in API mode at both ends and the time the pin is high is indeterminate because you don't have full control of the time the transmissions take.

But, that doesn't appear to be what they're doing. It looks to me like they're using an XBee like a timer and taking the fact that it just turned on to send a pulse to the ultrasonic transmitter. Expensive little timer, but it may be something they had on hand. To have the XBee do this you want to look at the sleep sections of the Digi document. Just have it shut down (sleep) and turn on however often you want it to. Then find a pin to take the pulse off of and go for it. I'm supported in this by the fact there aren't two XBees in the presentation.

Oh, and you can program a series 2 XBee, but it's a total pain in the bottom. You basically replace the bootloader on the XBee with a different one of your own design and the entire XBee becomes yours; haven't done it, and it isn't documented very well. There's also a programmable XBee that is roughly an MCU connected directly to the XBee, but I know nothing about those devices.