Closed washed closed 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)?
Good points, thanks! That looks good as well:
Low level seems to be around 80mV; should be totally fine for a TTL input.
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 :)
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.
No worries, I learned and used this stuff at some point and I had to look at the diagram three times.
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.
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)
Much complex
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 :)
See #11 for an updated version of this
Happy with this after initial testing. Also see #11, #5.
Some NPN BJT and a few resistors should do it, i think?![image](https://github.com/washed/drempelbox/assets/13495821/d02a0c94-e74f-4621-9bb1-491990d23c46)