Why my arduino just give 1,2VDC on digital pin

Hello Everybody,now i'm working with monoxide gas sensor project but why my arduino just give output 1,2VDC in every digital pin i used,can anybody help me please?? :slight_smile:

Because something is wrong :astonished:
When you did not set a pin to output, the pin is floating and can have any voltage between 0V and 5V.

If you want help, post your circuit, and a link to the sensor type and/or data sheet.

SURELY you are not trying to run the sensor heater from a digital output pin!

Post your Code

How's the Arduino powered? What voltage, to what input connection?

Let's see the code too: you sure pin is pinModed as output?

PutraArya:
sorry for my bad english,why my output digital pin arduino only give 1,5 until 2,5 Volt ?

Is anything connected to it?

when i want to make a single voltage amplifier using npn transistor BD139, my transistor cant switch off :fearful:
when i tried to troubleshooting it,i found that my arduino digital pin has 2,5volt as High output and 1,2 as Low Output,it means that the voltage is more than the cut off voltage of BD139,.

can anyone help me to solve it?? to make my Low output near 0volt??

when i want to make a single voltage amplifier using npn transistor BD139, my transistor cant switch off :fearful:
when i tried to troubleshooting it,i found that my arduino digital pin has 2,5volt as High output and 1,2 as Low Output,it means that the voltage is more than the cut off voltage of BD139,.

can anyone help me to solve it?? to make my Low output near 0volt??

Baseresistor value?
What are the output voltage without transistor?
Schematic?

Pelle

JimboZA:
How's the Arduino powered? What voltage, to what input connection?

Let's see the code too: you sure pin is pinModed as output?

First i used my laptop usb connection to power it,and the second i used adaptor.However the result always same.
Here's my code hope you can help me to correct it please :slight_smile:

  /*
* SevenSegment sketch
* Shows numerals ranging from 0 through 9 on a single-digit display
* This example counts seconds from 0 to 9
*/
// bits representing segments A through G (and decimal point) for numerals 0-9
const byte numeral[10] = {
 
  //ABCDEFG /dp
  B11111100, // 0
  B01100000, // 1
  B11011010, // 2
  B11110010, // 3
  B01100110, // 4
  B10110110, // 5
  B10111110, // 6
  B11100000, // 7
  B11111110, // 8
  B11110110, // 9
};
 //Konfigurasi PIN
  // |   | | | |
  // com g f a b
  //_____________
 // | 4 digit   |
 // | 7 segment |
 // -------------
 // | | | |   |
 // d . e c  com  ,, and the other just has same configuration
 
// pins for decimal point and each segment
//                           dp,G,F,E,D,C,B,A
// arrow show paired pin     / / / / / / / /
const int segmentPins[8] = {14,8,7,9,5,3,4,6};
const int inPin = 0; // assign pin
const int outputPin[4] = {10,11,12,13};
const long UPDATE_TIME = 250; // waktu ngambil data sensor
long count = 0;
int state = 0;
byte digit[4];
void setup(){
  for(int i=1; i < 8; i++){
    pinMode(segmentPins[i], OUTPUT); // set segment and DP pins to output
  }
  
  for(int i=0; i < 4; i++){
    pinMode(outputPin[i], OUTPUT); // set segment and DP pins to output
  }

  digit[0] = 0;
  digit[1] = 0;
  digit[2] = 0;
  
  Serial.begin(9600);
}

void loop(){
  // Read Sensor
  count++;
  if (count >= UPDATE_TIME)
  {
    int value = analogRead(inPin)/ 1024.0 * 500; 
    Serial.println(value, DEC);  // prints the value read	
    int i = value ;
    int b = i - i / 100 * 100;

    int firstdigit = (i / 100);
    int seconddigit = (b / 10);
    int thirddigit = (b - b / 10 * 10);
    digit[0] = firstdigit;
    digit[1] = seconddigit;
    digit[2] = thirddigit;	
    count=0;
  }
  
  // Set Power
  setPower(state);    

  // Set Dgit
  showDigit(digit[state]);
  
  // the last value if i is 10 and this will turn the display off
  delay(3); // pause two seconds with the display off
  state++;
  if (state == 4)
  {
    state = 0;
  }
}

// Displays a number from 0 through 9 on a 7-segment display
// any value not within the range of 0-9 turns the display off
void showDigit( int number){
  boolean isBitSet;
  for(int segment = 1; segment < 8; segment++){
    
    if( number < 0 || number > 9){
      isBitSet = 0; // turn off all segments
    }
    else{
      // isBitSet will be true if given bit is 1
      isBitSet = bitRead(numeral[number], segment);
    }
    isBitSet = ! isBitSet; // remove this line if common cathode display
    digitalWrite( segmentPins[segment], isBitSet);
  }
}

void setPower(int number){
  switch (number)
  {
    case 0 :
      digitalWrite(11, 1);
      digitalWrite(12, 0);
      digitalWrite(13, 0);
      digitalWrite(10, 0);
      break;
    case 1 :
      digitalWrite(11, 0);
      digitalWrite(12, 1);
      digitalWrite(13, 0);
      digitalWrite(10, 0);
      break;
    case 2 :
      digitalWrite(11, 0);
      digitalWrite(12, 0);
      digitalWrite(13, 1);
      digitalWrite(10, 0);
      break;
    case 3 :
      digitalWrite(11, 0);
      digitalWrite(12, 0);
      digitalWrite(13, 0);
      digitalWrite(10, 1);
      break;
    default : break;
  }
}

fungus:

PutraArya:
sorry for my bad english,why my output digital pin arduino only give 1,5 until 2,5 Volt ?

Is anything connected to it?

no i think no i'm just measure from digital pin and ground i used, is my arduino broke or maybe i should complain to the seller??

