PIC Controlled Sensors

Thread Starter

JDR04

Joined May 5, 2011
356
Hello folks, I'm looking for advice on how to go about this project.

My intension is to build a circuit that can use two types of sensors, condenser microphone for sound detection and a phototransistor for light. (not used together/same time)

I would like to incorporate a PIC to sense the signals and then control a camera. The camera side I think I have sorted out but am wondering;

Can I use a simple opamp that will cater for both types of sensors?

Can this be done with one opamp circuit to keep things simple.

Any suggestions and ideas will be greatly appreciated. Thanks a lot............John
 

Thread Starter

JDR04

Joined May 5, 2011
356
hi JD,
You need to tell us in more detail in what way, 'control a camera' means.?

Eric
Hello Eric, what I mean is that a threshold will be set on the PIC and if this is exceeded then an output will then trigger a DSLR via an optocoupler. Hope this makes sense?
 

ericgibbs

Joined Jan 29, 2010
10,195
hi,
So you just want to 'take a photo shot' when the PIR detects a 'warm' object.

You could just use a Comparator IC output, eg: LM393 to detect the required PIR signal level.

Have you any details of the way are connecting output of the IC to the DSLR.?

E
 

ericgibbs

Joined Jan 29, 2010
10,195
hi JD,
If you do not already have a PIR sensor, look at this image.
They are from Amazon, the two pots control the sensitivity and the On period.
Works from 5V thru 20V, output is 3.3V when PIR senses and 0V when no PIR detected.

E
 

Attachments

Thread Starter

JDR04

Joined May 5, 2011
356
hi JD,
If you do not already have a PIR sensor, look at this image.
They are from Amazon, the two pots control the sensitivity and the On period.
Works from 5V thru 20V, output is 3.3V when PIR senses and 0V when no PIR detected.

E
The IR sensor I do have is very similar to your one. I'll be using it in a later project. For this project I would like to have the choice of using a microphone to detect sound or a phototransistor to detect light. Depending on the circumstances. My issue is can I use only one opamp circuit that will provide a signal to the microcontroller no matter which sensor I have connected?

If a opamp is OK to use my next question would naturally be which one that requires low power?

So in short, can I use a opamp to interface either a microphone or a phototransistor to my PIC?
Thanks again for your guys time..........John
 

ericgibbs

Joined Jan 29, 2010
10,195
hi,
The LM393 is a dual Comparator, one half can be configured as an Amplifier driving the other half as a Comparator.

The Gain of the Amplifier can be adjusted to suit a Mic or PIR intput.

E
 

Attachments

Thread Starter

JDR04

Joined May 5, 2011
356
hi,
The LM393 is a dual Comparator, one half can be configured as an Amplifier driving the other half as a Comparator.

The Gain of the Amplifier can be adjusted to suit a Mic or PIR intput.

E
Hi eric, sorry for the late reply. Is there any chance you could suggest such a circuit for me to work with please.......Thanks a lot....John
 

ericgibbs

Joined Jan 29, 2010
10,195
hi JD,
I do have circuit I could modify and post, but I need to know more details.
The power supply that you are using, the microphone type and also the PIR voltage output range.

What voltage and signal the DSLR requires to trigger.?
E
 

Thread Starter

JDR04

Joined May 5, 2011
356
hi JD,
I do have circuit I could modify and post, but I need to know more details.
The power supply that you are using, the microphone type and also the PIR voltage output range.

What voltage and signal the DSLR requires to trigger.?
E
Thanks eric, the microphone will be a simple standard electret mic. It wont be a IR sensor but a PHOTOTRANSISTOR.

All I need is for the opamp to provide a signal between 1 and 5 volts to the microcontroller. Threshold etc will be set in the microcontroller software. The camera activation will also be handled by the software. Voltages will be 5V dc.

Many thanks for your help....John
 

ericgibbs

Joined Jan 29, 2010
10,195
hi JD,
Ref the photo-transistor, I guess you know that a regular photo-trans will not give a usable signal from a moving PIR radiating object.?
They are usually used as part of 'beam break' path pair, ie: modulated IR emitting diode being detected by the IR matched photo-transistor.

E
 

ericgibbs

Joined Jan 29, 2010
10,195
hi JD,

This is the proposed circuit in LTSpice simulation, the V2 signal source is the electret mic input.
Pot U4 sets the threshold at which the output comparator is switched.
C5 and R8 are the delay for the switching On time.
[change C5 value to give the required delay]

Resistor R3 sets the Gain of the first stage to approx 100, if you need to have a variable gain, change R3 to say a 200K pot.

In order to add the PIR/photo-diode section to this circuit I need to know more detail about the PT and the way is it is planned to be used.

Operation,
One half of the LM393 , U3 is configured as an amplifier which drives D2, a rectifying diode. The DC voltage from the diode charges capacitor C3.
The Vreference voltage is set by pot U4. As the voltage on C5 increases it will reach a level that exceeds the Vref and the output of the comparator U2 will switch from approx 0v to 5V.

The purpose of R8 is to discharge C5 when the Vin input signal is removed. This will then switch U2 back to 0v.

The sim plot shows the operation when the Vin signal is 100mV from the electret mic.

Do you know how to power and connect the electret mic.?



E
 

Attachments

Top