Go Back   Home > Forums > >
Home Forums Rules Articles diyAudio Store Blogs Gallery Wiki Register Donations FAQ Calendar Search Today's Posts Mark Forums Read

Analog Line Level Preamplifiers , Passive Pre-amps, Crossovers, etc.

Help with one button relay input switching
Help with one button relay input switching
Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 10th January 2018, 12:56 PM   #11
satx is offline satx  United States
diyAudio Member
 
Join Date: May 2012
Location: San Antonio, Texas
OK. Maybe that's why my current flip flop module isn't working. It's supposed to be able to drive relays directly though.

Any specific transistor I should use?

And is the rectangle in the schematic a resistor? Is that to set the output voltage?
  Reply With Quote
Old 10th January 2018, 01:03 PM   #12
nigelwright7557 is offline nigelwright7557  United Kingdom
diyAudio Member
 
nigelwright7557's Avatar
 
Join Date: Apr 2008
Location: Carlisle, England
Quote:
Originally Posted by satx View Post
Thanks

I honestly don't know what I mean by non pcb mounting either I'm just looking for the easiest way to deal with an IC without using a PCB. I already have discreet parts and modules all over the place.
Use stripboard and then you can use DIL pcb sockets on it.
__________________
PCBCAD51 pcb design software. 2018 version out now with lower prices >> http://www.murtonpikesystems.co.uk
  Reply With Quote
Old 10th January 2018, 01:48 PM   #13
Mooly is offline Mooly  United Kingdom
diyAudio Moderator
 
Mooly's Avatar
 
Join Date: Sep 2007
Help with one button relay input switching
Quote:
Originally Posted by satx View Post
OK. Maybe that's why my current flip flop module isn't working. It's supposed to be able to drive relays directly though.

Any specific transistor I should use?

And is the rectangle in the schematic a resistor? Is that to set the output voltage?
Pretty much any small signal high gain NPN transistor would be fine such as BC546. The resistor limits the base current to the transistor. Absolute value depends on the supply voltage and transistor gain and so with 12 volts you would need something in the 5k6 region.

The idea is to get the transistor to operate as a switch, fully on or fully off. If we haven't enough base current then the transistor will still turn on, but not fully. That would mean some voltage would be 'wasted' across the transistor and the relay would not see the full 12 volts needed.
  Reply With Quote
Old 10th January 2018, 06:20 PM   #14
russc is offline russc  England
diyAudio Member
 
Join Date: Mar 2011
Location: W Yorkshire
Hi, in response to post 4.
Yes, the Arduino provides the switching logic.
Fig 4 on the ESP page shows something similar with a PIC.
One button would cycle 1,2,3,1,2,3,...
Second button only if you want to cycle 3,2,1,3,2,1...
The ULN chip, exactly as ESP post 3. It does the same as Mooly's transistor in post 8 but drives up to 7 relays from 1 chip.
The Arduino would also work with the transistor switch.
  Reply With Quote
Old 16th January 2018, 11:48 PM   #15
Gusser is offline Gusser  United States
diyAudio Member
 
Join Date: Feb 2014
Default Contact Bounce?

You may have bounce issues with a simple switch pulling the clock line up or down. No mechanical switch goes simply ON/OFF. They oscillate back and forth for a few milliseconds while the contacts are moving. Too fast for the eye to see but the clock line sees it as multiple button pushes.

A dirt cheap solution is a capacitor across the switch but you get what you pay for. it can still bounce or can have a lag.

Better is an active debounce circuit before the clock input. There are many examples on line.

Last edited by Gusser; 16th January 2018 at 11:52 PM.
  Reply With Quote
Old 17th January 2018, 12:54 PM   #16
satx is offline satx  United States
diyAudio Member
 
Join Date: May 2012
Location: San Antonio, Texas
Sorry about my absence there guys, I had the flu last week.

Gusser, thanks for the heads up on the bounce issue. I think I'll try it without the debounce and then look into that if I have problems with the simpler circuit.
  Reply With Quote
Old 17th January 2018, 12:57 PM   #17
satx is offline satx  United States
diyAudio Member
 
