Author Topic: Weird relay module driving  (Read 1312 times)

0 Members and 1 Guest are viewing this topic.

Offline ReWoPTopic starter

  • Contributor
  • Posts: 15
  • Country: pt
Weird relay module driving
« on: January 04, 2019, 11:00:44 pm »
Hi all, first i would like to say that i'm a electronics hobbyist with no formal education on this subject so please bare with me  :-BROKE  :P

I have those ebay 5V relay module with 3 pins - VCC, GND and IN - and to latch the relay i just need to pull IN pin to ground.

But the circuit that i intend to use to control it has a little quirk. I need to monitor a voltage source (about 9V) and i would like to drive the relay in the following manner:

1- If the voltage source = 0V Then relay OFF
2- If the voltage source = 9V Then relay still OFF
3- If the voltage source drops from 9V to 0V Then relay ON

The voltage source always starts at 0V, after 'x' amount of time it jumps to 9V, after 'y' amount of time it goes back down to 0V and after 'z' amount of time the whole "system" resets and repeats again.

I could use a microcontroller to implement this (like an Arduino) but i think its an overkill... I'm in the impression that this could be done with some transistor logic and also, maybe, with some OP AMP, but i can't get my head into it..


Please help!  :scared:

Big thanks in advance!  :-+
« Last Edit: January 04, 2019, 11:14:21 pm by ReWoP »
 

Offline soldar

  • Super Contributor
  • ***
  • Posts: 3595
  • Country: es
Re: Weird relay module driving
« Reply #1 on: January 04, 2019, 11:19:37 pm »
You want a falling edge (from 9 V to 0) to set a bistable? Then it stays set until when? It is never reset?
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline ReWoPTopic starter

  • Contributor
  • Posts: 15
  • Country: pt
Re: Weird relay module driving
« Reply #2 on: January 04, 2019, 11:39:26 pm »
You want a falling edge (from 9 V to 0) to set a bistable? Then it stays set until when? It is never reset?

Thanks for the reply!

The state should change (turn the relay ON) when the 9V is disconnected (voltage source is again 0V) and the relay should stay ON until reset (circuit voltage off then on).
 

Offline soldar

  • Super Contributor
  • ***
  • Posts: 3595
  • Country: es
Re: Weird relay module driving
« Reply #3 on: January 04, 2019, 11:55:21 pm »
That should be easy to do with an R-S flip-flop latch which can easily be built with a couple NAND gates. When the circuit powers up it is reset and when the 9 volts disappear it is set.

What voltage is the main circuit? The 9 volt will always be present when the main circuit powers up? 
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline ReWoPTopic starter

  • Contributor
  • Posts: 15
  • Country: pt
Re: Weird relay module driving
« Reply #4 on: January 05, 2019, 12:05:23 am »
What voltage is the main circuit? The 9 volt will always be present when the main circuit powers up? 

The main circuit is 20v but since the relay is 5V ill use a step down converter to get the 5V to this "monitor circuit" and relay operation.

When the circuit powers up the voltage source (the monitored voltage) is 0v.
 

Offline pwlps

  • Frequent Contributor
  • **
  • Posts: 372
  • Country: fr
Re: Weird relay module driving
« Reply #5 on: January 05, 2019, 12:47:17 am »
Maybe there is a simpler way but you can do it with two standard 74-family logic circuits: a 7474 D flip-flop with the clock input driven via a 7414 Schmitt inverter:
http://www.ti.com/lit/ds/symlink/sn74hc74.pdf
http://www.ti.com/lit/ds/symlink/sn74ahct1g14.pdf

The 7414 is needed to provide a fast enough clock edge (your 9V source won't necessary guarantee it, moreover it can have some oscillations when disconnecting).  The D input of the 7474 should be connected to the supply voltage via a RC filter to guarantee that D stays low for a few microseconds during the circuit startup/reset when voltages can vary.  The input of the 7414 inverter is driven by the 9V source via a voltage divider (to get 5V input), possibly adding a capacitor shunt to avoid any ringing when disconnecting if your 9V leads are long.
« Last Edit: January 05, 2019, 12:50:10 am by pwlps »
 

Offline soldar

  • Super Contributor
  • ***
  • Posts: 3595
  • Country: es
Re: Weird relay module driving
« Reply #6 on: January 05, 2019, 12:58:05 am »
This circuit is a start. A flip flop made with two gates. The 100K resistor and 100 K capacitor keep the reset low during startup so the circuit initializes reset.

The Set input will set the flip flop when driven low. If it is slow changing then it will need a schmit trigger.

Since it starts low we need a differentiator so that S goes low with the transition and not the state of the 9 volts.

I will try to complete it tomorrow. It is late here

All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline pwlps

  • Frequent Contributor
  • **
  • Posts: 372
  • Country: fr
Re: Weird relay module driving
« Reply #7 on: January 05, 2019, 12:58:39 am »
That should be easy to do with an R-S flip-flop latch which can easily be built with a couple NAND gates. When the circuit powers up it is reset and when the 9 volts disappear it is set.

He wants it to go on only when the voltage goes low a second time (not when it is low at startup) so I don't see yet how it could be made with a simple RS without edge-driven clock input. Interesting though...
 

Offline soldar

  • Super Contributor
  • ***
  • Posts: 3595
  • Country: es
Re: Weird relay module driving
« Reply #8 on: January 05, 2019, 01:01:09 am »
Yes, it needs a differentiator (capacitor) and schmit trigger if slow moving.
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline pwlps

  • Frequent Contributor
  • **
  • Posts: 372
  • Country: fr
Re: Weird relay module driving
« Reply #9 on: January 05, 2019, 01:02:07 am »
Since it starts low we need a differentiator so that S goes low with the transition and not the state of the 9 volts.

ah, I got it now, finally our solutions seem equivalent - but yours is sipmler I admit  :)
 

Offline soldar

  • Super Contributor
  • ***
  • Posts: 3595
  • Country: es
Re: Weird relay module driving
« Reply #10 on: January 05, 2019, 01:05:18 am »
Like this. You can use gates with schmitt trigger inputs to shape the input. Connect the 9 V through two gates.

CD4093b - quad nand gate with Schmitt trigger inputs

http://www.ti.com/lit/ds/symlink/cd4093b.pdf
« Last Edit: January 05, 2019, 09:07:43 am by soldar »
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline ReWoPTopic starter

  • Contributor
  • Posts: 15
  • Country: pt
Re: Weird relay module driving
« Reply #11 on: January 05, 2019, 07:24:02 pm »
Thanks you both for all the info!  :clap:

I don't thing than i have any nand gates IC, i thing ill have to order it and try that. :-+ :-+ :-+

But i found out that i have a over voltage and under voltage circuit board that operates a relay. I can program it to latch the relay if the monitored voltage is 0v, the problem with this board is that at startup the relay will latch because is 0v...

Is there a way to turn on this board only after the 9v is present then the board will take care of the relay when it goes back to 0v.

« Last Edit: January 06, 2019, 07:29:10 pm by ReWoP »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf