Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

electronic switch design

Status
Not open for further replies.

goshantry

Newbie level 6
Joined
May 4, 2012
Messages
14
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Location
Delhi, India
Activity points
1,361
untitled.JPGi am trying to build a simple electronic switch with a transistor, relay and a microcontroller. i want to turn on the relay only when ethe microcontroller gives a high output. i am trying to simulate this circuit but cannot get the desired ac output.
please help me on this.
 
Last edited:

In your schematics voltage is set to off hence it is zero volts every where. Let it be active fulltime then relay will switch power to 1K resistor.
Are timing in mS? Is your code working perfectly? Which microcontroller is in use?
 
i am using 8085 microcontroller.
i want to switch my circuit for ac voltage so why should i supply dc voltage in my schematic.
plz explain
 

V5 is AC voltage to be switched through relay. Live wire should be controlled through safety purpose not ground wire.
DC 10V (V1) is to supply control circuit, relay and 5v for microprocessor. Relay coil voltage rating should be according to dc supply.
 
but if i do not connect the ground with the ac supply the program shows errors for floating nodes

could you tell me if there is anything wrong with the circuit
 

i tried to change the position of the ac source but the circuit is not switching the output. i am still getting perfect ac voltage at the output.
what could be the cause of this?
 

View attachment 73695i am trying to build a simple electronic switch with a transistor, relay and a microcontroller. i want to turn on the relay only when ethe microcontroller gives a high output. i am trying to simulate this circuit but cannot get the desired ac output.
please help me on this.


Can you define when uC give signal or what is conditions for that. All of this is possible with simple Ne555 timer.
 

i am still getting perfect ac voltage at the output.
what could be the cause of this?
Your circuit is OK, you're just measuring the voltage on the wrong side of the load resistor.

For safety, change your circuit as ALERTLINKS showed, so that one end of R1 is connected to ground. Then probe the voltage at the other end of R1.
 

Can you define when uC give signal or what is conditions for that. All of this is possible with simple Ne555 timer.

i want that my uC should give the on pulse for 5 min and off pulse for 5 min.
but as orcad is taking ages to simulate those values so i have reduced the time for simulation

---------- Post added at 16:09 ---------- Previous post was at 16:07 ----------

Your circuit is OK, you're just measuring the voltage on the wrong side of the load resistor.

For safety, change your circuit as ALERTLINKS showed, so that one end of R1 is connected to ground. Then probe the voltage at the other end of R1.


i changed the circuit and had placed the probes everywhere but still cannot get the desired output
 

Did you check the voltage at the base and collector of Q1 to make sure it is switching on and off?

What relay are you using? Perhaps 10V is not enough to switch it. e.g. If the coil is rated at 24V, then the relay will not switch on with 10V.

btw, I think R2 should be much higher - perhaps 100 Ohms. The 10 Ohm resistor you have will draw a lot of current from the microcontroller.
 
Did you check the voltage at the base and collector of Q1 to make sure it is switching on and off?

What relay are you using? Perhaps 10V is not enough to switch it. e.g. If the coil is rated at 24V, then the relay will not switch on with 10V.

btw, I think R2 should be much higher - perhaps 100 Ohms. The 10 Ohm resistor you have will draw a lot of current from the microcontroller.


the transistor is showing the clock pulse as it is.
the output voltage across the load is now rising linearly
 

You've got ONTIME = OFFTIME = 10 microseconds. That's much too fast for a relay to switch. Try ONTIME = OFFTIME = 1 Second.
 

i want that my uC should give the on pulse for 5 min and off pulse for 5 min.
but as orcad is taking ages to simulate those values so i have reduced the time for simulation

This can be done with uC, but I think this is job for simpler IC not for uC. Of course its ok if You whant to learn how to do it. Circuits should be easy as possible.
 

but as orcad is taking ages to simulate those values so i have reduced the time for simulation
Can't you increase the timestep in the simulator to make it run faster?

Timestep = 100uS should be OK with 50Hz AC and ONTIME = OFFTIME = 1 Second.
 

Relay switch action is delayed 5mS-40mS due to mechanical movement. See properties of relay in simulator. Also set coil voltage to 10V, as it is source volage or change V1 accordingly. Set on/off delay time not less than 50mS to let relay operate.
 
Can't you increase the timestep in the simulator to make it run faster?

Timestep = 100uS should be OK with 50Hz AC and ONTIME = OFFTIME = 1 Second.

when i increased the time step to 100uS then it showed error after 10% that the voltages and current failed to converge.

---------- Post added at 10:35 ---------- Previous post was at 09:24 ----------

Relay switch action is delayed 5mS-40mS due to mechanical movement. See properties of relay in simulator. Also set coil voltage to 10V, as it is source volage or change V1 accordingly. Set on/off delay time not less than 50mS to let relay operate.

tried by keeping the on off time to 1 s but still getting the same results
 

First confirm your relay circuit is working ok by replacing R2 resistor at transistor base to 2.2k and instead of giving pulse from mcu, just connect to +10V through a switch and operate switch manually. When transistor is in on state, there is .5-.7 volts on its base. This test will rule out problems due to mcu and coding. Sometimes output pin of certain microcontrollers need pull up resistor to output logic 1, see if this is not the case.
 
  • Like
Reactions: goshantry

    goshantry

    Points: 2
    Helpful Answer Positive Rating
    V

    Points: 2
    Helpful Answer Positive Rating
The picture he posted earlier showed the correct voltages at the base and collector of the transistor. However the relay doesn't operate. I suspect he may be using the wrong relay, e.g. one with a 24V coil.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top