Problems with phototransistor (Process Control Text)
RyGuy
Posts: 7
I'm working on chapter 4 of the Process Control text and I am having an unusual problem. Well, at least it seems unusual to me....
The readings I am getting from the phototransistor are weird when the collector node is connected to Vin (+) on the ADC08031 chip (pin 2). The readings are always between 0.12V-0.18V.
While I was trying to troubleshoot the problem I disconnected the two circuits and measured the voltage across the phototransistor with a multimeter. It worked perfectly. It was giving me close to five volts when my was hand far away and dropped as I brought it closer.
So, I thought the problem was with the ADC... but I reconnected a potentiometer to the ADC circuit in place of the phototransistor circuit and it too worked perfectly. Both circuits work on their own, but do not work together.
If I had to guess, I would think something is wrong with the ADC chip. Probably something to do with the input impedance being screwed up, but it seems to work fine with the potentiometer.
Anyway, do any of you have any ideas or similar experiences?
Thanks
The readings I am getting from the phototransistor are weird when the collector node is connected to Vin (+) on the ADC08031 chip (pin 2). The readings are always between 0.12V-0.18V.
While I was trying to troubleshoot the problem I disconnected the two circuits and measured the voltage across the phototransistor with a multimeter. It worked perfectly. It was giving me close to five volts when my was hand far away and dropped as I brought it closer.
So, I thought the problem was with the ADC... but I reconnected a potentiometer to the ADC circuit in place of the phototransistor circuit and it too worked perfectly. Both circuits work on their own, but do not work together.
If I had to guess, I would think something is wrong with the ADC chip. Probably something to do with the input impedance being screwed up, but it seems to work fine with the potentiometer.
Anyway, do any of you have any ideas or similar experiences?
Thanks
Comments
-Phil
-Phil
I've attached the schematic for the circuit from the text.
Like I said, all I have to do is disconnect the blue wire connecting the phototransistor to pin 2 of the ADC and the phototransistor works properly when I measure the voltage with a multimeter.
I am thinking something is wrong with the ADC, but I can't track one down at the local electronic shops or Digikey and the shipping charges to Canada are outrageous if ordering from the parallax store. I was hoping it was something wrong with the circuit...
Post Edited (RyGuy) : 10/16/2009 3:42:45 PM GMT
Also, be sure that the Vdd power to the chip is plugged into a Vdd socket at the end of the BOE.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
-Phil
(The ADC's pin 1 could be connected to V_ss instead, no I/O connection necessary.)
That wouldn't produce the behavior he's seeing, though. It would just prevent him from reading the chip if he's using P13 as a chip enable — or not: who knows where P12 might be floating.
-Phil
The datasheet states:· "A conversion is initiated by first pulling the /CS line low.· This line must be held low for the entire conversion.· The converter is now waiting for a start bit and its MUX assignment word."
[noparse][[/noparse]So, maybe keeping the /CS low isn't a great idea, but leaving it floating/not_LO is right out.]
RyGuy, what's your progress?
-Phil
As far as I'm concerned, till the circuit as constructed and the schematic are in agreement then there's nothing much worth talking about.
-Phil
I rewired the circuit to make it neater for the picture and put that wire in the wrong spot. I've fixed that problem, but didn't have any affect on the behaviour of the circuit.
I also tested the resistance in the breadboard as suggested by Phil and did not see any shorts in the breadboard.
The code that i have been using is attached.
I rebuilt the circuit with a potentiometer in place of the phototransistor and I was wrong earlier about it working properly. If I set the potentiometer to 3.5V at the tap without pin 2 of the ADC connected and then connect pin 2 the voltage shoots down to 0.55V. For 4.5V, connecting to pin 2 drags it down to 1.44V. I thought it was working properly before because I was able to get 5V out of the tap, but that was only with the potentiometer wide open.
It looks like the problem is pin 2 of the ADC trying to drag any voltage applied to it to zero.
I am thinking the best way to solve this problem would be to swap in another ADC chip and see if that fixes the problem. It would at least eliminate another possible source of the problem if that doesn't work. Like I said before though, I am having trouble tracking down that exact chip. Could any of you recommend another ADC with similar operation which might be more widely available?
Again, thanks for all of your help.
-Phil
Unfortunately the only ADC I could find was the ADC0803LCN, which sends the output to 8 individual pins instead of sending the 8 bit output through 1 pin. Not too big of a problem, but now the breadboard is a mess of wires and I need to use 8 pins of the stamp to read the output. Though, after dealing with the frustration of the circuit not working, I have no problem dealing with this.
Thanks for all of your help and advice.