Connecting a sensor and an Uno

Hello. I'm rather new to electonics so I think my question must be silly. I'd appreciate some advice.
So, I have a project to read oil pressure in my car's engine.

I have this 3-wire sensor: https://aliexpress.ru/item/1447040260.html
It needs 12 V as an input and gives an output signal in the range from 1 to 5 V.
I plan to read that voltage and calculate pressure.

From what I know, I ran into some conclusions:

  1. The sensor needs exactly 12V to produce correct output.
  2. Arduino can work with 12 V power supply, but would be much better off with 5V.
  3. A car's voltage is far from 12V and is rather volatile.

So I plan to use two adjustable DC-DC converters- one to provide Arduino with 5V and another to power the sensor with 12V. See the diagram attached,

My question is - how to create a common ground between the sensor and the arduino for the latter to be able to actually compare voltages?
Do I connect the sensor's GND and GND on arduino both to DC-DC converter powering the sensor with 12V?

All grounds together and you have a common ground

If your DC-DC converters share a common ground on both sides (input/output) then you already have a common ground.

Occasionally, the converter may be isolated type.

You can measure the voltage between output +ve pin and input GND. Should be same as output +ve and output GND.

Having done such for Rotax in experimental plane, you should drive the sender (sensor) from 5 V, the same as your Arduino supply. Use a 1% resistor of 1K (Rotax was 910 Ohms series.) Of course, if you have dash gauges using the oil pressure, this scenario will not work.

Rotax sender:

In any event, you must have a series resistor to 5V or 12V and you take the connection to the analog pin at the junction.

#define WaterTemp_AnalogIn        A0  // Coolant Temperature
#define OilTemp_AnalogIn          A1  // Oil Temperature
#define OilPress_AnalogIn         A2  // Oil Pressure
#define FrontCylTemp_AnalogIn     A3  // Cylinder Head Front Temperature 1
#define RearCylTemp_AnalogIn      A4  // Cylinder Head Rear Temperature 2

int CHTemp_1    =  0;                 // Cylinder Head Temperature 1
int CHTemp_2    =  0;                 // Cylinder Head Temperature 2
int EOTemp_1    =  0;                 // Engine Oil Temperature
int EOPres_1    =  0;                 // Engine Oil Pressure
int ECTemp_1    =  0;                 // Engine Coolant/Water Temperature

// CHT: Cylinder Head Temperature
//const int CHT[] PROGMEM = { 360, 360, 256, 329, 302, 284, 275, 266, 257, 248, 239, 235, 230, 225, 221, 212, 208, 203, 200, 197, 194, 191, 188, 185, 182, 180, 178, 176, 173, 171, 169, 167, 166, 164, 162, 160, 158, 156, 154, 152, 151, 150, 149, 147, 144, 143, 142, 141, 140, 138, 137, 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, 122, 121, 121, 120, 119, 118, 117, 116, 115, 114, 113, 113, 112, 111, 110, 109, 108, 107, 106, 106, 105, 105, 104, 104, 103, 102, 101, 100, 99, 98, 97, 97, 96, 96, 95, 95, 94, 93, 92, 91, 90, 89, 89, 88, 88, 87, 87, 86, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 74, 72, 70, 68, 66, 65, 64, 62, 61, 58, 56, 54, 52, 50, 48, 46, 44, 42, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40 };
const int CHT[] PROGMEM = { 302, 302, 302, 302, 302, 286, 281, 269, 257, 249, 242, 234, 228, 221, 216, 213, 207, 202, 199, 194, 191, 189, 185, 182, 180, 178, 175, 173, 171, 168, 166, 164, 161, 159, 158, 157, 154, 152, 151, 148, 147, 146, 145, 144, 142, 140, 139, 137, 136, 135, 134, 133, 131, 130, 129, 128, 127, 126, 125, 124, 123, 121, 120, 119, 118, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 102, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100 };
//const int CHT[] PROGMEM = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 };

// EOT: Engine Oil Temperature
//const int EOT[] PROGMEM = { 360, 360, 256, 329, 302, 284, 275, 266, 257, 248, 239, 235, 230, 225, 221, 212, 208, 203, 200, 197, 194, 191, 188, 185, 182, 180, 178, 176, 173, 171, 169, 167, 166, 164, 162, 160, 158, 156, 154, 152, 151, 150, 149, 147, 144, 143, 142, 141, 140, 138, 137, 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, 122, 121, 121, 120, 119, 118, 117, 116, 115, 114, 113, 113, 112, 111, 110, 109, 108, 107, 106, 106, 105, 105, 104, 104, 103, 102, 101, 100, 99, 98, 97, 97, 96, 96, 95, 95, 94, 93, 92, 91, 90, 89, 89, 88, 88, 87, 87, 86, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 74, 72, 70, 68, 66, 65, 64, 62, 61, 58, 56, 54, 52, 50, 48, 46, 44, 42, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40 };
const int EOT[] PROGMEM = { 302, 302, 302, 302, 302, 286, 281, 269, 257, 249, 242, 234, 228, 221, 216, 213, 207, 202, 199, 194, 191, 189, 185, 182, 180, 178, 175, 173, 171, 168, 166, 164, 161, 159, 158, 157, 154, 152, 151, 148, 147, 146, 145, 144, 142, 140, 139, 137, 136, 135, 134, 133, 131, 130, 129, 128, 127, 126, 125, 124, 123, 121, 120, 119, 118, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 102, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100 };
//const int EOT[] PROGMEM = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 };

