Also, the relay requires 71.4 mA. This is fine for the 2n3904 to handle, but you do need to provide enough base current (which is controlled by your 10k resistor) for it to work well. From the datasheet, the current gain of the 2n3904 is only guaranteed to be at least 30 when collector current is upwards of 50 mA, so you want 71.4 mA / 30 = 2.38 mA base current. That means the resistor should be at most (5 - 0.7)V / 2.38 mA, so at most 1.8k (anything down to 1k is fine if you don't have a big selection to work with). You could use a N-channel mosfet instead of the transistor, in which case at 10k (or more) resistor would be fine, so your circuit would consume less standby power (for zero standby power, use a reed relay).
That, I think, alleviated some confusion. The set-up worked on my breadboard, but not when hooked up on my PCB.
When I jumped ground to the relay, it tripped, but the transistor was not sufficiently outputting. I will try dropping the resistance. Otherwise, would a 2nd transistor suffice?
I am open to trying a MosFet down the line, as everyone keeps steering me to them. I would just need to order them.
With respect to the quenching diode, that means that I should have it across 85/86 with band pointing toward 5v, correct?
I have tried actually dioding the output of the transistor, but it seems the voltage drop may be part of my problem.
Is there a decent resource for PCB best practices? I am just shoving braided wire through right now, and struggling to make great connections, especially with that relay, the pins of which need to be bent to barely fit into the board.
That, I think, alleviated some confusion. The set-up worked on my breadboard, but not when hooked up on my PCB.
When I jumped ground to the relay, it tripped, but the transistor was not sufficiently outputting. I will try dropping the resistance. Otherwise, would a 2nd transistor suffice?
I am open to trying a MosFet down the line, as everyone keeps steering me to them. I would just need to order them.
With respect to the quenching diode, that means that I should have it across 85/86 with band pointing toward 5v, correct?
I have tried actually dioding the output of the transistor, but it seems the voltage drop may be part of my problem.
Is there a decent resource for PCB best practices? I am just shoving braided wire through right now, and struggling to make great connections, especially with that relay, the pins of which need to be bent to barely fit into the board.
I rigged it up and it works perfectly.
I have 4 AA batteries as the 5-6v power supply.
Now I am wondering how this type of set-up could be more efficient. Would replacing the relay with a triac cut power consumption?
What is the simplest or best way to switch 120VAC with a low current, DC sensor?
At this point, I am going beyond my little project and am basically trying to get better at controlling higher current/voltage loads with low current/voltage sensors.
I got some reed switches in the mail, and would like to get some cheap Mosfets, triacs, and scrs. What specific part numbers would you guys recommend for similar applications (under 10A, 12vdc or 120VAC).
And to clarify, the set-up people were recommending was:
Reed switch triggers Mosfet or Triac, which connects the two poles of the light switch, right?
Where would you need diodes in this circuit, and what current rating?
Thanks for all your help. I am trying to self-teach and have not mastered transistors, which I feel has been a bottleneck.
Mosfets can only control DC current (so a fine suggestion for driving a relay coil, not suitable for AC power switching)
Maybe I have diffrent mosfets but they switch AC 230VAC 50Hz
This AC mosfets (2xBUZ78) switch is designed for 230VAC 30W light bulb soft start and dimming using PWM with inductor.
BTW: AC mosfets switch can switch DC too, but of course its series RDSON and body diode conduction after some power level have to be taken into account.
Will see how long this light bulb will last-I guess forever? For sure much longer than without any soft starts.
There is no high start currents while soft start is implemented and additionaly rectifier and caps can be used while I hate 100Hz light flickering @ 50Hz mains in the case of light bulb connected directly to mains and still for somereason need additional heat source so it is quite nice artifical Sun now without any flickering
I looked up the BUZ78, and it's just a standard N channel FET? It's true that MOSFETs can be placed in anti-series to successfully switch AC;
The "LOAD" is your light bulb. On the left hand side of the circuit, they're using a NAND gate to drive the optotriac; ignore that, you can use your reed switch there instead. Connect earth to the primary side somewhere for safety too.
I got the breadboard to work by with:
opto-isolator
pin 1 to 9v through 900 ohm.
Reed switch pulled up with 100k to 9v, down to ground when closed.
this trips transistor, which supplies ground to Pin 2 of opto-isolator.
That seems to reliably work. I measured current and found that the higher voltage power source, the more power consumption.
At 9v, it consumes .18mA off, and 9.3mA on.
Does that all sound like I am on the right track? That doesn't seem low enough to last for years, but it should be better than the 3 days the last one worked.
Should I have been using a N.C. reed switch the whole time?
Single BUZ78 mosfet can't, but on my prototype PCB are two mosfets (I've shown schematic in other post) and when 9.6V from this fresh battery is connected to VGS which has additionaly 100k resistor to discharge gate and ensure switch is OFF when there is no external gate drive voltage, than you can put multimeter and I got 12 Ohm resistance, while this switch will be used for <30W light bulbs.
Typical BUZ78 RDSON is about 6.5 Ohm, so in series without load we get 2x more bigger.
Nice thing with this AC mosfets switch is it does not need any minimal load current to triger it on like in the case of triac , so I was able to measure its RDSON when is ON without any load.
To keep this switch ON for long time only about 0.1mA will be drown from battery while 100k resistor will try discharge this AC mosfets switch gates
You don't need the 100k pull-up (if the reed switch is open-circuit, we want the optotriac emitter to be off -- and it's impossible for any current to flow throw the optotriac emitter if the switch is open, so that's fine as it is). How are you seeing any current at all when the reed switch is open circuit? The whole point of the reed switch is that it mechanically disconnects the battery when open.
I am apparently confused about how to turn on and off the opto-isolator.
The reed switch is normally open. When the door is closed, there is a magnet closing the reed switch. I probably should have been using a n.c. switch, which would open the circuit when the door is closed. That didn't occur to me because I have never used reed switches before and had not jumped through the hoops of wiring it backwards like I have been.
My pullup resistor is used to close the circuit, feeding voltage to the opto-isolator, which is resting at ground.
12 ohm * 166 mA is 2V, so for anything more than 166mA (20W in 120V countries, 40W in 240V countries), the thyristor will be burning less power, while being much easier to safely drive. I'm sure you could find better FETs though.
What is the opto-isolator outputting to trigger AC current through the gates?
Can you use triacs for 12vDC applications, or is a MosFet more appropriate?