Author Topic: Record Speaker Line Out on a PC/Laptop/RaspberryPi or ESP32  (Read 674 times)

0 Members and 1 Guest are viewing this topic.

Offline circuitdoctorTopic starter

  • Newbie
  • Posts: 9
  • Country: sa
Record Speaker Line Out on a PC/Laptop/RaspberryPi or ESP32
« on: October 28, 2024, 08:04:59 pm »
Hello EEV family,

I am looking for a readily available circuit or a DIY solution where I have a speaker, I want to remove the speaker and convert this speaker into a audio line input so that any PC, laptop, Raspberry Pi or a ESP32 can consider it as a audio input and I can record the audio signal. Any help or starting point for this project would be appreciated.
 

Offline Analog Kid

  • Frequent Contributor
  • **
  • Posts: 593
  • Country: us
Re: Record Speaker Line Out on a PC/Laptop/RaspberryPi or ESP32
« Reply #1 on: October 28, 2024, 08:11:31 pm »
Are you talking about converting a speaker output from an external device into an input to the Pi? or are you just adding a line-level input to the Pi? Not clear from what you posted.
 

Offline circuitdoctorTopic starter

  • Newbie
  • Posts: 9
  • Country: sa
Re: Record Speaker Line Out on a PC/Laptop/RaspberryPi or ESP32
« Reply #2 on: October 28, 2024, 08:18:14 pm »
Thankyou for pointing it out @Analog Kid, yes I am looking to convert the output from a speaker (so there are these two wires SPKR+ and SPKR- that connects to it), I need a readily available circuit or a DIY circuit that takes these two inputs (SPKR+ and SPKR-) and converts them to a line-level acceptable as microphone input that any laptop or a raspberryPi can then record.
 

Offline Analog Kid

  • Frequent Contributor
  • **
  • Posts: 593
  • Country: us
Re: Record Speaker Line Out on a PC/Laptop/RaspberryPi or ESP32
« Reply #3 on: October 28, 2024, 08:25:25 pm »
In that case a simple attenuator should work, something to just bring down the level of the speaker output like this:



Use a 20K-50K pot and adjust it to a satisfactory level. Later if you want to eliminate the pot you could measure the two segments at the adjusted setting and make a voltage divider with 2 resistors of those values.

Be aware that a microphone-level input isn't the same as a line-level one; the mike input will be much more sensitive. This solution should work even with a mike input, but will require careful adjustment not to overdrive the input.
« Last Edit: October 28, 2024, 08:27:41 pm by Analog Kid »
 

Offline circuitdoctorTopic starter

  • Newbie
  • Posts: 9
  • Country: sa
Re: Record Speaker Line Out on a PC/Laptop/RaspberryPi or ESP32
« Reply #4 on: October 28, 2024, 08:28:31 pm »
Are voltage level of concern here, or is there any readily available market circuit that converts the speaker line level to a microphone output for direct recording? I think (not sure) that the resistive attenuator might cause some loading effect.
 

Offline Analog Kid

  • Frequent Contributor
  • **
  • Posts: 593
  • Country: us
Re: Record Speaker Line Out on a PC/Laptop/RaspberryPi or ESP32
« Reply #5 on: October 28, 2024, 08:34:50 pm »
A high-resistance pot/divider (say 20-50K) won't load the speaker output (typically 4-8 ohms) at all. This shouldn't be a problem for whatever's driving the speaker; if it is (that is, if the speaker-driving device wants to see a speaker load there), then you can just put a 10-ohm resistor across the speaker output before this attenuator as a dummy load.
The divider will reduce the speaker voltage (input side) to a lower voltage acceptable to either a microphone or line-level input (after adjustment).
The high value of the divider (actually the value of the "bottom" part) will be high enough to match the impedance of the mike/high-level input. In any case, it doesn't really matter: it's OK to drive a high-impedance input from a low-impedance source, but not the other way around.
 

Offline circuitdoctorTopic starter

  • Newbie
  • Posts: 9
  • Country: sa
