Shop OBEX P1 Docs P2 Docs Learn Events
Using the S2 speaker with Emic 2? — Parallax Forums

Using the S2 speaker with Emic 2?

W9GFOW9GFO Posts: 4,010
edited 2012-12-15 22:34 in Robotics
The Emic 2 can be directly connected to an 8 ohm speaker, according to the documentation. I cannot find any info on the speaker used in the S2. Is it 8 ohm? If it isn't, what would I need to do to make it work with the Emic 2?

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-12-14 18:35
    It's no less than 8 ohms, but it could be 16. In either event, it should be safe to use it with the Emic2. But here's another thought: why not couple the Emic2's output to one of the S2's analog inputs and just pass the resulting data to the S2's onboard speaker amp?

    -Phil
  • W9GFOW9GFO Posts: 4,010
    edited 2012-12-14 18:41
    But here's another thought: why not couple the Emic2's output to one of the S2's analog inputs and just pass the resulting data to the S2's onboard speaker amp?

    That sounds good. :) Any examples of how to code that?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-12-14 20:26
    Well, I spoke off the cuff and too soon. Theoretically, it could be done, but it would entail not calling the S2's start method, which -- among other necessary functions -- sets up a round-robin sampling sequence for the analog multiplexer. Unfortunately, this sequence is much too slow for sampling audio input and would have to be killed for my idea to be effective. The microphone input has it's own, dedicated sigma-delta ADC, but using that would entail some hacking. Maybe it's better just to unplug the speaker and drive it driectly.

    -Phil
  • W9GFOW9GFO Posts: 4,010
    edited 2012-12-14 23:54
    Would it be possible to connect up the Emic 2 to the speaker while leaving the existing connection intact?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-12-15 00:40
    I don't know, Rich. It might cause harm to the S2's built-in amplifier to back-drive it like that. It's not something I would risk.

    -Phil
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-12-15 09:48
    Wouldn't the microphone to headphone object be a good starting point for something like this? I think you'd want to use the highest sample rate practical.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-12-15 10:02
    It would be, except that the main sigma-delta ADC in the S2 is multiplexed with other vital inputs that have to be monitored, such as motor current. The microphone ADC is dedicated, but would have to be hacked on the PCB to gain access.

    -Phil
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-12-15 10:26
    Doesn't the S2 use a hardware Mux? So could the program make the mux only pay attention to the Emic while it's speaking?
    I'm guessing this would require a change in the S2 object.

    I wasn't suggesting using the on board mic, but doesn't the ADC work the same for the analog pins as it does for the mic (assuming the mux can hold position at the analog pin)?

    It might be easier (but who would want to do it that way?) to use a Veho 360 with the Emic and not use the S2 speaker.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-12-15 10:43
    Duane Degn wrote:
    So could the program make the mux only pay attention to the Emic while it's speaking?
    I'm guessing this would require a change in the S2 object.

    A change to the S2 object would make it possible, although holding the mux on one channel long enough for an utterance would interfere with other vital functions.

    A better solution may be to hack the Emic2 to tap its digital output before conversion to analog and output that to the S2's digital inputs. Or, just add an SPI ADC between the Emic2 and the S2's hacker port.

    -Phil
  • W9GFOW9GFO Posts: 4,010
    edited 2012-12-15 10:47
    One goal is to have everything internal to the S2. XBee, pen lifter and Emic. Not enough room for a Veho.
  • ercoerco Posts: 20,255
    edited 2012-12-15 13:11
    How about a 1/8" jack that the Emic plugs into which breaks the speaker connection to the S2? Just like a 1970s transistor radio. Perhaps

    http://www.ebay.com/itm/2pcs-1-8-3-5mm-Female-Phono-Mono-Panel-Phone-Jack-K1-/180738189027?pt=US_Audio_Cables_Adapters&hash=item2a14d5e6e3

    or

    http://www.ebay.com/itm/4pcs-Panel-PCB-3-5mm-1-8-Female-TRS-Headphone-Jack-K3A-/290571856792?pt=US_Audio_Cables_Adapters&hash=item43a76eab98

    Edit: Oops, I thought you wanted to plug the Emic in externally. If you run off 3x 14500 Li-Ion AAs. you can reclaim half of the battery compartment for a small second speaker.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-12-15 13:27
    If you add an additional hardware MUX, you could control which device is connected to the speaker, the Emic or the S2's normal audio. Just use one of the S2's I/O pins to control the MUX.

    Or even simplier, use a relay. (I can't believe I suggested this before erco). You might need a DPDT one I'm not sure if it would be okay to leave the negative lines of the Emic and S2 tied together. You'd still need to use one of the S2's IO pins to control the relay.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-12-15 14:48
    The S2's Speaker amp has a differential output, so you'd have to break both connections. At those power levels, an IC mux would be too wimpy. 'Better, I think, just to add an SPI or I2C ADC to the hacker port.

    -Phil
  • W9GFOW9GFO Posts: 4,010
    edited 2012-12-15 15:17
    Believe it or not, I did think of using a relay.

    I want this to be an easy hack so I am trying to keep it as simple as possible.
  • ercoerco Posts: 20,255
    edited 2012-12-15 15:33
    I actually held back from suggesting one of the Goldmine's $1.50 latching DIP relays. Tiny and they consume no power once in the desired mode.
  • W9GFOW9GFO Posts: 4,010
    edited 2012-12-15 18:06
    ... and I held back on commenting that you didn't actually hold back. :)
  • ercoerco Posts: 20,255
    edited 2012-12-15 22:15
    Fair enough.

    Then I will withold my thought to use a center-tapped audio transformer to allow two different sources to drive one speaker.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-12-15 22:34
    erco wrote: »
    Fair enough.

    Then I will withold my thought to use a center-tapped audio transformer to allow two different sources to drive one speaker.

    Would that work?

    Wouldn't the transformer still back drive the S2's amp?
Sign In or Register to comment.