Author Topic: Questions on a circuit. Switching from +5V to ground  (Read 8026 times)

0 Members and 1 Guest are viewing this topic.

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Questions on a circuit. Switching from +5V to ground
« on: June 20, 2013, 08:07:01 pm »
I have a circuit that's pretty simple, but not sure how to go about it without using a relay, and I don't want to do that.  Relays are too big, I need a small component for surface mount.

Here's what I have.

I have 8 hall sensors. The output signal puts out  5volts.  When a magnet triggers the sensor, the output then goes to about 0.20volts.  I want to set up a circuit so that when a hall sensor is triggered, it will light up a single LED, indicting that one of the hall sensors have been triggered.

Something like the picture.  Except, I am not sure how to change it so that when the voltage drops to the 0.20 volts, the LED will light.

Any ideas?  I would like to use a very small footprint for the SMD chip.  I will be using 2 quad Diode chips and their footprint is SOT-363. very small.
« Last Edit: June 20, 2013, 08:08:50 pm by Falcon69 »
 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: Questions on a circuit. Switching from +5V to ground
« Reply #1 on: June 20, 2013, 08:19:52 pm »
I think I figured it out.

I could use a PNP transistor.  Supply the 5volts to the emitter via a resistor to drop the voltage to like 3.2volts (needed for the LED), then, when the base (power from the sensor) drops to the 0.20 volts, it will turn on the transistor, letting current flow from the emitter to the collector (LED), correct?
 

Offline dfmischler

  • Frequent Contributor
  • **
  • Posts: 548
  • Country: us
Re: Questions on a circuit. Switching from +5V to ground
« Reply #2 on: June 20, 2013, 08:28:35 pm »
Um, how much current can the hall effect sensor sink?  The simplest thing to do is have the hall effect sensor pull down the cathode of the LED, and tie the anode to +5 through a resistor..  There may be reasons why your circuit needs to be more complicated, but you didn't specify.
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 7764
  • Country: de
  • A qualified hobbyist ;)
Re: Questions on a circuit. Switching from +5V to ground
« Reply #3 on: June 20, 2013, 08:30:24 pm »
Two transistors should do the job. The first one for inverting the signal and the second one to switch the LED. If you have to hit the 0,2V exactly a comparator would be the solution. Should the LED just light as long as the singal is 0.2V or do you like to have it lit for a specific time?
 


Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: Questions on a circuit. Switching from +5V to ground
« Reply #5 on: June 20, 2013, 08:35:03 pm »
I had the diodes that way, because I didn't want to chance any current going back through the Sensor and messing with the function of the ULN2803's.

I guess I don't understand.
 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: Questions on a circuit. Switching from +5V to ground
« Reply #6 on: June 20, 2013, 08:36:42 pm »
My multimeter displayed about 4.9volts and when triggered, about 0.13 volts on the sensor output signal.  It will fluctuate a little, depending on the power supply source.
 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: Questions on a circuit. Switching from +5V to ground
« Reply #7 on: June 20, 2013, 08:39:00 pm »
Something like the picture.  Except, I am not sure how to change it so that when the voltage drops to the 0.20 volts, the LED will light.

Reverse all diode directions. Connect D9 to +5V instead of ground.

So you are saying to let the LED ground out through the Sensor?  That signal output of the sensor goes to a series of ULN2803's.  Will it still ground out through those as well?  Without effecting the operation of them?
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 7764
  • Country: de
  • A qualified hobbyist ;)
Re: Questions on a circuit. Switching from +5V to ground
« Reply #8 on: June 20, 2013, 08:58:42 pm »
The output of the hallsensor is also going into a few ULN2803 chips.  The sensor data sheet is here,

Could you please provide a schematic to show how the ULN2803s are driven.

Quote
http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&ved=0CCwQFjAA&url=http%3A%2F%2Fwww.allegromicro.com%2F~%2Fmedia%2FFiles%2FDatasheets%2FA3141-2-3-4-Datasheet.ashx&ei=nWbDUdjOJ-GWiAL9jYGQDw&usg=AFQjCNEOdzCEoz2KfzfuhXorAUsx0yxKKg&bvm=bv.48293060,d.cGE

Open-Collector 25 mA Output ... Compatible with Digital Logic
This opens another door.

Quote
Will this transistor work?  Using 4 of them?
http://www.mouser.com/ds/2/302/BC857BS-85394.pdf

I'd go for the NPN version. But first we have to check out how you drive the ULN2803s.
 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: Questions on a circuit. Switching from +5V to ground
« Reply #9 on: June 20, 2013, 09:11:27 pm »
This is the schematic.  This one uses ULN2003's, but I've updated it using 2803's for the 8 outputs instead of 7.


The circuit I'm wanting to add, would be on the External USB Schematic. (the second one)  I want to add the Red LED to that to give a visual indication that a switch has been triggered.  It's not needed, I just want the effect.
« Last Edit: June 20, 2013, 09:14:37 pm by Falcon69 »
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 7764
  • Country: de
  • A qualified hobbyist ;)
Re: Questions on a circuit. Switching from +5V to ground
« Reply #10 on: June 20, 2013, 09:50:59 pm »
A simple inverter (74HC14ish) plus diodes would do the trick. Connect each sensor output to one inverter input, put a diode at each inverter output and connect all diode cathodes together to drive a singe LED.
 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: Questions on a circuit. Switching from +5V to ground
« Reply #11 on: June 20, 2013, 10:07:11 pm »
any suggestion as to which one?  Do they only come as 6 circuits?  I need a total of 8.

Can you explain how the inverter works?  It looks like the ones on Mouser are only 5.2mA.  The LED takes 20mA of current.

Thanks for the help madires
 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: Questions on a circuit. Switching from +5V to ground
« Reply #12 on: June 21, 2013, 06:03:20 am »
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 7764
  • Country: de
  • A qualified hobbyist ;)
Re: Questions on a circuit. Switching from +5V to ground
« Reply #13 on: June 21, 2013, 11:26:56 am »
any suggestion as to which one?  Do they only come as 6 circuits?  I need a total of 8.

Use two 74HC14 or a single 74HC240 which got 8 tri-state inverters.

Quote
Can you explain how the inverter works?  It looks like the ones on Mouser are only 5.2mA.  The LED takes 20mA of current.

Are you familiar with logic gates? Basically they got two states: low and high (like 0V and 5V). If you feed the inverter (=not) with a low state it will output a high state and vice versa. You could build one with some transistors. Since this is a very brief explanation please see  http://en.wikipedia.org/wiki/Logic_gate for a starting point.

The 74HC14 and the 74HC240 provide enough output current for the 20mA LED.

Quote
Thanks for the help madires

You're welcome!
 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: Questions on a circuit. Switching from +5V to ground
« Reply #14 on: June 21, 2013, 02:53:46 pm »
okay, so if i understand it right....

The chip has a vcc (voltage input of the 5 volts), and a ground.  I connect those.

Then each sensor to the input. and the anode of a diode to the output, then a resistor and then the LED and then to ground (like in picture).

So, when the switch is high (4.9 volts), the diodes anode would be as if I had connected it to ground.  But when the Sensor is low (0.13 volts), then the diodes anode would be as if I connected it to the 5 volts (vcc). Is that correct?  So it kind of works like a transistor then? If 5 volts is supplied to the vcc, is that what the LED will see (minus the 1.2v drop through diode), so the LED will see a total of 3.8 volts?  I think the diodes drop 1.2 volts, if I red the chip characteristics correctly.

And since no reverse current can flow to the sensor, it shouldn't interfere with the ULN2803's operation.
And since no current or voltage is really used from the sensor, it shouldn't interfere with the ULN2803's operation.

So, if that is correct, will I need a resistor between sensor and inverter to drop the voltage lower to get closer to 0 volts when the switch is activated with the magnet?

A Little confused on the Schematic of the 74HC240.


Would it be connected as....

Sensor to 1A0 then 1Y0 to Diode Anode
Sensor to 1A1 then 1Y1 to Diode Anode
Sensor to 1A2 then 1Y2 to Diode Anode
Sensor to 1A3 then 1Y3 to Diode Anode
Sensor to 2A0 then 2Y0 to Diode Anode
etc....

What are 1OE and 2OE for, it says 'Output Enable Input (Active LOW'
What would I connect GND1 to?  Do I just use a couple of vias through the pad and then go under the board and connect to ground?

Would I need any other resistors or capacitors?
« Last Edit: June 21, 2013, 03:07:38 pm by Falcon69 »
 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: Questions on a circuit. Switching from +5V to ground
« Reply #15 on: June 21, 2013, 02:56:45 pm »
oh, i think i know what the 1OE and 2OE do, using a switch, I can make it so the inverters are off or on.  So, I need to connect those to something to make the chip work?  Or just leave them unconnected.?

OH!  it says active LOW. I am assuming that means they must be connected to ground to make the chip active (or working as it should)
« Last Edit: June 21, 2013, 02:59:07 pm by Falcon69 »
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 7764
  • Country: de
  • A qualified hobbyist ;)
Re: Questions on a circuit. Switching from +5V to ground
« Reply #16 on: June 21, 2013, 03:56:55 pm »
okay, so if i understand it right....

The chip has a vcc (voltage input of the 5 volts), and a ground.  I connect those.

Then each sensor to the input. and the anode of a diode to the output, then a resistor and then the LED and then to ground (like in picture).

Yes, and connect the cathodes of all diodes, then connect the resistor to that point.

Quote
So, when the switch is high (4.9 volts), the diodes anode would be as if I had connected it to ground.  But when the Sensor is low (0.13 volts), then the diodes anode would be as if I connected it to the 5 volts (vcc). Is that correct?  So it kind of works like a transistor then? If 5 volts is supplied to the vcc, is that what the LED will see (minus the 1.2v drop through diode), so the LED will see a total of 3.8 volts?  I think the diodes drop 1.2 volts, if I red the chip characteristics correctly.

Yep, the diodes prevent any current flow from a high state output into any low state output, since the inverter's output in low state sinks current (would cause a short circuit). The transistors are inside the inverter:-) If you need a higher voltage you could use Schottky diodes with a drop about 0.3V.

Quote
And since no reverse current can flow to the sensor, it shouldn't interfere with the ULN2803's operation.
And since no current or voltage is really used from the sensor, it shouldn't interfere with the ULN2803's operation.

CMOS logic gates got a high input impedance (FETs).

Quote
So, if that is correct, will I need a resistor between sensor and inverter to drop the voltage lower to get closer to 0 volts when the switch is activated with the magnet?

No, because the low/high states are not fixed voltages, they're are within a voltage band. For the 74HC family at 5V Vcc low is roughly 0-2V and high is 2.7-5V.

Quote
A Little confused on the Schematic of the 74HC240.
Would it be connected as....

Sensor to 1A0 then 1Y0 to Diode Anode
Sensor to 1A1 then 1Y1 to Diode Anode
Sensor to 1A2 then 1Y2 to Diode Anode
Sensor to 1A3 then 1Y3 to Diode Anode
Sensor to 2A0 then 2Y0 to Diode Anode
etc....

Yes!

Quote
What are 1OE and 2OE for, it says 'Output Enable Input (Active LOW'
What would I connect GND1 to?  Do I just use a couple of vias through the pad and then go under the board and connect to ground?

The 74HC240 is a bus driver, therefore it got those enable pins. Simply connect them to ground (always enabled).

Quote
Would I need any other resistors or capacitors?

I'd add a 100nF bypass cap nearby.
 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: Questions on a circuit. Switching from +5V to ground
« Reply #17 on: June 21, 2013, 04:09:58 pm »
awesome, thank you Madires.

Where exactly would I put the Capacitor? And I have plenty of the 0.1uF (100nF) 0805 capacitors :)

Would it go from the anode of the LED to ground?
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 7764
  • Country: de
  • A qualified hobbyist ;)
Re: Questions on a circuit. Switching from +5V to ground
« Reply #18 on: June 21, 2013, 04:27:52 pm »
awesome, thank you Madires.

Where exactly would I put the Capacitor? And I have plenty of the 0.1uF (100nF) 0805 capacitors :)

Would it go from the anode of the LED to ground?

It's placed between Vcc and Gnd as near as possible to the 74HC240. Most place the bapass cap just in front or back of the IC where the traces of Vcc and Gnd come in.
 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: Questions on a circuit. Switching from +5V to ground
« Reply #19 on: June 21, 2013, 04:33:58 pm »
okay, thank you.  Will start laying all this out now in DipTrace.  Thanks!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf