Step 2Design The Circuitry
The solution is a simple circuit that will briefly turn out actuator on and then off, even though the input is always high.
| « Previous Step | Download PDFView All Steps | Next Step » |
| « Previous Step | Download PDFView All Steps | Next Step » |

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.
r2 and r3 ?
Question for anybody: Could you please explain in more detail the circuit logic? (It's been forever since my electrical engineering courses. I actually feel kinda' embarassed)
I understand the NAND itself:
http://en.m.wikipedia.org/wiki/Negated_AND_gate?wasRedirected=true
...but I could use more help with the R/C delay, and mainly the R1 R2 leading into the Mosfet.
Thanks!
Essentially the delay is determined by the amount of time it takes C1 to charge up through R3. Once charged the input of U1 will go high and then because it is a NAND gate, the output goes low, and shuts the power off to Q1.
Now I'm not exactly sure why I put R1 in, I think an old engineer friend told me it was to prevent "noise" from triggering Q1.
The circuit didn't seem to work without R2, I think its acting as a pullup resistor to keep the logic gate stable.
Sorry I couldn't explain more, hopefully a real engineer can chime in :)
R1, according to my thinking, is not needed, since the motor driver you are using is a mosfet. They are voltage, not current operated, just like the CMOS NAND gate chip. If the engineer friend said it prevents noise, well, I guess so. I don't know enough to confirm or dispute it, but I can say for this application, it would most likely work fine without it.
R2 is needed. Why? Well, let's back up and look at R3 and C1. Normally, the alarm signal (just "alarm" for short) is low, or 0v. That means both of C1's terminals are connected to 0v ("GND" for short), and one of the GND's are coming from the alarm, though R3. Effectively, C1, if it had any charge, is emptied out now.
Going toward the NAND, we see that both of its inputs are tied together, forming one input. This effectively makes it an inverter (0 in, 1 out and vice versa). Since alarm is off, and C1 is discharged, the inverter's input sees a 0. That make the output 1, or high, or 5v, and that... wait a minute... that turns on the N-channel mosfet, which turns on the motor.... that's not right.... It's supposed to be off.
Okay, nevermind; imagine that a high signal means motor is off, and a GND or 0v or low means motor is on.
Anyway, when the alarm has been low for a while, C1 is discharged, the inverter sees a 0, outputs a 1 and motor does not move.
Now, the alarm goes off. Alarm goes high , and tries to make the motor signal high through R2, but the inverter is still outputting a high (C1 is still empty), and since both are high... the motor stays... off.
Anyway, C1 slowly fills up through R3 (it makes an RC, so the time it takes for this can be found with some math), the inverter eventually sees a high signal, so it sends out a low from its output. Now the inverter's output is low, and alarm is still high. Now we have conflict, but since alarm is weakened by R2, the inverter wins, and the resulting signal to motor is low which means the motor is... ummm... on. Yeah.
Okay, so that's not what we wanted the circuit to do, so.... let's try this, imagine the alarm signal is already high, and when the alarm goes off, it goes low. And we will scrap the motor's 1 = off, and 0 = on. Okay, let's try again.
C1 is full, the inverter is outputting a low, overriding alarm's weakened (high) signal, and the N-channel mosfet is cutting power to the motor. Yes, so far, the scenario sounds good.
Now, the alarm signal goes low, because it's annoying like that. Alarm is 0, C1 is still full, so until it empties through R3, inverter sees a 'full' C1, therefore, the inverter still outputs a 0, overriding the ... alarm's 0. So the motor is still off....
Okay, after C1 eventually empties through R3, the inverter finally sees a 0, so it outputs a 1. Alarm is still 0, so that means the inverter's 1 overrides the alarm's 0, so the motor is on.... and it stays that way until....
That's not right, this circuit cannot work as described. There is an error somewhere. Wait.... The NAND chip's datasheet says it has open collector outputs. Now THAT changes things! If the NAND's output was normal, there would be no point to having R2. Okay, let's go through this one more time.
First, what is open drain? It's just like open collector outputs. See wikipedia or something for what that means. For now, remember that the inverter's output is either disconnnected for a 1, and connects to 0v for a 0. We replace 1 with essentially disconnecting the output from the circuit.
Now, with everything else as described in the ible, let's go tackle it one more time.
Alarm is at 0. C1 is empty. inverter's output is 1 (disconnected), so the alarm's weakened signal trickles through R2 to make the N-mosfet cut power to motor. Motor is off.
ALARM GOES OFF!!!!
Alarm is 1. C1 is slowly filling up, but still looks empty. Inverter makes a judgement call that C1 is empty, and still outputs... nothing (because it's 1), meaning, since the inverter's output is powerless, alarm's weakened signal trickles through R2 to make the N-mosfet on, giving super awesome power to motor! The button gets pushed, we cheer hooray, and, oh no! C1 has finally filled up through R3 (remember, alarm stays 1), and oh no! inverter sees a 1! It now outputs a 0; it's no longer disconnected (ummm, it's now connected to 0v), and the super 0v coming from the inverter overrides the weak 1 (from alarm through R2), and N-mosfet gets 0, and power is CUT, the alarm signal, though still 1, is powerless because C1 stays filled, inverter stays 0, and motor stays off.
it WORKS!!! MUwahahahahaaaa!
Oh, and when the alarm is turned off (0) by lazy human, C1 makes inverter output 0, and alarm outputs 0, inverter wins and it's 0. When C1 finally empties, inverter sees 0, outputs a 1, meaning it's disconnected. Since alarm is 0 and inverter is disconnected, N-mosfet still sees 0, and motor is still not going anywhere.
Need motor to stay on longer? Make R3 (and/or C1) bigger. Motor on too long? make R3 (and/or C1) smaller.
The NAND chip's output MUST be open collector/drain! If it's not, you can make it so by using a resistor and a transistor (or just another N-mosfet).
Genius one-shot timer circuit. Who designed it?
I was originally trying to do it with a 555 as thats my go-to move. That didn't work as monostable 555s don't like to work with a constant trigger. So I asked a engineer at work (I'm an elec tech) and he directed me to a project's schematic that had a more complex version of this for a different purpose. So I used that as a template and changed some things to make it cheaper and better suited for the ABP.
I'm planning on using the same circuit for a different project but only with an AND gate to act as a power startup delay.
Yes, I was wondering why no 555 was used....
If you ever need to learn about making sequencing R/C circuits for more complicated things (such as pushing one button, and activating some other motor, then delay, then off), take a look at BEAM, it's a design philoophy that champions using simple discreet logic chips and circuits to do timed stuff (like a walking robot). With a little modification, "bicore" or "microcore" circuits would give you greater power over what your trigger signal can set into motion (the sequence could even respond to input from other signals to modify the sequence timing!).
For more info:
solarbotics.com (parts)
solarbotics.net (info and tutorials-highly recommended)
Wrist hurt from too much typing. Brain hurt from too much analytical critical thinking.