Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Forseti
May 26, 2001
To the lovenasium!

petit choux posted:

Wow, I'm glad I showed you guys this one. Now what does class a, b or ab connote?

https://en.wikipedia.org/wiki/Power_amplifier_classes

They're the configurations for a power amplifier and each have trade-offs and strengths relative to the others

That phono jack is awesome! A lot more clear from the new angle, and very cool way to build something like that. I love looking at old designs for the exact reason you said, it's cool to see how the things were made before being highly optimized for factory scale production, and the techniques are often a lot more adaptable to DIY

Adbot
ADBOT LOVES YOU

Stack Machine
Mar 6, 2016

I can see through time!
Fun Shoe

petit choux posted:

Wow, I'm glad I showed you guys this one. Now what does class a, b or ab connote?

It denotes how often each output transistor is conducting. So in class A there's usually one transistor with a resistor for a load, always conducting. In class B it's 2, with each conducting exactly half of the time (say 1 for negative-going and 1 for positive-going), and with AB it's the same with a little bit of overlap to keep distortion low. (there's also class C for cool RF amps and class D for the audio amps that made all other audio amps obsolete).

So I think I was wrong earlier, the AB will burn more power, not less, vs class B. It's just more practical to build a working class AB amp than a class B amp because "exactly half the time" is impractical.

petit choux posted:

And that stack thing is the 1/4" jack, and an object lesson in how to DIY one if you ever find yourself on an uncharted desert isle. And dig the big red reset button on the back. No power switch, but a bright shiny reset button.



Makes me appreciate the schematic symbol a little more:

petit choux
Feb 24, 2016

THANK YOU!

Still haven't started cleaning, jeez. Gotta get off the computer. But while I'm shredding ancient hardware, I showed you this several pages back,



a toy train transformer with a cool retro enclosure that I was hoping to maybe make a drum toy out of. Drilled out the rivets, I know you all could have predicted this exactly:




Stack Machine posted:

So I think I was wrong earlier, the AB will burn more power, not less, vs class B. It's just more practical to build a working class AB amp than a class B amp because "exactly half the time" is impractical.

But that you were right in that it's sort of a class AB, yes? This terminology is new to me, thanks!

Now to get to cleaning and find something I can use to test this amp.

You guys are at a whole nother level, while I'm still a 20th C hobbyist with a copy of Anderton's Electronics Projects for Musicians and so forth. But I'm hoping you all find schooling me to be a little entertaining. I appreciate you. I'm enjoying this and hope to show off some more gear that I'm shredding for your amusement now and then. I'd been looking forward to opening up this amp for a while.

Dominoes
Sep 20, 2007

Are PTC ("resettable") fuses a bad idea for battery-powered devices? I understand they have a voltage drop. (Which could be a problem as battery life sags over time depending on how much overhead you have in batt V vs min acceptable V for components). I'm troubleshooting battery life issues, and wonder if I should use these fuses only on the wall-power lines.

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
I took them out of my battery powered devices, the nominal resistance was unacceptably high

Dominoes
Sep 20, 2007

Thanks! Going to do the same. On the production boards I ordered, will replace with 0-ohm resistors.

longview
Dec 25, 2006

heh.

Shame Boy posted:

Unrelated to that, I want to be able to control this power supply I'm building remotely, but also keep anything external completely isolated - in case something goes very wrong, I don't want it sending a few kilovolts up the wire to a computer. Initially I was thinking bluetooth, but then I realized I'm putting this in a big grounded metal box and RF tends to dislike those. Now I'm thinking optical, most chips these days have built-in IrDA support via the UART controller and it's not like it's high-bandwidth or anything. But that got me wondering, could I use a couple TOSLINK connectors / cables for this? I don't really see a reason why you couldn't just run the IrDA protocol over TOSLINK, it's not like the controller cares or anything, and the bandwidth would be well below what TOSLINK normally carries. Am I missing something obvious that would make this not work?
This will probably work very well. Typically TOSLINK interfaces are DC balanced (i.e. manchester coded or similar), so the receiver is typically fed to a self-oscillating 7404 type inverter. As long as your receiver doesn't care about the input basically being a square wave when there's no signal it should be fine. I would expect IrDA to operate approximately the same way.
You could also just use optocouplers, these are typically fairly slow (~10 us rise/fall time is typical).
The benefit is they're more compact and can pass DC so you could use a standard UART protocol.
Examples of typical couplers include PC123 and PC817.

Dominoes posted:

Are PTC ("resettable") fuses a bad idea for battery-powered devices? I understand they have a voltage drop. (Which could be a problem as battery life sags over time depending on how much overhead you have in batt V vs min acceptable V for components). I'm troubleshooting battery life issues, and wonder if I should use these fuses only on the wall-power lines.
You should be able to look up the resistance for a relevant current in the data sheet for the fuse, typically it's a fairly sharp increase in resistance near the threshold current. Basically they operate with a thermal positive feedback, once they start heating up the heating increases as the resistance increases similarly. (According to I^2*R).
If you never expect the fuse to blow a standard fuse is probably fine and may be better, but all fuses have some resistance since they basically operate the same way except the temperature increases up to the material melting point.

If your batteries can supply decent current you can use a higher current fuse or PTC to increase efficiency, but the cost of that is you need to be able to supply enough current to actually blow the fuse, which affects e.g. wire gauges before the fuse (and everything downstream).
Consider a 20+ A 12 V supply feeding several meters of AWG 26 wire, protected by a 1 A fuse, there's a fair chance the wiring is the fuse in this case, and you don't want the wiring to be the fuse unless you really love chlorine gas.

Forseti
May 26, 2001
To the lovenasium!

longview posted:

This will probably work very well. Typically TOSLINK interfaces are DC balanced (i.e. manchester coded or similar), so the receiver is typically fed to a self-oscillating 7404 type inverter. As long as your receiver doesn't care about the input basically being a square wave when there's no signal it should be fine. I would expect IrDA to operate approximately the same way.
You could also just use optocouplers, these are typically fairly slow (~10 us rise/fall time is typical).
The benefit is they're more compact and can pass DC so you could use a standard UART protocol.
Examples of typical couplers include PC123 and PC817.

Also if you're not married to whatever microcontroller you're using, the ESP32 has a very nice RMT peripheral that is extremely flexible: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/rmt.html

I feel like I'm always talking up the ESP32, but I really do think they got a lot of things VERY right for hobbyists (and of course that isn't a coincidence since they hired on a bunch of 'hobbyists' when the ESP8266 took off).

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
Some things about the ESP32 are kinda irritating, which is only made worse by the fact that they are the best option for so many different projects.

They really blew the performance/cost equations out of the water compared to any of the more traditional manufacturers

Dominoes
Sep 20, 2007

longview posted:

You should be able to look up the resistance for a relevant current in the data sheet for the fuse, typically it's a fairly sharp increase in resistance near the threshold current. Basically they operate with a thermal positive feedback, once they start heating up the heating increases as the resistance increases similarly. (According to I^2*R).
If you never expect the fuse to blow a standard fuse is probably fine and may be better, but all fuses have some resistance since they basically operate the same way except the temperature increases up to the material melting point.

If your batteries can supply decent current you can use a higher current fuse or PTC to increase efficiency, but the cost of that is you need to be able to supply enough current to actually blow the fuse, which affects e.g. wire gauges before the fuse (and everything downstream).
Consider a 20+ A 12 V supply feeding several meters of AWG 26 wire, protected by a 1 A fuse, there's a fair chance the wiring is the fuse in this case, and you don't want the wiring to be the fuse unless you really love chlorine gas.
Thank you! It looks like this one has a Rimin = Minimum device resistance prior to tripping at 25C = 0.060Ω, and R1_max = Maximum device resistance = 0.210Ω. Vmax = 6.0, trip current = 2.5A. Those resistances don't see high, but if I can't figure out how to interpret, may just move to hard-wire power only until I'm sure all the power-draining bugs I'm hitting are gone.

Dominoes
Sep 20, 2007

Also, Cortex-M for life, losers!

And come on ST, get your poo poo together re SVDs. Pay an intern to QC them with the RMs for a summer or something.

Forseti
May 26, 2001
To the lovenasium!

Dominoes posted:

Also, Cortex-M for life, losers!

And come on ST, get your poo poo together re SVDs. Pay an intern to QC them with the RMs for a summer or something.

On the other hand, I can actually still buy ESP32s because hardly anyone uses them at scale :D

I do like the ARM chips though, very nice working with such a mature platform. Xtensa is a pain in the rear end, interested to see if RISC-V works out any better. But in either case, the different between the ESP8266 and ESP32 tools is massive and I love that Espressif is genuinely putting in effort to make their products good. I could see them catching up faster than people would expect.

Edit: VV :glomp:

Forseti fucked around with this message at 20:01 on Jun 13, 2021

Dominoes
Sep 20, 2007

Too soon - don't rub it in

Stack Machine
Mar 6, 2016

I can see through time!
Fun Shoe

petit choux posted:

But that you were right in that it's sort of a class AB, yes? This terminology is new to me, thanks!

Yeah it's class AB. A weird thing about this amp vs modern amps is that the"push" and "pull" side both look like the same type of transistor (both PNP or NPN). The little transformer is used to "flip" one side so one can "push" current and the other can "pull". Tube amps had to work this way because p-channel vacum tubes aren't possible. Modern class AB amps will just use a complementary NPN/PNP (or NMOS/PMOS) pair on the output.

So when the output voltage is zero, both transistors are on a little and pulling current from the supply through that transformer, kind of like the right hand side of this schematic:

Marsupial Ape
Dec 15, 2020
the mod team violated the sancity of my avatar

Shame Boy posted:

Got any flea markets? There's usually a dude selling weird old radios at flea markets. Even the lovely one in my relatively rural home town had a Weird Old Radio Dude. If you're lucky, he'll sell you some junk ones for real cheap too. I got a stack of five CB radios for like $15 a little while ago, been meaning to go through em'.

You've just triggered my geriatric millennial rant. All the good quality junk at yard sales and flea markets cycled out of my area over a decade ago. It's mostly because all the good poo poo got picked over and then, because Walmart and Dollar Store dominate rural economies, the only thing that started getting resold was broken, cheap Chinese poo poo. It's all used Disney-themed kids clothes, now.

I've complained about it, before, but there is no choice or selection in rural communities, anymore. Walmart and Dollar Store killed everything. I do the vast majority of my non-essential shopping online. I was mulling it over the other day, and I realized that we've come full circle back to being hillbillies paging through the Sears and Roebuck catalog.

Anyway, rant over. I don't want to derail the thread with my geographic angst.

petit choux
Feb 24, 2016

Marsupial Ape posted:

You've just triggered my geriatric millennial rant. All the good quality junk at yard sales and flea markets cycled out of my area over a decade ago. It's mostly because all the good poo poo got picked over and then, because Walmart and Dollar Store dominate rural economies, the only thing that started getting resold was broken, cheap Chinese poo poo. It's all used Disney-themed kids clothes, now.

I've complained about it, before, but there is no choice or selection in rural communities, anymore. Walmart and Dollar Store killed everything. I do the vast majority of my non-essential shopping online. I was mulling it over the other day, and I realized that we've come full circle back to being hillbillies paging through the Sears and Roebuck catalog.

Anyway, rant over. I don't want to derail the thread with my geographic angst.

Yeah, having grown up in rural IN, I feel you. Also, if you live near a university try to see what they do with their old tech. I used to get the coolest old poo poo at the Terrapin Trader at U of M. And they have a web site too. ED: or did before the epidemic anyway.

Forseti
May 26, 2001
To the lovenasium!
If you can get to a ham radio swap meet, those guys tend to have awesome stuff

