Help: Basic Electronics
Dec. 13th, 2006 08:47 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
This wound up getting sketched out on my whiteboard at work, but it seems simple enough to me that I can build it on a breadboard. I assume some of you fine readers have basic electronics clue, maybe even to the point of having actually applied your 6.002 knowledge recently. So, if you wouldn't mind reviewing the following and telling me if it makes sense...

V1 is 12V, V2 is 5V, but that's not terribly relevant. The idea is that if the switch S1 is closed, then the motor M1 will draw current through the transistors Q1 and Q2, with how much being determined by resistors R1 and R2. If current is flowing through Q1, then it's also flowing through the optoisolator, lighting the LED.
(Original version here; current flowing through Q1 also pulls current through Q3, and thence the relay, lighting the LED..)
Does the basic idea make sense? I assume that then I can put arbitrary digital junk on the right-hand side of the relay. I think I have my transistors in the right direction too. I can figure out actual values for parts later.
Edit: [14 Dec 2006] Updated schematic after commentary from
nonnihil.

V1 is 12V, V2 is 5V, but that's not terribly relevant. The idea is that if the switch S1 is closed, then the motor M1 will draw current through the transistors Q1 and Q2, with how much being determined by resistors R1 and R2. If current is flowing through Q1, then it's also flowing through the optoisolator, lighting the LED.
(Original version here; current flowing through Q1 also pulls current through Q3, and thence the relay, lighting the LED..)
Does the basic idea make sense? I assume that then I can put arbitrary digital junk on the right-hand side of the relay. I think I have my transistors in the right direction too. I can figure out actual values for parts later.
Edit: [14 Dec 2006] Updated schematic after commentary from
![[livejournal.com profile]](https://www.dreamwidth.org/img/external/lj-userinfo.gif)
no subject
Date: 2006-12-14 03:18 am (UTC)no subject
Date: 2006-12-14 12:28 pm (UTC)no subject
Date: 2006-12-14 12:46 pm (UTC)First off, you're using PNP transistors, which IIRC are generally a bit less efficient than NPN and require more current in cutoff. Consider switching to NPN.
It looks generally workable to me, although I wonder a bit about having two large, different inductances (the motor and the relay) there. It seems like a recipe for sparking at the switch and possible a bit of weird motor jerking. You might consider a largeish capacitor somewhere in the general vicinity of M1/Q2/U1. Shorting M1 with a capacitor will reduce sparking, while shorting Q2 with a capacitor might also reduce the chance that motor load jitter burns out Q2. Or just get a really huge Q2.
Oh, and a fuse. Always a fuse for anything driving a motor.
no subject
Date: 2006-12-14 02:57 pm (UTC)Maybe instead of the relay I actually want to use an optoisolator, though. I don't expect to be running any particular current on the LED/digital side of it, ind I do see loosely how multiple parallel inductance sources could be an issue. I should try to draw the result up tonight.
no subject
Date: 2006-12-15 01:06 am (UTC)no subject
Date: 2006-12-15 06:53 am (UTC)no subject
Date: 2006-12-15 11:38 am (UTC)The other exciting detail here is that I might not want variable-voltage DC across M1; there's an alternate standard where I can use +/-12V to send digital signals. That simplifies one aspect of this (I can send "don't move" across the tracks and still detect block occpancy, where now no voltage implies no current implies no detection). It complicates one aspect (the train can respond to the controller by manipulating its current draw). I can buy a DCC system off-the-shelf, but it's pricey, nice ones are overkill for the layout I have, and it still doesn't do signals.