How do I get a 5 volt output?

I need to run 5 volts out to run a relay. I just want to run it for one set of code, how can I go about this? I know there is a 5 volt out, but I have no idea how to utilize it. Here is the code, sorry but the highlight thing does not work for me.

digitalWrite (led5, HIGH); //starts beeping
delay(10000000 0);
digitalWrite (led5, LOW);
delay(100);

Anyways, I need to run it at 5 volts. NOT pwm.

Thanks ahead of time.

That's exactly what you are currently doing, assuming you are using a 5V Arduino. digitalWrite (led5, HIGH); sets the pin to 5V.

But you should not use that to directly drive a relay, use the pin to drive a transistor that in turn drives the relay. And add a flyback diode.

This is well documented in the playground I think.


Rob