Marsupial Ape
Dec 15, 2020
the mod team violated the sancity of my avatar
I think I will just have to hit up local pawn shops. Now that the mask mandate has been lifted (and I've been vaccinated since the beginning of February) I'm going to start spending my weekends looking for yard sales and poo poo.

Speaking of Class D stereos...look at this adorable little thing. A 2 x 30 watt stereo amplifier you can put in your pocket. I have zero use case for it, but it does give me ideas. Right now, the only thing holding my back from do the flat panel DML speaker system is find a DIY stereo kit that I like. I want to two do two panels with with a normal and bass exciter mounted in series on each. Just another project in the back of my brain.

TheFluff
Dec 13, 2006

FRIENDS, LISTEN TO ME
I AM A SEAGULL
OF WEALTH AND TASTE
Can I ask dumb questions about microelectronics here? I'm relatively clueless but I have a small (I think) project that I think should be feasible - can I get a sanity check?

I have an old Volvo Penta diesel engine in my boat, and it lacks a tachometer. I found an old original Volvo Penta branded VDO tach at a flea market for next to nothing, and of course I had to buy it. It's not original to my engine, but still it's got the proper vintage look, and I want to use it. I have a tachometer output on my alternator (marked "W" - it's attached to one of the windings I believe and generates a pulse 6 times per revolution), so I was hoping I could use that. It seems though that this tachometer was made to be used with a tach sender attached to some kind of fuel pump crank or something, not the alternator, because it's marked "inductive" and "165000 imp/min". Since it's a 5000 rpm tach I interpret that as 165000/5000 = 33 pulses per engine revolution, which is far higher than what my alternator is cranking out (roughly 14 pulses per engine revolution, since it runs about twice as fast as the engine).

So, is it possible to build a cheap/tiny digital circuit that scales up an arbitrary analog frequency by a given proportion? This is all very low voltage stuff, a couple of volts ish, and very low current. By stumbling around on Google I found some cheap voltage-to-frequency and frequency-to-voltage converters, but that doesn't quite tell me how to do the scale factor (scaling down in the voltage domain is just a resistor, right, but I want to scale up...?). Any ideas? Is this feasible at all without some big kludgey hack? I mean I know I could almost certainly do it in software with an Arduino, but that seems a bit overkill. There are also commercial products that do this but they're like $100 and I don't want to pay that much (and I also want a DIY project).

e: found an application note about Microchip's TC9400 which seems to describe exactly what I want:

TheFluff fucked around with this message at 11:37 on Jun 14, 2021

Forseti
May 26, 2001
To the lovenasium!

TheFluff posted:

Can I ask dumb questions about microelectronics here? I'm relatively clueless but I have a small (I think) project that I think should be feasible - can I get a sanity check?

I have an old Volvo Penta diesel engine in my boat, and it lacks a tachometer. I found an old original Volvo Penta branded VDO tach at a flea market for next to nothing, and of course I had to buy it. It's not original to my engine, but still it's got the proper vintage look, and I want to use it. I have a tachometer output on my alternator (marked "W" - it's attached to one of the windings I believe and generates a pulse 6 times per revolution), so I was hoping I could use that. It seems though that this tachometer was made to be used with a tach sender attached to some kind of fuel pump crank or something, not the alternator, because it's marked "inductive" and "165000 imp/min". Since it's a 5000 rpm tach I interpret that as 165000/5000 = 33 pulses per engine revolution, which is far higher than what my alternator is cranking out (roughly 14 pulses per engine revolution, since it runs about twice as fast as the engine).

So, is it possible to build a cheap/tiny digital circuit that scales up an arbitrary analog frequency by a given proportion? This is all very low voltage stuff, a couple of volts ish, and very low current. By stumbling around on Google I found some cheap voltage-to-frequency and frequency-to-voltage converters, but that doesn't quite tell me how to do the scale factor (scaling down in the voltage domain is just a resistor, right, but I want to scale up...?). Any ideas? Is this feasible at all without some big kludgey hack? I mean I know I could almost certainly do it in software with an Arduino, but that seems a bit overkill. There are also commercial products that do this but they're like $100 and I don't want to pay that much (and I also want a DIY project).

e: found an application note about Microchip's TC9400 which seems to describe exactly what I want:



I'm no expert, but I like to learn things, and I believe that you could use a PLL for this somehow:

https://www.youtube.com/watch?v=SS7z8WsXPMk

but I don't know if it can work if the base frequency is changing all the time. I think there's a way to make it work but I haven't used PLLs often enough to know how. It's definitely an interesting problem though so I'm sure I'll be thinking about it all morning!

If you feed the pulses into a capacitor, you'd end up with a voltage stored that corresponds to the frequency that could then control a VCO (voltage controlled oscillator, which is one of the parts on that PLL chip).

This is the sort of thing that seems like it's waaaaay easier with a microcontroller though and is the sort of thing the puny couple cent ones do well.

Normally I think a tach is counting pulses from the coil which you don't have of course, so I guess the alternator output is faking that? I think maybe you'd count the period between pulses, and then send how many pulses that would work out to so you'd be lagging a bit but probably not noticeable, guessing it's not a super fast revving motor :)

If that chip is specifically for this application, that's the way to go I'd say.

TheFluff
Dec 13, 2006

FRIENDS, LISTEN TO ME
I AM A SEAGULL
OF WEALTH AND TASTE

Forseti posted:

I'm no expert, but I like to learn things, and I believe that you could use a PLL for this somehow:

https://www.youtube.com/watch?v=SS7z8WsXPMk

but I don't know if it can work if the base frequency is changing all the time. I think there's a way to make it work but I haven't used PLLs often enough to know how. It's definitely an interesting problem though so I'm sure I'll be thinking about it all morning!

If you feed the pulses into a capacitor, you'd end up with a voltage stored that corresponds to the frequency that could then control a VCO (voltage controlled oscillator, which is one of the parts on that PLL chip).

This is the sort of thing that seems like it's waaaaay easier with a microcontroller though and is the sort of thing the puny couple cent ones do well.

Normally I think a tach is counting pulses from the coil which you don't have of course, so I guess the alternator output is faking that? I think maybe you'd count the period between pulses, and then send how many pulses that would work out to so you'd be lagging a bit but probably not noticeable, guessing it's not a super fast revving motor :)

If that chip is specifically for this application, that's the way to go I'd say.

Interesting, I'm gonna have to learn a lot more now :v:

On modern diesels I dunno how they do these things, but this is from 1979 and purely mechanical - the only electric parts of it are the starter and the alternator. It doesn't even have glow plugs. The tachometer is from a slightly newer engine, but a lot of these old marine Volvos seem to have had a sensor/sender that (AFAIUI) consisted of a magnet on the fuel pump crankshaft and a coil in the sender body itself that the magnet would induce a current in on every revolution. I think there is even an OEM sender like this that fits my engine, but it's $250 (lol). The alternator is doing something similar but not exactly the same (again AFAIUI), and is the other common way to get a tachometer reading on old diesel engines. It's absolutely not a fast-revving motor, it gets to its working rpm and sits there for hours :v: The main application for this tach would be to make it easier to consistently hit a good working rpm - I myself can do it by ear these days but not everyone on the boat can.

Since finding that link for the TC9400 I've done a bit more reading and it seems like for the input side (frequency-to-voltage conversion) it might be a bit clunky - it seems it wants a 5V reference voltage, which I don't have. On the other hand, TI has a thing called the LM2907 which seems specifically designed for automotive applications like this one and it seems much easier to use - and it's under $3 on digikey. I'm completely new to this though and I don't understand half of the datasheet so I'm sure there will be Problems. I'll have to learn a lot more first.

TheFluff fucked around with this message at 14:54 on Jun 14, 2021

Forseti
May 26, 2001
To the lovenasium!
After a little searching around, I think there are probably off the shelf adapters made for engine swaps to translate tach signals. Not sure how adaptable they are (like can you set the ratio yourself), but something like that is probably the easiest way to get it working.

After that, I think a microcontroller (e.g. an arduino) is probably the easiest way to build something yourself.

The PLL is the most interesting to me because it's probably the hardest way to solve this problem :). They don't get used often as discrete components that I'm aware of these days because it's usually easier to use digital circuits like a micro controller, but I looooove the puzzle of figuring out how to do things with analog parts

TheFluff
Dec 13, 2006

FRIENDS, LISTEN TO ME
I AM A SEAGULL
OF WEALTH AND TASTE

Forseti posted:

After a little searching around, I think there are probably off the shelf adapters made for engine swaps to translate tach signals. Not sure how adaptable they are (like can you set the ratio yourself), but something like that is probably the easiest way to get it working.

After that, I think a microcontroller (e.g. an arduino) is probably the easiest way to build something yourself.

The PLL is the most interesting to me because it's probably the hardest way to solve this problem :). They don't get used often as discrete components that I'm aware of these days because it's usually easier to use digital circuits like a micro controller, but I looooove the puzzle of figuring out how to do things with analog parts

Yeah I found a few commercial products that seem to offer this functionality but the cheapest one I saw was $65, and the point here is more to gently caress around than to just solve the problem, so that's not an option :v:

Stack Machine
Mar 6, 2016

I can see through time!
Fun Shoe

Forseti posted:

The PLL is the most interesting to me because it's probably the hardest way to solve this problem :). They don't get used often as discrete components that I'm aware of these days because it's usually easier to use digital circuits like a micro controller, but I looooove the puzzle of figuring out how to do things with analog parts

You can also implement PLLs for low frequencies in microcontrollers/FPGAs. An all-digital approach is probably the easiest way to do a PLL in this 0-200Hz range.

Forseti
May 26, 2001
To the lovenasium!
Have you tried just hooking up the tach? Does it make a reading and it's just too slow? Just curious.

I believe the tach works on a spark ignition engine by counting the pulses from the ignition coil, which will make a pulse every time a spark plug for one of the cylinders fires. For a 4 stroke that would be 1 pulse per cylinder per two rotations I think. I would think that they'd be faking that on a diesel to make it easy to reuse a tach from a gasoline engine, but 14 seems like a lot? 33 seems waaaay too much although I agree with the assumptions you made to come up with that number.

Maybe I should research how these things actually work instead of just guessing lol. I'm basing this on that I have a dwell meter for setting up points ignition somewhere that I'm pretty sure has a tach reading and it just hooks up to the distributor IIRC.

TheFluff
Dec 13, 2006

FRIENDS, LISTEN TO ME
I AM A SEAGULL
OF WEALTH AND TASTE

Forseti posted:

Have you tried just hooking up the tach? Does it make a reading and it's just too slow? Just curious.

I believe the tach works on a spark ignition engine by counting the pulses from the ignition coil, which will make a pulse every time a spark plug for one of the cylinders fires. For a 4 stroke that would be 1 pulse per cylinder per two rotations I think. I would think that they'd be faking that on a diesel to make it easy to reuse a tach from a gasoline engine, but 14 seems like a lot? 33 seems waaaay too much although I agree with the assumptions you made to come up with that number.

Maybe I should research how these things actually work instead of just guessing lol. I'm basing this on that I have a dwell meter for setting up points ignition somewhere that I'm pretty sure has a tach reading and it just hooks up to the distributor IIRC.

I haven't tried it yet, the boat is 90 minutes from here. I think I'd like to dry-run it a bit first to see how it behaves, but I don't have a pulse generator handy to drive it with at the moment.

On an alternator-driven tach the number of pulses per revolution depend on how many poles the alternator has; mine has 6 which is apparently fairly common, but higher numbers also exist. Alternators typically want to run at around 6000 rpm to get full charge, and since my engine has a redline of 2600 rpm (lol) the belt pulley for the alternator drives it at something like 2.5x the engine rpm (I forget the exact numbers but I sized the alternator pulley to get me around 5000 rpm when the engine is at around 2000 rpm, which is about as fast as we ever run it). On more modern tachometers there's an adjustment screw (think it might just be a trim potentiometer?) that lets you adjust the frequency-to-voltage conversion they do internally so you can make them cooperate with your alternator, but these old VDO's seem to be made to a certain spec and aren't adjustable.

Annoyingly I don't have a datasheet for the original Volvo sensor unit so I don't have any more hard data to go off of, but I did find some random rear end old forum post somewhere which agreed with the 33 pulses/engine revolution number, fwiw.

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
Unfortunately, the state of modern electronics means that a microcontroller isn't overkill at all, and is probably the right answer.

Doing it discretely with no code is definitely more interesting, but you'd be spending weeks or even months designing and troubleshooting a system that ultimately is more brittle and expensive and worse in every way than buying a dev board for literally $2.


Advantage, though, is that you can bring your laptop to the boat and tweak it on the fly instead of pulling the whole unit out and taking it home

Forseti
May 26, 2001
To the lovenasium!
Ahhhh ok, yeah that makes a lot more sense. I do think an arduino based approach would be pretty straight forward, basically measure the period coming in and send the appropriate pulses that the gauge is expecting to see. You'd be a period behind that way, but still way faster than the tach or engine changes speed anyway, so it shouldn't matter at all. I think the trickiest bit would be the circuitry for the Arduino to tolerate the input and output at the appropriate levels.

So I think basically you'd want an Arduino (or some kind of microcontroller) doing the following:

1) Mesaure the period between input pulses (we'll call this T)
2) Scale this period for the output, e.g. 14*T/33 (call this Tprime)
3) Send a pulse every Tprime

