Problems with an IR proximity switch and avoltage regulator

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
emkli
 
Posts: 51
Joined: Sun Mar 17, 2013 1:37 pm

Problems with an IR proximity switch and avoltage regulator

Post by emkli »

Hi there!

I have a little technical problem with a device I've ordered a few weeks ago. It's an infrared proximity switch. There is very little information about this thing in the 'net; the most informative source of information is this one:

http://www.geeetech.com/wiki/index.php/ ... BANNED_module

The problem which occours is the following: I'm using these IR switches in a ATMega328p project which gets 5V from a voltage regulator. The switches seem to work, but the voltage regulator gets EXTREMELY hot. I've checked my wiring but it seems to be correct. It also doesn't get hot if the switches are disconnected. To be sure, I also connected the devices to my Arduino UNO, which uses a completely different VR - same issue. So I guess, I need some kind of an additional protection, like diodes or resistors.

Any ideas?

Greetings,
Markus

User avatar
zener
 
Posts: 4567
Joined: Sat Feb 21, 2009 2:38 am

Re: Problems with an IR proximity switch and avoltage regula

Post by zener »

Where did you buy it? Technically you need the datasheet to show how much current it uses. However you can also measure it yourself. Many voltage regulators cannot supply a lot of current. It could be a simple matter that the sensors need more current than the regulators can provide. You need to know how much current the sensors are using, how much they are supposed to need, and how much your regulator can supply.

User avatar
emkli
 
Posts: 51
Joined: Sun Mar 17, 2013 1:37 pm

Re: Problems with an IR proximity switch and avoltage regula

Post by emkli »

I've bought it from Seedstudio. There are several, mostly asian suppliers who offer this thing. In the meantime, I was able to figure out the name of the device: E18-D80NK, but it seems that there is just no datasheet around. The only helpful thing I've found BANNED this one:

Image´

(from here: http://arduino-info.wikispaces.com/Infr ... anceSensor)

It says that the sensor output line is a "Open-collector NPN pulldown output" and I need to put a Pullup resistor to +5V. Should a 10K resistor be okay? But can this be the reason the voltage regulator gets so hot? By the way, my VR supports up to 1,5 A and the IR switch module is sayed to have a maximum load current of 100 mA

User avatar
zener
 
Posts: 4567
Joined: Sat Feb 21, 2009 2:38 am

Re: Problems with an IR proximity switch and avoltage regula

Post by zener »

Your VR has a power limit also, which I am guessing you are exceeding. I can possibly provide the answer if you can provide the following info:

What is the PN of the VR you are using? Through hole or SMT?

Does it have any heat sink?

What is the voltage into the VR?

How much current is a sensor drawing based on actual measurement?

What is the total current the VR is supplying?

User avatar
emkli
 
Posts: 51
Joined: Sun Mar 17, 2013 1:37 pm

Re: Problems with an IR proximity switch and avoltage regula

Post by emkli »

Ok, let's try:

I'm using a KIA7805API (Datasheet).

TO-220, maximum output 1,5A, input voltage is 12V, no heat sink.

I've tried to measure the current flow on all three lines of a sensor. At VDC and GND, the current is 0,05 A in "open" state (no obstacle) and 0,06A in "closed" state. However, I wasn't able to measure the current at the signal line (I was able to measure the voltage there, however).

User avatar
phild13
 
Posts: 247
Joined: Mon Sep 10, 2012 1:05 pm

Re: Problems with an IR proximity switch and avoltage regula

Post by phild13 »

Not sure how your attempting to hook it up but sensors of this type are very common in the industrial world (though they cost more in general) and are designed to drive the base of a transistor (PLC input) not drive a load directly. The sensor should pull about 100mA in operation.

If the sensor has not been damaged I would hook it up like this to a micro controller such as an Uno input

Red to +5vdc
Green to GND
Yellow (Signal) goes to the base of a transistor such as a PN2222A through a 1K resistor
Emitter of the PN2222A goes to GND
Collector of the PN2222A goes to a digital input pin of the microcontroller you have selected for input.
Connect a 10K resistor to the PN2222A Collector and 5V

The digital input on the microcontroller should go high when the sensor is blocked by an object.
Edit: Actually the microcontroller input would be high when the sensor does not see an object (sensor is off) and would be low when the sensor turns on.

You can also drive a relay or other device in a similar fashion from the PN2222A provided you don't exceed it's rating or you substitute a different transistor. Don't forget if driving inductive loads to include a snubber circuit across the inductive load.
Example:
schemeit-project1.jpg
schemeit-project1.jpg (23.82 KiB) Viewed 752 times
Last edited by phild13 on Mon Nov 24, 2014 1:08 pm, edited 1 time in total.

User avatar
emkli
 
Posts: 51
Joined: Sun Mar 17, 2013 1:37 pm

Re: Problems with an IR proximity switch and avoltage regula

Post by emkli »

Thank you very much! The shown scenario is exactly what I wanted to do. I will try this tomorrow. I really hope that the sensor isn't damaged, but the red LED in the back is still indicating a detected object, so I think, there's hope... ;)

