Reverse Engineering problem, Controlling an unknown coolant valve

I have an unknown Coolant Control Valve I am trying to reverse engineer from the OEM part so I can test and compare potential suppliers. The Valve has pins (M-, M+, Vout, VCC, Gnd) and I know Vcc is 5V and Vout should output the position of the valve. I also know the valve is controlled by a DC motor which operates independently of the encoder that provides Vout. I am attempting to use an Arduino Nano, 10K potentiometer, LCD display, and L298N motor controller to allow me to dial in an angle based on the Vout and have the valve rotate to the set angle. I am not getting movement of the valve but instead a whine from the motor and the LCD screen fades and turns off when I hit a certain position causing the whole circuit to restart. I was hoping someone could look at my code and what I am trying to do and offer some guidance.

I am uploading a picture of the circuit that operates the valve which has an integrated encoder along with a picture of my setup.
image
image

The connections are as follows:

Power Supply
(+) - 12V rail on breadboard
(-) - Ground rail on breadboard

Nano -
Vin - 12V rail on breadboard (Right Side)
Gnd - Gnd on breadboard (both grounds rails are conencted)
5V - 5V rail on breadboard (left side)
Analog0 - Middle pin of potentiometer
Analog1 - Vout of Control Valve
Analog4- LCD bridge SDA
Analog5- LCD Bridge SCL
Digital9- ENA on L298N
Digital8- In1 on L298N
Digital7- In2 on L298N

Potentiometer:
Front - Ground
Middle - Analog0 on Nano
back - 5V rail

LCD Screen
GND- Ground rail on breadboard
Vcc - 5V rail on breadboard
LCD bridge SDA - Nano Analog4
SCL - Nano Analog5

L298N
12V - 12V rail on breadboard
GND - Ground rail on breadboard
Vcc - Not connected
ENA - Digital9 on Nano
IN1 - Digital8 on Nano
IN2 - Digital7 on Nano
Motor(+) - M+ on valve
Motor(-) - M- on Valve

Coolant Valve
Gnd - Gnd rail on breadboard
Vcc - 5V rail on breadboard
Vout - Analog1 on Nano
M+ - Motor(+) on L298N
M- - Motor(-) on L298N
my code is as follows:

#include <Wire.h> // Include the Wire library for I2C communication
#include <LiquidCrystal_I2C.h> // Include the LiquidCrystal_I2C library for LCD control

#define ENA 9
#define IN1 8
#define IN2 7
#define POT A0
#define VOUT A1

LiquidCrystal_I2C lcd(0x27, 16, 2); // Initialize the LCD with the I2C address and 16 columns and 2 rows

