Shop OBEX P1 Docs P2 Docs Learn Events
help with transistor before basic stamp — Parallax Forums

help with transistor before basic stamp

regularguyregularguy Posts: 7
edited 2011-08-05 08:53 in General Discussion
Hello everyone. I have a Basic stamp2 i have been using to make fun projects, a couple simple robots and lights and sounds. Now I want to read a sensor with the basic stamp and make desicions. Maybe someone can help with my troubles?

The sensor outputs light intensity data many times per second so when I look at the signal on a oscilliscope it is 4V + a 1V signal, so the signal is above ground. I took some classes a couple years ago but I did not understand transistors very well. I used a capacitor to filter the DC but leave the data and now I need to convert the 0-1V signal to 0-5V for my basic stamp to read right? I tried an OPamp from Radio Shack but it was to much gain, 20X I think minumun. So I tried to use 2N3904 NPN transistor,

I read a lot on-line and I think I want a common emitter circuit which outputs off the collector. I tried all the calculations from my books and the data sheet but no good. I got a free program called transistor amp and it seems to work very well but the circuit doesn't have voltage gain!? I don't know what I'm doing wrong if someone can help? I get the same thing in and out of the transistor like it is not doing anything. I tried changing the resistor on the collector to allow more current but it is the same. My voltage is 5.02V to everything but I do not am using the basic stamp right now while I work on this. I can draw a schematic but on paper and scan it if you want to see it. It is just the sensor 5V and this transistor circuit.
397 x 765 - 166K

Comments

  • LeonLeon Posts: 7,620
    edited 2011-08-04 12:05
    You should get plenty of gain from that amplifier, you must have wired it wrong. Check the voltages around the transistor, especially at the collector - it should be about 2.5V.

    You can get any gain you want from an op amp, BTW, within reason. It all depends on the amount of feedback.
  • ctwardellctwardell Posts: 1,716
    edited 2011-08-04 12:09
    Can you post a part # for the sensor?

    C.W.
  • Mike GreenMike Green Posts: 23,101
    edited 2011-08-04 12:11
    I think you're making this way too complicated. What sensor are you using? One of the light sensors that works like what you describe doesn't output an analog signal. It outputs a digital signal consisting of pulses whose width is proportional to the light intensity.

    First, get the documentation for the sensor preferably as a PDF file or maybe a JPG file and attach that to a reply. Use the Go Advanced button and use the Attachment Manager that you get with the Go Advanced button. Second, look at the RCTIME statement in the Stamp Manual. There's also a nice description of the use of the RCTIME statement to measure voltages here. Click on the app-notes link and look at the section on using RCTIME.

    If you have the kind of sensor I described, you'd use a PULSIN statement to measure the width of a pulse.
  • regularguyregularguy Posts: 7
    edited 2011-08-04 12:21
    Thank you wow! that was fast. I will check my wiring again I think the 20th time :) I do not know a part number for the sensor but I can look again it is a photo transistor I think but it has a board on it with a lot of different parts and it is pretty old I think, I do not know what it was used for but it is old. I do not understand OPamp feedback but I will read about this. I only need 5 times amplification right?
  • regularguyregularguy Posts: 7
    edited 2011-08-04 12:28
    I know this rctime command but the minumum is 1.4V so I did not think it would work! so maybe I do not need the transistor? I will look for a data sheet too if that will help. The sensor works for seeing light and because I see the signal on my oscilliscope so that is good.
  • ercoerco Posts: 20,259
    edited 2011-08-04 15:06
    You can RCtime a phototransistor easily, see p. 4 at http://www.seas.upenn.edu/~robo2005/Electronics%20Lab%202%20v6.doc

    Ditch your old board and get a new phototransistor (even Radio Shack has 'em), you're almost done.

    http://www.radioshack.com/search/index.jsp?kwCatId=&kw=phototransistor&origkw=phototransistor&sr=1
  • regularguyregularguy Posts: 7
    edited 2011-08-04 19:56
    I checked my wiring and made a drawing of how it is connected but both are the same as my picture in post1 and I checked each resistor with a meter and used a new 2n3904 from the pack that I have never used so I do not understand where I am wrong? The only difference I see is I used a 10uf capacitor instead of 6.8uf and a 180uf instead of 150uf because I do not have them. The picture in post1 shows two ceramic capacitors I think but I do not have ceramic capacitors that big uf. Is this ok?

    Thank you for your photo transistor link. Mine does not look like that but it is ok. I should get a new one. I wish the transistor worked though but I do not know why it doesnt

    I guess I cannot use this one.
  • regularguyregularguy Posts: 7
    edited 2011-08-04 20:05
    Leon I checked the voltages like you said and the collector is 1.595V and the emitter is 0.884V the base is 0.909V and emmiter to collector is 0.710V and emmiter to base is 0.022V.
  • Mark_TMark_T Posts: 1,981
    edited 2011-08-05 06:15
    Leon wrote: »
    You should get plenty of gain from that amplifier, you must have wired it wrong. Check the voltages around the transistor, especially at the collector - it should be about 2.5V.

    You can get any gain you want from an op amp, BTW, within reason. It all depends on the amount of feedback.

    Not sure I'd call a factor of 4 "plenty of gain" !! The gain is basically set by the shunt feedback from the emitter resistor - in this configuration the voltage gain is approximately the Rc/Re.

    However for measurements its op-amp circuits everytime, discrete transistor design is unnecessarily hard and the op-amp designers have done all the hard work for you.

    Don't think you want an AC only amplifier anyhow? opamps are DC amplifiers.
  • Spiral_72Spiral_72 Posts: 791
    edited 2011-08-05 08:53
    I agree with Mark in that an op amp should be a simpler solution if you can tune it to a 12dB gain.

    Also, I wonder how a simple transistor switch would work for you? Emitter to ground, a cap then 10k resistor on the base and a 1k - 2.2k resistor on the collector. It may be more noisy, but it doesn't sound like a little noise would hurt what you are trying to do.
Sign In or Register to comment.