I am making a voltage measurement device .that will be measuring voltages of 0.3v to 3v (through a esp32 ADC port ) . But some times the voltage of source reaches 220v but it's not to be measured .
And also the circuit needs to be protected from lightning surge so need some protection system
So can any one suggest what to do .I thought to give octocoupler a chance but it's not able to measure voltages below 1v .maybe some other octocoupler or another process. I will be thanked to be helped.
Please provide a schematic of the circuit as it is now. Please also describe in detail the various inputs/outputs and the conditions that apply to them, which would clarify for instance when and under which conditions this one input 'reaches 220V' (AC or DC?)
Furthermore, instead of opening new threads about the same question, just continue with the one you already had and provide full information (see above) so people can help you better. For instance, @Grumpy_Mike's response basically duplicates what you've already been told elsewhere, so it doesn't help you nor him ahead.
Here's your other thread: Help on octocoupler selection
I've flagged this one as a cross post so I expect later today both threads will be merged into a single one.
Can I safely assume that is a fault condition? Is that 220 mains voltage, DC, ??? How you do this depends on your basic circuit. It can be done without an optocoupler. Also what safety requirements do you have to meet.
I doubt an opto-coupler is good to isolate from lightning surges. Very fast rise time spikes will go through an opto-couple due to the internal capacitance.
What is the output impedance of you voltage to be measured source? i.e. can you put.... say a 10k load on it and still get a valid reading?
Where is the power for the ESP32 coming from and where is it's output going? i.e. what else in the system is connected to the ESP32.
For lightning protection you can use a gas discharge tube.
See lots of examples by searching the web with the following words:- Lightning protector on electric circuits
I used these when designing set top boxes. There main protection is for the high electric field that is produced during a thunder storm. Not much can survive a direct strike because there is too much power to dissipate.
Other forms of protection circuits can be found here:- Protecting inputs