Shop OBEX P1 Docs P2 Docs Learn Events
Multiple Photodiodes, how do I add(sum) output voltages correctly? — Parallax Forums

Multiple Photodiodes, how do I add(sum) output voltages correctly?

Will EyeamWill Eyeam Posts: 16
edited 2009-04-16 05:31 in Accessories
On my robot, I have 17 sensors(light-to-voltage photodiode tsl12s)·total, 6 on the left and right sides=12, and 5 in the front center. For each side, 6 photodiodes will be used; 3 filtered to 10kHz and 3 filtered to 20kHz. I need to compare which photodiode(10kHz or 20kHz)·has the bigger output.

My question: what's the easiest way to sum the outputs from three·10kHz/20kHz·filtered photodiodes? I am using the interleaved adc example, so I would prefer·One sum'd output from 3 sensors because the Propeller uses 2 I/O pins for each input signal in the adc example.
photodiode_cir.jpg
attachment.php?attachmentid=58725

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-04-03 18:05
    Will,

    I think you're making this way too complicated. The Propeller can be used to accept input from the TSL12S directly and do the filtering in software. In fact, you could use one sensor for both 10kHz and 20kHz detection, perhaps simultaneously. You can also use an analog multiplexer to connect several sensors to one pin and sample them sequentially.

    A couple questions:

    1. Are the light sources that you're detecting being modulated by the same Propeller that's detecting them? (This would simplify things enormously.)

    2. Since 20kHz is a harmonic of 10kHz, do you get any crosstalk between the two frequencies? Usually when two frequencies are being detected like this, it's better if they don't have a harmonic relationship with each other.

    -Phil
  • Will EyeamWill Eyeam Posts: 16
    edited 2009-04-03 19:33
    The light source will be coming from led beacons, using a 555 timer chip to produce the desired frequency. We can always adjust the RC pair (on beacon and filter)if interference is detected. Can you show me an example on how to utilize the tsl12s to detect/distinguish 2 frequencies. BTW I am using the Propeller. Basically If the left beacon is called S1, right beacon: S2, I want the left side of the bot to compare s1-s2, and have the right side compare S2-s1. This way, if the result on the left side is greater than the right, the bot will know that it is closer to the left beacon.

    Post Edited (Will Eyeam) : 4/3/2009 8:23:07 PM GMT
  • kwinnkwinn Posts: 8,697
    edited 2009-04-04 03:40
    Are you sure the schematic is correct? I see pin 2 from the TLS going directly to the inverting input of the op amp and pin 3 going through C3 and R5 to the same input.
  • Will EyeamWill Eyeam Posts: 16
    edited 2009-04-04 04:25
    the schematic has a function generator object for simulation purposes, the pins are not intended to match the tsl
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-04-04 07:46
    Will,

    I did some experiments with the TSL12S and TSL14S. The TSL12S saturates in normal room light, so I used the less sensitive TSL14S instead, along with the following circuit:

    attachment.php?attachmentid=59820

    I did the testing using my modem object (Bell202_modem in the OBEX). I thought this would be a good test, since it works by comparing the 1200Hz ampplitude with the 2200Hz amplitude simultaneously. I was able to communicate at 1200 baud with this setup, but only over a distance of a few inches. (The 'scope showed a signal amplitude on the Propeller pin of about 1V P-P.) So it may be necessary to use either a much brighter LED beacon or a stage of amplification ahead of the Propeller pin.

    -Phil

    Post Edited (Phil Pilgrim (PhiPi)) : 4/4/2009 8:28:35 AM GMT
    587 x 274 - 3K
  • kwinnkwinn Posts: 8,697
    edited 2009-04-04 13:59
    Will, you can sum the signals by connecting the R5 outputs together on the - input of the op amp.

    If you run the ir beacons at 1200 and 2200 Hz you can use the modem object in the obex with some modifications to measure the relative intensities and get rid of the filters, but you will most likely need to add an agc circuit.
  • Will EyeamWill Eyeam Posts: 16
    edited 2009-04-10 00:46
    The circuit I am working with will have to be used because the project is due in a month. I have tried connecting R5 outputs, but did not see the 2 signals "sum".
  • kwinnkwinn Posts: 8,697
    edited 2009-04-10 03:00
    You will not see much on the inverting input, but you should see the summed signal on the output of the amplifier stage and if you have both filters connected to the same amplifier stage you should see both signals if the IR detectors can see both beacons.
  • Will EyeamWill Eyeam Posts: 16
    edited 2009-04-11 18:10
    Thanks for the help Kwinn, I will be doing more experiments on monday with a few sensors, I have a question tho. I am using a sigma-delta ADC, and was wondering how I can take an average of 3 or 4 readings, or is there a way to compare 3 or 4 readings and store the greatest value? Here's my posts for the ADC.
  • kwinnkwinn Posts: 8,697
    edited 2009-04-11 20:59
    Will, you can take as many readings as you want on each input, add them together, and take an average, but I would not bother with the dividing or shifting to get an average. The sums work just as well as long as you take the same number of readings from each sensor. I took a look at your post for the adc and it should work. The reason for the variation in readings may be that you are trying to measure an AC wafeform, so the reading will vary depending on the exact point in the wafeform you take your reading. You may have to add a peak hold circuit to get more stable readings, at which point the averaging may not be needed.
  • Will EyeamWill Eyeam Posts: 16
    edited 2009-04-15 19:24
    How do I build a simple peak hold circuit? yes I am trying to measure an AC waveform..
  • kwinnkwinn Posts: 8,697
    edited 2009-04-16 05:31
    See the attached application note starting at page 18. Not suggesting you use a particular op amp since almost any general purpose op amp would work for this application.
Sign In or Register to comment.