Printable Version | Subscribe | Add to Favourites
New Topic New Poll New Reply
Author: Subject: Controlling lights etc with momentary switches
flak monkey

posted on 6/10/10 at 07:45 PM Reply With Quote
Controlling lights etc with momentary switches

One for the electrical wizards....

I ideally want to control all the lights on my bike with momentary push button switches on the handle bars, including the indicators.

Basically I want them to work so that you push the button once to turn the lights on, then again to turn it off.

Will a latching relay do this? Or do I need to look for something different or a different way of doing it? If its too complicated then I will start looking for compact latching push button switches





Sera

http://www.motosera.com

View User's Profile Visit User's Homepage View All Posts By User U2U Member
Davegtst

posted on 6/10/10 at 07:49 PM Reply With Quote
Yep a latching relay will do this.
View User's Profile View All Posts By User U2U Member
flak monkey

posted on 6/10/10 at 07:55 PM Reply With Quote
Are there different types of latching relay? I see that some require 12v to another coil to change switch 'off' the relay which would need another switch to cancel?





Sera

http://www.motosera.com

View User's Profile Visit User's Homepage View All Posts By User U2U Member
Davegtst

posted on 6/10/10 at 08:01 PM Reply With Quote
This should do.
http://www.cbsonline.co.uk/latching-change-over-relay-rly6lat-3594-p.asp

View User's Profile View All Posts By User U2U Member
MakeEverything

posted on 6/10/10 at 08:14 PM Reply With Quote
You want a Press to make Press to break relay. As dave suggests, one like the changeover relay that CBS offer.





Kindest Regards,
Richard.

...You can make it foolProof, but youll never make it Idiot Proof!...

View User's Profile E-Mail User View All Posts By User U2U Member
flak monkey

posted on 6/10/10 at 08:31 PM Reply With Quote
Thanks

Just need to find some compact push button switches that look ok now





Sera

http://www.motosera.com

View User's Profile Visit User's Homepage View All Posts By User U2U Member
40inches

posted on 6/10/10 at 08:38 PM Reply With Quote
quote:
Originally posted by flak monkey
Thanks

Just need to find some compact push button switches that look ok now

Something like these?

View User's Profile View All Posts By User U2U Member
owelly

posted on 6/10/10 at 08:45 PM Reply With Quote
I did a similar thing but used push to make to switch on and push to break to switch off. I used normal relays with the switched output looped through the push to break switch back into the coil. When you pushed the PTM switch, it triggered the relay and it stayed on because of the output being connected to the coil until you hit the PTB which released it. Probably a very complicated of doing somehting simple but thats what tedious nightshifts do to you...





http://www.ppcmag.co.uk

View User's Profile E-Mail User Visit User's Homepage View All Posts By User U2U Member
tony-devon

posted on 6/10/10 at 09:20 PM Reply With Quote
I normally use a volvo car headlight relay

with the lights off pressing it flashes full beam, with lights on, it toggles between hi and lo, and its just one wire to the switch

I normally build with fat bars and drill and tap them, then fit a microswitch, failing that theres some great bar mounting switch housings on britchopper





heavy is good, heavy is reliable, and if it breaks, hit them with it

View User's Profile E-Mail User Visit User's Homepage View All Posts By User U2U Member
Madinventions

posted on 7/10/10 at 12:35 AM Reply With Quote
At the risk of becoming slightly more complicated...

If there are several circuits to include it might be worth considering using a small microcontroller to handle the switches and control some standard (ie cheaper) relays? Almost certainly the way I'd do it, but then microcontrollers are my 'thing'. It'd let you do all sorts of odd things if buttons are held down or pressed briefly (ie flash indicator 3 times after a brief push, etc?)
Ed.



[Edited on 7/10/10 by Madinventions]





Mojo build diary: http://www.madinventions.co.uk

Solo music project: Syrrenfor http://www.reverbnation.com/syrrenfor

View my band website:
http://www.shadowlight.org.uk

http://www.eastangliankitcars.co.uk/

View User's Profile Visit User's Homepage View All Posts By User U2U Member
flak monkey

posted on 7/10/10 at 06:41 AM Reply With Quote
quote:
Originally posted by Madinventions
At the risk of becoming slightly more complicated...

If there are several circuits to include it might be worth considering using a small microcontroller to handle the switches and control some standard (ie cheaper) relays? Almost certainly the way I'd do it, but then microcontrollers are my 'thing'. It'd let you do all sorts of odd things if buttons are held down or pressed briefly (ie flash indicator 3 times after a brief push, etc?)
Ed.



Sounds clever Ed, always willing to learn something new

If you are at Diss on sunday I'll catch up with you there





Sera

http://www.motosera.com

View User's Profile Visit User's Homepage View All Posts By User U2U Member
BenB

posted on 7/10/10 at 11:56 AM Reply With Quote
It would indeed be a PoP with a nice little PIC. The only issue would be debouncing the switch either electronically or in software but that's hardly an untrodden path.
View User's Profile Visit User's Homepage View All Posts By User U2U Member
Madinventions

posted on 7/10/10 at 12:43 PM Reply With Quote
Debouncing in software is relatively simple. You just need to check the condition of the switch every few milliseconds via an interrupt loop. If the contacts are made, then increment a counter. If the contacts are open then decrement the counter. If the counter=0 then consider the button as not pressed. If the counter is greater than a certain number then it means that the switch has been pressed for a given duration. This makes it easy to check for short/long presses and even 'double clicks' given an extra bit of code.

Of course, it's only relatively simple because I do quite a lot of it. On the other hand, you should see my welding... Bloomin' awful!


I'd love to be able to help if I can Flak. See you Sunday.
Ed.





Mojo build diary: http://www.madinventions.co.uk

Solo music project: Syrrenfor http://www.reverbnation.com/syrrenfor

View my band website:
http://www.shadowlight.org.uk

http://www.eastangliankitcars.co.uk/

View User's Profile Visit User's Homepage View All Posts By User U2U Member

New Topic New Poll New Reply


go to top






Website design and SEO by Studio Montage

All content © 2001-16 LocostBuilders. Reproduction prohibited
Opinions expressed in public posts are those of the author and do not necessarily represent
the views of other users or any member of the LocostBuilders team.
Running XMB 1.8 Partagium [© 2002 XMB Group] on Apache under CentOS Linux
Founded, built and operated by ChrisW.