washed / drempelbox

0 stars 0 forks source link

Amp shutdown control #7

Closed washed closed 9 months ago

washed commented 9 months ago

Some NPN BJT and a few resistors should do it, i think? image

tmh-alex commented 9 months ago

Works. Guess you could crank up R1, R2, and R5 by a magnitude of ten. Should still be robust enough against noise and reduced power consumption. I wonder if R2 is needed at all (defeats the floating property, doesn't it)?

washed commented 9 months ago

Good points, thanks! That looks good as well:

Low level seems to be around 80mV; should be totally fine for a TTL input. image

tmh-alex commented 9 months ago

Waaait, aren't we overlooking the obvious? Is R5 even needed, either? According to the datasheet the base cutoff current is 50 nA, putting the upper limit of R1 to 52 MOhm. With 1 Mohm we'll surely be on the safe side with a base current of 2.6 mA. We can afford that :)

washed commented 9 months ago

I have to admit i am super rusty (ha!) on discrete stuff. It seems fine without R5 and an R1 up to ~20k from some quick sim.

tmh-alex commented 9 months ago

No worries, I learned and used this stuff at some point and I had to look at the diagram three times.

washed commented 9 months ago

Used a BC547C (first NPN i found in a bag^) and a 100k between base and gpio. works a treat. One potential (pun intended) issue: we need to tie two previously separated grounds together. We'll need to see if this has any adverse effects; the schematic assumed both grounds are already the same net.

tmh-alex commented 9 months ago

If that's a problem, try a 0.33 uF capacitor between the transistor base and the raspi ground. This should make a first order filter with the cutoff frequency at around 25 Hz (assuming R1=20 kOhm)

washed commented 9 months ago

PXL_20231029_204519821.MP.jpg

Much complex

washed commented 9 months ago

Software side is implemented by this: https://github.com/washed/drempelbox/commit/2e209eeeb605e9b5bdb4f3ad1ef7510ee3e0d448 we'll need to decide on when to switch on/off at some point. But now it is possible to do so :)

washed commented 9 months ago

See #11 for an updated version of this

washed commented 9 months ago

Happy with this after initial testing. Also see #11, #5.