Skip to main content
Associate II
April 11, 2026
Question

Vac sense circuit of STEVAL-7BIDIRCB

  • April 11, 2026
  • 1 reply
  • 145 views

Dear ST community, 

I'm reviewing the Vac sense circuit of STEVAL-7BIDIRCB, where the circuit uses a resistor divider to generate a low voltage of VACN and VACL for MCU. I simulated this section of circuit in LTspice, and here is my result : 
Saeid_2-1775942241126.png

My Vac input is +/-256V sine waveform and VACL that I'm measuring is +/-900mV sine waveform. 
Based on my calculation this is a simple voltage divider and I should see +/-1.8V sine waveform. 

Saeid_3-1775942377861.png

Why am I seeing 1.8V/2 = 900mV ?   I did some research and my understating is that when there is an equal resistor network each side of AC source ( N and L), Vac IN  becomes half ( 256V -> 128), but I don't understand how it is possible when my Vac input is 256V ? 

 

 

1 reply

Peter BENSCH
Technical Moderator
April 12, 2026

The VAC sensing network on the STEVAL-7BIDIRCB is not equivalent to a simple single voltage divider. Each sensing branch uses the full series chain of four 220k resistors (e.g. R149, R153, R157, R159), not just three, are connected to the two AC conductors L and N forming together a differential measurement of the mains voltage. If you only use three 220k resistors as in your calculation, the divider ratio is overestimated and the expected output becomes too high.

With the correct resistor chain, the voltage at VACL/VACN is reduced accordingly, so a measured sine amplitude of around ±0.9V is consistent with the schematic. In other words, the lower amplitude is due to the complete symmetric sensing topology, not an issue with the circuit.

Please also note that Protective Earth (terminal H between L, N) is not connected to GND (marked with A)!

Hope that helps?

Regards
/Peter

SaeidAuthor
Associate II
April 13, 2026

Hi Peter, 

Thank you very much for reviewing my post and sharing the information. I have updated my simulation: I am now using four 220kΩ resistors in series and a 4.7 kΩ pull-down resistor to ground.  Here is my new result: each side (N and L) shows a sine waveform of approximately ±670 mV, with a 180 phase difference. 

Saeid_0-1776050317432.png

However, based on my calculations, I expected to see ±1.36 V instead of ±670 mV.

Q1: Can you please advise why there is this discrepancy? Am I missing something?

Saeid_4-1776053458926.png

Q2: why am I measuring approximately 128 VAC (half of 256 V) when I measure VL with respect to ground? However, when I disconnect VL from the circuit, it shows to 256 V.

 

Saeid_2-1776052372661.png


Q3: Can you please help me understand how a symmetric sensing topology reduces the voltage from 256V to128V?  Which voltage should be considered when calculating the resistor values?

Saeid_5-1776053956597.png

Q4: Does the STEVAL-7BIDIRCB use the STM32G4's internal OPAMP1 to measure VAC? If so, what is the op-amp configuration? Is it using negative feedback with a positive offset to shift the signal into the positive range?

Peter BENSCH
Technical Moderator
April 20, 2026

The behaviour you are seeing is mainly due to the symmetric sensing topology and the way the AC voltage is distributed across the two branches.

A few key points:

  • The circuit is not a simple single-ended divider from one line to ground
  • The two resistor strings must be considered together as part of the overall Vac sensing network
  • In this topology, each branch only sees a portion of the full AC voltage, which is why the sensed amplitude is lower than a simple single-divider calculation would suggest

So, if you now use four 220k resistors per branch, the smaller amplitude you measure at VACL / VACN is consistent with the schematic. The value of about ±670mV is therefore not unexpected.

For Q2 and Q3, the apparent 128Vac with respect to ground is also a consequence of the symmetric arrangement. Once the full network is connected, the line voltage is no longer observed as an isolated source-to-ground signal, but as part of the complete divider structure between VL and VN

For Q4, the VACL and VACN signals are routed directly to the MCU analogue inputs as shown in the schematic in DB5164, fig. 8 (see VACL_F and VACN_F). The detailed internal analogue configuration is not described in the public documentation, so details on the operational amplifier configuration would need to be confirmed through the support of your local distributor (requires an NDA).

Regards
/Peter