4 ms·
this is great, i've been reading a lot about headphone impedance this week, but from the perspective of 'i want to use 3.5mm jacks for super simple data communi
by kragen 3y ago
this is great, i've been reading a lot about headphone impedance this week, but from the perspective of 'i want to use 3.5mm jacks for super simple data communications and power for small devices, so how do i keep from burning out headphones if someone accidentally plugs them in'
(also it turns out that these jacks briefly short-circuit as you plug and unplug them)
because 'super simple' excludes power negotiation schemes like usb-c, whatever power i deliver to small devices is also available if someone plugs in a resistor, and earspeakers are pretty similar to resistors at dc, and normally driven at only about a milliwatt
the vast majority of current headphones (and headphone-driving amplifiers) out there today conform to the android specs (though probably approximately 1% of the headphones of interest to nwavguy)
jack: https://source.android.com/docs/core/interaction/accessories/headset/jack-headset-spec https://source.android.com/docs/core/interaction/accessories...
plug: https://source.android.com/docs/core/interaction/accessories/headset/plug-headset-spec https://source.android.com/docs/core/interaction/accessories...
relevant appnotes on driving them include david guo's https://www.analog.com/media/en/technical-documentation/application-notes/an-1429.pdf https://www.analog.com/media/en/technical-documentation/appl... and the anonymous https://www.digikey.com/Site/Global/Layouts/DownloadPdf.ashx?pdfUrl=83910E9C9595434A8E39DA9873B12F9D https://www.digikey.com/Site/Global/Layouts/DownloadPdf.ashx...
- frabert 3y agoThis is unwanted advice, I know, but here is what I would do: I'd make it so that both the transmitter has a very high output impedance (so that plugging in an headphone causes its output to drop to near zero) and the receiver has very high input impedance (so that it doesn't bog the tx down). It will cause some noise issues, because a very high impedance front end will pick up stray radio transmissions, but I think it's doable given a small enough bandwidth
- kragen 3y agojust in case this wasn't clear, plugging headphones or other audio equipment into these 3.5mm jacks is not the intention of this design; rather, i want to minimize the chance of destroying expensive equipment if it happens by accident noise is pretty irrelevant on the power rail. but if i put a high constant impedance on the power rail—say, a 100Ω resistor in front of 5 volts—none of the devices powered from it can draw much power, 25mA being the limit in that case (for the data line, sure, resistance is not at all futile, resistance is a perfectly good solution, along with some clamping diodes) what i have in mind is two things: 1. maybe use a trrs connector and use the second sleeve for the power rail? that way the only thing that ever gets plugged into it by accident is a microphone, which i think is unlikely to burn out at 5 volts (even if normally it's not subjected to more than 2.2 volts) 2. also, limit the current with a linear current source. this design simulates as having about 10Ω impedance over the 0–100mA range and a few kilohms once you exceed the current limit: http://tinyurl.com/23qvuylw http://tinyurl.com/23qvuylw
- frabert 3y agoYou could do what USB does and limit the current until the device signals it wants full power!
- kragen 3y agoa couple of levels up i said > 'super simple' excludes power negotiation schemes like usb-c like, i think you're thinking about devices one or two orders of magnitude bigger than what i'm talking about. i want to be able to wire up a 35¢ device like an attiny4 https://www.digikey.com/en/products/detail/microchip-technology/ATTINY4-TSHR/2238292 https://www.digikey.com/en/products/detail/microchip-technol... with maybe three 1¢ resistors and two 1¢ diodes for protection http://tinyurl.com/26ngjdzh http://tinyurl.com/26ngjdzh or maybe just soldered directly to the jack. it has 512 bytes of flash for the code and 32 bytes of ram; that would have to contain both whatever is necessary for the communication protocol and whatever application i want to run on it (in that case maybe it could handle a capacitive touch button or run a couple of 5-volt pwm channels) i'm not sure the attiny4 is powerful enough. but i'm pretty sure i can make the attiny45, the ch32v003, the pms150c, the attiny202, the stm8s003f3, or the mb95f264hpft work otoh in usb-c a lot of the power negotiation consists of things putting particular resistors across the line, which you could do even at that small granularity. a bus topology won't let you do that, though; if you had five devices plugged in, all their resistors would be in parallel (incidentally, despite the name, usb is not a bus; it's a bunch of point-to-point links. that's why it can do that)
- geon 3y ago> i want to use 3.5mm jacks for super simple data communications and power That sounds like an all around bad idea.
- icegreentea2 3y agoIt's not the best idea, but it's not the worst idea either. The original Stripe reader used the 3.5mm jack for example. It's even been used in some power applications (https://www.amazon.ca/UY-CHAN-Original-Soldering-Replacement/dp/B07KCKXJQZ?th=1 https://www.amazon.ca/UY-CHAN-Original-Soldering-Replacement...)
- krallja 3y agoSquare*
- kragen 3y agoi haven't tested this, but i think it is a less bad idea for what i want to use it for, which is 5-volt power at up to 500 milliwatts, than for the ts80 tip. if the ts80 tip is 4.5Ω it needs to carry 3.8 amps, which means 17 volts, which would definitely kill your earphones. but you could imagine that the ts80 uses foldback current limiting or some more elaborate scheme to handle short circuits, which will happen in any case during hotplugging due to the shape of the 3.5mm plug. foldback wouldn't help (the earspeakers are higher resistance than the soldering tip, not lower) but you could design the iron to only turn on the 17 volts if 100 millivolts delivers 20 milliamps or more, say and, yeah, square. i want to do higher data rates and simpler electronics than an actual audio interface can handle, though
- kragen 3y agoit's like a ratburger: it's not good, but hey, it sure is cheap
- ahdsr 3y agoZSA uses this for their keyboards. The moonlander I'm typing this on uses a headphone jack for all of the above [1] [1] https://www.zsa.io/moonlander/ https://www.zsa.io/moonlander/
- semi-extrinsic 3y agoWhy not just go with RJ11 (6P4C) instead? The PCB mount connectors are cheap, cables are easily available even from most local electronics stores, up to 10m lengths.
- kragen 3y agoyeah, rj-11 or 4p4c ('rj-9') are the other candidates, and they have some real advantages over 3.5mm jacks: - cables are available even from hardware stores, and also so are bus adaptors which connect two or three or five cables together, pin for pin; these do exist for 3.5mm jacks but are less common - spiral 4p4c cables are cheap and easily available - it doesn't short the power rails together as you're plugging it in - the cables are all pretty high quality, which is not true at all for the 3.5mm audio cables they also have some disadvantages: - the cables are much larger than 3.5mm cables - the jacks are much larger than 3.5mm jacks - instead of absentmindedly plugging earphones into my data logger or programmable load and blowing up the earphones, the danger is that i (or a child, say) might absentmindedly plug the data logger into the phone jack on my cable modem, which is something like 50 volts on-hook and 90 vac when it rings - 3.5mm jacks are an evolution of phone switchboard connectors, so they should be good for thousands of insertions and the plugs for like a million or so, and i'd be surprised if rj-11 or 4p4c connectors made it to hundreds
- formerly_proven 3y agoReliability of 3.5mm vs phone jacks is probably pretty similar (500-1000 cycles?), 1/4” jacks, at least the good ones like Neutrik, brag about >10k cycles. I think there’s a reason audio patch panels used either 1/4” or Lemo. I expect far more reliable contact from RJ preloaded contact springs compared to 3.5mm, which are noisy when disturbed even when new. You could use 4P4C, the handset connector, instead of RJ11/6P4C, the phone line connector. Reasonably common, and no risk of ever plugging in a phone line.
- kragen 3y agoyou might be right, but regular plugging and unplugging is a part of the normal usage of the cylindrical connectors in a way it isn't for the modular telephone installation stuff. the tabs do sometimes break off, but i think that's a question of abuse (dragging them backwards through a rat's nest) rather than wear or defects (i assume by 'phone jacks' here you mean rj-11 and 4p4c, but https://en.wikipedia.org/wiki/Phone_jack https://en.wikipedia.org/wiki/Phone_jack lists cylindrical 3.5mm and ¼” 'phone connectors' as well, because they originated in telephone switchboards) you can actually plug a 4p4c plug into an rj-11 jack, or even an rj-45 jack; it enters and holds securely. it may damage the rj-45 contacts, but it will fit. but it's probably true that it's a less likely error for someone to make in practice, and i wonder if maybe the higher on-hook voltages aren't even passed through to the handset another plus of the modular phone connectors is that they're significantly less work to attach to a cable than a 3.5mm plug, once you have the right crimping tool anyway. (you'll get a shitty connection until you learn to do it right.) otoh, the 3.5mm plug doesn't need a crimping tool
- shadowpho 3y agoWhat’s wrong with type c connectors? They are dirt cheap, psu/cable is already done for you, thoroughly tested, and easy to solder(6pin version)
- kragen 3y agousb c? they're fragile as shit, they're a pain in the ass to solder compared to 3.5mm jacks or rj-11 jacks, the data protocol is a fucking nightmare, making a compliant psu is even worse, 90% of the market consists of noncompliant devices that are thoroughly tested to not work, you have to insert them at the right angle, and, worst of all, here in argentina they aren't even dirt cheap basically in many ways usb c represents the opposite of what i want to achieve however, it does have some real merits! the other 10% of the market has some really excellent devices which can reliably deliver many watts of power over relatively lightweight, flexible cables; the connectors are quite thin and lightweight, more so even than 3.5mm jacks; most usb-c devices can charge from usb-a chargers and talk to usb-a data ports, where the data protocol is still a fucking nightmare, but at least it's a widely implemented fucking nightmare that delivers multiple megabits; and even if you do have to insert the connector at the right angle, at least now you can do it without looking, unlike usb-a, mini-b, and micro-b
- shadowpho 3y ago>they're fragile as shit. Which part? >data protocol is a fucking nightmare How come? I’ve done many projects with type c and never felt that way. For basics (5v/1A) it’s just two resistors. For higher voltages I stick a pd controller that handles it.
- kragen 3y agothe pins on the usb-c connector are tiny, which makes them individually fragile, but also the connector inside the device is short, and usb-c cables invariably have a long semi-rigid strain relief to protect the cable from breaking, so the cable has a large lever arm to torque the connector off your pcb. it's a huge problem with micro-b jacks, which are about the same size. usb-c fixes some of the micro-b mechanical problems, but not that one one problem with the usb data protocol is that it won't work over a bus; it requires point-to-point links. but, more generally, my complaint about the data protocol is this. i want two devices with no usb hardware, clocked at 8 megahertz ±10%, with a kilobyte or less of code memory, to communicate with each other. there are multiple reasons that is just never going to happen over usb. usb requires timing precision of ±0.5%, so a crystal or at least a ceramic resonator is mandatory (not a reasonable option on an 8-pin micro), and v-usb requires over a kilobyte of code memory to run at all. and even v-usb only provides a slave device! even if all your devices are avrs with crystals, you can't run a wire between two devices running v-usb and have them communicate. and bitbanging a usb master requires, as i understand it, several times more code (i've never done it) also, v-usb won't let you do anything else while you're communicating; it needs every clock cycle so, i want something that's about 3% or less of the complexity of the usb protocol, with timing specs that are 40 times more relaxed i agree that if you only want power and not communication, and your durability requirements are not high, usb-c is a very practical option. and, even with communication, it's an even more practical option for connections at a larger granularity than what i'm talking about, where the devices involved are big enough for one of them to be a usb master. but that's a different order of magnitude: tens of kilobytes of ram on each endpoint, not tens of bytes