Prelude conversion project - some questions

Technical discussion on converting internal combustion to electric
User avatar
jonescg
Senior Member
Posts: 2102
Joined: Thu, 21 Jan 2010, 23:05
Real Name: Chris Jones
Location: Perth, WA.

Re: Prelude conversion project - some questions

Post by jonescg » Thu, 26 Apr 2018, 14:54

Lo and behold I got there in the end :) Just using a 100 k NCT thermistor as a voltage divider and an Arduino to control a couple of digital outputs.

Code: Select all

//  This sketch is a simple if-then system.  If the analog input sensor exceeds the first setpoint, pin 4 goes high.
//  If the sensor exceeds the second setpoint, pin 2 goes high. 

int thermistorPin = A0;    // select the input pin for the potentiometer
int sensorValue = 0;  // variable to store the value coming from the sensor

void setup() {

  pinMode(4, OUTPUT);      // declare pin 4 as an output (coolant pump)
  pinMode(2, OUTPUT);      // declare pin 5 as an output (AC compressor)
  Serial.begin(9600);       //turn serial monitor on for double-checking.
}

void loop() {
  
  sensorValue = analogRead(thermistorPin); // read the value from the sensor
  Serial.print(sensorValue);               // print the sensor value on the screen
  Serial.println("");
  delay(500);                              // gives the sensor time to stabilise
  if (sensorValue > 625)
    digitalWrite(4, HIGH);      // if the reading exceeds 625, turn 4 on
  else
    digitalWrite(4, LOW);       // otherwise leave it off
    
  if (sensorValue > 640)
    digitalWrite(2, HIGH);      // if the temperature sensor exceeds 640, turn 2 on
  else
    digitalWrite(2, LOW);       // otherwise leave it off
    
}
I'm proud of myself anyway :)
AEVA National Secretary, WA branch vice-chair

User avatar
jonescg
Senior Member
Posts: 2102
Joined: Thu, 21 Jan 2010, 23:05
Real Name: Chris Jones
Location: Perth, WA.

Re: Prelude conversion project - some questions

Post by jonescg » Thu, 26 Apr 2018, 14:57

Proof that it works :)
Uno thermistor.jpg
Uno thermistor.jpg (120.01 KiB) Viewed 248 times
AEVA National Secretary, WA branch vice-chair

rhills
Site Admin
Posts: 259
Joined: Fri, 25 Jul 2008, 01:57
Real Name: Rob Hills
Location: Waikiki, WA

Re: Prelude conversion project - some questions

Post by rhills » Thu, 26 Apr 2018, 16:59

Looks good to me.

One tweak you might consider is to move the Delay(500) to either the end or the beginning of the loop. The value of sensorValue isn't going to change after it is read at the first line of the loop() routine no matter how long you delay so to me it's more logical to read the value, process it, then delay before reading it again. I can't see that this has caused any problems in the code you have now, but if you needed to change the code later, you might slip in a bug by misintepreting the comment on your delay(500) line which implies that sensorValue might change during that delay.
Rob Hills
AEVA Webmaster
2014 Mitsubishi Outlander Aspire PHEV
Jul 2014 - Feb 2018
Total Petrol: 551.6L
ODO: 39992
Av Consumption: 1.38 L/100km

User avatar
coulomb
Site Admin
Posts: 3120
Joined: Thu, 22 Jan 2009, 20:32
Real Name: Mike Van Emmerik
Location: Brisbane
Contact:

Re: Prelude conversion project - some questions

Post by coulomb » Thu, 26 Apr 2018, 20:34

Isn't this a comment error? :oops:

pinMode(2, OUTPUT); // declare pin 5 as an output (AC compressor)

Later comments talk about pin 2.

Yes, I'm a pedant. :geek:
Learning how to patch and repair PIP-4048 inverter-chargers and Elcon chargers.

User avatar
jonescg
Senior Member
Posts: 2102
Joined: Thu, 21 Jan 2010, 23:05
Real Name: Chris Jones
Location: Perth, WA.

Re: Prelude conversion project - some questions

Post by jonescg » Thu, 26 Apr 2018, 20:47

Yes, correctly spotted ☺. Pin 5 wouldn't grip the solid core wire properly so I used 2 instead.

...pedant. 😆
AEVA National Secretary, WA branch vice-chair

User avatar
jonescg
Senior Member
Posts: 2102
Joined: Thu, 21 Jan 2010, 23:05
Real Name: Chris Jones
Location: Perth, WA.

Re: Prelude conversion project - some questions

Post by jonescg » Fri, 27 Apr 2018, 15:15

Updated the code and circuit to operate from four independent thermistors now.
Pumps on.jpg
Pumps on.jpg (161.64 KiB) Viewed 229 times
Pumps and compressor on.jpg
Pumps and compressor on.jpg (139.13 KiB) Viewed 229 times

Code: Select all

int Therm1 = A0;    // declare A0 as T1 input
int Therm2 = A1;    // declare A1 as T2 input
int Therm3 = A2;    // declare A2 as T3 input
int Therm4 = A3;    // declare A3 as T4 input
int Therm1Value = 0;  // 
int Therm2Value = 0;  // 
int Therm3Value = 0;  // 
int Therm4Value = 0;  // Define values of thermistor inputs

int LowT = 630;     //Define the limit where coolant pumps turn on
int HighT= 640;     //Define the limit where the AC compressor comes on

void setup() {

  pinMode(4, OUTPUT);      // declare pin 4 as an output (coolant pump)
  pinMode(2, OUTPUT);      // declare pin 2 as an output (AC compressor)

}

void loop() {
  
  delay(150);
  Therm1Value = analogRead(Therm1);
  Therm2Value = analogRead(Therm2);
  Therm3Value = analogRead(Therm3);
  Therm4Value = analogRead(Therm4);
  delay(150);
  Therm1Value = analogRead(Therm1);
  Therm2Value = analogRead(Therm2);
  Therm3Value = analogRead(Therm3);
  Therm4Value = analogRead(Therm4);     // As per Rob's suggestion, this stops flickering when close to the limit.
    
  if (Therm1Value > LowT or Therm2Value > LowT or Therm3Value > LowT or Therm4Value > LowT)
    digitalWrite(4, HIGH);      // if the reading exceeds 630, turn 4 on
  else
    digitalWrite(4, LOW);       // otherwise leave it off
    
  if (Therm1Value > HighT or Therm2Value > HighT or Therm3Value > HighT or Therm4Value > HighT)
    digitalWrite(2, HIGH);      // if the temperature sensor exceeds 640, turn 2 on
  else
    digitalWrite(2, LOW);       // otherwise leave it off
    
}

So far it works well. Next step is to include some maths so that I can enter a temperature in degrees Celsius rather than an arbitrary ADC value between 0 and 1023...
AEVA National Secretary, WA branch vice-chair

User avatar
jonescg
Senior Member
Posts: 2102
Joined: Thu, 21 Jan 2010, 23:05
Real Name: Chris Jones
Location: Perth, WA.

Re: Prelude conversion project - some questions

Post by jonescg » Wed, 02 May 2018, 16:10

I use Sketchup a lot for drawing all sorts of stuff, and I was amazed to discover that some kind individual decided to draw an entire model of a 1988 Honda Prelude!
Prelude battery size up.jpg
Prelude battery size up.jpg (242.26 KiB) Viewed 205 times
Prelude battery placement.jpg
Prelude battery placement.jpg (358.14 KiB) Viewed 205 times
Perfect for sizing up the battery! It should fit neatly where the fuel tank was. I'll probably have to devise some kind of sub-structure in the floor of the car to which this battery would be bolted to. It would probably weigh in at about 140 kg all told, so some decent fixings will be needed. I'll try and make the enclosure out of composite like fiberglass or carbon - whatever is light / cheap / strong (or only two of the three).
AEVA National Secretary, WA branch vice-chair

User avatar
jonescg
Senior Member
Posts: 2102
Joined: Thu, 21 Jan 2010, 23:05
Real Name: Chris Jones
Location: Perth, WA.

Re: Prelude conversion project - some questions

Post by jonescg » Mon, 14 May 2018, 21:28

The heat exchanger I ordered has arrived - looks to be quite a powerful one so I'll definitely be putting this on the end of the blower, not the start.
Heat exchanger.jpg
Heat exchanger.jpg (48.5 KiB) Viewed 137 times
In other great news, the cells will be arriving in about 3-4 weeks time. Then we get busy in the shed each night...
9050135 (1).jpg
9050135 (1).jpg (34.25 KiB) Viewed 137 times
9050135 (3).jpg
9050135 (3).jpg (27.45 KiB) Viewed 137 times
9050135 (4).jpg
9050135 (4).jpg (30.61 KiB) Viewed 137 times
The liquid cooled DC/DC converter and 6.6 kW onboard charger should be here very shortly too.

Brake vacuum pump and reservoir are in thanks to Graeme, so we're not far away from making it happen!
AEVA National Secretary, WA branch vice-chair

User avatar
jonescg
Senior Member
Posts: 2102
Joined: Thu, 21 Jan 2010, 23:05
Real Name: Chris Jones
Location: Perth, WA.

Re: Prelude conversion project - some questions

Post by jonescg » Tue, 15 May 2018, 14:35

Okay on the heating and cooling side of things I might have some productive leads:

@Victor336v from Metric Mind has designed these 360 V DC water heaters with integrated pump and thermostat:
http://www.metricmind.com/category/ev-fluid-heaters/

I hope he has progressed them because it would be perfect for the job. Otherwise I see a company in the EU stocks a 2 kW water heater with a very basic thermostat:
https://www.strom-linie.eu/produkte/dc- ... zer-temro/

Meanwhile, I also found some AC compressors on Alibaba specifically for electric vehicles.
https://www.alibaba.com/product-detail/ ... aeb4jKEvsh

Waiting to hear back from these folks, but it would seem it's fed by a 360 V DC supply. I presume the power is varied with 0-5 V, or PWM, or a digital signal.

Great to finally have a mature EV manufacturing industry around the world; it means purpose built parts are starting to find their way into the hands of DIY'ers.
[/quote]

(Edited to update Victor's product details)
AEVA National Secretary, WA branch vice-chair

User avatar
jonescg
Senior Member
Posts: 2102
Joined: Thu, 21 Jan 2010, 23:05
Real Name: Chris Jones
Location: Perth, WA.

Re: Prelude conversion project - some questions

Post by jonescg » Thu, 17 May 2018, 10:52

So I bought one of these:
Strom-linie Astro water heater.jpg
Strom-linie Astro water heater.jpg (179.45 KiB) Viewed 71 times
It's got a really basic contactor which is modulated by a bimetallic thermostat. I'm assuming the contactor is rated to the task.

Still chasing AC compressors, but it looks like there are some good 5-6 kW, 380 V DC powered options around.
AEVA National Secretary, WA branch vice-chair

User avatar
4Springs
Senior Member
Posts: 456
Joined: Thu, 23 Dec 2010, 01:14
Real Name: Christopher Walkden
Location: Selbourne, TAS

Re: Prelude conversion project - some questions

Post by 4Springs » Thu, 17 May 2018, 18:05

Details on that heat exchanger? It looks a neat little unit.

User avatar
jonescg
Senior Member
Posts: 2102
Joined: Thu, 21 Jan 2010, 23:05
Real Name: Chris Jones
Location: Perth, WA.

Re: Prelude conversion project - some questions

Post by jonescg » Thu, 17 May 2018, 18:21

4Springs wrote:
Thu, 17 May 2018, 18:05
Details on that heat exchanger? It looks a neat little unit.
Bought it here: https://www.fishpond.com.au/Kitchen/Dud ... 9129425010
AEVA National Secretary, WA branch vice-chair

User avatar
jonescg
Senior Member
Posts: 2102
Joined: Thu, 21 Jan 2010, 23:05
Real Name: Chris Jones
Location: Perth, WA.

Re: Prelude conversion project - some questions

Post by jonescg » Thu, 17 May 2018, 18:40

I might have bought a few of these too:
IMG_1421.png
IMG_1421.png (317.78 KiB) Viewed 47 times
We'll see how they go. 36 cc/rev displacement, and will run on a DC bus up to 500 VDC.
AC_Compressor_Specs.JPG
AC_Compressor_Specs.JPG (93.02 KiB) Viewed 47 times
AEVA National Secretary, WA branch vice-chair

User avatar
jonescg
Senior Member
Posts: 2102
Joined: Thu, 21 Jan 2010, 23:05
Real Name: Chris Jones
Location: Perth, WA.

Re: Prelude conversion project - some questions

Post by jonescg » Fri, 18 May 2018, 16:17

Well after not getting enough assurance that this compressor would be suitable for the job, I went for a different vendor who offered far more information.
WURZ AC Compressor.jpg
WURZ AC Compressor.jpg (266.58 KiB) Viewed 33 times
WURZ AC Compressor in an actual EV.jpg
WURZ AC Compressor in an actual EV.jpg (227.4 KiB) Viewed 33 times
At least they provided a wiring diagram!
Wurz Wiring diagram.JPG
Wurz Wiring diagram.JPG (41.46 KiB) Viewed 33 times
I got two - one for the Prelude and one for the CRX.
AEVA National Secretary, WA branch vice-chair

Post Reply