Go Down

Topic: Weird analog readings (Read 774 times) previous topic - next topic

TomS

Hello Arduino friends!

I just came across a weird problem when trying to read some sensor values.

The setup is this:

+12V ----- Photodiode ---x--- Resistor ------- GND

(The photodiode is in reverse and the 12V is just to increase responsiveness of the sensor)

When I now connect x (which has a few millivolts) to an analog input pin on the Arduino I can't get any useful readings at all.
All I get is:
Code: [Select]
0
0
0
0
0
1023
1023
0
0
0
0
0
1023
1023
0
0
...


It always jumps between zero and 1023.

If I now change the +12V and GND to the +5V out and GND of the Arduino it works like a charm.

Does anybody have an idea what the problem here might be (and how to solve it)?

Thanks a lot & have a great day!
Tom

TomS

I did another test and found out the following:

If I measure the voltage between x and the GND of the external 12V PSU I am getting the expected few millivolts.
But if I measure between x and the Arduino GND I get a negative voltage?!!
That explains why the ADC doesn't work, but why does this occur at all?!


RuggedCircuits

Do you not have the two grounds connected together? That is required for this to work.

--
The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, speaker, microphone, light sensor, potentiometer, pushbuttons

TomS

Thanks a lot, that did the trick.

MarkT

Don't do this, 12V will definitely fry your Arduino if too much light falls on the photodiode.  One fix is to wire a Schottky diode between x and 5V to clamp the photodiode output to 5.4V and protect the pin's protection diode, but you might be better just increasing the resistor value for higher sensitivity?
[ I won't respond to messages, use the forum please ]

TomS

12V never comes in contact with the Arduino.
The Photodiode is installed in reverse in the 12V circuit and the voltage is only used to increase sensitivity and responsiveness of the Photodiode.
The actual voltage at x is only a few millivolts even in direct sunlight.

But thanks for the advice nonetheless! :)

Go Up