Electronic – MSP430 Launchpad connection of photoresistor and concerns regarding Launchpads protection

msp430

I am using the MSP430 Launchpad and I have a question regarding photoresistors. The thing is that when you connect a LED with a pin in Launchpad, which you have configured, as output I read that you must use a resistor in series as not to damage the LED. When trying to find how to connect the photoresistor every source said that one must connect a 10kOhm resistor in series as not to damage the Launchpad. Regarding both the LED and the photoresistor as a simple resistor why in the first case we connect the resistor for the protection of the LED and in the second for the protection of the Launchpad? Also why can the Launchpad be damaged by its own voltage? I mean if a pin is configured to input and one tries to use an extremely large voltage then sure it will be damaged, but when you try to use 3.3V generated from its own Vcc whay may be damaged?

Best Answer

An LED is not a resistor; it does not follow Ohm's law. Basically, once you exceed the drop voltage, it will draw as much current as it can, to the point that it destroys itself. This is what the resistor does: limit the current flowing through to a safe level. Try connecting an LED directly to a 9V battery - it may last long enough to give a visible flash of light before it dies. It may also become hot enough to be uncomfortable to hold.

As for the microcontroller on your Launchpad, again it's not the voltage but the current that will damage it. If you were to connect an output pin to ground and drive it high (or connect it to Vcc and drive it low), you are basically making a short circuit. Excess current will flow through the pin and can burn out the silicon of the chip or the internal wire connecting the silicon to the pin.

For the phototransistor, assuming you connect it only to an input, then the internal resistance of the input pin will greatly limit the current through the phototransistor and input pin. However, since GPIO pins can be programmed to either input or output, it's a good idea to put a current limiting resistor, just in case you accidentally set the pin as an output instead.