The a-C/a-C:B homojunction of palmyra sugar has been successfully fabricated using the nanospray method. Palmyra sugar was chosen as the main source of carbon because it is cheap, renewable, abundant and available around the clock. nanospray is used as a deposition method on glass ITO substrates because of several advantages, namely cheap, easy, portable, low power consumption, the deposited layer is more evenly distributed and thinner. Junction samples when in bright conditions [emitted light] showed an increase in current and voltage values compared to dark conditions. Testing the current and voltage of the junction sample shows the characteristics of a rectifier diode. This confirms the results of the test using PES as a doping process with amorphous carbon with boron capable of changing the conduction type from a-C from an intrinsic semiconductor to a p-type semiconductor. Testing the junction sample when irradiated with visible light using a lamp shows symptoms of the photovoltaic effect. Tests directly on the sun when conditions AM 1.5 samples showed symptoms of the photovoltaic effect. This indicates that the a-C/a-C:B amorphous carbon homojunction junction sample functions as a solar cell.