No idea your level of familiarity with programming microcontrollers and I'm not super familiar with the way Arduino does things. You'd want a timer interrupt to keep track of real time, Arduino probably does this for you I would think (probably a global called 'ticks' or something like that). I'd use an input interrupt for the input pulses, e.g. every time the pin goes high, the microcontroller jumps to a certain routine, which would perform the scaling calculation. Then in a main loop send an output pulse every time the appropriate number of ticks have passed corresponding to the calculated Tprime.

Sorry for being vague, but I'm kinda thinking out loud myself :). The above is also assuming the arduino doesn't have any other responsibilities and can just spend its idle time just checking if enough ticks have passed.

Edit: I should say I'm using arduino and microcontroller pretty much interchangeably here because the Arduino is the easiest way to get started with a micro controller, but the same strategy would apply to something like a PIC as well

Cojawfee
May 31, 2006
I think the US is dumb for not using Celsius
Be careful though. Buying an arduino leads to projects, and projects lead to you having a GPS module and an LCD screen and you've made your own Garmin that happens to also have an RPM readout.

ekuNNN
Nov 27, 2004

by Jeffrey of YOSPOS
Does anyone have experience with Conductive transparent paint like this or something similar?
https://hollandshielding.com/Conductive-transparent-paint

I'm hoping to use it to transform some 3D-printed shapes into capacitive touch sensors with light on the inside, but it's really expensive so I'm hesitant to buy it without being able to test it first :ohdear:

Forseti
May 26, 2001
To the lovenasium!

ekuNNN posted:

Does anyone have experience with Conductive transparent paint like this or something similar?
https://hollandshielding.com/Conductive-transparent-paint

I'm hoping to use it to transform some 3D-printed shapes into capacitive touch sensors with light on the inside, but it's really expensive so I'm hesitant to buy it without being able to test it first :ohdear:

I don't have experience with the paint, but I did read this before which was fascinating: https://antennatestlab.com/3dprinting

They were trying to print a horn antenna and had to do a lot of post processing to get the conductive paint to work well enough. Buuuuut, an antenna is way more sensitive to conductive losses, your application should be a lot more forgiving. Still maybe helpful to see their experience though.

I would think the easiest thing to do would be to use copper tape stuck onto the plastic instead if you can conceal it readily enough. You could also try a conductive filament if your printer can use it, which conducts poorly (especially the cheap kind) but should be more consistent, and you could probably compensate with electronics (an op amp or transistor, some kind of amplifier basically).

TheFluff
Dec 13, 2006

FRIENDS, LISTEN TO ME
I AM A SEAGULL
OF WEALTH AND TASTE

ante posted:

Unfortunately, the state of modern electronics means that a microcontroller isn't overkill at all, and is probably the right answer.

Doing it discretely with no code is definitely more interesting, but you'd be spending weeks or even months designing and troubleshooting a system that ultimately is more brittle and expensive and worse in every way than buying a dev board for literally $2.


Advantage, though, is that you can bring your laptop to the boat and tweak it on the fly instead of pulling the whole unit out and taking it home

What kind of microcontroller are you thinking of here? The alternator voltage pulses can most likely be up to 15 volts and it's likely to be fairly noisy, and AFAIK at least Arduinos don't really handle that (but then again I don't know much about Arduinos). The input will be max around 650 Hz or so and the output pulse train up to about 1.35 kHz.

I don't disagree that a microcontroller is probably easier for me since I don't actually know poo poo about circuit design (code will be no problem since I'm a software engineer for my day job, although I've never worked with microcontrollers before), but since I've already found ~$3 IC's that seem specifically designed for this application I'm not sure why that would be worse? As far as I can tell the $3 LM2907 can run off of my existing 12V system (12V nominal, it's more like 11.8-14.5V in practical use) and happily tolerates up to 28V on the pulse input, and as far as I can tell all it needs to make a voltage out of my alternator frequency is two capacitors and a resistor. Converting that voltage back to a frequency seems a bit more involved, but I think it's within my capabilities to figure out.

Still all of this is a bit academic at the moment, I need to verify that the tach actually works like I think it does first. Ironically a microcontroller might be the easiest way to do that :v:

TheFluff fucked around with this message at 17:44 on Jun 14, 2021

Forseti
May 26, 2001
To the lovenasium!

TheFluff posted:

