Collecting Steering wheel angle in real time

I am planning to buy M2 to collect some real time driving data (e.g., speed, acceleration, steering wheel angle, brake angles, and so on) using Honda Civic 2012.

I am confused which devise I should buy. Is it M2 (under the hood) or M2 (under the dash)? Also is there any example code I can look into initially before getting the devise?

Thanks,
Albal13

All of that should be available on the OBDII port so you could probably use that version. The under the hood version is more versatile but it also requires you to know a lot more about the car in order to hook it up. Some of the data you want is available over OBDII PID codes so you can start with https://github.com/macchina/ArduinoDUE_OBD_FreeRunningCAN

Thanks for the reply. Actually, I mostly want to get real time driving data on steering wheel angel and acceleration.

I am not sure if OBD II port includes steering wheel angel. From the OBD II port description (https://en.wikipedia.org/wiki/OBD-II_PIDs), I cannot find any ID dedicated for steering wheel angel. Please correct me if I am wrong.

Can you give me more suggestions or resources to check?

Thanks,
Albal13

The trouble is you’d have to try it and see. Quite often the OBDII port in a car does not just have OBDII traffic on it. Usually they just drop one of the CAN channels from the ECU to the OBDII port (sometimes two or three CAN channels even) and call it good. The ECU responds to OBDII traffic on that CAN bus so it works for the intended purpose of allowing OBDII but also has a lot of extra goodies on it. You won’t know what you’ll find there unless you try it yourself or get captures from someone else who has done it. I have a Buick Enclave that I took captures from. I also have captures from two Nissan Leafs, a few Tesla Model S’s, and a Smart car. If you have something else then either you have to try it and see or see if anyone on this forum might have the same basic type of car and could grab a capture for you. You might also see if https://github.com/commaai/opendbc has your vehicle type listed. That’s another good source for car parameters found on CAN. But, quite often you have to try it yourself. So, I can’t tell you that OBDII will work for you or not. Maybe you’re best off getting the under the hood version. That way you can hook it up a variety of ways if need be.

Thank you again. My Car is Honda Civic 2012. The link includes Honda Civic 2016.

Maybe, I can go for the ‘under the hood’. Fingers crossed! Literally, I have zero background on these types of stuffs. I will highly appreciate if you can also point out some ‘Hello world’ programs to start with.

Thanks,

Hi @CollinK , I am currently trying to get steering wheel rotation from a Nissan Leaf - would you be willing to share the information you have collected with me?

@albal13 - Have you had any success getting the real-time steering angle so far?

I didn’t obtain this info but there exists a large list of decoded CAN frames for the Leaf.

I can’t promise it’s all 100% accurate. It’s just the best I’ve got.

Thanks, if this is accurate it’s exactly what I need.
Do you have any idea which generation of LEAF this was taken from?

Also, am I right to think that the throttle position on the LEAF is accessible from the standard PID, mentioned here (https://en.wikipedia.org/wiki/OBD-II_PIDs)?

Sorry if this is a basic thing, it’s just that I am very new to this.

Thanks,
Atanas

Well, they started their work on decoding back in 2011 so I’d imagine the range of vehicles covered is likely 2011-2014 or so. I have no idea if Nissan might have changed anything after that. But, it’s worth a try.

I’m not sure what info the Leaf supports over standard OBDII PID requests. The standard was meant for emissions testing of gasoline cars so electric cars kind of just support whatever they feel like. On this forum I posted an OBDII scanner sketch that will connect to a car and ask what it supports. You can run that and see if throttle position is one of the supported PID codes. I’m not able to test my leaf right at the moment. Maybe I can try it out later tonight. I have a 2013 model.

I am currently working on an installation where I want to use the LEAF as a video game controller, unfortunately I won’t have access to an actual car for some time, so if you could test a real vehicle for the steering angle and throttle position PID’s - that would be awesome.

Yes, I have collected the steering wheel angle and steering wheel momentum data. I have used the M2RET and SavvyCAN to identify the Identifiers for these two events. You need to try by yourself. I can share the IDs found for the Honda Civic 2011.

Thank you for the info on the reverse engineering approach, I’ll wait to see if @CollinK can confirm the ID’s of the steering and throttle on his LEAF, then try to do a test on a dealership car to see if they are the same for my generation of LEAF.