void setup() {
  lcd.init(); // Initialize the LCD
  lcd.backlight(); // Turn on the backlight
  pinMode(ENA, OUTPUT);
  pinMode(IN1, OUTPUT);
  pinMode(IN2, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  int potValue = analogRead(POT);
  int dutyCycle = map(potValue, 0, 1023, 0, 255);
  analogWrite(ENA, dutyCycle);

  int voutValue = analogRead(VOUT);
  float valvePosition = map(voutValue, 0, 1023, 0.0, 1.0);
  Serial.print("Valve Position: ");
  Serial.println(valvePosition, 2);

  if (valvePosition < 0.5) {
    digitalWrite(IN1, HIGH);
    digitalWrite(IN2, LOW);
  } else {
    digitalWrite(IN1, LOW);
    digitalWrite(IN2, HIGH);
  }

  int angle = map(valvePosition, 0, 1, 0, 180); //180 is default, set as max angle
  displayAngle(angle);

  delay(100);
}

void displayAngle(int angle) {
  lcd.setCursor(0, 0); // Set the cursor to the first column of the first row
  lcd.print("Angle: ");
  lcd.print(angle);
}

Buy a known coolant valve with a data sheet, follow the directions for operating it, and your problems should go away.

Else, please read the forum guide to know how to ask a question here.

Automotive coolant valves do not include data sheets which is why I am trying to reverse engineer it

I do not see how this post does not fit forum rules

None of those things sound like a problem with your code. They sound like power supply problems.

1 Like

That is what I was thinking as well but I have quadruple checked the connections but I will try powering the Arduino and LCD independently and see if that changes anything

In addition, the L298 is useful only for low power toy motors.

Neither use very much current. It's the motor that will use lots of current.

You didn't include a wiring diagram, information about auxiliary components like the power supply, or photos of the valve. To start...

It is a reverse engineering project I dont have either

Do you not have the valve? You mentioned a lot of Arduino related hardware. Why would it being a reverse engineering project prevent you from drawing wiring diagram? You mentioned that the motor was whining, this proves you have some kind of power supply... but what?

How do you know? Isn't it an unknown valve? Can you not take a photo of the valve and post it?

Please re-read:

1 Like

Power Supply is: DC Power Supply Variable, ENGINDOT 30V 5A Adjustable DC Bench Power Supply with 4 Digit LED Display, Data Hold, Coarse and Fine Adjustment (10mV, 1mA) with 110V/45.3" Alligator Lead: Amazon.com: Industrial & Scientific

Coolant Valve is: 06L121111P - Thermostat - Genuine Volkswagen Part (vw.com)

I am using an Arduino Nano and L298N bridge along with a 10K potentiometer.

I am doing all this to try and test parts from some unknown suppliers and compare them to the OEM part.

I have a part drawing but it is confidential that calls out Vcc is 5Volts and the DC motors working voltage is 12V

Below is a picture of the coolant valves circuit

Much better, thanks. How about some shots of your test setup, including all wiring, power supply settings, and a wiring diagram? Pretty much standard fare when people ask here about their reverse engineering projects...

I am making a wiring diagram right now but here is an image of my setup with my power supply along with the connections

Power Supply
(+) - 12V rail on breadboard
(-) - Ground rail on breadboard

Nano -
Vin - 12V rail on breadboard (Right Side)
Gnd - Gnd on breadboard (both grounds rails are conencted)
5V - 5V rail on breadboard (left side)
Analog0 - Middle pin of potentiometer
Analog1 - Vout of Control Valve
Analog4- LCD bridge SDA
Analog5- LCD Bridge SCL
Digital9- ENA on L298N
Digital8- In1 on L298N
Digital7- In2 on L298N

Potentiometer:
Front - Ground
Middle - Analog0 on Nano
back - 5V rail

LCD Screen
GND- Ground rail on breadboard
Vcc - 5V rail on breadboard
LCD bridge SDA - Nano Analog4
SCL - Nano Analog5

L298N
12V - 12V rail on breadboard
GND - Ground rail on breadboard
Vcc - Not connected
ENA - Digital9 on Nano
IN1 - Digital8 on Nano
IN2 - Digital7 on Nano
Motor(+) - M+ on valve
Motor(-) - M- on Valve

Coolant Valve
Gnd - Gnd rail on breadboard
Vcc - 5V rail on breadboard
Vout - Analog1 on Nano
M+ - Motor(+) on L298N
M- - Motor(-) on L298N

I would

a: use heavier wire from the H-bridge driver to the motor (or double up the duPont connectors) and,

b: bypass the breadboard (limited current carrying capacity) and connect directly to the terminal strip,

c: bypass the termianl strip and wire motor the direct to the H-bridge driver.

image

To me the key word is "should". Please confirm that the original controller actually does what you think it "should" do? If it does, then your next piece of test equipment is an oscilloscope to examine the signals the original equipment uses and then duplicate them.

I’m unsure how you can specify a part based on what an OEM part does - would it matter if another part operated more quickly , took more current , made more noise , flowed less/more , lasted shorter /longer ? With out knowing the requirements for the pump , how do you know what is good or bad ??

I’d guess you’d need to know how it interfaces and works too …..

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