User avatar
zener
 
Posts: 4567
Joined: Sat Feb 21, 2009 2:38 am

Re: Problems with an IR proximity switch and avoltage regula

Post by zener »

If you have 2 sensors drawing 60mA and Vin - Vout on the regulator is 7V, then the power dissipated on the regulator would be 7*.12 = .84W (assuming no other loads). That much power would make it very hot. The data sheet claims it can handle 1.9W without a heat sink. However, at that point it would be around 150C probably.

So it is hot but not to the point of burning itself up, but it will burn your finger if you touch it probably. I would put a heat sink on it.

User avatar
phild13
 
Posts: 247
Joined: Mon Sep 10, 2012 1:05 pm

Re: Problems with an IR proximity switch and avoltage regula

Post by phild13 »

Power dissipation (amount of heat generated) of a linear regulator increases as the input voltage increases. The regulator has thermal limiting so it is probably not getting too hot.

Lets say we have a 5 volt linear regulator supplied by 9vdc input.
A simple way of looking at a linear regulator is that the regulator essentially acts like a big variable resistor. It adjusts its resistance as needed to maintain a consistent 5V output. So if the output load for example is a full 1 A, then the output power delivered by the regulator is 5V × 1 A = 5 W, and the power input to the circuit by the 9 V power supply is 9V × 1 A = 9 W.
The voltage dropped across the regulator is 4V, and at 1 A, that means that 4W is dissipated as heat by the linear regulator. If you bump the input voltage up to 12 volts then 12 V × 1 A = 12W and that 7 volts is dropped across the regulator and 7 watts is going to be dissipated as heat.

The two parts – the regulator voltage drop and the load are the places where power is dissipated while in operation.

User avatar
emkli
 
Posts: 51
Joined: Sun Mar 17, 2013 1:37 pm

Re: Problems with an IR proximity switch and avoltage regula

Post by emkli »

Thanks for all your advice. So I guess, a heat sink is neccessary for my project... ;) Anyway, I have a couple of BC337 lying around; the datasheet looks pretty much the same as the PN2222. I guess I can use them as a drop-in replacement?

User avatar
phild13
 
Posts: 247
Joined: Mon Sep 10, 2012 1:05 pm

Re: Problems with an IR proximity switch and avoltage regula

Post by phild13 »

I just used a PN2222A as an example. Your using the prox switch to turn on the base of a transistor so any NPN transistor with the proper ratings for the load and voltages involved would work in place of the PN2222A and that transistor could drive whatever load (within it's capability) you want with minor changes in the circuit.

User avatar
zener
 
Posts: 4567
Joined: Sat Feb 21, 2009 2:38 am

Re: Problems with an IR proximity switch and avoltage regula

Post by zener »

If the sensor has an open collector output (probably does) and if you are just reading it with a Digital Input pin, then you don't need a transistor, just the pullup resistor.

User avatar
phild13
 
Posts: 247
Joined: Mon Sep 10, 2012 1:05 pm

Re: Problems with an IR proximity switch and avoltage regula

Post by phild13 »

That is correct that the transistor is probably not needed in this case, but I think it is a safer and better practice to use the transistor as it isolates the sensor (control input) from the microcontrollers digital input. This would for example enable one to use a different sensor that may output 12 or 24 volts with a controller that is not tolerant of those voltages.

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”