Share headphones with iPod and Tx/Rx

Link to the Flow Chart as it makes the problem self explanatory

I am wanting to learn how to use the Arduio and am hoping to make a project that can be a real benefit to my life instead of just a flashing diode ("hello world")

I have looked over this site I suspect this project is within the Arduino's scope, but wanted you gurus to first give me the thumbs up, as it would be very discouraging if my project proved to be beyond the scope of the Arduino's abilities.

In summary Question to the guru's:

  1. after looking at attached flowchart is this project within the Arduino's scope of abilities?

edit: sorry just realized this should have been posted in the Hardwar>Interfacing section (my bad! :-[)

Not a guru by any means, but your flow chart shows very logically what you want and the Arduino certainly has the means to execute the logic (enough memory, enough speed, etc). The Arduino would seem to have enough inputs and outputs to handle the tasks also. What is not clear is how much external circuitry will be required to interface the various inputs and outputs.

Switching audio sources between the various sound generators (radio, mic, ipod) to the one headset is pretty simple and can be done with either Arduino controlled relays or op-amps (I think headphone audio might be too high a level and current to use simple analog mux chips by themselves).

You will need some kind of analog op-amp circuits to be able to detect the presence of sound from the mic and radio so that adds to the external circuitry needed. Mic level is especially low level so that would take some extra amplification, radio sound output is a little higher output so possible a simple diode rectifier/filter circuit would drive a analog or possibly even a digital input to the Arduino.

Lastly you need to be able to control the ipod. That I have no knowledge of, so the first question is does the ipod have external control inputs that would allow manipulating the ipod operations? If not it would be a most difficult problem. if it does you would probably just need external interface components like optical isolators to command the ipod.

So the big challenge is not in the Arduino, the real challenge is all the external interfacing circuitry that you will have to develop. And that would be true no matter what brand or model of micro controller you try and use.

Lefty

Thanks retrolefty for taking the time to reply.

Let me briefly state that my electronics knowledge dates back many years to my grade 11 electronics class in which my focus was more on enjoying life than listening to the teacher... so I am way over my head, but hope to bite this project off in small chunks as its main purpose is to learn with a real world result at the end.

I'm thinking the logical break down of the projects is:

  1. control relay to select which audio source is routed to the speakers. I suspect this can be accomplished with one relay, when relay triggered, sound source 'A' is connected, when relay is not triggered sound source 'B' is connected.

  2. Solve how to detect presence of sound then set up logic to control relay correctly. I have no idea what an analog op-amp circuit would even look like, so any help on this subject would be appreciated.

After thinking on this a bit I have realized that the mic detection is very easy as I currently use a momentary switch (mounted on a thumb ring to allow control without removing my hands from the break handles) to trigger the mic on and off, I could easily just directly monitor when the mic is engaged by the switch.

  1. Control iPod with remote commands.

    Not sure how hard this is going to be, but it is the least important, and probably the most fiddly. from what i have read, it is just a matter of connecting to three pins on the iPod (Rx, Tx, and ground) but with all things simple... this might prove to be quite challenging in the application.

Question for the Guru:

  1. What do I need to buy?
    1.a. is the Arduino Duemilanove the correct choice for me?
    1.b. from others experience is there a 'shield' breadboard that would be sufficient for my needs or should I work on a larger breadboard on the side of it?

Detect audio signal:

I found this schematic for an Audio Activated Switch

I'm going to start this project with setting up this circuit unless one of you have a better plan.

EDIT:
the forum does not let me edit my first post so here is a simplified/updated flow chart: <CLICK ME - FLOW CHART>

That should be a good starting point. I would just eliminate the output mosfet transistor as it would otherwise require a load resistor to actually develop a output voltage when 'on', but possibly enabling the internal pull-up resistor for the digital input pin would work with the transistor shown.

Just wire the top side of the 4.7 megohm resistor directly into a Arduino input pin should work fine. You might also want to power it from the Arduino +5vdc voltage pin instead of the 3v battery. The standard Arduino has a 3.3vdc power pin available also. Don't forget to wire a ground from this circuit to an Arduino ground pin.

Good luck;

Lefty

UPDATE:
Ok finally got enough time to order/scavage all the parts (the Arduino arrived yesterday- Yeah!!!)

I have the audio detector breadboarded at the moment with it triggering a transistor to flip on a relay as a first step. The results have been less then encouraging with sporatic results.

Sometimes it will trigger the relay, other times nothing happens. My next step is to follow retrolefty's advice and wire the 4.7M resistor to the arduino instead of to the ground and attempt to figure it out through programing... I am hesitent of hooking my own untested circitry to the arduino (I'm scared of blowing the thing up).

Question:

  1. Is there a method I could use to determine if the audio detection circuit is working prior to hooking it up to the Arduino. It would make more sense to me if I was able to eliminate the hardwiring from the list of variables, as I suspect learning to program the Arduino has enough challenges of its own.

  2. I could not source the Op Amp as called for in the circuit and have replaced it with a Dual Op Amp (KA2904) I pillaged from a microwave. Are all op amps basically the same? Will this one work the same as the one called for in the schematic or will I need to change some of the resistor values to make it work correctly?

edit: posted code here with questions as it is not working...