Can I connect pins to high voltage?

I am using arduino due. And I have a LED which driven by 12 voltage. So I connect led to my pin 10 and add a 1K resistance to protect my board.

And it seems work well. I can use digitalWrite to control my led. But I am a little worry about it. Does it will hurt my board?
Is it still ok to use 24 voltage?

Do not do this, it will damage your board.

If you want to switch 12 or 24V, you must use a transistor or relay. I would recommend a bc337 transistor, if the led current is only a few hundred mA, but there are many others you could use. You will need a resistor for the transistor's base pin (e.g. 4K7) as well as led series resistor.

But why do you want to use 12V to light your led?

:frowning: Cause It's a colorful led series. It need voltage over 12V.

Tell us the LED forward voltage and current draw.

The forward voltage is 12V, and current draw is about 100ms.

Assuming you mean 100mA, the bc337 or similar will be fine. Try a 2K2 resistor between the Arduino pin and the transistor base.

Does this led have built-in current limiting? If so, you won't need a series resistor. Post a link and we can check.

the Due cannot source or sink that much current on any of its pins. according to my pinup diagram,

High current pins can source 15 ma, And sink 9 ma.
low current pins can source 3 ma, And sink 6 ma.

You can damage your processor if you exceed these values.

Does the Arduino due share the same power source with the led??

Ok, I use a S9013 and it works well.