Difference between revisions of "Electronics project notes/Audio notes - basic audio hacks"

From Helpful
Jump to: navigation, search
m (Cassette speed mod)
m (Line out from speaker out)
(2 intermediate revisions by the same user not shown)
Line 148: Line 148:
 
<!--
 
<!--
 
...to simple hifi sets, boomboxes and the like.
 
...to simple hifi sets, boomboxes and the like.
 +
  
 
There is usually a place on the board with line level signal, where you can solder in your wire.
 
There is usually a place on the board with line level signal, where you can solder in your wire.
It may sometimes take a lot of staring and some expertise to figure out where that is, though.
+
 
 +
It may take a lot of staring and some expertise to figure out where that is, though.
  
  
 
If there is a function you do not use, such as the tuner, you can replace that.
 
If there is a function you do not use, such as the tuner, you can replace that.
  
If there is a function you rarely use, you can add a DPDT switch to switch between it and your aux socket.
+
If there is a function you rarely use (like the tuner), you can add a DPDT switch to switch between it and your aux socket.
 +
 
  
 
(If you're ''really'' lazy you can just add your wire to an existing function without disconnecting it, but there are reasons to avoid this - see above)
 
(If you're ''really'' lazy you can just add your wire to an existing function without disconnecting it, but there are reasons to avoid this - see above)
Line 163: Line 166:
 
==Line out from speaker out==
 
==Line out from speaker out==
 
<!--
 
<!--
'''Due warning''': It's perfectly safe ''''only''''' if you get the values right, '''and''' pay attention while connecting.
+
'''Due warning''':
 +
It's perfectly safe ''''only''''' if you get the values right, '''and''' pay attention while connecting.
  
  
Line 171: Line 175:
 
An amp designed for 30W .. 100W speakers will put out something between 10 and 40 volts.
 
An amp designed for 30W .. 100W speakers will put out something between 10 and 40 volts.
  
Since you want to divide down to half a volt or so ([[line level]]), divide by twenty, thirty, fourty, fifty or so.
+
Since you want to divide down to below half a volt ([[line level]]), divide by twenty, thirty, fourty, fifty or so.
 
It's easy enough to use standard-value pairs like 1K and 10K, or 1K and 33K, or whatnot.
 
It's easy enough to use standard-value pairs like 1K and 10K, or 1K and 33K, or whatnot.
  
This means one or two dozen milliamps at most, which won't bother your amp or connected speakers at all (well under a Watt).
+
This means one or two dozen milliamps at most, which won't bother your amp or connected speakers at all (well under a Watt).  
You ''may'' want to use resistors specced to sink 0.25W.
+
You may want to use resistors specced to sink 0.25W.
  
 
Car audio have these (called something like high-low(-level) converters), to be able to take a speaker output and feed it into a more specific amp.
 
  
  
Line 187: Line 189:
  
 
* Insulate wires properly. You don't want accidental shorts because of a moment's laziness
 
* Insulate wires properly. You don't want accidental shorts because of a moment's laziness
i.e. Just make it hard to do wrong :)
 
  
 
* Apparently, don't use with bridge-type amps, as regularly used in cars (meaning? why?)
 
* Apparently, don't use with bridge-type amps, as regularly used in cars (meaning? why?)
Line 196: Line 197:
  
 
You can use a transformer-based design instead, this can be safer design.
 
You can use a transformer-based design instead, this can be safer design.
 +
 +
 +
 +
Car audio have these (called something like high-low(-level) converters),
 +
to be able to take a speaker output and feed it into a more specific amp.
 +
  
 
-->
 
-->
Line 246: Line 253:
 
<!--
 
<!--
  
As you may know, DC motor speed are fairly directly related to input voltage.  
+
As you may know, DC motor speed related to input voltage. Closer to the motor's full speed this is pretty linear, at some ower voltage it starts dropping off faster, and there is a voltage below it will do nothing.
  
Not true for tape motors. Motors in tape players need to be able to run at well controlled speed, because any variation in the tape speed is noticeable pitch change.
 
  
Cassette tapes players have constant tape speed by pulling tape between capstan and pinch roller.
+
Tape motors are different. Motors in tape players need to be able to run at well controlled speed, because any variation in the tape speed is noticeable pitch change.
{{comment|(and not the takeup roll - which is usually on a slipping design with just enough friction to pull and rereel it. It is sometimes done with a separate motor, to not have to drive it from the same motor)}}
+
  
The mechanical load will vary somewhat - not much, but enough that designers have to consider it.
+
The tape itself is pulled between capstan and pinch roller, from that motor {{comment|(note: not the takeup roll - that's usually a low-friction slipping design that turns a little too fast, so deals with the varying uptake speed. It is sometimes done with a separate motor, to not have to share torque from the same motor)}}
  
 +
Point is that the mechanical load ''will'' vary somewhat - not much, but enough that designers have to consider it.
  
These motors may also have an extra shield to avoid he motor's electric fields making it into nearby audio traces.
+
 
It's separate so it can be a higher-permeability metal so that it doesn't have to be as thick for the same protection.
+
(side note: These motors may also have an extra shield to avoid he motor's electric fields making it into nearby audio traces. It's separate so it can be a higher-permeability metal so that it doesn't have to be as thick for the same protection)
  
  
Line 263: Line 269:
 
This is relevant because there are a few different solutions-motor-wise.
 
This is relevant because there are a few different solutions-motor-wise.
  
'''If there are no components on the PCB towards the motor''' (and it's 2-wire), it's likely that the motor is a constant-speed design.
+
'''If there are no components on the PCB towards the motor''' (and it's 2-wire),
 +
it's likely that the motor is a constant-speed design.
  
One such design is electromechanical, which basically uses rotational force on a weighed spring,
+
One such motor design is electromechanical,
so that at a certain speed it electrically disconnects the motor.  
+
basically uses a weighed spring carrying the current,  
This is basically a cheap feedback loop. It works surprisingly decently,  
+
meaning that at a high enough speed it electrically disconnects the motor.
and doesn't vary speed with input voltage so is good for battery powered solutions,
+
For how simple and cheap this feedback loop is, it works surprisingly decently,  
but the speed varies with temperature, and it's mainly seen in cheaper designs.
+
and is works when battery powered because it's constant under mildly changing voltage.
 +
It has other flaws, such as speed varying temperature,
 +
and it's mainly seen in cheaper designs.
  
 
See e.g. [https://www.youtube.com/watch?v=jJDk7tftOGE] [https://www.youtube.com/watch?v=yUT512DW8pg]
 
See e.g. [https://www.youtube.com/watch?v=jJDk7tftOGE] [https://www.youtube.com/watch?v=yUT512DW8pg]
Line 309: Line 318:
  
  
The pot may not live forever since at full speed the same current goes through it. You can improve that by adding a transistor as current buffer, but some of the below variants are about as much work.
+
The pot may have limited lifetime since at full speed the same current goes through the pot.
 +
You can improve that by adding a transistor as current buffer,
 +
but some of the below variants are about as much work and work better.
  
 
The limited useful range may also matter, particularly if you really just put it inline.
 
The limited useful range may also matter, particularly if you really just put it inline.
Line 315: Line 326:
  
  
'''The nicer few-component variant''' is to use a pot to control a variable regulator (e.g. LM317). This will also mostly go slower, though makes it easier to expose more range.
+
'''The nicer still-few-component variant''' is to use a pot to control a variable regulator (e.g. LM317).
 +
This will also mostly go slower, though makes it easier to expose more range.
  
 
You ''may'' want to spend some time calulating the resistors around it to give you a useful range.
 
You ''may'' want to spend some time calulating the resistors around it to give you a useful range.
Line 321: Line 333:
  
  
Another option is PWM.
+
 
 +
Another option is PWM.  
 
You can make this from a 555 (plus transistor for buffer), and it allows  
 
You can make this from a 555 (plus transistor for buffer), and it allows  
  
Also, since you're using an ADC anyway it's now easy to also add CV input.
+
You can also get PWM from a small PIC or AVR (plus transistor for buffer, though L293D is more convenient), which is somewhat overkill, though if you're a programmer type you might find it slightly nicer to set the speed limits in code rather than with resistors, and potentially allows more inputs, e.g. adding CV input.
 
+
You can also get PWM from a small PIC or AVR (plus transistor for buffer), which is somewhat overkill, though if you're a programmer type you might find it slightly nicer to set the speed limits in code rather than with resistors, and potentially allows more inputs.
+
 
+
 
+
 
+
 
+
 
+
  
  

Revision as of 01:17, 14 July 2019

This is for beginners and very much by a beginner. It's meant to try to cover hobbyist needs, and as a starting point to find out which may be the relevant details for you, not for definitive information.

Some basics and reference: Volts, amps, energy, power · Ground · batteries · resistors · changing voltage · transistors · fuses · diodes · varistors · capacitors · inductors · transformers · baluns · amplifier notes · frequency generation · skin effect


And some more applied stuff:

IO: IO and wired communication · localish communication · wireless (ISM RF, GSM, RFID, more) · 802.11 (WiFi) · 802.15 (including zigbee)


Sensors: General sensor notes, voltage and current sensing · Knobs and dials · Pressure sensing · Temperature sensing · humidity sensing · Light sensing · Movement sensing · Capacitive sensing · Touch screen notes

Actuators: General actuator notes, circuit protection · Motors and servos · Solenoids

Some stuff I've messed with: Avrusb500v2 · GPS · Hilo GPRS · Bluetooth serial · JY-MCU · DMX · ESC/POS notes

Audio notes: basic audio hacks · microphones · amps and speakers · device voltage and impedance, audio and otherwise ·

Less sorted: Common terms, useful basics, soldering · Microcontroller and computer platforms · Arduino and AVR notes · ESP series notes · Electronics notes/Phase Locked Loop notes · mounts, chip carriers, packages, connectors · signal reflection · pulse modulation · electricity and humans · Unsorted stuff


See also Category:Electronics.

Combining multiple signals (to one input)

This article/section is a stub — probably a pile of half-sorted notes, is not well-checked so may have incorrect bits. (Feel free to ignore, fix, or tell me)

You may want this when you want to

connect multiple inputs to e.g. a speaker set with only one input plug
wire an AUX port to somethat that doesn't have it


Manual switch

This isolates the inputs, mechanically. The simplest version is a switch (DPDT for stereo). Could do this in a cable, or make a small box with some sockets.

You'll get a pop whenever you switch. There are some fairly quick-and-dirty ways around this.

But often you don't want to have to do this manually in the first place, so...


Y splitter

A wire with three plugs, that connects everything to everything.

The device that senses this signal is high-impedance so is fine with this. Worst case the combination is so loud that it clips.


However, the things producing sound wont' be quite as happy. In practice, most things you'll connect have active output, meaning they are powered and have a lowish-impedance amp at the end. Sometimes they'll be passive, but can be reactive themselves, e.g. guitar pickups.

In both cases, these will interact, which is unintended. It will usually affect audio quality, which is already enough reason not to do this.

In some cases the current pushed into the other thing can break things. So this is probably a bad idea.

To avoid most of these problems, the inputs need some resistance between them.



Y splitter with resistors

The most basic alleviation is a passive summing circuit, which puts a resistor on an input lines before you join them.

It means going to the other sound source sees more resistance than going . It doesn't completely isolate the signals, but assuming active outputs, it limits current enough to avoid damage and almost all distortion. (again, instrument pickups are a little different)

It will lower volume. For example, 10kOhm, which is probably wise, will attenuate around 6dB(verify), which is half. Since there's a noise floor somewhere, and you'll turn the volume up, this means more noise. And if the amp only volume and no input gain, then the total possible sound produced is also lower. In cars you'll probably notice neither and this is a fine solution.

See/read:


Passive potmeter mixer

Instead of just a resistor, you could add a potmeter so that you can fade between the two channels (or mix each input into the output).

The combination and values are a little different between these two cases.

You may want a two-channel pot, to separately do the same thing with both stereo channels.

Same notes on less signal and more noise as before.


Buy active mixer

Adding more channels would attenuate down some more, and the noise starts to come closer, so you'll soon want an active summing circuit instead (recognizable by that they take DC power input).

Your cheap $20 active mixers are not the best quality ("I could make this" level) and are often they're two-channel (or 4-channel mono, same thing).

Halfway decent ones are easily $50, and if you find that a little expensive for what they are, you can consider soldering your their own (see below).


Build Active mixer

The "passive adder plus potmeter" option is functionally much of a real mixer.

The main thing still to add is amplification right after - so that you no longer lessen the signal, and so it doesn't fall into the next device's noise floor.

This does require a power supply. At this point you probably want to build something more solid than a pot on a wire.

Note that adding more channels to what you have is now a fairly simple and cheap option. (planning for a number of channels, and/or stereo, is still handier to do up front though)

http://www.learningaboutelectronics.com/Articles/How-to-build-your-own-audio-mixer

http://web.archive.org/web/20150220140529/http://www.mattkrass.com/?page_id=880

http://forum.allaboutcircuits.com/showthread.php?t=26654

Multiple headphones on one output

This article/section is a stub — probably a pile of half-sorted notes, is not well-checked so may have incorrect bits. (Feel free to ignore, fix, or tell me)

A Y-cable puts two loads in parallel.


This does two things:

Makes the headphones interact

...because they are not simple loads. However, they won't do so very much, you probably won't notice or care, and it can't damage them.


doubles the load

(...if equal impedance. If they're different it's something roughly 2-ish, and one will be louder than another.)

If the output can handle that, it's perfectly fine.

Most any headphone amp will be fine, as they're typically designed to cope with real-world variation in headphones.


Computers, mobile phones, and such will often be fine for similar reasons.

Though in case they have separate speaker out and line our, then line out may not, this is fairly rare.

Things that can't deal will distort the sound, in extreme cases overheat.

You can usually avoid that by keeping the volume low. Half is safest, more may be okay depending on the combination of devices.


http://boards.straightdope.com/sdmb/showthread.php?t=624492

Adding a line/aux in

Line out from speaker out

Avoiding pops

Car audio

Tape related

Cassette speed mod

Tape loops