What kind of microcontroller are you thinking of here? The alternator voltage pulses can most likely be up to 15 volts and it's likely to be fairly noisy, and AFAIK at least Arduinos don't really handle that (but then again I don't know much about Arduinos). The input will be max around 650 Hz or so and the output pulse train up to about 1.35 kHz.

I don't disagree that a microcontroller is probably easier for me since I don't actually know poo poo about circuit design (code will be no problem since I'm a software engineer for my day job, although I've never worked with microcontrollers before), but since I've already found ~$3 IC's that seem specifically designed for this application I'm not sure why that would be worse? As far as I can tell the $3 LM2907 can run off of my existing 12V system and happily tolerates up to 28V on the pulse input, and as far as I can tell all it needs to make a voltage out of my alternator frequency is two capacitors and a resistor. Converting that voltage back to a frequency seems a bit more involved, but I think it's within my capabilities to figure out.

Still all of this is a bit academic at the moment, I need to verify that the tach actually works like I think it does first. Ironically a microcontroller might be the easiest way to do that :v:

What you're looking for is a VCO, a voltage controlled oscillator. You can buy ICs that only do that, but you'd get one included in something like a CD4046 PLL (for $0.66) and you could use only that part of the chip if you wanted to.

You are right that you'd need to convert the level for any microcontroller that I know of. There are lots of ways to do this, but my first thought would be to use an opto-isolator, which is an LED on one side (say, from the alternator) and a photodetector on the other side. Inside it will literally flash the LED when the alternator sends a pulse and convert this flash back into an electronic pulse on the other side at whatever supply voltage you give it. With the microcontroller you wouldn't need a VCO at all.

TheFluff
Dec 13, 2006

FRIENDS, LISTEN TO ME
I AM A SEAGULL
OF WEALTH AND TASTE

Forseti posted:

What you're looking for is a VCO, a voltage controlled oscillator. You can buy ICs that only do that, but you'd get one included in something like a CD4046 PLL (for $0.66) and you could use only that part of the chip if you wanted to.

You are right that you'd need to convert the level for any microcontroller that I know of. There are lots of ways to do this, but my first thought would be to use an opto-isolator, which is an LED on one side (say, from the alternator) and a photodetector on the other side. Inside it will literally flash the LED when the alternator sends a pulse and convert this flash back into an electronic pulse on the other side at whatever supply voltage you give it. With the microcontroller you wouldn't need a VCO at all.

With a microcontroller I'd probably need a separate power supply though :v:

Still this is very useful advice, and thank you! The idea I had was to use the aforementioned LM2907, where the output voltage is super easy to calculate, it's Vout = input_freq * Vcc * R1 * C1 where R1 and C1 are a user supplied resistor and capacitor respectively. The thing here though is that if I do that the output voltage becomes proportional to the supply voltage (Vcc), and the selling point of this whole deal was that I'd be able to hook it up directly to the existing 12V system, where the voltage easily varies by +/- 10%. To convert back I was looking at the LM231/LM331 voltage-to-frequency converters which seem a bit overkill for what I'm trying to do, and they have a much more convoluted circuit diagram:



And of course the big problem here is that the output frequency is not related to the supply voltage, so this would have some errors (or I'd need a regulated power supply - again). A VCO seems a lot more simple than this thing but I can't make heads or tails of the CD4046 datasheet. Microcontroller might be the way to go after all, as much as I don't want to write any code :smith:

TheFluff fucked around with this message at 19:13 on Jun 14, 2021

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
An optocoupler is also how I would read the pulses, yeah.

I'd probably pick up an Arduino nano*, a buck converter module, an optocoupler, and an isolated MOSFET breakout module off AliExpress/Amazon, and solder it all together.


By all means, go for the interesting/codeless solution first, but maybe have all the other components in reserve. I think you're going to run into issues, but without doing a detailed analysis, I would call them unknown unknowns. It's a learning experience, though, and definitely not wasted time.


* literally any dev board available can do this extremely modest task, I just named one at random that will be cheap, easy to get started with, and hasn't been hit by shortages afaik

longview
Dec 25, 2006

heh.

TheFluff posted:

[...]hook it up directly to the existing 12V system[...]

This isn't a great idea with modern vehicles and the situation is probably even worse for something old. Vehicle electrical systems are noisy, and all sorts of weird things can happen including +-100 V transients, battery reversal, running without a battery (generator only mode) with variable loads can cause seriously nasty overvoltage situations.

There are automotive voltage regulators you can use to take care of most of this, TI has some, I've used the TLE4274 from Infineon (rated to +-40 V on the input) with a varistor for protection. You could probably use a 10 or 12 V regulator for your analog circuitry.

Voltage-frequency/frequency-voltage conversion is a very old school way to do it, I would expect the accuracy and linearity would suffer compared to a digital design, but response speed might be better.
If moisture gets in your analog implementation will suffer, possibly stop working until it dries out, so conformal coating would probably be recommended.
A big benefit is there's no software to mess up, and there's usually no way for these ICs to glitch out due to some power supply noise like MCUs are very prone to.

The LM331 output driver is open collector so the output voltage can be whatever you need.
You'd need to know the characteristics of the load to know if the driver will be strong enough - you might need an output amplifier.

If you need precision the LM331 is probably much better than the 4046, the 4046 is mostly used as a PLL chip where the linearity and accuracy of the VCO is not as critical.

KnifeWrench
May 25, 2007

Practical and safe.

Bleak Gremlin

ekuNNN posted:

Does anyone have experience with Conductive transparent paint like this or something similar?
https://hollandshielding.com/Conductive-transparent-paint

I'm hoping to use it to transform some 3D-printed shapes into capacitive touch sensors with light on the inside, but it's really expensive so I'm hesitant to buy it without being able to test it first :ohdear:

I don't have experience with conductive paint, but I do have experience with custom capacitive touch sensors. The larger the area, the better the conductivity you'll need for predictable results. If your 3d printed shapes are small, it's probably fine, but plan for some testing and iteration.

For reference, I designed a mass-produced capacitive touch sensor that used carbon ink printed onto the substrate to reduce costs, but which still needed a 5cm* square lattice printed over that in silver ink in order to make it consistent. The carbon alone wouldn't have been conductive enough.

Since that paint is designed for shielding/ESD discharge, I'd imagine its conductive properties are nominal, and not super low resistance. That may lead to some flaky behavior in your capacitive touch controller.

*I don't trust my memory. Not to be used as design guidance

KnifeWrench fucked around with this message at 19:57 on Jun 14, 2021

TheFluff
Dec 13, 2006

FRIENDS, LISTEN TO ME
I AM A SEAGULL
OF WEALTH AND TASTE

longview posted:

This isn't a great idea with modern vehicles and the situation is probably even worse for something old. Vehicle electrical systems are noisy, and all sorts of weird things can happen including +-100 V transients, battery reversal, running without a battery (generator only mode) with variable loads can cause seriously nasty overvoltage situations.

There are automotive voltage regulators you can use to take care of most of this, TI has some, I've used the TLE4274 from Infineon (rated to +-40 V on the input) with a varistor for protection. You could probably use a 10 or 12 V regulator for your analog circuitry.

Voltage-frequency/frequency-voltage conversion is a very old school way to do it, I would expect the accuracy and linearity would suffer compared to a digital design, but response speed might be better.
If moisture gets in your analog implementation will suffer, possibly stop working until it dries out, so conformal coating would probably be recommended.
A big benefit is there's no software to mess up, and there's usually no way for these ICs to glitch out due to some power supply noise like MCUs are very prone to.

The LM331 output driver is open collector so the output voltage can be whatever you need.
You'd need to know the characteristics of the load to know if the driver will be strong enough - you might need an output amplifier.

If you need precision the LM331 is probably much better than the 4046, the 4046 is mostly used as a PLL chip where the linearity and accuracy of the VCO is not as critical.

Very good advice, thanks a lot, and thanks for encouraging the inconvenient desire to avoid a microcontroller! :v:

At this point I need to screw around with the tach a bit to see what it actually does before going further, so I'll report back!

Cory Parsnipson
Nov 15, 2015
Are small FPC cables really, really delicate? Or am I manhandling them? I have 3 Nintendo Switch thumbsticks like this one here:



and I'm finding that all of them stopped working. Or at least I think it's the thumbsticks because if I do a continuity test and voltimeter probe of all the downstream connections leading into my microcontroller, everything looks fine (I can even bridge some signals to ground and watch the analog signal go to 0, watch a button become pressed, etc). Why I think it's the thumbsticks is because until today, I had one hooked up working perfectly and then went to go add a second thumbstick. The second thumbstick looked like there was no connection, meaning I saw a very noisy analog signal that wasn't affected by the thumbstick movement. I took out the working one and swapped it into the second connector. At this point, I saw that the x axis was responding, but the y axis was noisy and not responding. But then when I went to put the good thumbstick back into the original spot, the x axis was good and the y axis was still broken! And soon after that, neither axis was good and all three were behaving the same.

Am I killing the connections with static shock? Or bending them too hard and causing some sort of internal breakage? I put them into and out of the ZIF connector with my fingers and as far as I can tell I don't use too much force, though occasionally I need to bend it 90 degrees to push it into the slot.

I'm not sure if that's enough information to give a sensible answer, but I'm trying to figure out if there's anything I can do to avoid going through packs of these like candy...

Cory Parsnipson fucked around with this message at 04:12 on Jun 16, 2021

Adbot
ADBOT LOVES YOU

mewse
May 2, 2006

Cory Parsnipson posted:

Are small FPC cables really, really delicate? Or am I manhandling them? I have 3 Nintendo Switch thumbsticks like this one here:



and I'm finding that all of them stopped working. Or at least I think it's the thumbsticks because if I do a continuity test and voltimeter probe of all the downstream connections leading into my microcontroller, everything looks fine (I can even bridge some signals to ground and watch the analog signal go to 0, watch a button become pressed, etc). Why I think it's the thumbsticks is because until today, I had one hooked up working perfectly and then went to go add a second thumbstick. The second thumbstick looked like there was no connection, meaning I saw a very noisy analog signal that wasn't affected by the thumbstick movement. I took out the working one and swapped it into the second connector. At this point, I saw that the x axis was responding, but the y axis was noisy and not responding. But then when I went to put the good thumbstick back into the original spot, the x axis was good and the y axis was still broken! And soon after that, neither axis was good and all three were behaving the same.

Am I killing the connections with static shock? Or bending them too hard and causing some sort of internal breakage? I put them into and out of the ZIF connector with my fingers and as far as I can tell I don't use too much force, though occasionally I need to bend it 90 degrees to push it into the slot.

I'm not sure if that's enough information to give a sensible answer, but I'm trying to figure out if there's anything I can do to avoid going through packs of these like candy...

Maybe the housing on the nintendo switch mechanically prevents movements to the outer limit of the joystick and that's what's killing them. Just a wild rear end guess because your board looks clean

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply