but I'm confused because in the answers of the 2010 question they talk about "ground" and the battery I have doesn't have that connection.
Can you help me with a diagram of the connections according to my materials?
The Arduino uses a reference when it measures a voltage. The reference is default 5V. That means you need to power the Arduino with a power supply, because the power via the USB cable varies too much.
When the sensor outputs 20mA, then 20mA is wasted (in the 250Ω resistor). Such a battery will be empty before you know it.
GP 23A 12V : https://international.gpbatteries.com/products/gp-high-voltage-battery-23a
I'm guessing 38mAh (number is from similar Panasonic battery), so the battery will last one hour.
I am a mechanics student and my first language is not english, it is difficult for me to understand, sorry.
it's hard for me to understand the electrical diagrams, that's why i use schematics of the real devices
I thought I could not power the sensor with the arduino because the minimum voltage needed by the sensor is 8V, and the arduino pins deliver max 5V, but apparently I power the arduino with a power jack would not need the battery, in that case how would be the connection?
If you can split the 12V power to the Arduino board and the pressure sensor, that would be better. If your power supply comes with a jack plug, then you may use the VIN. That is what I have drawn below. I have also added the protection resistor.
@Koepel Thank you very much for your answer and your two diagrams :), this is what I was waiting for because I find it difficult to understand the electronic diagrams.
If you can split the 12V power to the Arduino board and the pressure sensor, that would be better.
What would be the reason? the sensor can be damaged? because it is the most expensive thing of all, I don't want to damage it
There is a diode from the power barrel jack to VIN on the Arduino board. That means the sensor does not get 12V, but 11.4 or so, and the 12V is already low.
In most cases a 12V power line goes to all parts, that makes the overall wiring easier to understand. Since the sensor needs only up 20mA, it is safe to use VIN.
You may use 220Ω for the resistor. That is a more common value, but you have to adjust the calculation in the sketch.
The protection resistor can be about 1k to 10k. I would use 4k7. It is to protect the Arduino analog input in case the sensor is powered and the Arduino board is not or if the 250Ω resistor is broken.