Introduction: Arduino Voltage Sensor 0-25V
The reason I'm making this is because I couldn't find any really helpful information on how to fix the code for my voltage sensor. Arduinos have built in voltage sensors. Unfortunately, they only support voltages of 0-5V. This module allows you to measure voltages of 0-25V by presenting a lower voltage to the arduino for measuring. After you have this value you simply feed it through some math and you get your actual voltage. Don't ask me how this math works. I don't know. If you do know however, please share. I'm really just editing the example code from the seller so that it will display decimal values instead far less useful int values.
To start you need to wire it up. It's extremely easy as it only needs 3 wires.
Plug + into 5V, - ground and S into an analogue pin. I have removed all but the relevant pins in a pinout of the arduino nano. If you're using another model then you'll have to figure them out on your own. Any analogue pin will do. As far as I am aware at least. Once you have done this you're ready to move on to the software.
Step 1: Fixing the Code
The example code I got from the seller would only output a very limited integer value for the voltage. When you're trying to tell the actual voltage of what you're measuring though it isn't all that helpful. Because of this I fixed the code a bit so that it would give me a float value. In the photos you can see the edits I have made. I will also list the edits below. Keep in mind that the analogue pin will need to be changed depending on which pin you attach the S pin to.
This is the original code.
} void loop()
This is the edited code.
I have also included the finished code in case anyone wants it.
We have a be nice policy.
Please be positive and constructive.
I want to stop the voltage reading for a particular reading( suppose after 12V) and this reading how to send client mobile phone using arduino and GSM modem.