Join Date: May 2012
Location: San Antonio, Texas
Quote:
Originally Posted by Mooly View Post
Pretty much any small signal high gain NPN transistor would be fine such as BC546. The resistor limits the base current to the transistor. Absolute value depends on the supply voltage and transistor gain and so with 12 volts you would need something in the 5k6 region.

The idea is to get the transistor to operate as a switch, fully on or fully off. If we haven't enough base current then the transistor will still turn on, but not fully. That would mean some voltage would be 'wasted' across the transistor and the relay would not see the full 12 volts needed.

I have a bunch of 2N3906 transistors. Would that work in this application?

Also the circuit you drew, I'd need one for each of the inputs, correct? So, one resistor and one transistor for each relay I intend to switch?

Thanks
  Reply With Quote
Old 17th January 2018, 12:59 PM   #18
nigelwright7557 is offline nigelwright7557  United Kingdom
diyAudio Member
 
nigelwright7557's Avatar
 
Join Date: Apr 2008
Location: Carlisle, England
Quote:
Originally Posted by satx View Post
I have a bunch of 2N3906 transistors. Would that work in this application?

Also the circuit you drew, I'd need one for each of the inputs, correct? So, one resistor and one transistor for each relay I intend to switch?

Thanks
2n3904 is the npn version of that transistor.
Don't forget to put reverse biased diode across relay coil to stop back emf's blowing 2n3904.
__________________
PCBCAD51 pcb design software. 2018 version out now with lower prices >> http://www.murtonpikesystems.co.uk
  Reply With Quote
Old 17th January 2018, 07:17 PM   #19
Gusser is offline Gusser  United States
diyAudio Member
 
Join Date: Feb 2014
Default You could but...

Quote:
Originally Posted by satx View Post
I have a bunch of 2N3906 transistors. Would that work in this application?

Also the circuit you drew, I'd need one for each of the inputs, correct? So, one resistor and one transistor for each relay I intend to switch?

Thanks
You can use PNP but then everything is backwards so to speak.

The emitter goes to VCC.

The collector goes to the relay coil (+ side if any)

The other side of the relay coil is grounded.

The base needs a low value resistor in the hundreds of ohms range and turns on the relay by taking that resistor to ground or below 0.6v, opposite of the NPN version where the relay turn on by taking the resistor to V+.

You should pull the base up to VCC with about 47K to make sure it stays off when expected to.

You still need the diode with the anode to ground and the cathode to the PNP collector.

If still using the 4017, now you need and inverter for each relay driver. Far better IMO to just buy some 2N3904's. They cost pennies.

Last edited by Gusser; 17th January 2018 at 07:20 PM.
  Reply With Quote
Old 18th January 2018, 07:24 AM   #20
Mooly is offline Mooly  United Kingdom
diyAudio Moderator
 
Mooly's Avatar
 
Join Date: Sep 2007
Help with one button relay input switching
Quote:
Originally Posted by satx View Post
I have a bunch of 2N3906 transistors. Would that work in this application?

Also the circuit you drew, I'd need one for each of the inputs, correct? So, one resistor and one transistor for each relay I intend to switch?

Thanks
Missed your reply yesterday.

As the others have said, the transistor has to be NPN for simplicity.

You could use two PNP's plus another resistor per relay but then you more than double the component count.
Attached Images
File Type: jpg Capture.JPG (54.7 KB, 161 views)
  Reply With Quote

Reply


Help with one button relay input switchingHide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Controlling a latching relay with a single button? curupa Parts 3 27th October 2012 06:18 AM
Question regarding Max. Switching rate push button for Class-D amp + accessories eladmi Class D 3 24th October 2012 12:08 AM
Switching loudspeaker with relay quietdragon Solid State 8 3rd November 2011 04:46 AM
need dpdt switching relay help subaruzero Parts 1 27th September 2006 07:27 PM
Relay switching circuit please jnewbold Solid State 10 3rd March 2005 06:39 AM


New To Site? Need Help?

All times are GMT. The time now is 03:19 PM.


Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 15.00%
vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
Copyright ©1999-2018 diyAudio
Wiki