Page 2 of 2

Re: Prelude conversion project - some questions

Posted: Thu, 26 Apr 2018, 14:54
by jonescg
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 :)

Re: Prelude conversion project - some questions

Posted: Thu, 26 Apr 2018, 14:57
by jonescg
Proof that it works :)
Uno thermistor.jpg
Uno thermistor.jpg (120.01 KiB) Viewed 273 times

Re: Prelude conversion project - some questions

Posted: Thu, 26 Apr 2018, 16:59
by rhills
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.

Re: Prelude conversion project - some questions

Posted: Thu, 26 Apr 2018, 20:34
by coulomb
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:

Re: Prelude conversion project - some questions

Posted: Thu, 26 Apr 2018, 20:47
by jonescg
Yes, correctly spotted ☺. Pin 5 wouldn't grip the solid core wire properly so I used 2 instead.

...pedant. 😆

Re: Prelude conversion project - some questions

Posted: Fri, 27 Apr 2018, 15:15
by jonescg
Updated the code and circuit to operate from four independent thermistors now.
Pumps on.jpg
Pumps on.jpg (161.64 KiB) Viewed 254 times
Pumps and compressor on.jpg
Pumps and compressor on.jpg (139.13 KiB) Viewed 254 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...

Re: Prelude conversion project - some questions

Posted: Wed, 02 May 2018, 16:10
by jonescg
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 230 times
Prelude battery placement.jpg
Prelude battery placement.jpg (358.14 KiB) Viewed 230 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).

Re: Prelude conversion project - some questions

Posted: Mon, 14 May 2018, 21:28
by jonescg
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 162 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 162 times
9050135 (3).jpg
9050135 (3).jpg (27.45 KiB) Viewed 162 times
9050135 (4).jpg
9050135 (4).jpg (30.61 KiB) Viewed 162 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!

Re: Prelude conversion project - some questions

Posted: Tue, 15 May 2018, 14:35
by jonescg
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)

Re: Prelude conversion project - some questions

Posted: Thu, 17 May 2018, 10:52
by jonescg
So I bought one of these:
Strom-linie Astro water heater.jpg
Strom-linie Astro water heater.jpg (179.45 KiB) Viewed 96 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.

Re: Prelude conversion project - some questions

Posted: Thu, 17 May 2018, 18:05
by 4Springs
Details on that heat exchanger? It looks a neat little unit.

Re: Prelude conversion project - some questions

Posted: Thu, 17 May 2018, 18:21
by jonescg
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

Re: Prelude conversion project - some questions

Posted: Thu, 17 May 2018, 18:40
by jonescg
I might have bought a few of these too:
IMG_1421.png
IMG_1421.png (317.78 KiB) Viewed 72 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 72 times

Re: Prelude conversion project - some questions

Posted: Fri, 18 May 2018, 16:17
by jonescg
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 58 times
WURZ AC Compressor in an actual EV.jpg
WURZ AC Compressor in an actual EV.jpg (227.4 KiB) Viewed 58 times
At least they provided a wiring diagram!
Wurz Wiring diagram.JPG
Wurz Wiring diagram.JPG (41.46 KiB) Viewed 58 times
I got two - one for the Prelude and one for the CRX.

Re: Prelude conversion project - some questions

Posted: Wed, 23 May 2018, 16:55
by jonescg
Water pumps have been ordered - I got three of the Davies Craig 15 litre per minute pumps. I suspect one of these pumps will be powerful enough for the inverter + motor + DC/DC converter. But not sure sure if they're up to the task of the charger + battery cooling loop. They sell a 23 litre per minute one as well - might be ideal for this loop given the large amount of plumbing involved.

If you don't subscribe to the Weber Auto youtube channel, I highly recommend you do. He does a teardown of a late model Prius and covers the radiator extensively. Interestingly, the radiator has two sections - an upper section for the IC engine coolant, and a lower (smaller) section for the inverter and DC/DC converter loop. I'm tempted to fit a Prius radiator to the Prelude and take advantage of this 2-in-1 radiator. The large radiator seems excessive for the battery, but it's probably not going to matter too much.
113296_Prius_radiator.jpg
113296_Prius_radiator.jpg (55.5 KiB) Viewed 19 times
After all, I'll need some cooling fans to suit, and these are already the right size...