-2
\$\begingroup\$

I’m working on a voltage stabilizer project using a Nuvoton MS51FB9AE microcontroller, and I’m confused about how my input voltage measurement circuit handles a range of 240V AC to 300V AC, 50 Hz. The circuit works fine, but I need help understanding its operation and calibrating it accurately for RMS voltage calculation.

enter image description here

Voltage Scaling

Input Voltage: 300V AC RMS, 50 Hz, with a peak voltage of

300 x √2 = approx 424V

Initial Divider (R1 and R2):

  • R1 = 1MΩ and R2 = 100kΩ form a voltage divider before D2.
  • Voltage across R2:

100k/1M + 100k x 424V = 38.5V peak.

  • D2 (1N4007) rectifies this to half-wave, reducing the peak to ~38.5V (minus ~0.7V forward drop) ≈ 37.8V peak at the cathode.

ADC Input Node (After R2, C1, C2, R3): The ADC input (Pin 20) sees this 37.8V peak, which exceeds the MS51FB9AE’s 5V ADC range.

Questions -

  1. Why does the circuit correctly read up to 300 V AC without damaging the microcontroller? What design or protection mechanisms are in place that allow the microcontroller to safely measure high-voltage AC signals, such as 230–300 V, without getting damaged?
  2. How can I accurately measure AC voltage in firmware?
    • Should I use the RMS formula for precise measurement? How many samples are enough for accurate voltage measurement ? What should be the logic for reading the AC voltage ?
    • What is the most efficient and reliable method to ensure consistent AC voltage readings across all units—such that if one unit displays 240 V, every other unit also shows 240 V with minimal variation? should be same for even 100 units as well.
    • To achieve this level of consistency, do I need to implement a calibration routine during production or in firmware?
\$\endgroup\$
3
  • \$\begingroup\$ MICRO - Hi, (a) Since you're asking about the circuit, it seems it isn't yours. To comply with the site referencing rule, details of the original source of copied / adapted material must be provided by you, next to any copied / adapted item. If the original source is online, please edit the question & add the webpage/PDF etc. name & link (URL) (e.g. website name + webpage title + URL). If the source is offline (e.g. printed book / private intranet) then add full details "to the best of your ability" e.g. title, authors, page etc. \$\endgroup\$ Commented Jun 29 at 0:54
  • \$\begingroup\$ (continued) (b) At least some of the question seems to have come from genAI (ChatGPT, Google Gemini etc.). While the current default SE guidelines do allow genAI content within limits: (i) On this site, we don't want questions which ask us to explain genAI responses; (ii) Content from genAI responses must be disclosed and attributed to the specific genAI tool & the general prompt which was used to generate that response. Did you ask genAI (e.g. ChatGPT) how the circuit works and include some of that in the question? Or did you ask genAI to design it? Or something else? What's going on? TY \$\endgroup\$ Commented Jun 29 at 0:55
  • \$\begingroup\$ Hi, this is a stabilizer which reverse engineer it and drew on Digikey Scheme it online software and I asked chatgpt also and grok as well but they didn't give satisfactory answers. I wanted to give it a try here as well. I framed my own questions and asked ChatGPT to refine my questions for better understanding. Don't downvote me for this. This is not GenAI designed question. It's orginal. Do you want a eagle schematic which I have designed and PCB hardware image, I can send you. \$\endgroup\$ Commented Jun 30 at 9:31

1 Answer 1

1
\$\begingroup\$

The voltage divider is made up of R1, R2 and R3, assuming that ADC pin 20 draws negligible current. To calculate the voltages, interchange R1 and D2. Then the steady state voltages are: VC2 = (Vp * 122/1122) - 0.7 = (424 * 122/1122) - 0.7 = 45.4 VC1 = (Vp * 22/1122) - 0.7 = (424 * 22/1122) - 0.7 = 7.613

For your question 1, The voltage the ADC faces is only VC2, in this case, 7.6 volts. This is in excess of the permitted value of 5 Volts, so you need to replace R3 by 10K, which will give 41.3 and 3.12 volts.

\$\endgroup\$
1
  • \$\begingroup\$ With the 1 meg resistor in series the capacitor will not charge to the peak voltage. of the signal. It will probably be closer to the average rectified value. \$\endgroup\$ Commented Jun 29 at 17:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.