Drive Accord Honda Forums banner

1 - 15 of 15 Posts

·
Registered
Joined
·
8 Posts
Discussion Starter #1
Hello all, I purchased android head unit for my 2006 honda accord euro, and the unit is okay, but it lacks quality, like screen is scratching with every touch, and the most thing that annoys me is that my dashboard is not showing outside temperature anymore. As I could figure out, the temp sensor is connected directly to the a/c controller board of the unit, and then it is sending through canbus network only with can high wire to the dashboard. I don't have osciloscope or can bus reader to figure out what it is even sending through network, and want to see if anyone else is having the same problem and did anyone find the solution.

I have figured it out. As seen from internet every chinese head unit for Accord lacks displaying outside temperature on the cluster. So I built arduino based CAN network reader and read messages from factory radio. From those informations pulled from HVAC controller I've wrote the code that takes input from the outside temp sensor and translate it to CAN messages and sends it to the cluster. Finally working just right, thing that bothered me since I've bought this head unit. Here's the video demonstrating it working:

All is left to do is to put it in a case and wire it permanently.
 

·
Registered
Joined
·
8 Posts
Discussion Starter #3 (Edited)
Here's what I've done so far:

I'm using Arduino nano v3 from ebay, and MCP2515 CAN bus module also from ebay.
Hooked up using this schematic:
wiringarduinomcp2515.png

Picture is from internet using arduino uno, but works the same on nano. The MCP2515 have a jumper for 120ohm, you need it when connecting outside of the car and don't need it when connecting to the car!

Next I've downloaded the libraries for this module. Which can be found on this link: coryjfowler/MCP_CAN_lib
Found the example for recieve:
517762


Next thing was to modify it to my need.

517763

Baud rate for this network is 33.3kbps and the MCP2515 module is operating on 8Mhz crystal. Then upload to the board.

Wiring the OEM HVAC :
517764

Because the network we use for this project is single wire can protocol it only uses CAN High terminal on the MCP2515 board, we need CAN Low to wire it to the ground pin of the arduino.

(NOTE: Input for the ambient sensor is SOURCE INPUT, means that the pin is pulled to ground, measuring that pin give us about 5V, mine did 4.7V, important for later scaling ).
(Another NOTE: This is HVAC unit for ACCORD EURO, I've found the schematic for AMERICAN ACCORD and the pinout for 22pin connector was not the same! ).
I've hooked up a potentiometer to pin 21 and started measuring
This is what I've got reading it with serial monitor:

CANID: 0x12F85351 DLC:2 DATA: 0xFF 0x00
CANID: 0x12F85351 DLC:2 DATA: 0xFF 0x00
CANID: 0x12F85351 DLC:2 DATA: 0xFF 0x00
CANID: 0x12F85351 DLC:2 DATA: 0xFF 0x00
CANID: 0x1610FF51 DLC:0 DATA:
And then the sequence repeats.

CANID: 0x1610FF51 DLC:0 DATA: - represents something and don't know what but obviusly it is important and it's going to be implemented in the code later

Only thing is that I don't know is how much messages are separeted. I've separated them by 300ms and it works :D

DATA part of the read out is based on the temperature, it is a 2 byte word. First byte is for temperature, and the second is for for heated back window and side mirrors. In the example it is 0xFF which is HEX and the value is 255 in decimal, that's when nothing is conneted to pin 21. Lowest I've got is 0x38 which is 56 in decimal, that's when the pin 21 is shorted to ground. For the second byte you need to make one input that represents the second byte. 0x00 is heaters off and 0x80 or 128 in decimal for on
Doing the same test on the chinese HVAC board resulted that no matter the input, board sends 0xFF to cluster, and because of that it is not showing the temperature!

Next part is to send the data to the cars cluster.
IMPORTANT: Because chinese HVAC is sending something to this addresses it is a MUST to disconnect the CAN bus wire from chinese board and connect it only to arduino. As the result after installing arduino to the car, it will no longer show on the chinese head unit when the door is open (if you have this feature) because chinese HVAC cannot recieve messages from the car any more.

Now building my own code and uploading it to the arduino an wiring it to the car. I've wired the sensor input of the HVAC to the analog pin 0 of the arduino and scaled it that the chinese board and on the dash shows the same
I will not upload the code here until I test it fully and to be sure nothing bad happens to the car, I've only tested it for a couple of minutes only, in a couple of days I will put it in car and leave it to work.

Little information on the code in Arduino IDE:


sensorValue = analogRead(sensor);
cantxValue = sensorValue / 4.35;
unsigned char canMsg[2] = {cantxValue, 0x00};
CAN0.sendMsgBuf(0x12F85351, 1, 2, canMsg);

I've done the analog read of the sensor 0 and than devide it by 4.35 and then it matches the temp on the chinese head unit and the cluster.
When the code is fully tested I will upload it here.


(NOTE: If anyone tries something on their car and make a damage, it's not my fault :D )
(Another NOTE: English is not my native language, so grammer police, be kind).
 

Attachments

·
Registered
Joined
·
8 Posts
Discussion Starter #8 (Edited)
this is the working code that I run for some time:

// CAN Accord cluster ambient temperature
//

#include <mcp_can.h> // Library
#include <SPI.h>
#define defrostinput 5 // Input from HVAC for rear window heater, I extracted the led status output of the HVAC, need to solder a thin wire and get it to arduino D5 input




MCP_CAN CAN0(10); // Set CS to pin 10
int sensor = A0; //Input from the cars front temperature sensor (already pulled up signal from HVAC, just wire it in parallel, because HVAC also needs this signal, do not cut the wire) goes to A5 input of the arduino
int sensorValue = 0;
int actTemp = 0;
int defrost = 0;
int val = 0;


void setup()
{

pinMode(defrostinput, INPUT);


Serial.begin(115200);
CAN0.begin(MCP_ANY, CAN_33K3BPS, MCP_8MHZ); // double check the MCP2515, the are two types, with 8mhz and 16mhz, if you put the wrong value, it will be real bad

CAN0.setMode(MCP_NORMAL);



}

void loop()
{
val = digitalRead(defrostinput);
sensorValue = analogRead(sensor);

actTemp = (sensorValue / 3.9) + 2; //Input is scaled, it most depends of the arduino voltage, for example it is 5V, but if the voltage drops to 4.8, the value for temperature on the cluster is going to change. This formula is for exatcly 5v on the arduino power input.
if (val == HIGH) {

defrost = 128;

} else {

defrost = 0;

}

unsigned char canMsg[2] = {actTemp, defrost};
CAN0.sendMsgBuf(0x12F85351, 1, 2, canMsg);
delay(300);
CAN0.sendMsgBuf(0x12F85351, 1, 2, canMsg);
delay(300);
CAN0.sendMsgBuf(0x12F85351, 1, 2, canMsg);
delay(300);
CAN0.sendMsgBuf(0x1610FF51, 1, 0, 0);

delay(400);
}


/*
END FILE
*/


Be aware, you must disconnect the wire from HVAC that is going for CANBUS, because messages will collide, and you can damage something. The power for the arduino also needs stable voltage. I faced some issues where my cars ECU started to bring Check Engine with DTC Processor malfunction error because of unstable voltage on arduino. Only erased with professional diagnostics. So do it on your own, and I'm not responsible if something goes wrong. If you have other questions or need help putting it all together, write me.
 

·
Registered
Joined
·
4 Posts
I really thank you again!
I d like to know, why you use defrost input from arduino? Cause you disable the Can from the HVAC so it cannot control the rear window defrost system and you do it externaly from arduino?
 

·
Registered
Joined
·
8 Posts
Discussion Starter #10
Because on most chinese HVACs defroster works, and it sends the controling messages to the car, but when we cut the wire for CAN from HVAC, the defroster stops working but it is activated on the HVAC. When you activate it the front LED lit up on the buttons, I used that LED to make arduino input and send the CAN message with arduino to activate the heaters. This also applies to the side rear view mirror heaters.
 

·
Registered
Joined
·
4 Posts
Goya94 where did you manage to find the schematics for the european Accord? Do you have the EU service manual?
I cant find any info for the EU version. Thanks!
 

·
Registered
Joined
·
8 Posts
Discussion Starter #12
Goya94 where did you manage to find the schematics for the european Accord? Do you have the EU service manual?
I cant find any info for the EU version. Thanks!
I did not find EU service manual. I found the US version but it is not the same wiring, although some things do match up. With HVAC it is not the same, and I did reverse engineering of all the pins of the HVAC with an oscilloscope and some basic electronic components, like resistors and potentiometers. For can bus I used arduino like I mentioned in my post how I did it.
 

·
Registered
Joined
·
4 Posts
You did a lot of word and thank you for this. I ll report my results after i complete the setup.
Thank you again!
 

·
Registered
Joined
·
8 Posts
Discussion Starter #15
Little update. I just ordered arduino with embedded can bus controller from seedstudio. It is more compact an ready for this modification. I will post the results when it arrives. Here's the picture of the board:
526016
 
1 - 15 of 15 Posts
Top