// ECT: Engine Coolant Temperature
const int ECT[] PROGMEM = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 };
//const int ECT[] PROGMEM = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 };

// EOP: Engine Oil Pressure
//const int EOP[] PROGMEM = { 0, 0, 3, 6, 9, 12, 13, 15, 17, 20, 23, 25, 27, 29, 44, 48, 53, 58, 62, 73, 80, 87, 94, 102, 110, 116, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 };
const int EOP[] PROGMEM = { 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 10, 11, 12, 13, 14, 14, 15, 15, 16, 17, 18, 19, 20, 21, 22, 22, 23, 24, 25, 26, 27, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 44, 45, 46, 47, 48, 49, 50, 54, 55, 56, 57, 58, 58, 59, 61, 63, 65, 67, 69, 70, 71, 73, 74, 75, 77, 78, 80, 82, 83, 85, 87, 90, 93, 96, 97, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 123, 125, 127, 131, 133, 135, 139, 143, 145, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 };
//const int EOP[] PROGMEM = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 };

// ________________________________________________________________________(read analog pin previously defined)
    // Cylinder Head sensor #1
int CylHeadFront()
{                                                        
    /* int therm = analogRead(FrontCylTemp_AnalogIn) / 4;    // 10-bits with a VCC 5V+ reference */
    // int therm = (analogRead(FrontCylTemp_AnalogIn) >> 2);    // divide by 4 to remap 10-bit analog to 8-bit analog
    int ROW = 3;
    int therm = ( analogAverage ( ROW, FrontCylTemp_AnalogIn ) >> 2);
    int CHTemp_1 = pgm_read_word(&CHT[therm]); 
    return (CHTemp_1) ;
}
// ________________________________________________________________________(read analog pin previously defined)
    // Cylinder Head sensor #2
int CylHeadRear()
{
    // CHT Rear: OLED positions 8, 9, 10 LINE2

   /* int therm = analogRead(RearCylTemp_AnalogIn) / 4;       // 10-bit == 0 - 1023 */
   // int therm = (analogRead(RearCylTemp_AnalogIn) >> 2);    // divide by 4 to remap 10-bit analog to 8-bit analog
    int ROW = 4;
    int therm = ( analogAverage ( ROW, RearCylTemp_AnalogIn ) >> 2);
    int CHTemp_2 = pgm_read_word(&CHT[therm]);
    return (CHTemp_2) ;
}

// ________________________________________________________________________(read analog pin previously defined)
// Water Temperature int ECTemp_1    =  0    // Engine Coolant (Water) Temperature    
// OLED Display positions: 0, 1, 2 LINE2
 int EngineCoolantTemp()
{
   /* int therm = analogRead(WaterTemp_AnalogIn) / 4;   //10-bit == 0-1023 */
   // int therm = (analogRead(WaterTemp_AnalogIn) >> 2);
    int ROW = 0;
    int therm = ( analogAverage ( ROW, WaterTemp_AnalogIn ) >> 2);
   // Water Coolant Temperature
   int ECTemp_1 = pgm_read_word(&ECT[therm]);
    return (ECTemp_1) ;
}

// ________________________________________________________________________(read analog pin previously defined)
//  Oil Temperature int EOTemp_1    =  0;     // Engine Oil Temperature                
//  OLED Display positions: 4, 5, 6 LINE1
int EngOilTemp()
{
    /* int therm = analogRead(OilTemp_AnalogIn) / 4; // 10-bit, 0-1023 */
    // int therm = (analogRead(OilTemp_AnalogIn) >> 2);
    int ROW = 1;
    int therm = ( analogAverage ( ROW, OilTemp_AnalogIn ) >> 2);
    /* Engine Oil Temperature */
    int EOTemp_1 = pgm_read_word(&EOT[therm]);
    return (EOTemp_1) ;
}

// ________________________________________________________________________(read analog pin previously defined)
// Oil Pressure int EOPres_1    =  0;        // Engine Oil Pressure
// OLED Display positions 4, 5, 6 LINE2
int EngineOilPres()
{
    /* int therm = analogRead(OilPress_AnalogIn) / 4;      // 10-bit == 0-1023 */
    // int therm = (analogRead(OilPress_AnalogIn) >> 2);
    int ROW = 2;
    int therm = ( analogAverage ( ROW, OilPress_AnalogIn ) >> 2);
    EOPres_1 = pgm_read_word(&EOP[therm]);
    return (EOPres_1) ;
}

If you have long leads, you will create ground loops.
Also if you connect arduino ground to ground while the DCDC converter already has a ground.

If you do not plan to drive anything from your arduino except some LED's, you might be better off feeding the arduino with 12 V from your sensor supply.

That way you can send signal and ground together to your arduino.

Since cars are pretty noisy (high electric fields), I recommend 100 nF capacitors from analog input to ground and at end of each power supply (if not there already).

No, the output GNDs of converters are not connected. One goes to arduino, another goes to the sensor. The converters look like this:

1 Like

like this?

You mean the capacitor must be between the output wire of the sensor and it's own ground?

Capacitor on/near Arduino.

Schematic:
If Arduino and sensor are close (in one box), this is OK.
Otherwise feed sensor from 12V at Arduino (3 wires (12V, GND, signal) bundled from Arduino to Sensor).

like this?
Circuit2

Like that!

That may be a 4 ~ 20mA current loop sensor, in which case you will need a 250 Ohm load resistor to produce the 1 ~ 5 volts.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.