Connecting microcontroller 3.3V output to relay using ULN2803A
The basic connection scheme for ULN2803 is like



and for ULN2003 is like



where each box can be a relay or solenoid etc, ground side of the relays/solenoids connects to the ULN outputs

BUT the 500mA current per output doesn't tell the whole story, when you use more than one output and the outputs conduct simultaneously then the max current per output for ULB2803 is as shown in



so it hugely depends on the duty cycle and the number of outputs.

Note that ULN2003 has not the same characteristics, it seems to be able to provide less current per output