TriB:
Hi,
that sounds tough! You want to emulate an ECU to change an analog value (from a temperature sensor) to a k-line signal, which provides a gauge or something?
Did I understand that right?
For me it sounds a bit strange, at the first place. Because k-line is more or less not a common communication protocol between the components, because it is quite slow.
For Suzuki and Kawasaki we have 10417 baud and a protocol which consists out of:
- Format byte (always 0x80 except of initial message 0x81)
- Receiver address (0x11)
- Sender address (0xF1)
- Length
- Service idendtifier
- Protocol identifier
- Data
- Checksum
This is part of the KWP2000 / ISO 14320 protocol.
How the service identifier (SID) and protocol identifier (PID) work, is different from manufacturer to manufacturer.
So we all have no clue, how it might work for your S2000.
What I do know: Honda Motorcycles does not rely on that kind of protocol. The don´t have a Header (Format + Receiver + Sender) and I still did not completely understood it.
If you might have some data, we can take a look, but don´t promise anything. Sorry 
Thankyou for your help and attention TriB...
In attach I put a image from a Honda s2000 cluster!
Yes, all cluster work fine, some features (like a CHECK ENGINE light and other simple lights) I've make work in a civic EJ1 1995! These simple alerts don't need the CAN or K-line Protocol!
But this specific version (after 2006) the S2000 has a ambient temperature, engine coolant temp and oil temp... This parameters are calculated by ECU in delta and the result is showing in the cluster (Oil life and ECT gauge).
The ECT gauge only moves by a k-line/CAN messages and not a simple analog signal or digital pulse signal (like the tachometer and VSS in this case are digital pulse). This digital pulses I create "analog to digital" conversion with arduino pro micro and work fine.
Back to ECT, I started my research with a MCP2515 shield and tying to conect to the cluster or "read" somenthing... and "don't work".
With more deeply google research I've found the information: Honda S2000 - 2007 year are K-line and not CAN... And... This moves-me to found you and some information...
In a S2000 Forum, I've found th information from a datalogger scanner called "racelog" (and this scanner can learn k-line and PIDs from ECU to use information in races logger etc...) - Engine Coolant Temp (ID = 300 byte 1), Ambient Temp (ID = 300 byte 2),
And my doubt are "how to create this message above to your code and library can be sended to the cluster...
With a L9637D + arduino Nano I'm create this board (in another image). I'll pretend test it
I strat from this code (completly clean still untouched):
nclude "Arduino.h"
// Be sure that the AltSoftSerial library is available, download it from http://www.pjrc.com/teensy/td_libs_AltSoftSerial.html"
#include "AltSoftSerial.h"
#include "OBD9141.h"
#define RX_PIN 2 // connect to transceiver Rx
#define TX_PIN 3 // connect to transceiver Tx
//#define EN_PIN 10 // pin will be set high (connect to EN pin of SN65HVDA100)
AltSoftSerial altSerial;
OBD9141 obd;
void setup(){
Serial.begin(9600);
altSerial.begin(10400);
delay(2000);
// pinMode(EN_PIN, OUTPUT);
// digitalWrite(EN_PIN, HIGH); // enable the transceiver IC.
obd.begin(altSerial, RX_PIN, TX_PIN);
}
void loop(){
Serial.println("Looping");
bool init_success = obd.init();
Serial.print("init_success:");
Serial.println(init_success);
// init_success = true;
// Uncomment this line if you use the simulator to force the init to be
// interpreted as successful. With an actual ECU; be sure that the init is
// succesful before trying to request PID's.
if (init_success){
bool res;
while(1){
res = obd.getCurrentPID(0x11, 1);
if (res){
altSerial.print("Result 0x11 (throttle): ");
altSerial.println(obd.readUint8());
}
res = obd.getCurrentPID(0x0C, 2);
if (res){
Serial.print("Result 0x0C (RPM): ");
Serial.println(obd.readUint16()/4);
}
res = obd.getCurrentPID(0x0D, 1);
if (res){
Serial.print("Result 0x0D (speed): ");
Serial.println(obd.readUint8());
}
Serial.println();
delay(200);
}
}
delay(3000);
}
This code makes sense to me by the 9600 baud to my computer can show me what are sended and a altserial can up the 10400baud to the kline...
but I need some simple at now... send the message "ID = 300 byte 1" in hex to test if the ECT gauge restpind...
The time to respond in gauge are not much important, the ECT rise slow and the information is not much precise in bars...
maybe I make this more clear now...
thank you again