Electronics Seeing with photosensor?

Discussion in 'Modding' started by spider87, 12 Aug 2008.

  1. spider87

    spider87 Your modder

    Joined:
    29 Jan 2008
    Posts:
    119
    Likes Received:
    0
    I would like to start experimenting with photosensors like the kind you get from radioshack or something. Just to get the basic IO worked out and stuff. SO what I was thinking was hook one up to my demo board that came with my PICkit 2 and hook it to some of the pins on the PIC16F887. Can I just do this and then put 2 outputs on the screen and tell it to print the data on the pins I attached it to to those outputs? What is the output like? Any tips would be great.

    Then, I am thinking of making a vb program that takes the input from either this or a sonar that I will experiment with also (once I get the basics worked out) then read through them and use them to manipulate the form. Does anyone know if the microchip PICkit2 programming software includes any kind of Visual Studio references or modules or anything?

    Language isn't an issue just as long as there's a class somewhere for it.

    Thanks,
    Alex
     
  2. spider87

    spider87 Your modder

    Joined:
    29 Jan 2008
    Posts:
    119
    Likes Received:
    0
    lol subtle bump
     
    Last edited: 13 Aug 2008
  3. jakenbake

    jakenbake full duplex

    Joined:
    5 Jun 2005
    Posts:
    495
    Likes Received:
    3
    got a datasheet of one you had in mind?
     
  4. Stuey

    Stuey You will be defenestrated!

    Joined:
    20 Jan 2005
    Posts:
    2,612
    Likes Received:
    10
    Reading your first post three times still left me confused.

    I believe that a photosensor's output is analog. If your chip doesn't have a built-in ADC, you might need one to read the input.
     
  5. spider87

    spider87 Your modder

    Joined:
    29 Jan 2008
    Posts:
    119
    Likes Received:
    0
    Why do people always say that?

    But I'm not actually sure I was under the assumption that they just took light input and sent numbers based on that through to the chip. What's an ADC? lol
     
  6. Stuey

    Stuey You will be defenestrated!

    Joined:
    20 Jan 2005
    Posts:
    2,612
    Likes Received:
    10
    I don't know why people always say that. I said that because I wasn't sure what exactly you were using, and what your exact goals are. There are technical aspects missing as well. Photosensor? So is it a photodiode, phototransistor, or photo-resistor, or other? Sometimes it makes a difference. What screen are you talking about. Printing? You want the controller to print to your display? Then what do you want the photosensor to "see"? You just want a reading of the ambient light levels and for that intensity to be displayed onto an ambiguous screen? Too many uncertainties, too much confusion. I said that I was confused just so in case I understood things inaccurately.

    ADC = analog to digital converter

    It does send back numbers, but some microcontrollers need an ADC to sort things out. A particular sensor might read an intensity of say, 3.4 volts, while the microcontroller might want it input as a digital value. An 8 bit ADC takes the voltage range and converts it into numbers, say a range from 0 to 255. I'm a little rusty, but I think this is right.
     
  7. spider87

    spider87 Your modder

    Joined:
    29 Jan 2008
    Posts:
    119
    Likes Received:
    0
    Ok, thanks I'll clarify for you. I said photosensor because I wanted to be general because actually I haven't really looked into it I was hoping for some input on what would be best. By print I meant text in a debug window.

    What I'm trying to do with this is see what kind of output it has so I can figure out how to use the data. I'm trying to see, say, if I point it to a black surface that is lit what kind of number it would give me as compared to a white piece of paper and stuff. Basically just experimenting.

    Also, do you have any idea how I can look up whether I'd need an ADC or not?

    Thanks,
    Alex
     
  8. Stuey

    Stuey You will be defenestrated!

    Joined:
    20 Jan 2005
    Posts:
    2,612
    Likes Received:
    10
    Whether you need an ADC or not should be mentioned in the datasheet or info for your PIC chip. It might not even be needed, depending on how you want to do things.
     

Share This Page