Pages: [1]   Go Down
Author Topic: Weird analog readings  (Read 721 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 0
Posts: 110
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 110
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?!

Logged

0
Offline Offline
Faraday Member
**
Karma: 16
Posts: 2855
ruggedcircuits.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 110
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks a lot, that did the trick.
Logged

0
Offline Offline
Shannon Member
****
Karma: 207
Posts: 12190
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

[ I won't respond to messages, use the forum please ]

Offline Offline
Full Member
***
Karma: 0
Posts: 110
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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! smiley
Logged

Pages: [1]   Go Up
Jump to: