M
M
Maxim2014-09-24 09:20:31
Do it yourself
Maxim, 2014-09-24 09:20:31

How to make a tricky relay?

There is a button that is pressed N-th number of times, you need to make sure that the contacts close and open only once at the output. What relay can be used? Mains voltage 12 volts.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
Sergey Petrikov, 2014-09-24
@RicoX

Any relay + microcontroller, the operation logic will be any.

M
Maxim, 2014-09-24
@iru

Implemented on carduino.

int val = 0;
void setup() {
pinMode(13, OUTPUT);
  
}

void loop() {
  
  if(digitalRead(10)==HIGH)
  {
   if(val==0){
   digitalWrite(13,HIGH);//включаем светодио
   delay(1000);  
   digitalWrite(13, LOW);
   val++;
   } 
 }
 else
 {
 digitalWrite(13,LOW);//выключаем
 }
}

On the 13th and GND we put an output relay.
On the 10th and + 5v We put the input.

T
tugo, 2014-09-24
@tugo

The logic of the work is not fully understood.
If you need to press the button N times - the relay closes, opens. At what pressure did the relay close? How long should the relay be closed? Is the logic repeated for the next N clicks?
But for example:
1. Programmable relay PR110
Implement the logic you want.
2. Make on microcircuits of logical elements. Put them on a breadboard or printed circuit board.
3. Implement logic on Arduino.Relay_module_connection_to_Arduino.jpg

R
Roman, 2014-09-24
@Smirrom

On Arduino, you will need:
1. Arduino Nano (Chinese can be) - 120 rubles on AliExpress
2. Relay module - 70 rubles on AliExpress
3. Converter 5-12 V (any car charger with USB).
The program will be 5 lines in C++.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question