PDA

View Full Version : Challenging Projects - IR Object Detector with Transformerless Power Supply



sayzer
- 14th October 2006, 19:54
Hi there,

I am wondering if a project as in below circuit can be done.

With the help of mister_e, I have already, well mostly mister_e, done the controlling of TRIAC as an ON/OFF gate to the load (motor/heater) using transformerless power supply.

If I want to add an IR detection feature to this circuit, then I need to assign a frequency to the IR LED, and read it through the photo transistor (not by traditional 38Khz or 56Khz IR detector modules).

Thus, it becomes challenging while there is an ongoing sensitive interrupt process for the firing of TRIAC.

I am thinking, since the code is being run by serial execution, IR LED will never be encoding at the same time with detection of photo transistor. Thus, I put photo transistor to Timer1 module in counter mode. So that, it can count in the background once the code starts encoding the IR LED.

I would appreciate comments on this circuit.

Doable?



------------------------------
<img src="http://img10.picsplace.to/18/IR2.GIF" alt="Image Hosting by PicsPlace.to" >

------------------------------

mister_e
- 14th October 2006, 20:54
This Triac have a better di/dt than the first one we selected for sure.. but it has also one bug. The Current gate should be at least 30mA.. and usually we double it for safety sake.. i said usually. So a bit demanding for a single PIC i/o... but for a few ten or hundreds uSec of hold time it may work without stressing too much the i/o. Two i/o in parrallel is maybe a better choice OR external driver.

Now you must filter the opto-transistor output as it will certainely pick-up more than the I/R spectrum. At least a high-pass filter will remove some mess. A simple R/C circuit on the PIC input? Maybe...

Is the current enough for the I/R led and for this application... i may have some doubt on it. This bring this LED driver stuff once again or use i/o in parrallel... wich never turned me on. even if it could work in theory.

all that new current need may probably be too much for the transformerless PSU.... but at the same time we still working with short pulses, and and and. Worth a try for sure. Keep the scope on the rails to see what's happen. Increase C3 (wich have to be 0.47uF and not 0.047 uF anyways ;) ) if much current is needed. You know my opinion of transformeless PSUs anyways...

So there's tons of maybe once again!

PS, i would certainely add a snubber for this TRIAC or use BTA216 instead... without snubber.

mister_e
- 15th October 2006, 09:02
another thing... there's something missing on GP0...

sayzer
- 15th October 2006, 09:31
Ok, yeap. Fast drawing. Missed that.

There should be 10K resistor tied between GP0 and +5V supply.

Meanwhile, IR LED will never work at the same time with TRIAC. Once there is a detection then TRIAC will be fired for the adjusted duration (by AN0 reading).

For IR encoding, I was thinking like 500Hz.


--------------

sougata
- 16th October 2006, 06:03
Hi,

You mentioned that you won't be using a ready IR detection module
If I want to add an IR detection feature to this circuit, then I need to assign a frequency to the IR LED, and read it through the photo transistor (not by traditional 38Khz or 56Khz IR detector modules).

Then why stick to 38KHz you can simply use anything that suits your PIC. In fact you can turn-on the LED, immediately look for the transistor and if found on then do it in a loop to prevent ambient light trigger.

And as I suppose its going to be a hand drier you can control the leakage of ambient light into your phototrans.

sayzer
- 16th October 2006, 08:54
Hi sougata,

Thanks for the comments. Yes the application is hand-dryer.

But, I am not quite clear about your idea.

Could you please be more specific?

BTW; The idea of not using ready IR modules is for cost purposes.

-------------

sougata
- 16th October 2006, 09:07
Hi,

You know when you have turned on the LED, so you know technically when to check for a (0) in your app. So the frequency doesn't make any sense. Now there can be two conditions :

1. The LED is ON and you sense it via the photo

2. The LED is not ON still you sense by the photo (ambient light)

Use IR Filter to obviate the 2nd Issue now say you find the photo on against a LED ON then check it in a loop:

Turn off the LED and the photo should be OFF if not then ambient light (not likely if taken care of)

Turn On the LED and check again , do this turn on-off thing in a loop and if the condition satisfies reset your internal "off" counter. If you detect no object then turn off the TRIAC after the specified delay has elapsed.

You won't be doing Phase Angle Control I suppose so should not be very complicated. If doing a phase angle control then a little bit more complex. Choose the zero cross to set your fire angle and object detection. Cause anyway you would be firing the TRIAC a little later...

P.S. - For a cheap IR filter for your test , expose a colour film for about a minute in normal fluroscent light develop it and the black negative is your I.R. Filter. Read somewhere on the web never tested.

mister_e
- 16th October 2006, 14:29
I was thinking of using a PWM signal for the LED. 12F683 could be handy here.

Start the HPWM of x KHz, and use the internal timer to count in background. With a decent prescaler, it should reject most part of the ambient light.

Just an idea... in theory it works.

sayzer
- 16th October 2006, 17:17
Thanks for the details Sougata. I am definitely taking all info into consideration.

And For 12F683, I will check the price and see if it is any advantage over using 12F675.

I am currently working on this thing.

mister_e
- 16th October 2006, 18:19
More codespace
1 Hardware PWM
internal OSC up to 8 MHZ

If i refer to digikey, the price difference for a single 8pin DIP is in the worst case 0.36$ mmm, i know, sometime it's enough.

sayzer
- 16th October 2006, 18:23
Sometimes I think that I can even sell parts to Digikey.

If you know what I mean.