Re: Record Speaker Line Out on a PC/Laptop/RaspberryPi or ESP32
« Reply #6 on: October 28, 2024, 08:39:50 pm »
In my case (its basically a drive-thru base station). There is a speaker point on the PCB says SPKR+ and SPKR-. Bu the speaker is not connected physically. So lets say if we connect a 8-10 Ohm dummy load so that the circuit thinks a speaker is connected. But then our attenuator circuit comes in parallel with the speaker load (10 Ohm resistor) this will make the overall resistance less than the 10 Ohm resistance. How about any opamp based approach?
 

Offline Sacodepatatas

  • Regular Contributor
  • *
  • Posts: 107
  • Country: es
Re: Record Speaker Line Out on a PC/Laptop/RaspberryPi or ESP32
« Reply #7 on: October 28, 2024, 08:41:32 pm »
In that case a simple attenuator should work, something to just bring down the level of the speaker output like this:

(Attachment Link)

Use a 20K-50K pot and adjust it to a satisfactory level. Later if you want to eliminate the pot you could measure the two segments at the adjusted setting and make a voltage divider with 2 resistors of those values.

Be aware that a microphone-level input isn't the same as a line-level one; the mike input will be much more sensitive. This solution should work even with a mike input, but will require careful adjustment not to overdrive the input.

Be careful, because nowadays small voltage class D amps use BTL for increasing the output power. In this case, Speaker- is not ground. Also, these amps lack of LPF at the output so there must be a capacitor somewhere for integrating the high freq PWM.

Edit: of course if you use separate isolated power suplies for each device (for instance, batteries), then you can safe connect SPKR- to ground.
« Last Edit: October 28, 2024, 08:48:12 pm by Sacodepatatas »
 
The following users thanked this post: tooki, circuitdoctor

Offline Analog Kid

  • Frequent Contributor
  • **
  • Posts: 593
  • Country: us
Re: Record Speaker Line Out on a PC/Laptop/RaspberryPi or ESP32
« Reply #8 on: October 28, 2024, 08:42:52 pm »
You're overthinking this.
The resistance of the attenuator (20-50KΩ) is so much greater than the speaker impedance (2-10Ω) that it won't make any difference. It'll be what they refer to as "swamped" by the low resistance, so no worries there.

What exactly is this "drive-through base station"?
« Last Edit: October 28, 2024, 08:45:01 pm by Analog Kid »
 

Offline circuitdoctorTopic starter

  • Newbie
  • Posts: 9
  • Country: sa
Re: Record Speaker Line Out on a PC/Laptop/RaspberryPi or ESP32
« Reply #9 on: October 28, 2024, 08:51:41 pm »
I will give this method a try.

Its a HME EOS|HD Drive Thru base station setup I ahve at my store. It uses a phantom powered microphone (+18v, +18v, GND) at the outdoor post where the client speaks and places the order. This microphone output can be played on a wireless headset that the order taker has and a speaker output (grill speaker) so all employees can hear the order.
 

Offline Analog Kid

  • Frequent Contributor
  • **
  • Posts: 593
  • Country: us
Re: Record Speaker Line Out on a PC/Laptop/RaspberryPi or ESP32
« Reply #10 on: October 28, 2024, 08:58:54 pm »
Why don't you try my idea and see how it works? Pretty much zero chance of damaging anything; worst case would be it doesn't work (for reasons given here by @Sacodepatatas). But I'd bet on it working.

An opamp solution would be complete overkill here.
 

Offline circuitdoctorTopic starter

  • Newbie
  • Posts: 9
  • Country: sa
Re: Record Speaker Line Out on a PC/Laptop/RaspberryPi or ESP32
« Reply #11 on: October 28, 2024, 08:59:52 pm »
I will give it a try and comment on it here very soon.
 

Offline circuitdoctorTopic starter

  • Newbie
  • Posts: 9
  • Country: sa
Re: Record Speaker Line Out on a PC/Laptop/RaspberryPi or ESP32
« Reply #12 on: October 28, 2024, 09:09:44 pm »
Why don't you try my idea and see how it works? Pretty much zero chance of damaging anything; worst case would be it doesn't work (for reasons given here by @Sacodepatatas). But I'd bet on it working.

An opamp solution would be complete overkill here.

I just red about the line output converters, what do you think using it would be a good idea?
 

Offline Analog Kid

  • Frequent Contributor
  • **
  • Posts: 593
  • Country: us
Re: Record Speaker Line Out on a PC/Laptop/RaspberryPi or ESP32
« Reply #13 on: October 28, 2024, 09:16:15 pm »
Don't know anything about them; can you post a link?

@Sacodepatatas: if the device does use a class D amp with speaker +/- isolated from ground as you wrote, do you think this would work to get around that problem? All high-value (~10K or more) resistors to avoid danger of loading the output.

 

Offline circuitdoctorTopic starter

  • Newbie
  • Posts: 9
  • Country: sa
Re: Record Speaker Line Out on a PC/Laptop/RaspberryPi or ESP32
« Reply #14 on: October 28, 2024, 09:18:04 pm »
 

Offline Analog Kid

  • Frequent Contributor
  • **
  • Posts: 593
  • Country: us
Re: Record Speaker Line Out on a PC/Laptop/RaspberryPi or ESP32
« Reply #15 on: October 28, 2024, 09:22:34 pm »
Probly should be this instead:

 
The following users thanked this post: circuitdoctor

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 4069
  • Country: ua
Re: Record Speaker Line Out on a PC/Laptop/RaspberryPi or ESP32
« Reply #16 on: October 28, 2024, 10:24:15 pm »
since speakers working with high voltage, you're needs to use protection diodes to avoid damage of your sound input port on notebook/pc/raspberry pi

Sound input ports are designed 1-2V signals, while speakers can work with 12-50 V signal and even more, depends on power and impdeance
« Last Edit: October 28, 2024, 10:27:59 pm by radiolistener »
 

Offline Analog Kid

  • Frequent Contributor
  • **
  • Posts: 593
  • Country: us
Re: Record Speaker Line Out on a PC/Laptop/RaspberryPi or ESP32
« Reply #17 on: October 28, 2024, 10:52:55 pm »
I just red about the line output converters, what do you think using it would be a good idea?

What I showed you is a line-output converter. The only thing that needs "converting" here is the voltage, which is reduced by the attenuator to an acceptable level for either a microphone or line-level input. No other "conversion" needed: no equalization, impedance matching, etc.

Regarding the caution about high voltage damaging the amplifier input, that shouldn't be a problem since the attenuator will reduce the input voltage to a safe level. It needs to be carefully adjusted, and after that you can just "set and forget" it.
 

Online themadhippy

  • Super Contributor
  • ***
  • Posts: 3120
  • Country: gb
Re: Record Speaker Line Out on a PC/Laptop/RaspberryPi or ESP32
« Reply #18 on: October 28, 2024, 11:52:57 pm »
Quote
is there any readily available market circuit that converts the speaker line level to a microphone output for direct recording?
A  di box
 

Offline Analog Kid

  • Frequent Contributor
  • **
  • Posts: 593
  • Country: us
Re: Record Speaker Line Out on a PC/Laptop/RaspberryPi or ESP32
« Reply #19 on: October 29, 2024, 12:42:02 am »
DI box?
Looking at some online schematics, guess what? their input circuit does exactly what my (much simpler) suggestion does: attenuate the speaker output to a lower level:

 
The following users thanked this post: circuitdoctor

Offline Sacodepatatas

  • Regular Contributor
  • *
  • Posts: 107
  • Country: es
Re: Record Speaker Line Out on a PC/Laptop/RaspberryPi or ESP32
« Reply #20 on: October 29, 2024, 03:39:29 am »
Probly should be this instead:

(Attachment Link)

Yes, This should work.

Just take into account that the resistance combination of the parallel resistor and potentiometer shall be about the same value of the remaining resistor. The real ground for the line input would be somehow a "virtual ground" for the speaker output circuitry.
« Last Edit: October 29, 2024, 03:47:17 am by Sacodepatatas »
 
The following users thanked this post: Analog Kid


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf