Analog Port as 5V?

heres a simple transistor schematic:

the diode is only needed for motors, solenoids, and other stuff with coils in them

the load is what you want to power and the 10 volts can obviously be changed