Design a power measurement and display system for a solar power panel using PIC-
ID: 3783177 • Letter: D
Question
Design a power measurement and display system for a solar power panel using PIC-18. Write a C program to perform the following tasks: To convert analog input voltage (0-5 Volts), ANO, and current(0-10 Amperes), AN1, To calculate power = voltage*current To display power (Watts) on the two segment-displays, which are connected to PORT B and PORT D as shown below. PORT D outputs 7 segments, from Segment a (PD6) to Segment g (PDO). PORT B Bit 1 is connected to the common cathode of the ten's digit, and Bit 0 is connected to the common cathode of one's digit display. To enable a display, output a low to the common cathode of the display, and output highs to the common cathodes of the other displays.Explanation / Answer
int voltage = analogRead(A3); // Reads the analog value on pin AN0 into variable voltage
Serial.print(“Analog value: “); // to print the value of voltage
Serial.println(voltage);
int current = analogRead(A3); // Reads the analog value on pin AN0 into variable voltage
Serial.print(“Analog value: “); // to print the value of voltage
Serial.println(current);
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.