element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Embedded and Microcontrollers
  • Technologies
  • More
Embedded and Microcontrollers
Embedded Forum Voltage drop on MCU output pin
  • Blog
  • Forum
  • Documents
  • Quiz
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Embedded and Microcontrollers to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 4 replies
  • Answers 1 answer
  • Subscribers 474 subscribers
  • Views 658 views
  • Users 0 members are here
Related

Voltage drop on MCU output pin

Former Member
Former Member over 9 years ago

Hi.

 

I am experiencing a voltage drop on my MCU when I connect it to a solid state relay. With the relay removed I measure 5V on the op pin as expected but with the relay connected I am only getting 1.6V. It is a  PVN021A which has about 5mA current draw. Anyone familier with these devices know where th voltage drop is coming from?

 

Thanks,

 

Mark.

  • Sign in to reply
  • Cancel

Top Replies

  • jc2048
    jc2048 over 9 years ago +2 suggested
    Input is an LED. You need a series resistor to limit the current. Currently it's only the FET in the MCU that's limiting the current (to something like 150mA, so don't leave it on for too long). You might…
  • kulky64
    kulky64 over 9 years ago in reply to Former Member +1 verified
    You messed up port letters, LowTemp is on PORTB and HighTemp is on PORTD, MedTemp you have correctly on PORTD. So it should look like this: else if(incomingByte == 'd'){ PORTB &= ~(1<<LowTemp); PORTD &…
  • jc2048
    0 jc2048 over 9 years ago

    Input is an LED. You need a series resistor to limit the current.

     

    Currently it's only the FET in the MCU that's limiting the current (to something like 150mA, so don't leave it on for too long). You might have damaged either or both already.

     

    Try a 620 ohm resistor.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • Former Member
    0 Former Member over 9 years ago in reply to jc2048

    Ah Silly me. I put in some 500 ohm resistors and the op pins are now back to 5V. However I had a problem which I thought that may solve. In my code below which turn on or off a particular relay whether the characters 'a','b','c','d','e' or 'f' are sent via the serial port. It works for the most part except for when I send 'd' it should turn off  'a','b' and 'c' but it doesn't. The value on the pins is the same as if nothing has been sent. Is there something silly I am overlooking here?

     

    Mark.

     

    #define F_CPU 16000000UL   // AVR clock frequency in Hz, used by util/delay.h

    #include <avr/io.h>

    #include <util/delay.h>

     

     

    #define BAUDRATE 9600

    #define BAUD_PRESCALLER (((F_CPU / (BAUDRATE * 16UL))) - 1)

     

     

    int therm_25 = 12; // 25 degrees

    int therm_37 = 10; // 37 degrees

    int therm_45 = 13; // 45 degrees

    int power = 11;

    int incomingByte = 0;   // for incoming serial data

     

     

    #define HighTemp  PORTD6  //R1 - 1K

    #define MedTemp  PORTD7  //R2 - 1k4

    #define LowTemp  PORTB0 //R3 - 1k78

    #define Power  PORTD5

     

     

    int main(void)

    {

      UBRR0H = (uint8_t)(BAUD_PRESCALLER>>8); //Set the Uart baud rate

      UBRR0L = (uint8_t)(BAUD_PRESCALLER);

      UCSR0B = (1<<RXEN0);//|(1<<TXEN0); //Enable the receiver and transmitter

      // 1<<TXEN0 interefres with serial port for MAC address read. needs to be disabled

     

      UCSR0C = (3<<UCSZ00); //Set 2 data bit length to 8-bit. (1 << USBS0) for 2 stop bits

     

     

      DDRD = 0b11100000;

      DDRB = 0b00000001;

     

     

        while(1)

        {

            while (! (UCSR0A & (1 << RXC0)) );

      incomingByte = UDR0;

           

      if(incomingByte == 'a') {

      PORTB |= (1<<LowTemp);

      PORTD &= ~(1<<MedTemp);  

      PORTD &= ~(1<<HighTemp);

     

     

      }

           

      else if(incomingByte == 'b'){

      PORTD |= (1<<MedTemp);

      PORTB &= ~(1<<LowTemp);

      PORTD &= ~(1<<HighTemp);

      }

     

     

      else if(incomingByte == 'c'){

      PORTD |= (1<<HighTemp);

      PORTB &= ~(1<<LowTemp);

      PORTD &= ~(1<<MedTemp);

      }

     

     

      else if(incomingByte == 'd'){

      PORTD &= ~(1<<LowTemp);

      PORTD &= ~(1<<MedTemp);

      PORTB &= ~(1<<HighTemp);

      }

     

      else if(incomingByte == 'e'){

      PORTD |= (1<<Power);

      }

     

      else if(incomingByte == 'f'){

      PORTD &= ~(1<<Power);

      }

           

        }

    }

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • kulky64
    0 kulky64 over 9 years ago in reply to Former Member

    You messed up port letters, LowTemp is on PORTB and HighTemp is on PORTD, MedTemp you have correctly on PORTD. So it should look like this:

     

    else if(incomingByte == 'd'){

      PORTB &= ~(1<<LowTemp);

      PORTD &= ~(1<<MedTemp);

      PORTD &= ~(1<<HighTemp);

      }

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • Former Member
    0 Former Member over 9 years ago in reply to kulky64

    Indeed it is. I'v been staring at this screen for too long.

     

    Thanks guys.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube