What's new
Van's Air Force

Don't miss anything! Register now for full access to the definitive RV support community.

Selectively Latching Momentary Switch Circuit

iamtheari

Well Known Member
This is for my smoke system. I plan to have an enable/disable switch on the panel, but I want the on/off control on my stick. I have a flashlight that works how I want it to work, but my one semester of EE courses in college didn't cover this.

The flashlight has one momentary button. When you tap it briefly, it latches the light ON. Tap it again to turn the light OFF. But if you hold the button down for more than about a half second, it just shines the light until you release the button.

I don't want to disassemble this particular flashlight to try to figure out the circuit. Does anyone have ideas on how to wire such a thing up without needing a microcontroller? I can make a latching circuit easily enough, but the dual function is beyond me.
 
Your flashlight does that through digital processing/logic using only a momentary switch. Not sure how you can replicate that for your application.

Larry
 
Your flashlight does that through digital processing/logic using only a momentary switch. Not sure how you can replicate that for your application.

Larry

What Larry said. Its done with a freq clock and a counter. Its digital logic. We didnt do digital circuits until second year EE...tho in reality I didnt learn proper digital design until I went to work doing it. However, if you built it it would have to be out of discrete components and it would be bulky, and probably suseptable to stray static electricity; not what you want for your smoke system - the flashlight guys built the functions into a chip they designed and sent out for fab, MOSAIC style.....if they even use that anymore.
 
What Larry said. Its done with a freq clock and a counter. Its digital logic. We didnt do digital circuits until second year EE...tho in reality I didnt learn proper digital design until I went to work doing it. However, if you built it it would have to be out of discrete components and it would be bulky, and probably suseptable to stray static electricity; not what you want for your smoke system - the flashlight guys built the functions into a chip they designed and sent out for fab, MOSAIC style.....if they even use that anymore.

That makes sense to me, that they would design a chip for their flashlights and have it mass-produced. It's a shame that Vertical Power won't let us reprogram the VP-X firmware to do things like this. Of course, that's one of those "what could possibly go wrong?" ideas that is better left on the drawing board. :)
 
I'd try to give a bit more thought to how it would operate while you're actually flying, before pursuing implementation. A pushbutton with no physical feedback of its condition leaves you without knowledge of its state. If it's a light in front of your eyes, great (maybe). But if its smoke out the back of the plane....

I'd find it easier to use a toggle or rocker switch that was center-off, momentary on in one direction and latching on in the other.

Just another perspective, FWIW.

Charlie
 
I think with some thought it could be done with some resistors, capacitors and a D flip flop or two. However, I think you are over complicating things unnecessarily. You would also need a logic power supply and drivers or relay to control the system.
Consider a mom-off-on toggle switch or slide switch. (On)-off-on.
A mini would fit on the stick.
KISS
 
Any chance of just lifting/transplanting the circuitry from the flashlight-----and using it to control some magic electronic widget capable of handling the current of the smoke system??
 
Child?s play with a $.70 PIC processor. Momentary pushbutton witch input, output to a small power MOSFET to run your relay coil. I?d be more than happy to write the code and burn you a chip if you can take it from there. I just don?t have the time to actually build it for you.

I?ve used the exact same program logic for many years in a number of products and projects.
 
Google bistable flip flop. This is a basic circuit from eons ago that might do what you want. Simple components. There are also bistable relays that also might do. No need for micros or programs.
 
Latching Relay

You need an InPower VCM-01 latching solid state relay. $55 at Waytekwire.com.

Ron B
 
A bistable or latching relay can turn the smoke on and off with button pushes, but the other part of what he's asking for is a little more involved. Yes, you can absolutely do it with discrete logic, but there's an easier and cheaper way. I'm a huge fan of gates and flip-flops amd registers... and still have not actually used one in over 15 years.

The program logic is dead simple. Watch the switch input. If you see the switch activated, start a timer to see if it's a short press or not. React accordingly. Switch debounce is a couple lines of code, and you can even set a max time for the outout if you want. Like I said, been there and done that.
 
dale hit it the easiest way,a pic 12f675 for less than a buck and a few other parts and done.

bob
 
OK, I got a little bored over the weekend. I've got a PCB laid out and firmware written to do this job.
  • Short press of the button (less than 1/2 second) toggles the smoke ON or OFF.
  • Holding the button down keeps the smoke ON until it's released.
  • There's a 5 minute timeout on the pushbutton, in case of a stuck button. That timeout is easily altered in firmware (at build time) but not after installation. I did include an extra input to disable to timeout entirely.
The whole thing is on a small PCB with a DB9 male connector. There's an onboard solid-state switch good for about 2A, plenty to drive a relay. I designed it to fit into a little plastic enclosure, about 1-1/5" x 2-5/8" to make it easy to place without worrying about shorting something. All it requires is power, ground, and a pushbutton input to ground. Output is a switch to ground (power MOSFET, if you care).

I personally have no immediate need for this widget. It's a fun little project, though, and I'm willing to put together a few if people are interested. If no one cares I'll file it away with the other stuff I've cooked up, proven works, and never actually used. :) If you want one, shoot me a PM. If I can unload enough to pay for the parts, I'll whip up a small batch.

And Bob, I actually moved to the 12F1840 a few years back. For a few cents more you get 4x the program memory and a whole lot more features, including a pull-up on GP3 -- saves a resistor. Note: Having said that, the firmware will fit comfortably in a PIC10F322 for slightly over half the cost. I just happen to have 12F1840s left on hand from previous projects. :)
 
Last edited:
dale, I use the 12F675 when ever I can as I have a couple thousand laying around that I use in a product that I designed about 8 or 10 years ago and am still selling. funny part is I was programming a bunch as I read this post. you know how it is, if it works and you got the part use it! its still a great part if you only need a little bit of code and a couple of I/O lines.

bob burns
 
dale, I use the 12F675 when ever I can as I have a couple thousand laying around that I use in a product that I designed about 8 or 10 years ago and am still selling. funny part is I was programming a bunch as I read this post. you know how it is, if it works and you got the part use it! its still a great part if you only need a little bit of code and a couple of I/O lines.

bob burns

Totally get it. I used the 627 originally, the 675 for a while, then the 683, then the 1840. I never bought in huge quantities because the volume discounts weren't there. If I were going to produce these, any of the above would work... but apparently no one is interested, so the design goes into the "nice, fun, works, no market for it" pile.
 
Dale, I hadn?t seen this thread. If you end up building any of these I?d take one. I have a momentary push button on my stick that I planned on using for smoke but hadn?t thought through how to work it. Planing a diy smoke system this spring. I would wire a bright red light on the instrument panel in parallel with the smoke pump so I know when it?s on.

Let me know.

Thanks

Jesse
 
I'd thought about making a few prototypes if there was interest. Having small quantities of high quality PCBs made is a whole lot cheaper and faster than it once was. Like I said, I have no real need for it myself yet. If I ever finish this biplane I'll equip it with smoke for sure, but Lord only knows when that will be.
 
Back
Top