Pages: [1]   Go Down
Author Topic: analogsensor input don't work in ext alimentation  (Read 410 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


I don't understand, my arduino has a programm with IR sensor,
when it's connected to usb alimentation, the values are detected, the led-indicator is lighting and switch off when no detection,
When it's in ext alimentation, the led indicator is always lighting, without sensor, with sensor but without people in front...

I forget something but what???

this code

#define DETECT_MIN 128
#define DETECT_MAX 1024
#define SILENCE      500

int inputPinSensor;
int ledPin;
int val;
int byte0;
int byte1;
int byte2;
int byte3;
int byte4;
int byte5;
int byte6;
int byte7;

void setup() {
      val = -1;
      inputPinSensor = 2;
      ledPin = 13;

      pinMode(inputPinSensor, INPUT);
      pinMode(ledPin, OUTPUT);


void loop() {
      val = analogRead(inputPinSensor);
      if (val >= DETECT_MIN && val <= DETECT_MAX) {
            digitalWrite(ledPin, HIGH);
            digitalwrite(ledPin, LOW);


thanks for some help
because Because


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

This is wrong:
but this shouldn't even compile.
I guess that you mean power supply with alimentation? Didn't you forget the jumper for the external power supply?

Pages: [1]   Go Up
Jump to: