Audio as control input

I recently bought a DFRobot Rover (My Third Arduino :D) and i would like to try to control it with an audio signal. Now before I go much further into detail I just want to say that I could easily use the standard of BT or wifi and have a robot thats essentially a copy of everything else i have found on the web, but i could litterally just copy the code from numerous instructables, and there isn't any challenge and therefore no sense of accomplishment (at least to me).

I decided that I would like my Android phone to output the audio. I have found two programs on the droid market that "sound" promising. the two programs are pwmbuddy and audio serial out, Of the two pwmbuddy seems to have a better HMI. Now the problem i am having is that I cannot find an example sketch for these programs and currently i haven't the experience or knowledge to even claim that i know where to begin. If theres anyone here that has tried a control interface like im proposing, or even just interested in another great challenge, Id be eternally grateful for the help.

For those interested in aiding this abomination, i have included the links to the programs i listed above.

Thanks for reading:) Nicholai


"audio serial out",d.aWM

i could litterally just copy the code from numerous instructables, and there isn’t any challenge and therefore no sense of accomplishment (at least to me).

I cannot find an example sketch for these programs and currently i haven’t the experience or knowledge to even claim that i know where to begin.

It strikes me as rather ironic that you want to solve the problem yourself to get a sense of achievement, but want somebody to tell you how to go about it.

If you can’t solve the whole problem yet then break it down into parts that can be solved separately, and work through them.

thank you for replying :smiley:

just to be clear, i dont want someone to write my code for me. Ill just say i have a “decent” grasp of programming with an arduino, but without an example im kinda stuck.

From what I have read both of them require the use of interupts, that is something that i haven’t ever dealt with. so theres many questions there, if you know of a good place to start with that id be much obliged.
I guess this is more just a feasibility thing. I want to try something that isn’t all that common.
My idea is to use an fm transmitter and a cheap dollar store fm radio for my control system. i know that the range will be severely limited and i do eventually plan to upgrade to a bluetooth system. (since tinkering with electronics is my favorite passtime, cost isn’t too much of a concern)


I see that those Android applications let you generated a PWM or serial data stream over the Android's audio output.

The Arduino has the capability to receive either of those, if you can find a way to get them to its input pins (and assuming the voltage levels are compatible.

I'm not clear how you're going to get them there, though. A direct wired connection may be easiest but is probably not what you want.

You mentioned FM radios. What sort of thing were you considering - an FM radio control system, or something else? To control an FM transmitter you'd need to replace the existing joystick potentiometer with something that your Android could control. I don't see how you'd do that directly, so you may be looking at Andoid -> wired connection -> Arduino -> radio connection TBD -> Arduino on 'bot. In that case you have a lot of options for ways for the two Arduinos to to communicate. What sort of range are you looking for? Would you consider doing away with the FM radio completely and carrying your serial-over-audio stream via a pair of XBee modules?

well my initial thoughts were to use a simple fm radio reciever with its output (which isn't 5 volts) coupled to a 3904 transistor to "buffer" my signal up to 5 volts. as for my transmitter i was thinking of using a simple fm transmitter for mp3 players. my audio signal would be generated by my phone ( one of the reasons i want to try this setup is i could utilize some nice "retro" equipment like an old school cassette walkman to say playthrough a prewritten set of instructions. (kindof a novelty but could be highly entertaining). as for getting the signals there, i thought of taking a 1/8th" stereo cable "hard-wired" into the arduino, that way i could debug the system easier.

setup for this would be as follows. android pwm audio >>fm transmiter>>>fm radio>>>2n3904>> arduino.

Im not opposed to using xbees instead however that would limit my hmi to either a pc or a second xbee equipped arduino. i kinda like the bluetooth idea a little more since i could use a smartphone or a pc or another bluetooth enabled arduino as my hmi.

The apps you're looking at fool the Android audio output into producing a logic level serial or PWM signal - you do not have an audio signal as such so I don;t think you will get results trying to send it over a radio link that is designed to carry audio.

XBees essentially carry a serial connection over a radio network. Given that you have [ can have ] a serial connection coming out of the Android, the solution I was suggesting was to take the serial output from the Android directly to the XBee, use the XBee to carry it to the remote XBee, and connect that into an Arduino that would receive the serial stream and do something with it. It's quite an expensive solution, but that doesn't seem to be a concern. It's not particularly conventional, is unlikely to be the easiest solution to get working or to give the best results, but that seems to be what you're angling for here. If you wanted easy you'd start with a plain old model radio control system and use it as-is, or use Bluetooth.

Now i get where your coming from with the xbees. that is pretty much what i am shooting for. your right that it wouldn't be a very cheap solution, but since i build then disassemble to rebuild better, the cost would be the same at the end. I was just trying to find a way to communicate with my robot thats unique and out of the ordinary. I think that it will work through the radio link since the reciever i intend to use does not have a output signal filter (meaning you can tune to an unused fm station and youll hear the "fuzz" unlike the newer recievers that tune out white noise) since the signal that im utilizing actually does produce an audio tone when played through speakers i think that i have a good chance to succeed. in order for this to work though i need to get it running hardwired first. one thing im not clear on is how i would tell the arduino that the first pulse is one parameter and the second pulse is another. Iread the information with software and it mentions that i need to utilize interrupts, unfortunatly im completly ignorant as to how i would go about this. just a little background so you know what level of experience your dealing with, I have my A.A.S. in robotics and automated systems, with a fair knowledge of programming on systems such as ABB, FANUC, and the Allen Bradley micrologix plc's. I could program this in ladder logic on a micrologix 1000 or even a slk 540, but these aren't cheap, and you have to purchase the programing software every year if you want to reprogram. and even though price isn't an object im not one to willingly throw away money on a programer every year.