Author Topic: transistor or mosfet instead of relay  (Read 623 times)

0 Members and 1 Guest are viewing this topic.

Offline Turbochardged

  • Contributor
  • Posts: 7
transistor or mosfet instead of relay
« on: April 15, 2021, 02:33:50 pm »
I'm currently using a 12V 20A relay to switch on and off a 12v 500ma timer. I'm not sure on what to use. I was thinking of using a transistor or mosfet, But i'm not sure on what and why. Does anyone have have a part they recommend? Currently the relay is powered 247, when the power drops out, the timer turns on.
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 6246
  • Country: ch
Re: transistor or mosfet instead of relay
« Reply #1 on: April 15, 2021, 05:18:29 pm »
Please explain the current setup better. What is driving what exactly? Can you explain what you're trying to do exactly?
 

Offline AmnevaR

  • Contributor
  • Posts: 18
  • Country: ua
Re: transistor or mosfet instead of relay
« Reply #2 on: April 15, 2021, 05:19:41 pm »
Maybe N-channel mosfet as a switch circuit is what you need?
Instead of the switch you can feed any signal to the gate of the mosfet (within reason of course, look at mosfet's datasheet)

https://circuitdigest.com/electronic-circuits/simple-mosfet-switching-circuit-how-to-turn-on-turn-off-mosfets

Online pigrew

  • Frequent Contributor
  • **
  • Posts: 612
  • Country: us
Re: transistor or mosfet instead of relay
« Reply #3 on: April 15, 2021, 05:27:37 pm »
One key advantage of a relay is isolation; there is no electrical connection from the primary to the secondary.

Is your control signal AC or DC? 12V logic? 5V logic?

Is your load AC or DC? Does it need electrical isolation from the control signal?

How often do you need to switch the load?

A photo of your setup could also be helpful.
 

Offline Turbochardged

  • Contributor
  • Posts: 7
Re: transistor or mosfet instead of relay
« Reply #4 on: April 15, 2021, 05:38:44 pm »
No isolation is needed. Basically a 12v DC 3A supply feeds a touch bar sensor that disconnects 12v when touched. I have a 12v DC 500mA timer that activates a 12v DC 30mA sounder. Since the touch bar drops power when activated, I have it connected to a 12v DC relay (C, NO). When the relay dies, it powers the timer and sounder until the bar is released.
 

Offline Turbochardged

  • Contributor
  • Posts: 7
Re: transistor or mosfet instead of relay
« Reply #5 on: April 15, 2021, 05:55:12 pm »
I was thinking about a high output transistor. I have a few " TIP42C"  and with a 10k across the base and emitter and a 2k from the touch bar 12v dc output to the base. The tip42c has a -5v Vebo.
 

Online ledtester

  • Super Contributor
  • ***
  • Posts: 1421
  • Country: us
Re: transistor or mosfet instead of relay
« Reply #6 on: April 16, 2021, 02:43:37 am »
I was thinking about a high output transistor. I have a few " TIP42C"  and with a 10k across the base and emitter and a 2k from the touch bar 12v dc output to the base. The tip42c has a -5v Vebo.

A schematic would be very helpful.
 

Offline perieanuo

  • Frequent Contributor
  • **
  • Posts: 558
  • Country: fr
Re: transistor or mosfet instead of relay
« Reply #7 on: April 16, 2021, 07:20:30 am »
if i guess right, you wanna cut power to your timer
the transistor driving the relay coil can drive a pnp transistor with emmiter on 12VDC rail, in that pnp collector you have the voltage for powering your timer
 or using a mosfet in some equivalent configuration (mosfet is nicer and you'll lose less voltage compairing with pnp solution)
the schematic depends on how your transistor drives your relay coil, put the schematic on paper and someone will show you the modifications accordingly
 

Offline Turbochardged

  • Contributor
  • Posts: 7
Re: transistor or mosfet instead of relay
« Reply #8 on: April 16, 2021, 02:49:02 pm »
if i guess right, you wanna cut power to your timer

Actually the opposite.
 

Online ledtester

  • Super Contributor
  • ***
  • Posts: 1421
  • Country: us
Re: transistor or mosfet instead of relay
« Reply #9 on: April 16, 2021, 04:34:59 pm »
You should tell us how you've programmed the XY-LJ02 -- i.e. which mode it is in:

https://www.katranji.com/tocimages/files/438402-214756.pdf

This is my understanding of how the circuit works - let me know if it's correct or not.

1. The touch bar normally holds relay RY2 energized which keeps the timer unit de-powered.
2. When the touch bar is activated RY2 is de-energized and power is supplied to the XY-LJ02 timer and the piezo alarm.
3. If the touch bar is deactivated RY2 is energized and power is cut from the timer and piezo.
4. If power remains supplied to the timer for some period of time the XY-LJ02 connects the NO and C terminals which energizes RY1.
5. When RY1 is energized it latches becoming permanently latched. This make the piezo alarm sound whether RY2 is energized or not.

So it seems you want an piezo to sound when the touch bar is touched and not sound when it's not touched except you want it to sound permanently if the touch bar is touched for more than a certain amount of time.
 

Offline Turbochardged

  • Contributor
  • Posts: 7
Re: transistor or mosfet instead of relay
« Reply #10 on: April 16, 2021, 06:39:48 pm »
You should tell us how you've programmed the XY-LJ02 -- i.e. which mode it is in:

https://www.katranji.com/tocimages/files/438402-214756.pdf

This is my understanding of how the circuit works - let me know if it's correct or not.

1. The touch bar normally holds relay RY2 energized which keeps the timer unit de-powered.
2. When the touch bar is activated RY2 is de-energized and power is supplied to the XY-LJ02 timer and the piezo alarm.
3. If the touch bar is deactivated RY2 is energized and power is cut from the timer and piezo.
4. If power remains supplied to the timer for some period of time the XY-LJ02 connects the NO and C terminals which energizes RY1.
5. When RY1 is energized it latches becoming permanently latched. This make the piezo alarm sound whether RY2 is energized or not.

So it seems you want an piezo to sound when the touch bar is touched and not sound when it's not touched except you want it to sound permanently if the touch bar is touched for more than a certain amount of time.

You got it. The timer is used in "P4" so the count down starts upon energize.
 

Online ledtester

  • Super Contributor
  • ***
  • Posts: 1421
  • Country: us
Re: transistor or mosfet instead of relay
« Reply #11 on: April 16, 2021, 07:10:38 pm »
An Arduino would be ideal for this kind of timing logic. You could replace the XY-LJ02 and both relays with an Arduino and a transistor.

Note that the XY-LJ02 is just a pre-programmed Arduino + a relay. If you could change its program you could get rid of the other relays. But Arduinos are so cheap you might as well just get one and program it yourself.

 
The following users thanked this post: AmnevaR

Offline perieanuo

  • Frequent Contributor
  • **
  • Posts: 558
  • Country: fr
Re: transistor or mosfet instead of relay
« Reply #12 on: April 19, 2021, 06:54:11 am »
if i guess right, you wanna cut power to your timer

Actually the opposite.
well, your schematics shows i'm right, you have the relay cutting/giving power to that timer
anyway, what i said before stays, just as someone sayd, arduino that drives some bjt/mosfet like i proposed is also my recommended solution, cheap, simple so reliable
 

Offline Turbochardged

  • Contributor
  • Posts: 7
Re: transistor or mosfet instead of relay
« Reply #13 on: April 19, 2021, 01:28:26 pm »
I'm not good at programming arduinos. What would a simple mosfet replacement look like?
 

Online ledtester

  • Super Contributor
  • ***
  • Posts: 1421
  • Country: us
Re: transistor or mosfet instead of relay
« Reply #14 on: April 20, 2021, 04:06:20 am »
This is what an Arduino program would look like:

Code: [Select]
#define TOUCHBAR_PIN 5
#define ALARM_PIN 6
#define RESET_PIN 7

// TIMER LIMIT is in milliseconds, 5000 = 5 seconds
#define TIMER_LIMIT 5000

// 0 = timer not started, 1 = timer started, 2 = timer reached limit
int state;

unsigned long touch_time; // when the touch bar was last touched

void setup() {
  pinMode(TOUCHBAR_PIN, INPUT); // input from touchbar
  pinMode(ALARM_PIN, OUTPUT);   // connected to gate of MOSFET, activates alarm when set to 1
  pinMode(RESET_PIN, INPUT);    // input from reset button
  digitalWrite(ALARM_PIN, 0);
  state = 0;
}

void loop() {
  if (state == 0) {
    if (digitalRead(TOUCHBAR_PIN)) {
      digitalWrite(ALARM_PIN, 1);
      touch_time = millis();
      state = 1;
    } else {
      digitalWrite(ALARM_PIN, 0);
    }
  } else if (state == 1) {
    if (digitalRead(TOUCHBAR_PIN)) {
      unsigned long elapsed = millis() - touch_time;
      if (elapsed > TIMER_LIMIT) {
        state = 2;
      }
    } else {
      digitalWrite(ALARM_PIN, 0);
      state = 0;
    }
  } else {
    if (digitalRead(RESET_PIN)) {
      digitalWrite(ALARM_PIN, 0);
      state = 0;
    }
  }
  delay(1); // delay a millisecond
}
 
The following users thanked this post: Turbochardged


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf