Author Topic: Hall Effect to Trigger Light Switch  (Read 20740 times)

0 Members and 1 Guest are viewing this topic.

Offline ceamicloverTopic starter

  • Contributor
  • Posts: 37
Hall Effect to Trigger Light Switch
« on: September 09, 2014, 12:23:00 pm »
Goal:  Turn on the light in my entryway when the door is open.  I am trying to add Hall Effect sensors to my repertoire, so including that would be nice.

My electronics skills are beginner at best, so I am trying to do this project simply and without a microcontroller if possible.


My idea:
A magnet pulls my 3144 Hall Sensor from 5v to ground, so I figured that I could use that 5v to trigger 5vDC relay, 87 and 30 of which would go to the 2 points at the light switch.  It is just powering one bulb, so I figured that would be well within the current limits of the relay.

Problem:  I pulled the Hall up with a 10K resistor, and that does not provide enough current to trip the relay.
I added a 2n3904 transistor to step it up, but that had the same result.  I added another with no apparent effect.

From there, I tried posting on an electronics forum, but the light is still off.  Any suggestions would be appreciated.



Pretty much everything I know about this stuff comes from working on cars, wiring houses, and the minimal time spent on my arduino (aversion to programming).  So I am struggling with some of the nuances.
 

Offline PepeK

  • Regular Contributor
  • *
  • Posts: 62
  • Country: sk
Re: Hall Effect to Trigger Light Switch
« Reply #1 on: September 09, 2014, 12:49:04 pm »
What about a sensor used for security purposes to detect open doors, windows etc ? This consists of two pieces, the first one is mounted on the door (magnet in plastic), the second one contains contacts switched by the magnet. Use 5 or 12 DC adapter for safety and connect this in series with a solid state relay switching a bulb.

See link :  http://www.homesecuritystore.com/honeywell-943wg-wh
 

Offline ceamicloverTopic starter

  • Contributor
  • Posts: 37
Re: Hall Effect to Trigger Light Switch
« Reply #2 on: September 09, 2014, 01:35:40 pm »
That seems like a reasonable price.  I just figured that with a hall effect sensor, it should be fairly simple to make my own, as these store bought ones, I assumed, were just a Hall or Reed.

Why do you suggest a solid state relay, and do you know where to get them cheaply?
 

Offline WarSim

  • Frequent Contributor
  • **
  • Posts: 514
Re: Hall Effect to Trigger Light Switch
« Reply #3 on: September 09, 2014, 02:09:04 pm »

Goal:  Turn on the light in my entryway when the door is open.  I am trying to add Hall Effect sensors to my repertoire, so including that would be nice.

My electronics skills are beginner at best, so I am trying to do this project simply and without a microcontroller if possible.


My idea:
A magnet pulls my 3144 Hall Sensor from 5v to ground, so I figured that I could use that 5v to trigger 5vDC relay, 87 and 30 of which would go to the 2 points at the light switch.  It is just powering one bulb, so I figured that would be well within the current limits of the relay.

Problem:  I pulled the Hall up with a 10K resistor, and that does not provide enough current to trip the relay.
I added a 2n3904 transistor to step it up, but that had the same result.  I added another with no apparent effect.

From there, I tried posting on an electronics forum, but the light is still off.  Any suggestions would be appreciated.



Pretty much everything I know about this stuff comes from working on cars, wiring houses, and the minimal time spent on my arduino (aversion to programming).  So I am struggling with some of the nuances.
Not enough current for a cheep BJT.  Use a TTL MOSFET.  If I guessed at your cct correctly be sure to use a gate discharge resistor and a suppression diode.  Few body diodes do well with inductive loads. 


Sent from my iPad using Tapatalk
 

Offline PepeK

  • Regular Contributor
  • *
  • Posts: 62
  • Country: sk
Re: Hall Effect to Trigger Light Switch
« Reply #4 on: September 09, 2014, 02:29:14 pm »
That seems like a reasonable price.  I just figured that with a hall effect sensor, it should be fairly simple to make my own, as these store bought ones, I assumed, were just a Hall or Reed.

Why do you suggest a solid state relay, and do you know where to get them cheaply?

As you mentioned you are a beginner, my suggestion is to focus on a safety and do not use anything 120 V (American) or 230 V  (Europe) close to the doors. Especially if the door's frame is made from metal ... Create a safe circuit (powered by a double insulated adapter / transformer like 5 V / 9V / 12V) on the "switch" side and hide the SSR or other power relay into a double insulated case.

Regarding your SSR question : try to look for SSR 10 A, zero crossing switching on eBay (price approx 3 - 5 USD). 10A is enough for any bulb, some problems could occur if you use a transformer for halogen lamps or energy saving LED / fluorescent "bulbs".
 

Offline ceamicloverTopic starter

  • Contributor
  • Posts: 37
Re: Hall Effect to Trigger Light Switch
« Reply #5 on: September 09, 2014, 04:30:43 pm »
That seems like a reasonable price.  I just figured that with a hall effect sensor, it should be fairly simple to make my own, as these store bought ones, I assumed, were just a Hall or Reed.

Why do you suggest a solid state relay, and do you know where to get them cheaply?

As you mentioned you are a beginner, my suggestion is to focus on a safety and do not use anything 120 V (American) or 230 V  (Europe) close to the doors. Especially if the door's frame is made from metal ... Create a safe circuit (powered by a double insulated adapter / transformer like 5 V / 9V / 12V) on the "switch" side and hide the SSR or other power relay into a double insulated case.


I was not intending on running 120AC to the wooden door.  I was going to run 5vDC to the door to trip a 5vDC relay next to the light switch, with only pins 87 and 30 connected to 120.

Nor am I using current to open the door.  I was just going to use current to trip the relay to the lights.  The rest, I thought, would be low current 5v or ground from the Hall sensor.


I will look into the diodes and mosfet.  I was under the impression that those transistors could supply the 100mA
 

Offline cybertronicify

  • Regular Contributor
  • *
  • Posts: 70
  • Country: us
  • Electrical Engineering Student
Re: Hall Effect to Trigger Light Switch
« Reply #6 on: September 10, 2014, 11:40:37 am »
Try to use a reed switch. Its just a glass tube/plastic with 2 contacts. When a magnet is close enough it will close and allow current to pass. Assuming the light bulb is not something ridiculous like 1000 watts, you should be fine with a simple reed switch.
 

Offline cybertronicify

  • Regular Contributor
  • *
  • Posts: 70
  • Country: us
  • Electrical Engineering Student
Re: Hall Effect to Trigger Light Switch
« Reply #7 on: September 10, 2014, 11:43:32 am »
If you are controlling an AC voltage. You can use a Triac instead of a relay, its just 2 scr's back-to-back. It can handle lots of current with minimal cooling, i mean lots of current. 600v 40amps. You can also make a variable one where it just cuts and changes the waveform of the AC. (good on resistive loads, NOT good on inductive loads.)

http://datasheet.octopart.com/BTA40-600B-STMicroelectronics-datasheet-8193631.pdf
« Last Edit: September 10, 2014, 11:46:00 am by cybertronicify »
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
Re: Hall Effect to Trigger Light Switch
« Reply #8 on: September 10, 2014, 12:53:21 pm »
Ceamiclover, just throwing it out there; but your original concept is perfectly valid. (All these other suggestions work fine too, but you wanted to use a hall effect sensor for learning purposes, so I think that should be encouraged rather than just ignoring your original idea and suggesting boring, easy solutions like a reed switches [which are the standard way to do this sort of thing, to be fair])

A normal (not solid-state) relay works fine, and it comes with safety and isolation built-in. And using transistors as a way to boost the weak signal from the hall effect sensor is totally the right thing to do. I suspect that you just didn't connect the transistors correctly. Can you provide a diagram of the circuit you tried?
 

Offline PepeK

  • Regular Contributor
  • *
  • Posts: 62
  • Country: sk
Re: Hall Effect to Trigger Light Switch
« Reply #9 on: September 10, 2014, 12:54:10 pm »
Try to use a reed switch. Its just a glass tube/plastic with 2 contacts. When a magnet is close enough it will close and allow current to pass. Assuming the light bulb is not something ridiculous like 1000 watts, you should be fine with a simple reed switch.

Any mains powered bulb has so high "starting" current (10x more than nominal) which will solder reed contacts together for eternity :-)
 

Offline ceamicloverTopic starter

  • Contributor
  • Posts: 37
Re: Hall Effect to Trigger Light Switch
« Reply #10 on: September 10, 2014, 01:54:47 pm »
Try to use a reed switch. Its just a glass tube/plastic with 2 contacts. When a magnet is close enough it will close and allow current to pass. Assuming the light bulb is not something ridiculous like 1000 watts, you should be fine with a simple reed switch.

Any mains powered bulb has so high "starting" current (10x more than nominal) which will solder reed contacts together for eternity :-)

The relay would transmit power from constant Hot to switch lead at light.  All the reed or hall would do would be to trip the relay.
 

Offline ceamicloverTopic starter

  • Contributor
  • Posts: 37
Re: Hall Effect to Trigger Light Switch
« Reply #11 on: September 10, 2014, 02:00:39 pm »
If you are controlling an AC voltage. You can use a Triac instead of a relay, its just 2 scr's back-to-back. It can handle lots of current with minimal cooling, i mean lots of current. 600v 40amps. You can also make a variable one where it just cuts and changes the waveform of the AC. (good on resistive loads, NOT good on inductive loads.)

http://datasheet.octopart.com/BTA40-600B-STMicroelectronics-datasheet-8193631.pdf

I am unfamiliar with inductive load problems.  Is the relay the limiting factor because it is an inductive load, or the light bulb?
 

Offline ceamicloverTopic starter

  • Contributor
  • Posts: 37
Re: Hall Effect to Trigger Light Switch
« Reply #12 on: September 10, 2014, 02:05:03 pm »
Ceamiclover, just throwing it out there; but your original concept is perfectly valid. (All these other suggestions work fine too, but you wanted to use a hall effect sensor for learning purposes, so I think that should be encouraged rather than just ignoring your original idea and suggesting boring, easy solutions like a reed switches [which are the standard way to do this sort of thing, to be fair])

A normal (not solid-state) relay works fine, and it comes with safety and isolation built-in. And using transistors as a way to boost the weak signal from the hall effect sensor is totally the right thing to do. I suspect that you just didn't connect the transistors correctly. Can you provide a diagram of the circuit you tried?

I haven't learned fritzing yet, so let me know if this diagram is useless.  Also, I am open to using a Reed switch if that is more appropriate.  I guess I am just trying to gain a functional knowledge of all of these and where they are best applied.
 

Offline ceamicloverTopic starter

  • Contributor
  • Posts: 37
Re: Hall Effect to Trigger Light Switch
« Reply #13 on: September 10, 2014, 05:25:10 pm »
Apparently, the Hall sensor can send enough current to trip the relay when the magnet pulls to ground.  I could use pins 87a and 30 to hold the light off.

This seems much less ideal, however, as it involves constantly powering the relay and defaulting to the light being on if the magnet fails to trip sensor.

I am unsure how sending the 10k ohms to 5v to the base of the transistor failed to step up the current available.  instead, the voltage at the emitter appears to drop with each transistor I added in line.  Adding the relay load pulls the voltage down from 5 to 2 at the output of the hall.

Sorry for not being particularly versed in the vocabulary.
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
Re: Hall Effect to Trigger Light Switch
« Reply #14 on: September 11, 2014, 12:37:17 am »
OK, I think I see the (a) problem with the transistor circuit. You have your transistor on the high side -- if you have an NPN transistor, or an N-channel MOSFET, you want your switching to be low-side. That is, the emitter or source of the transistor is connected to ground, the collector or drain connected to one side of the relay coil, and the other side of the relay coil connected straight to the positive supply. Also, it'd be great if you could say which hall sensor part number, and which transistor part number, and which relay (or at least what the voltage of the relay coil is, and what resistance the coil is). This way we can be sure that the parts are suitable for each other.
 

Offline cybertronicify

  • Regular Contributor
  • *
  • Posts: 70
  • Country: us
  • Electrical Engineering Student
Re: Hall Effect to Trigger Light Switch
« Reply #15 on: September 11, 2014, 04:13:27 am »
The easiest way to complete this project is to use a reed switch in line with the mains. But like you said you don't want mains going into a wooden door, so you can use the reed switch in place of the Hall sensors as not all Hall effect sensors have enough current to drive the coils of the relay. you can solve that by pairing the Hall effect sensor with a triac, which on the BTA-400 only requires 50ma. From that you will learn about Hall sensors, silicon controlled rectifiers, and driving triacs. As a bonus you can use the triac as a dimmer too.
 

Offline cybertronicify

  • Regular Contributor
  • *
  • Posts: 70
  • Country: us
  • Electrical Engineering Student
Re: Hall Effect to Trigger Light Switch
« Reply #16 on: September 11, 2014, 04:25:51 am »
The lightbulb you are trying to
Power is a resistive load.

Resistive load means that when turned on. The current will rise instantly to a current value and stay.

An inductive load is when the device (I.e. motor, compressor) Pulls a peak amount of current for a couple of cycles then settles down to a "run" state.
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
Re: Hall Effect to Trigger Light Switch
« Reply #17 on: September 11, 2014, 11:18:27 am »
The lightbulb you are trying to
Power is a resistive load.

Resistive load means that when turned on. The current will rise instantly to a current value and stay.

An inductive load is when the device (I.e. motor, compressor) Pulls a peak amount of current for a couple of cycles then settles down to a "run" state.

Not to be too pedantic, but this is grossly oversimplified to the point of being practically completely wrong.

Inductive loads have a current waveform that lags voltage. Ideal inductive loads (approximate real world example: transformers) do not draw current surges when turned on.

Motors are the most commonly encountered/discussed inductive load, and motors do indeed draw current surges when first turned on. This is because the motor is stopped when first turned on, so the initial current is the stall current, which is much higher than the steady state current once running. This is nothing to do with it being inductive.

Resistive loads have a current waveform that is in phase with voltage. As you say, ideal resistive loads (approximated by bar heaters and such) do not draw current surges when turned on.

Incandescent light bulbs are resistive, but they do draw a current surge when turned on because the filament is cold and therefore lower resistance when first turned on. I = V/R, more current.

My point is, whether the load is inductive, and whether it is surgey are completely orthogonal things, as illustrated by the four permutations shown above. I therefore think other people on this thread saying that light bulbs are bad news for reed relays are probably right. (Even ideal inductive loads are bad news for relays, because the inductor tends to cause huge voltages and arcing when the relay tries to turn off and interrupt the inductor's current, but that's a whole other story.)
« Last Edit: September 11, 2014, 11:20:13 am by rs20 »
 

Offline cybertronicify

  • Regular Contributor
  • *
  • Posts: 70
  • Country: us
  • Electrical Engineering Student
Re: Hall Effect to Trigger Light Switch
« Reply #18 on: September 11, 2014, 02:10:07 pm »
The lightbulb you are trying to
Power is a resistive load.

Resistive load means that when turned on. The current will rise instantly to a current value and stay.

An inductive load is when the device (I.e. motor, compressor) Pulls a peak amount of current for a couple of cycles then settles down to a "run" state.

Not to be too pedantic, but this is grossly oversimplified to the point of being practically completely wrong.

Inductive loads have a current waveform that lags voltage. Ideal inductive loads (approximate real world example: transformers) do not draw current surges when turned on.

Motors are the most commonly encountered/discussed inductive load, and motors do indeed draw current surges when first turned on. This is because the motor is stopped when first turned on, so the initial current is the stall current, which is much higher than the steady state current once running. This is nothing to do with it being inductive.

Resistive loads have a current waveform that is in phase with voltage. As you say, ideal resistive loads (approximated by bar heaters and such) do not draw current surges when turned on.

Incandescent light bulbs are resistive, but they do draw a current surge when turned on because the filament is cold and therefore lower resistance when first turned on. I = V/R, more current.

My point is, whether the load is inductive, and whether it is surgey are completely orthogonal things, as illustrated by the four permutations shown above. I therefore think other people on this thread saying that light bulbs are bad news for reed relays are probably right. (Even ideal inductive loads are bad news for relays, because the inductor tends to cause huge voltages and arcing when the relay tries to turn off and interrupt the inductor's current, but that's a whole other story.)

I'm quite sure the bulb he/she is trying to power is not a 5000w bulb. Its more like a 100w or 250w max. That will NOT cause a relay to arc over and weld the contacts, of course if he/she parallels like 10 of them up then thats a whole other story.

The current surge in a 100w light bulb when turn ON is pretty much nothing. Yes the resistance is lower when cool and gets higher when hot, but it is nothing like the "stall" current of a motor.

About the transformer, it actually pulls a lot of current when powered on. (at least for a few cycles) If the transformer is a toroidal type, then prepare for even more current drawn on startup. The reason is because the transformer has to build its magnetic field since it loses it when the primary coil is not energized.
« Last Edit: September 11, 2014, 02:15:51 pm by cybertronicify »
 

Offline WarSim

  • Frequent Contributor
  • **
  • Posts: 514
Re: Hall Effect to Trigger Light Switch
« Reply #19 on: September 11, 2014, 02:41:59 pm »

Try to use a reed switch. Its just a glass tube/plastic with 2 contacts. When a magnet is close enough it will close and allow current to pass. Assuming the light bulb is not something ridiculous like 1000 watts, you should be fine with a simple reed switch.

Any mains powered bulb has so high "starting" current (10x more than nominal) which will solder reed contacts together for eternity :-)
Reed relays are made in a vast range of sizes.  Largest I have personally seen was 5.6kv 30A.  Yes it was very expensive. 
Just saying your assumption is very practical but not imperially true.  :)


Sent from my iPad using Tapatalk
 

Offline cybertronicify

  • Regular Contributor
  • *
  • Posts: 70
  • Country: us
  • Electrical Engineering Student
Re: Hall Effect to Trigger Light Switch
« Reply #20 on: September 11, 2014, 02:51:56 pm »
woah 5.6kv 30 amps? thats a whopping 168,000 watts. What's it paired with? A 20 ton magnet?  :-DD
 

Offline ceamicloverTopic starter

  • Contributor
  • Posts: 37
Re: Hall Effect to Trigger Light Switch
« Reply #21 on: September 11, 2014, 03:07:11 pm »


My point is, whether the load is inductive, and whether it is surgey are completely orthogonal things, as illustrated by the four permutations shown above. I therefore think other people on this thread saying that light bulbs are bad news for reed relays are probably right. (Even ideal inductive loads are bad news for relays, because the inductor tends to cause huge voltages and arcing when the relay tries to turn off and interrupt the inductor's current, but that's a whole other story.)

Do I need to alleviate this concern with a quenching diode?


Also, I was intending on hooking up to the light switch with 16awg speaker wire.  I know that this is not NEC, but it seemed overkill to try and connect 14/2 to my PCB.  It will be about a 1 foot run, and I am driving a 60W bulb, or I could even drop it to a 13w CFL.

If there are any problems with this, I am open to hearing them.
 

Offline WarSim

  • Frequent Contributor
  • **
  • Posts: 514
Re: Hall Effect to Trigger Light Switch
« Reply #22 on: September 11, 2014, 03:31:33 pm »

woah 5.6kv 30 amps? thats a whopping 168,000 watts. What's it paired with? A 20 ton magnet?  :-DD
It was a TWT safety switch.  :).  No shortage of magnetism. 


Sent from my iPad using Tapatalk
 

Offline ceamicloverTopic starter

  • Contributor
  • Posts: 37
Re: Hall Effect to Trigger Light Switch
« Reply #23 on: September 11, 2014, 03:51:53 pm »
OK, I think I see the (a) problem with the transistor circuit. You have your transistor on the high side -- if you have an NPN transistor, or an N-channel MOSFET, you want your switching to be low-side. That is, the emitter or source of the transistor is connected to ground, the collector or drain connected to one side of the relay coil, and the other side of the relay coil connected straight to the positive supply. Also, it'd be great if you could say which hall sensor part number, and which transistor part number, and which relay (or at least what the voltage of the relay coil is, and what resistance the coil is). This way we can be sure that the parts are suitable for each other.

Hall 3144
Transistor 2n3904
5vDC relay SRD-05vdc-sl-c

That works perfectly.  Thank you for your help.  I come from automotive aftermarket, and we never do anything with transistors, so this is challenging.

Do I need a quenching diode to protect against the spike when the relay opens?
And do I just connect it between 85 and 86, or am I supposed to diode each leg in the appropriate direction?


With regard to other helpful suggestions:  I ordered some reed switches and will probably pick up some triacs, as they seem like a good solid state alternative to using relays for everything.
« Last Edit: September 11, 2014, 04:13:10 pm by ceamiclover »
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
Re: Hall Effect to Trigger Light Switch
« Reply #24 on: September 12, 2014, 02:13:20 am »
OK, I think I see the (a) problem with the transistor circuit. You have your transistor on the high side -- if you have an NPN transistor, or an N-channel MOSFET, you want your switching to be low-side. That is, the emitter or source of the transistor is connected to ground, the collector or drain connected to one side of the relay coil, and the other side of the relay coil connected straight to the positive supply. Also, it'd be great if you could say which hall sensor part number, and which transistor part number, and which relay (or at least what the voltage of the relay coil is, and what resistance the coil is). This way we can be sure that the parts are suitable for each other.

Hall 3144
Transistor 2n3904
5vDC relay SRD-05vdc-sl-c

That works perfectly.  Thank you for your help.  I come from automotive aftermarket, and we never do anything with transistors, so this is challenging.

Do I need a quenching diode to protect against the spike when the relay opens?
And do I just connect it between 85 and 86, or am I supposed to diode each leg in the appropriate direction?

You get spikes when opening circuits to an inductive load, because inductive loads "want" to maintain a constant current -- if you open a switch that's supplying that current, the inductor will spike with a huge voltage when its current is cut off suddenly. In the case of a relay, it's the coil that's inductive, not the switch side. So you may* want to connect a diode across the coil terminals "pointing away from the transistor".

* I don't know whether your relay coil has enough inductance for this to be an actual necessity -- other people might have nice general rules.

EDIT: Sorry, didn't read your earlier messages before. A diode doesn't help at all with the surge from an incandescent bulb turning on. It only helps with inductive loads, which a light bulb certainly is not. If you're using this relay, you don't need to worry because your relay is rated for 7A; a 100W light bulb only consumes 1A steady (0.5A in countries with a proper mains voltage :P) and nowhere near 7A surge. The only place you might need any attention is on the coil side, as I mention above.

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).
« Last Edit: September 12, 2014, 06:44:44 am by rs20 »
 

Offline ceamicloverTopic starter

  • Contributor
  • Posts: 37
Re: Hall Effect to Trigger Light Switch
« Reply #25 on: September 12, 2014, 10:17:50 am »

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.
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
Re: Hall Effect to Trigger Light Switch
« Reply #26 on: September 12, 2014, 12:23:55 pm »
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?

Two transistors in parallel don't have a higher current gain overall -- the current from the resistor would be split in half between the bases of the two resistors, each halved base current is multiplied by the DC current gain, and that's added together again. Overall, that achieves nothing, except each transistor won't get as hot (transistor overheating is not at all a concern with your numbers). You could use a darlington arrangement, but that doubles the voltage drop across the transistors. It's just much easier and better in pretty much every way to just use a smaller resistor (if you only have 10k resistors to hand, put 5 of them in parallel.)

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.

Are you designing a PCB and getting it made professionally / making your own PCB with etchant / using veroboard or similar? Judging by the "barely fit into the board" comment, I'm assuming you're using veroboard. It's much better to use a drill to put extra holes where they need to be, rather than bending and stressing pins (the relay will never sit flush this way in any case). Solid-core (not multi-stranded) wire is preferred for rigid assemblies like a PCB, but having said that multi-stranded wire should solder fine. There are plenty of videos on the internet about how to solder.

About the quenching diode, yes, that's the right way to do it.

( Minor niggle: you're not putting your replies after the close quote tag, or you're deleting opening tags without deleting closing tags or something, so it looks like I'm saying what you're saying -- look at your own message above )
 

Offline ceamicloverTopic starter

  • Contributor
  • Posts: 37
Re: Hall Effect to Trigger Light Switch
« Reply #27 on: September 15, 2014, 01:08:57 pm »
http://www.ebay.com/itm/2PCS-6CMx8CM-Double-side-Protoboard-Circuit-Fibre-Glass-DIY-Prototype-PCB-Board-/221543786602?pt=LH_DefaultDomain_0&hash=item339509e86a

This is pretty much what I used.  I will try drilling holes.  I am familiar with soldering wire-to-wire from automotive.  Translating that to circuit board is the challenge now.  I will try to find more videos and solid core wire.

I have 1k resistors, and I will try that.  Thank you.
 

Offline ceamicloverTopic starter

  • Contributor
  • Posts: 37
Re: Hall Effect to Trigger Light Switch
« Reply #28 on: September 16, 2014, 05:45:01 pm »
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?
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
Re: Hall Effect to Trigger Light Switch
« Reply #29 on: September 17, 2014, 01:35:12 am »
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?

Circuits like these have different power consumptions when the light is on vs when it is off:

When the light is off, you have a 1k resistor, with the low side of it pulled down to ground by the hall sensor. That's 5mA running through the resistor and the hall sensor, which will run down a 2000mAh AA battery (each battery is contributing a full 5mA, even though the whole stack is outputting 5mA -- the stack compounds voltage, not current) in 2000mAh / 5 mA = 400 hours = ~17 days. The solution (besides using reed switches) is to use a MOSFET, with which a 100k resistor (~1700 days) would work fine.

I forgot to account for the hall effect sensor, it consumes about 5mA on its own -- really not ideal for battery operation. Again, that's ~17 days battery life on its own, even if you had a MOSFET and a 1000000k resistor. A reed switch is just an open circuit when it's open, it consumes zero power.

So everything above is talking about the magnetic sensing side of the circuit, we haven't even thought about the relay yet. Once the switch is activated, you've got ~80 mA of current running through the relay coil, which works out to about 24 hours of light output. A solid state relay or optotriac would consume less.
 

Offline ceamicloverTopic starter

  • Contributor
  • Posts: 37
Re: Hall Effect to Trigger Light Switch
« Reply #30 on: September 17, 2014, 02:02:59 pm »
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.
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
Re: Hall Effect to Trigger Light Switch
« Reply #31 on: September 18, 2014, 12:22:40 am »
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.

There are two completely separate routes you can go down here:

A. Safe isolation between detection and switching sides.

Here is just one of many ways to achieve this with acceptable battery life: check out figure 10 of this optotriac datasheet. It shows how simple it is to use an optotriac (the MOC3063) to trigger a more powerful triac. 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. The bad thing about this is that it is battery powered, so it will run out at some point (although it will last years), the good thing is that it is isolated and low-voltage, so it's safe to develop it more later, e.g. add a microcontroller/555 timer that keeps the light on for 10 seconds after the door is closed, etc.

Where are you getting parts from? Local shop, eBay, or somewhere fancy like element14/digikey? The latter is more expensive, but they have excellent range and easy-to-search websites.

B. No isolation

In this case, you'd just use a reed switch entirely on its own (if it's rated to handle the current), or a reed switch hooked up to a TRIAC. (An SCR is no good for switching AC because it only passes current in one direction). All exposed metal in the system is zap-if-you-touch-it.
 

Offline ceamicloverTopic starter

  • Contributor
  • Posts: 37
Re: Hall Effect to Trigger Light Switch
« Reply #32 on: September 18, 2014, 11:57:15 am »
I have been getting most of this stuff on ebay, and mainly from china so that I can get 2-3 times as many for the same price.  If that is ill-advised, I am unaware.

Where do you recommend getting the "fairchild semiconductors"? 
Are these also called triacs/Mosfets?
Thank you for indulging my lack of education.

I already have resistors and capacitors.
the caps i have are:
http://www.ebay.com/itm/351059190131?_trksid=p2059210.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT

http://www.ebay.com/itm/161117336372?_trksid=p2059210.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT

I haven't used them yet, so I am not particularly familiar with them.

I got them so that I could regulate voltage with LM317T.
I was thinking of using these with a 9v battery to drop down to 5v for my sensors.
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
Re: Hall Effect to Trigger Light Switch
« Reply #33 on: September 18, 2014, 12:57:43 pm »
I tend to pay (5 times) full price from the big distributors, but many people get their parts from eBay and seem to get by just fine. The optotriac datasheet I linked to is for the MOC3063; you can do an eBay search for MOC3063 and see a bunch there. An eBay search for triac also brings up a bunch of stuff, BTA16-600 looks fine but probably lots of other things are fine too.

You should Google around to find pages explaining MOSFETs, SCRs, TRIACs, SSRs. Mosfets can only control DC current (so a fine suggestion for driving a relay coil, not suitable for AC power switching), SCRs also only work in DC but stay on once triggered, TRIACs are like SCRs but work with AC power, etc, etc. They're all different things. Opto-triacs are just like triacs, except you trigger them on using light (from the LED that is sitting in the same package) instead of a directly connected terminal. This gives them isolation and safety. Opto- refers to this optical isolation, you can get opto-BJTs too (except they're actually called optocouplers, but think opto-BJT).

TRIACs have ~1V drop across them when on, multiply that by the 1A that a 100W bulb consumes because of the silly 110 VAC power supply in your country (100W bulbs only consume 0.4A in sensible 240V countries :P) and your TRIAC will be dissipating 1W of power. Multiply by 60 degrees C/W, the TRIAC will be getting very warm (85 degrees C or so at junction). This isn't strictly true, because TRIACs have a nice property that they have a lower voltage drop when they get hot (see the datasheet for the BTA16-600). so it won't get quite this hot. One more reason not to go poking your circuit, in any case.

Draw up a schematic with part numbers and values included and we'll see how it looks.

Please be careful when messing around with mains power; turn off and remove the fuse from the fuse box before touching anything. Do not poke around in live circuitry. Use an isolation transformer if the lid is off your project. Etc.
« Last Edit: September 18, 2014, 01:08:19 pm by rs20 »
 

Offline WarSim

  • Frequent Contributor
  • **
  • Posts: 514
Re: Hall Effect to Trigger Light Switch
« Reply #34 on: September 20, 2014, 11:54:17 pm »
Yes a MOSFET is a unipolar device but I can be used to control AC within a bridge.  Which has been done for decades.  It is not a new unproven method, as suggested by others.  (Not here, other sites, which I will not name).


Sent from my iPad using Tapatalk
 

Offline ceamicloverTopic starter

  • Contributor
  • Posts: 37
Re: Hall Effect to Trigger Light Switch
« Reply #35 on: October 02, 2014, 03:54:58 pm »
I just got 10 BTA16-600B and 10 MOC3063 DIP-6 Optoisolators in the mail and am researching them and trying to figure out my circuit with reference to figure 10 in your link.

Would 9v w/ 1800 Ohm resistor work for VCC and Rin?
     How will this be affected as battery voltage drops, and should I pick a lower resistance to account for the 2 conductor ~3 meter run to the reed switch?
Do I need to modify resistances after opto-isolator to account for 110VAC?
Do I need the 39 ohm resistor and .01 uF capacitor for "snubbing?"  I don't know what snubbing is.
     Does this cause some current to flow through the device at all times when you connect the hot to the switch-leg through that resistor and capacitor?
     

Again, thanks for your help
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
Re: Hall Effect to Trigger Light Switch
« Reply #36 on: October 03, 2014, 09:35:15 am »
Would 9v w/ 1800 Ohm resistor work for VCC and Rin?
     How will this be affected as battery voltage drops, and should I pick a lower resistance to account for the 2 conductor ~3 meter run to the reed switch?

Always design for the worst case -- so, measure the resistance of the cable (I can't imagine that it'll contribute much compared to the 1.8k resistor, but who knows), and assume your 9V battery has discharged to around 6 V. The LED inside the MOC3063 has a forward voltage drop of 1.5V worst case, so that's 4.5V across our resistor. The trigger current is 5mA minimum, so we want at least that much. Resistor value = 4.5V / 5mA = 900 ohm. Subtract your cable resistance from this (or forget it if the cable resistance is less than 50 ohms), and that's the value to use.

Do I need to modify resistances after opto-isolator to account for 110VAC?
Good question; I think those values are fine as is.

Do I need the 39 ohm resistor and .01 uF capacitor for "snubbing?"  I don't know what snubbing is.
http://en.wikipedia.org/wiki/Snubber, look under the "Thyristor" section (since a TRIAC is a bidirectional thyristor). It seems like you might not need it; since it seems to be for inductive loads like motors.

     Does this cause some current to flow through the device at all times when you connect the hot to the switch-leg through that resistor and capacitor?
Yes, although 0.01uF is quite a small value, so not very much. You can calculate the reactance ("resistance" in a loose sense, see the link) using the formula 1 / (2*pi*f*C). That's 300 kiloohms at 50 Hz, which works out to 0.34mA of current, 40mW of power. 40mW isn't much, but it might be 40mW more than necessary. Leave space on your circuitboard for a snubber, but I'd probably leave it out, at least at first? If you need it, the symptom of leaving it out is that the light turns on when not commanded to.
 

Offline eneuro

  • Super Contributor
  • ***
  • Posts: 1528
  • Country: 00
Re: Hall Effect to Trigger Light Switch
« Reply #37 on: October 03, 2014, 01:28:17 pm »
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  :-DD
This AC mosfets (2xBUZ78) switch is designed for 230VAC 30W light bulb soft start and dimming using PWM with inductor.

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  8)

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.
12oV4dWZCAia7vXBzQzBF9wAt1U3JWZkpk
“Let the future tell the truth, and evaluate each one according to his work and accomplishments. The present is theirs; the future, for which I have really worked, is mine”  - Nikola Tesla
-||-|-
 

Offline WarSim

  • Frequent Contributor
  • **
  • Posts: 514
Re: Hall Effect to Trigger Light Switch
« Reply #38 on: October 03, 2014, 02:19:23 pm »
It is a bad idea to depend on the characteristics of the body diode as a cct element.  I am repeating myself now, so obviously you are not heading my advice.  Good luck on your project. 


Sent from my iPad using Tapatalk
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
Re: Hall Effect to Trigger Light Switch
« Reply #39 on: October 03, 2014, 02:57:35 pm »
Maybe I have diffrent mosfets  but they switch AC 230VAC 50Hz  :-DD
This AC mosfets (2xBUZ78) switch is designed for 230VAC 30W light bulb soft start and dimming using PWM with inductor.

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; but if used to switch mains, the source pins are flapping around at mains voltages, so to drive the gate, you need isolated circuitry there. Unlike a thyristor, which has a clean, safe opto-isolated solution to this problem (the optotriac), I'm not sure which method you have in mind. Unlike a thyristor, which stays switched on for the rest of the cycle by itself, the MOSFET Vgs must be held positive despite the FETs essentially shorting out their own power supply. (Some?) solid state relays work by using a small solar panel to drive the gate voltage, which gives a hint at how difficult this is to do elegantly. Of course, another option is to have a battery-powered solution referenced to the source pin, flapping around at mains voltage, but that seems like a bad idea (TM) (care to change the battery that's at line voltage?). It's unsurprising that your average dimmer still uses thyristors, despite the disadvantage of a nearly 2V drop.

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.

So, what's an AC mosfet? Because, as above, the BUZ78 is just a standard N fet. Don't confuse a device that can't block AC (e.g. MOSFET) with a circuit topology that protects DC devices from the true AC nature of the load (e.g, single MOSFET behind bridge rectifier, anti-series MOSFETS...)  If you're switching DC into a non-inductive load, you don't need to think about the body diode at all...

Will see how long this light bulb will last-I guess forever? For sure much longer than without any soft starts.

Interesting question; although it can't be any better (in terms of total on time) than just leaving a light on all the time. I assume it's well established how switching a bulb on and off detracts from that ideal case. According to wikipedia, a 5% reduction in voltage will more than double the lifetime of the bulb (while reducing light output by only 20%), which might be a more successful approach.

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 

Interesting idea, but rectification and filtering can be performed regardless of AC switch technique, so this is a rather orthogonal discussion (except if you rectify first, in which case, hey, we have the single MOSFET behind a bridge rectifier solution). Without PFC, your power company might be unhappy though...

 

Offline eneuro

  • Super Contributor
  • ***
  • Posts: 1528
  • Country: 00
Re: Hall Effect to Trigger Light Switch
« Reply #40 on: October 03, 2014, 05:38:26 pm »
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;
In previous post you wrote that mosfets can NOT switch AC, so I've shown PCB with two mosfets which does it easy  ;)
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  8)

Light bulb lifespan extending and driving  it using AC/DC mosfets switch is another story and small off topic, so maybe in other thread will be better discus it, but nothing fancy-just trying to keep constant voltage on this light source to prevent flickering @ 230VAC 50Hz mains  8)
« Last Edit: October 03, 2014, 05:46:52 pm by eneuro »
12oV4dWZCAia7vXBzQzBF9wAt1U3JWZkpk
“Let the future tell the truth, and evaluate each one according to his work and accomplishments. The present is theirs; the future, for which I have really worked, is mine”  - Nikola Tesla
-||-|-
 

Offline ceamicloverTopic starter

  • Contributor
  • Posts: 37
Re: Hall Effect to Trigger Light Switch
« Reply #41 on: October 03, 2014, 09:24:21 pm »

 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.

Looking at the Opto-isolator:
I am confused about how to trigger the moc363 with the reed switch.  I had been using 5v at the reed switch to trip the relay, and keeping the relay off while the reed switch was grounding it.

In the diagram, it looks like pin 1 has voltage.  3 and 5 are open.  Is it controlled by supplying ground to Pin 2?
In my case, should I do constant ground at 2, and use resistance and/or a transistor to get the right voltage at 1 while the reed switch is open?

Basically, should I control the opto-isolator with power or ground, and does that modify the resistance from the 900 ohms from the previous post? 
 

Offline ceamicloverTopic starter

  • Contributor
  • Posts: 37
Re: Hall Effect to Trigger Light Switch
« Reply #42 on: October 03, 2014, 11:35:59 pm »
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?
« Last Edit: October 03, 2014, 11:40:34 pm by ceamiclover »
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
Re: Hall Effect to Trigger Light Switch
« Reply #43 on: October 04, 2014, 12:50:04 am »
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?

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.

Because we designed for a worst case battery voltage of 6V, and you're testing with 9V, we should be expecting more than our target current of 5mA -- so 9.3mA sounds right. 2000mAh / 9.3mA = 200 hours continuous on time, or over a year if the light is on for half an hour every day. You can try feeding in 6V supply, and then progressively increasing the resistance until it stops working, and then back off a bit. This means you're tuning the circuit to your particular optotriac.

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.

Very good, but if you put this solution into real service, how do you propose to make changing that battery a non life-threatening activity? "Turn the entire circuit off with an upstream switch" is not an acceptable answer for any kind of real-life scenario.

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  8)

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.

This would all be very interesting if your solution didn't involve a battery connected to mains. If we were to throw out the requirement that parts of the circuit be safely isolated, then we wouldn't need a battery at all and we'd just use the reed switch directly (or, use the reed switch to trigger the thyristor directly, no isolation).

 

Offline ceamicloverTopic starter

  • Contributor
  • Posts: 37
Re: Hall Effect to Trigger Light Switch
« Reply #44 on: October 04, 2014, 01:01:26 am »

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.

Again, thank you for all of your input.

and Warsim, thank you for your input.  It sounds like I need to familiarize myself with MosFets as well, escpecially if they can be useful in automotive, which is my profession.

 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
Re: Hall Effect to Trigger Light Switch
« Reply #45 on: October 04, 2014, 01:16:29 am »
I am apparently confused about how to turn on and off the opto-isolator.

If you look at the datasheet, you'll see there's an LED hidden inside the opto-triac. The opto-triac is on if you make that LED shine. If you remove the optotriac, and replace it with a normal red LED, you can use that to understand when the circuit would trigger the triac.

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.

You definitely want it arranged so that when the light should be on, the reed switch is closed. If the light should be on when the door is open, then I think, yes, that means an n.c. switch.

My pullup resistor is used to close the circuit, feeding voltage to the opto-isolator, which is resting at ground.

You should have four components, arranged in a loop: battery, resistor, reed switch, optoisolator emitter. These can be in any order you like, as long as the optoisolator emitter is connected the right way around with respect to the battery. When the reed switch is on, current flows from the battery to the optoisolator emitter, limited by the resistor. When the reed switch is off, no current can flow, end of story. I'll need to see a circuit diagram if you have further questions.

(btw, I think Warsim's comment was directed at eneuro)
 

Offline eneuro

  • Super Contributor
  • ***
  • Posts: 1528
  • Country: 00
Re: Hall Effect to Trigger Light Switch
« Reply #46 on: October 04, 2014, 07:59:16 am »
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.
This AC switch with cheap 2xBUZ78 can be used for 30W @ 230VAC easy and in this case I was not looking for anything since I had such two mosfets and a few quick calculations showed that power losses when this switch is ON will be around 0.25W in whole thing, so it is nothing when will compare it with switched 30W power.

How much power (resistive not inductive) do we need to switch and it is only ON/OFF no dimming etc?
Why battery, while small transformers costs a few $es and we have mains power available?

I think that one image or schematics is equivalent to hundreds written words, so simply draw something.
« Last Edit: October 04, 2014, 08:01:47 am by eneuro »
12oV4dWZCAia7vXBzQzBF9wAt1U3JWZkpk
“Let the future tell the truth, and evaluate each one according to his work and accomplishments. The present is theirs; the future, for which I have really worked, is mine”  - Nikola Tesla
-||-|-
 

Offline ceamicloverTopic starter

  • Contributor
  • Posts: 37
Re: Hall Effect to Trigger Light Switch
« Reply #47 on: October 04, 2014, 11:49:20 am »
I will order some normally closed reed switches.

General questions on triacs:

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?
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
Re: Hall Effect to Trigger Light Switch
« Reply #48 on: October 04, 2014, 12:30:06 pm »
What is the opto-isolator outputting to trigger AC current through the gates? 
Firstly, opto-isolators and opto-triacs are different things. At least, that's how I think most people use the terms. The MOC3063 is an opto-triac, not an opto-isolator.

The output side of the opto-triac has two pins which are normally open circuit. When the opto-triac is triggered the two pins are connected together (and stay connected until the current drops below holding current). It's just like a triac (because that's what it is, an optically triggered triac). The diagram in the datasheet is less mysterious than it seems, you can see the LED and the Triac in the package there.

( Opto-isolators, on the other hand, have outputs that look like a BJT transistor (again, just as it looks like in the circuit symbol). )

Quote
Can you use triacs for 12vDC applications, or is a MosFet more appropriate?
Thyristors have quite a large voltage drop (around 2 V), which is an insignificant fraction of mains voltage, but a significant fraction of 12V. Also, Thyristors kinda need the zero-crossings in AC; without a zero-crossing, a thyristor might never turn off. MOSFETs would be a most appropriate choice for 12V DC, and a digital isolator is a nice easy way to drive a MOSFET in an isolated way (although in most cases, you won't need isolation for a 12V system).
 

Offline WarSim

  • Frequent Contributor
  • **
  • Posts: 514
Re: Hall Effect to Trigger Light Switch
« Reply #49 on: October 04, 2014, 04:38:14 pm »
For those that are interested.
Opto and Triac are component descriptors. 
Isolator is a function descriptor. 

Opto means optometricly isolated.  Opto term is used to define it primary method of isolation.  Yes a device could use more than one.  Other types of devices use inductive and galvanic etc.  Many energy activated devices maybe integrated into an opto-isolator.  BJTs, MOSFETs, TRIACs, SCRs etc.

When the simplified phrase of opto-isolator is used it will refer to the most common type at the time of use.  If used today it means opto-isolated BJT.  Opto-BJT is another simplified phrase. 

If you use an opto-TRIAC read the datasheet.  Typically the trigger energy requirements are higher.  Various methods are used to compensate.  Multiple LED elements and increased gate surface are common are two common methods.  Multiple LED elements will increase the isolated trigger burden.  The second will slow the TRIAC down and require more heat dissipation.  Turn off is also slowed but the effect is trivial at mains frequencies. 


Sent from my iPad using Tapatalk
 

Offline eneuro

  • Super Contributor
  • ***
  • Posts: 1528
  • Country: 00
Re: Hall Effect to Trigger Light Switch
« Reply #50 on: October 06, 2014, 11:08:26 am »
Can you use triacs for 12vDC applications, or is a MosFet more appropriate?
Probably the most important thing is how much power do we need to switch and if it is inductive or resistive  ;)
By choosing proper resistors I used BTA16 and MOC3041 to switch 18VAC electromagnet solenoid easy.

There is only 500 pages of very good intros and even Spice simulation models source code to help with semiconductors in many electronic circuits
http://www.allaboutcircuits.com/pdf/SEMI.pdf

Triac is on page 343, after SCRs on 331 .
Worth to see while this book can save a lot of burned semiconductors  >:D
12oV4dWZCAia7vXBzQzBF9wAt1U3JWZkpk
“Let the future tell the truth, and evaluate each one according to his work and accomplishments. The present is theirs; the future, for which I have really worked, is mine”  - Nikola Tesla
-||-|-
 

Offline ceamicloverTopic starter

  • Contributor
  • Posts: 37
Re: Hall Effect to Trigger Light Switch
« Reply #51 on: October 06, 2014, 11:10:09 am »
I will definitely look into it.  Thanks
 

Offline eneuro

  • Super Contributor
  • ***
  • Posts: 1528
  • Country: 00
Re: Hall Effect to Trigger Light Switch
« Reply #52 on: October 09, 2014, 07:53:27 pm »
After reading those 500 pages probably you might looking for something like this  ;)

I use similar circuit 24h a day with small heat sink on BTA16 triac it drives small air conditioning 230VAC fan.

However, at 5V I put 330 Ohm resistor to get around 11mA current on left side of MOC3041 (about 1.2V voltage drop on internal MOCxxx 1-2 pins diode), since this is not low current version (MOC3043 has lower typical 5mA) and in place of one 360 Ohm resistor I put two 1W 180 Ohm, to minimalize a chance to get any arcing on short one small 360 resistor.

Note: Did not tested it with LPT-I used classic LM7805 as 5V power supply, no need for PC controll in my case.
« Last Edit: October 09, 2014, 07:57:15 pm by eneuro »
12oV4dWZCAia7vXBzQzBF9wAt1U3JWZkpk
“Let the future tell the truth, and evaluate each one according to his work and accomplishments. The present is theirs; the future, for which I have really worked, is mine”  - Nikola Tesla
-||-|-
 

Offline WarSim

  • Frequent Contributor
  • **
  • Posts: 514
Re: Hall Effect to Trigger Light Switch
« Reply #53 on: October 10, 2014, 06:16:33 pm »
That cct is very commonly used in remote and isolated dimmer switches.  Of course the real cheep ones skip the snubber.  Good cct to use if the part cost is low enough.  Just be sure to heed the power dissipation advice given by the others. 


Sent from my iPad using Tapatalk
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
Re: Hall Effect to Trigger Light Switch
« Reply #54 on: October 10, 2014, 11:07:12 pm »
After reading those 500 pages probably you might looking for something like this  ;).

Practically identical circuit to what I linked back at #31, just for the record ;)
 

Offline ceamicloverTopic starter

  • Contributor
  • Posts: 37
Re: Hall Effect to Trigger Light Switch
« Reply #55 on: January 20, 2015, 03:25:19 pm »
Having problems with this project.  It worked reliably for a couple of months and then discharged the batteries suddenly in the 2 projects I had.

I made 2 circuit boards with HC-SR501 Ir motion detectors to trigger opto-triac MOC363 to trigger Triac BTA16 to jumper a light switch.

I replaced the batteries and they worked again.  I had been flipping off a power strip that provided the 120vac constant when I didn't want the lights turning on.  I flipped the power strip on. the lights flicked on for an instant, and went out.  The battery had went from 9v to 1v suddenly.

This seems like the issue caused by a "brown-out" or surge.  I am wondering how I should protect my projects from this.  Do I need capacitors? Diodes?

In automotive, we use a clamping diode between the power and ground sides of a relay.  No idea whether that is applicable here, though.

Any help appreciated.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf