voltage sensor unstable in my code

good morning everyone

I would like to thank the tips that each one has sent, I will do all the procedures that indicated me and then I will tell the results, I also bought some components to have the hand when you need to do tests.