raschemmel:
Post your Code

  /*
* SevenSegment sketch
* Shows numerals ranging from 0 through 9 on a single-digit display
* This example counts seconds from 0 to 9
*/
// bits representing segments A through G (and decimal point) for numerals 0-9
const byte numeral[10] = {
 
  //ABCDEFG /dp
  B11111100, // 0
  B01100000, // 1
  B11011010, // 2
  B11110010, // 3
  B01100110, // 4
  B10110110, // 5
  B10111110, // 6
  B11100000, // 7
  B11111110, // 8
  B11110110, // 9
};
 //Konfigurasi PIN
  // |   | | | |
  // com g f a b
  //_____________
 // | 4 digit   |
 // | 7 segment |
 // -------------
 // | | | |   |
 // d . e c  com  ,, and the other just has same configuration
 
// pins for decimal point and each segment
//                           dp,G,F,E,D,C,B,A
// arrow show paired pin     / / / / / / / /
const int segmentPins[8] = {14,8,7,9,5,3,4,6};
const int inPin = 0; // assign pin
const int outputPin[4] = {10,11,12,13};
const long UPDATE_TIME = 250; // waktu ngambil data sensor
long count = 0;
int state = 0;
byte digit[4];
void setup(){
  for(int i=1; i < 8; i++){
    pinMode(segmentPins[i], OUTPUT); // set segment and DP pins to output
  }
  
  for(int i=0; i < 4; i++){
    pinMode(outputPin[i], OUTPUT); // set segment and DP pins to output
  }

  digit[0] = 0;
  digit[1] = 0;
  digit[2] = 0;
  
  Serial.begin(9600);
}

void loop(){
  // Read Sensor
  count++;
  if (count >= UPDATE_TIME)
  {
    int value = analogRead(inPin)/ 1024.0 * 500; 
    Serial.println(value, DEC);  // prints the value read	
    int i = value ;
    int b = i - i / 100 * 100;

    int firstdigit = (i / 100);
    int seconddigit = (b / 10);
    int thirddigit = (b - b / 10 * 10);
    digit[0] = firstdigit;
    digit[1] = seconddigit;
    digit[2] = thirddigit;	
    count=0;
  }
  
  // Set Power
  setPower(state);    

  // Set Dgit
  showDigit(digit[state]);
  
  // the last value if i is 10 and this will turn the display off
  delay(3); // pause two seconds with the display off
  state++;
  if (state == 4)
  {
    state = 0;
  }
}

// Displays a number from 0 through 9 on a 7-segment display
// any value not within the range of 0-9 turns the display off
void showDigit( int number){
  boolean isBitSet;
  for(int segment = 1; segment < 8; segment++){
    
    if( number < 0 || number > 9){
      isBitSet = 0; // turn off all segments
    }
    else{
      // isBitSet will be true if given bit is 1
      isBitSet = bitRead(numeral[number], segment);
    }
    isBitSet = ! isBitSet; // remove this line if common cathode display
    digitalWrite( segmentPins[segment], isBitSet);
  }
}

void setPower(int number){
  switch (number)
  {
    case 0 :
      digitalWrite(11, 1);
      digitalWrite(12, 0);
      digitalWrite(13, 0);
      digitalWrite(10, 0);
      break;
    case 1 :
      digitalWrite(11, 0);
      digitalWrite(12, 1);
      digitalWrite(13, 0);
      digitalWrite(10, 0);
      break;
    case 2 :
      digitalWrite(11, 0);
      digitalWrite(12, 0);
      digitalWrite(13, 1);
      digitalWrite(10, 0);
      break;
    case 3 :
      digitalWrite(11, 0);
      digitalWrite(12, 0);
      digitalWrite(13, 0);
      digitalWrite(10, 1);
      break;
    default : break;
  }
}

Peter_n:
Because something is wrong :astonished:
When you did not set a pin to output, the pin is floating and can have any voltage between 0V and 5V.

Pardon me? i think i was declare the pin to output on the void setup.. you can check it here:

const int segmentPins[8] = {14,8,7,9,5,3,4,6};
const int inPin = 0; // assign pin
const int outputPin[4] = {10,11,12,13};
const long UPDATE_TIME = 250; // waktu ngambil data sensor
long count = 0;
int state = 0;
byte digit[4];
void setup(){
  for(int i=1; i < 8; i++){
    pinMode(segmentPins[i], OUTPUT); // set segment and DP pins to output
  }
  
  for(int i=0; i < 4; i++){
    pinMode(outputPin[i], OUTPUT); // set segment and DP pins to output
  }

  digit[0] = 0;
  digit[1] = 0;
  digit[2] = 0;
  
  Serial.begin(9600);
}

is anything correct??

connection diagram ?

Is the digital pin configured as an OUTPUT?

Hi,

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png or pdf?

Tom.... :slight_smile:

AWOL:
Is the digital pin configured as an OUTPUT?

I asked the OP that some weeks back in this thread, responded today with code that looks like a "yes" but not sure if the pins set as OUTPUT there are the pins in question.

But now there are 4 or so threads on the same thing....

Hi,

If the pin you are measuring is an output pin that is supposed to go to a display, and it is multiplexed, then you will not see full 5V or 0V because the pin is outputting pulses.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png or pdf?

Tom...... :slight_smile:

Pelleplutt:
Baseresistor value?
What are the output voltage without transistor?
Schematic?

Pelle

hi pelle

i used 1k on the base and 440ohm on the collector
this is my schematic using isis im sorry the resistor value was default =(

transistor.PNG

TomGeorge:
Hi,

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png or pdf?

Tom.... :slight_smile:

Hi Tom
greeting from me :smiley:
sorry i'm nubie here so i'm just attach it :slight_smile:

transistor.PNG