When the key was pressed I need the arduino to switch a relay which turns on 12v leds, a simple relay.

Thread Starter

E-Newbie

Joined Jun 28, 2007
26
Hello,

Im really sorry im confused on this topic can someone help me find a relay for the following job please? I have a touch sensor connected to an arduino, when pressed I need the arduino to switch a relay which turns on 12v leds, I need the relay to stay switched on (leds stay on) till the switch is pressed again? Not sure if the arduino is even needed in any of this but I dont know enough about electronics. Could someone help me find a suitable relay for this please?

Thank you
 

djsfantasi

Joined Apr 11, 2010
9,156
The action you have described is called a toggle. While I often use Arduinos, I agree that one is overkill for this project.

Dodgydave’s suggestion of a CD4013 is a good one. So is Scott’s suggestion of a logic level MOSFET. (You’d need one anyway to switch a relay. But you might as well use it to drive the LEDs directly. Driving a relay with electronics is tricky anyway.)

Search for “CD4013 toggle switch” for circuits.
 

MrSalts

Joined Apr 2, 2020
2,767
If you only have an Arduino, it is a cheap/easy solution to build what you want. If you use another chip, you'll have to design a board or use a strip board or perf board to mount the chip. Using the Arduino is super easy if you have one available for this project.
By the time you order an alternative chip, board, shipping costs and your time - there is really no cost saved if you have an Arduino on hand that you can dedicate to this project (even if it is "overkill".
 

ScottWang

Joined Aug 23, 2012
7,397
The action you have described is called a toggle. While I often use Arduinos, I agree that one is overkill for this project.

Dodgydave’s suggestion of a CD4013 is a good one. So is Scott’s suggestion of a logic level MOSFET. (You’d need one anyway to switch a relay. But you might as well use it to drive the LEDs directly. Driving a relay with electronics is tricky anyway.)

Search for “CD4013 toggle switch” for circuits.
He wants to using the key to control, but I used sound to control.
The sound active control circuit.
 

ElectricSpidey

Joined Dec 2, 2017
2,758
I would do this in software.

Have an interrupt check to see if a variable is odd or even, then change the state of the output based on the result.

Then increment the variable.

Then at some point reset the variable.

Then just use a MOSFET to drive the LEDs.
 
Last edited:

Thread Starter

E-Newbie

Joined Jun 28, 2007
26
Thank u all for your help, I'm not sure of the led current its approximately 3m of white leds 60 leds per m, so not too high a current I'm using a 12v 2.5a led driver just because I had a few lying around. The switch goes behind a piece of glass for an infinity mirror, when pressed I just need the leds to come on, when touched again I just need them to turn off :)
Its the relays and mosfets and electronics side I dont understand the code I can do :) I've used relays before but years and years ago will read up on the CD4013
 

eetech00

Joined Jun 8, 2013
3,859
Hello,

Im really sorry im confused on this topic can someone help me find a relay for the following job please? I have a touch sensor connected to an arduino, when pressed I need the arduino to switch a relay which turns on 12v leds, I need the relay to stay switched on (leds stay on) till the switch is pressed again? Not sure if the arduino is even needed in any of this but I dont know enough about electronics. Could someone help me find a suitable relay for this please?

Thank you
Use something like this.
Connect to arduino GPIO output pin and toggle the output pin to switch the relay on/off.

https://www.amazon.com/HiLetgo-Channel-Latching-Bistable-Control/dp/B00LW2VLS0?psc=1
 

ericgibbs

Joined Jan 29, 2010
18,766
Hi E,
A 12Vdc relay with 3A to 5Amp rated contacts will be OK.
You will need either transistor or small FET to drive the relay, also a diode across the relay coil to suppress the back emf.

Write your best shot at an Arduino Sketch and post it, so we can debug as required.
Is Uno, Nano or .???

E
 

Audioguru again

Joined Oct 21, 2019
6,673
Why use an antique relay?
If the relay is used many times then it wears out and must be replaced.
If the relay is not used often then its contacts get oxidized and the relay will need replacement.
A transistor or Mosfet can replace the relay and last "forever".
 

Thread Starter

E-Newbie

Joined Jun 28, 2007
26
Thank u all, I dont need to use a relay specifically I was just looking for ways to control some lights but with a touch switch that is going to be sealed behind some glass so I dont want to risk blowing the touch switch and I believe the switch runs on 3-5v so I can't just connect it to the 12v led driver lol :) just wanted the simplest, cheapest way to turn on the leds using some sort of touch button that i can place behind a piece of glass
 

boostbuck

Joined Oct 5, 2017
501
A simple capacitive sensor tied to a relay driver board would be the simplest to my thinking. No coding required.

A quick search turned up these two devices: sensor switching a relay - there are many such devices.
 

MrSalts

Joined Apr 2, 2020
2,767
You'll have to bond the sensor pad to the glass to remove the air gap which will give more reliable operation. Anything from a dot of silicone, acrylic adhesive or a cyanoacrylate all should work. The silicone will allow easier disassembly/repositioning if needed. If you go cyanoacrylate, get the solvent free or "foam safe" versions. Also, the new UV cured J.B. Weld acrylic is really easy to work with and instant cure on UV exposure.
 

Thread Starter

E-Newbie

Joined Jun 28, 2007
26
I've been really stupid in all of this, I can just use a 5v led strip lol so if I had just a 5v led strip, I need some sort of touch switch that turns the leds on when touched once and off when touched again, I've been put off relays now, cos I didnt want to change it later on and if I remember last time I used a relay it made a click sound when turning on and off, I know that's trivial lol

MrSalts, I have uv cured oca for bonding a sensor to the glass :) I'm just used to working with normal on off switches so the circuit for all of this has just confused me and I havent used mosfets or transistors before :(
 

MrSalts

Joined Apr 2, 2020
2,767
I've been really stupid in all of this, I can just use a 5v led strip lol so if I had just a 5v led strip, I need some sort of touch switch that turns the leds on when touched once and off when touched again, I've been put off relays now, cos I didnt want to change it later on and if I remember last time I used a relay it made a click sound when turning on and off, I know that's trivial lol

MrSalts, I have uv cured oca for bonding a sensor to the glass :) I'm just used to working with normal on off switches so the circuit for all of this has just confused me and I havent used mosfets or transistors before :(
Just because the sensor and LEDs are both 5v doesn't mean you can switch the LEDs with a capacitive touch switch. The cap touch sensors I know cannot handle the high current of the LED strips. And, 5v strips will generally need much more current than a 12VDC strip for the same light.
 

Reloadron

Joined Jan 15, 2015
7,501
Working with a 5 volt signal be it from an Arduino, other micro controller or even a discrete circuit like a TTL or CMOS device, a CD4013 or SN7474 D flip flop you will need enough current handling capability to drive your LED string. A Logic Level MOSFET is a good choice. The FQP30N06L would likely be a good choice. As per Mr. Salts this will always come down to your last stage supplying enough current to drive your LED string or load. 12 Volt LED strings are common and easily driven with a simple MOSFET.

Ron
 
Top