View Full Version : Help! Latching R/C Switch
Bearded Flyer
Jan 27, 2006, 06:03 PM
I want to put a white LED in the nose of my Easystar powered from the BEC to make it easier to see which way it is pointing. The only spare channel I have is channel 4 which is a proportional channel (Rudder one Channel 1, Elevator on 2, Throttle on 3, co-pilot on 5 and home made PIC camera switch on 6).
I am look for a DIY switch that will turn on when the stick is fully one way, off when it is fully the other and stays either on or off when the stick is in the middle i.e. latching as I don't want to have to hold the stick one way to keep the light on. I have searched this forum and the internet and not found what I am looking for.
Does anybody have a circuit that will do this? I have some experience in programming PIC's and have some spare 12F629's, 16F84's and others that I could use (I cannot 'burn' the 'C' chips only the 'F' type) however if a circuit already exists then it would be easier and quicker.
Thanks in advance.
Richard
TEM
Jan 27, 2006, 06:33 PM
I haven't touched this stuff for a while and I don't want to sound like an idoit and get bashed be you pro's out there. But have you considered using a flip flop and some debouncing and use it as your latch instead of messing with PIC and such... Just a thought.....
Comatose
Jan 27, 2006, 07:00 PM
A Picoswitch (ad right above the thread) has some hysteresis (60us) about the center point, so it will do what you want as long as you don't bump it too much adjusting the throttle. If you have ATV on that channel and dial it down to about 20% throw you'd have exactly what you want.
Not exactly DIY though.
Bruce Abbott
Jan 28, 2006, 03:12 AM
Here's the source code and HEX file (12F629/75) for a switch with hysteresis. It turns on at <1.3mS, and off at >1.7mS. At in-between pulse lengths it holds the last state.
Connections are:- Servo pulse input on pin 4, switched output on pin 5, +5V on pin 1 and Ground on pin 8. I recommend placing a 100nF capacitor across the power supply pins, and a 1k resistor in series with pin 4. The PIC will drive about 20mA into a white LED (with 56 Ohm current limiting resistor) connected between pin 5 and +5V.
Just case you're wondering what the other pins do, there's a glitch-filtered servo output on pin 7, and signal status on pin 2.
Bearded Flyer
Jan 28, 2006, 05:40 AM
Thanks Bruce,
That is exactly what I wanted. I can now get to work and add some more weight to my overloaded plane!
Richard
Bearded Flyer
Jan 28, 2006, 05:25 PM
Bruce,
I have burned the PIC, mounted the LED (off a £1 multitool - cheaper than buying it separate!) in the nose pointing slightly down and it works perfectly.
Thanks again
Richard
realglow
Jan 29, 2006, 09:36 AM
A slide switch, mechanically moved by the subject servo when it is at the extreme positions, would be the most economical, but not the most cool....
pbunn
Jan 30, 2006, 03:28 PM
"A slide switch, mechanically moved by the subject servo when it is at the extreme positions, would be the most economical, but not the most cool...."
Not! the pic is less than $2 - servo and switch - way more cost.
pbunn
Jan 30, 2006, 03:37 PM
Bruce - Thanks for sharing the code - I was just getting ready to start programming a PIC 12c508 to drive a IRF Photovoltaic relay for a glow plug driver.
This will save me lots of time.
Pat Bunn
Dan Baldwin
Jan 30, 2006, 04:21 PM
Bruce - Thanks for sharing the code - I was just gettig ready to start programming a PIC508 to drive a IRF Photovoltaic relay for a glow plug driver.
This will save me lots of time.
Pat Bunn
I assume you are talking about a photovoltaic opto isolator. Which one did you find, and where did you find it? That's one of the projects I was going to work on one of these days, but I've had trouble finding the isolators at a reasonable price, so I was just going to use a small pulse transformer, and a diode and capacitor on the secondary to turn the fet on.
Dan
pbunn
Jan 30, 2006, 08:24 PM
DigiKey - same one used in the optoglow 2 by IR - about $4.50each
Pat Bunn
pbunn
Jan 31, 2006, 11:51 AM
Here is a photo of my glow driver - missing the Opto but the PIC is tested and works great (lights the LED)
Tomapowa
Feb 06, 2006, 01:17 AM
Many DIY ideas here...
http://www.diyrc.com
Controlling lights/LEDs from one R/C channel?.... check this out:
http://diyrc.com/RC-14c.html
vBulletin® Copyright ©2000-2009, Jelsoft Enterprises Ltd.