r00li / CarCluster

Control car instrument clusters from your computer for gaming or other purposes using ESP32
GNU General Public License v3.0
67 stars 20 forks source link

Roomster cluster speed #24

Open kerrcz opened 2 weeks ago

kerrcz commented 2 weeks ago

I have kinda working roomster cluster. RPM and indicators work but thats all i cant get working anything else any ideas to make atleast speed work?

kerrcz commented 2 weeks ago

i have the wiring (in czech) i have rn just pin 8 and 7. i tried adding to that 5and 6 and the whol ecluster didnt do anything. it was on but i didnt react at all obrázek_2024-11-10_144106128

r00li commented 2 weeks ago

Hmmm, looking at the pinout - speed signal input is pin 6. That makes it sound like the speed isn't actually provided through CAN, but is instead done via a pin. That would explain some things. Also, I see some other stuff that should be on CAN apparently isn't.

If speed is really by pin, then usually that is done as pulses. The higher the pulse frequency, the higher the speed.

kerrcz commented 2 weeks ago

could i somehow simulate that with esp32?

kerrcz commented 2 weeks ago

also that would explain why when i tried plugging in the speed into canbus the speed was jumping all around the place

r00li commented 2 weeks ago

could i somehow simulate that with esp32?

Yeah, it shouldn't be that hard. I think you should be able to do it with standard arduino PWM. Increasing the frequency will probably increase the speed. Start with something like 1Hz and go higher.

kerrcz commented 2 weeks ago

and could it be possible to make it work with your code?

r00li commented 2 weeks ago

Yes, it should. But you will of course need to do some modifications.

kerrcz commented 2 weeks ago

if you hade some free time could you please make those modifications? since i really dont know how to code

r00li commented 2 weeks ago

Definitely not. Especially because you need the cluster there to actually check what is happening. The PWM stuff should be quite trivial - just search google for "ESP32 arduino PWM" and you will find some tutorials. But you will need to know some arduino basics first.

kerrcz commented 2 weeks ago

it needs two pins so one that sends and ground or?

r00li commented 2 weeks ago

I think the input is for the cluster to show stuff, output is for some other devices in the car that also need that information. So you would only need 1 pin.

kerrcz commented 2 weeks ago

could you atleast try to write some really basic code for arduino nano so that i can try it? and then i would try to continue by myself

r00li commented 2 weeks ago

Well on an arduino Nano you can just try with tone first: https://docs.arduino.cc/language-reference/en/functions/advanced-io/tone/

just write tone(PIN, FREQUENCY);. Obviously replace PIN with your PIN and FREQUENCY with the frequency that you want. As I said start with 1 and then increase it to 10, 100 and see what happens.

kerrcz commented 2 weeks ago

i tried this and it didnt do anything https://docs.arduino.cc/tutorials/generic/secrets-of-arduino-pwm/