Pages: [1]   Go Down
Author Topic: GP2D12 Problem  (Read 382 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi there,
The problem - after connecting Sharp's sensor to Arduino Uno AD converter returns maximum level of measured signal for distance < circa 0,5m. Everything's done just like in examples. I've connected red cable to 5V ARduino's output, black one to GND and sensor's output directly to analog input A5. I've checked the sensor with multimeter- works properly.

Here "my" code:
int irReader = A5;    // the analog input pin for the ir reader
float irVal = 0;       // stores value from Ir reader
 
void setup()
{
  Serial.begin(9600);
  delay(1000);
}
 
void loop()
{
  irVal = analogRead(irReader);  //[V]
  Serial.println(irVal);
  delay(500);
}

Is anything else required? Or maybe I should connect Vout through pull-down resistor?
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13531
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Code is elementary but OK, have you tried the other analog ports ?

you did not use the digital port 5 by accident ? would not be the first ...
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No, it's analog input for sure smiley-wink No matter which channel I use the result is the same. Moreover, when I connect a channel to voltage divider's output (10k/10k), the voltage between GND and output equals 1V. It makes me think that there's something wrong with the hardware.
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13531
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


you could test the HW with a potmeter ...

- http://arduino.cc/en/uploads/Tutorial/potentiometer.jpg -
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So I did. Converter returns values 0-1023 for voltage 0-0.6V. Maybe there's something wrong with ADC amplifier's gain?
Logged

Pages: [1]   Go Up
Jump to: