Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] PIC24FJ256GB210 Controlling Output Voltage

Status
Not open for further replies.

ninnymoggin

Newbie level 4
Newbie level 4
Joined
May 24, 2020
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
47
I'm extremely new to this so please bear with me. I'm trying to turn on an LED (4v max.) using one of the digital i/o pins, but the pin is only outputting about 1.5v. The pin is set as an output. I also have a 12v power supply connected to the board to power several 12v push buttons. I have no experience with electrical or C (I'm a mechanical engineering student), so the simpler you can explain this the better. Thank you!
 

It's 1.5v with nothing attached. I'm using a 470 ohm resistor with my LED (no idea if that's right) and the light is very dim.
 

The resistor and LED seem OK but what is the supply voltage (VDD) to the PIC. It needs to be a little higher than the LED needs to allow for some drop in the internal circuits. The maximum according to the data sheet is 3.6V with a nominal 3.3 normally being supplied. The pin should go higher than 1.5V but maybe not enough to drive the LED adequately. The best solution would be to use the PIC to drive an NPN transistor and the transistor to drive the LED from the 12V supply.

PIC ---- Resistor (~2.2K) ----- transistor base
VSS ---- transistor emitter
VDD ---- Resistor ---- LED ----- transistor collector.

Use Ohms law to work out the resistor value in series with the LED. R = (12 - Vled)/Iled.
Iled is in AMPS so for a typical 10mA use 0.01A. The result is in Ohms.

Brian.
 

Hi,

1.5 V is too low for an open digital-output pin, you should expect 3.3 V. According to the datasheet the IO pins are capable to deliver 18 mA, which is sufficient to drive a LED.
The solution suggested by Brian will work for sure, but I'm more curious about the low PIN voltage whithout an attached load.

Which board do you use exactly?

greets
 

To decide if a LED is suited for direct drive by a 3.3V microprocessor, you'll check it's forward voltage at the expected low mA current. Some LEDs have too high forward voltage and should be better supplied by 5V IO.

Said 1.5 V suggests an incorrectly configured GPIO or additional circuit reducing the output.
 

Hi,

Be sure you connected the negative DVM input to PIC_GND.
Do verifying measurements to
* VCC
* LED (each pin)
* resistor (each pin)

And also be sure that that the PIC pin is steady (DC, non switching, nonnPWM, PIC not in reset...)

Klaus
 

Thank you all for the help. It turns out this issue was that my code was not in an infinite loop in my main function, so each time it looped back to the main it reinitialized the pin as an input and then an output again, so I was essentially picking up an average of the two voltage values.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top