n-type NiO:Al thin films were deposited by RF magnetron sputtering. Their optoelectronic properties versus Al target power was investigated. The results show that with increasing Al target power, the conduction type of NiO films changes from p-type to n-type. The variation of the film’s electrical and optical properties depends on Al amount in the film. When Al target power is relatively low, Al3+ cations tend to enter nickel vacancy sites, which makes the lattice structure of NiO more complete. This improves the carrier mobility and film’s transmittance. However, when Al target power exceeds 40 W, Al atoms begin to enter into interstitial sites and form an Al cluster in the NiO film. This behavior is beneficial for improving the film’s n-type conductivity but degrades the film’s transmittance. Finally, Al/(p-type NiO)/(n-type NiO:Al)/ITO homojunctions were fabricated. Their performance was compared with Al/(p-type NiO)/ITO heterojunctions without an n-type NiO layer. Thanks to the better interface quality between the two NiO layers, the homojunctions present better performance.