Page 2 of 3
Re: mimicking a speed signal output from arduino
Posted: Mon Mar 18, 2024 5:32 pm
by modularfox
Thanks
@Tom
step one is complete - read canbus and store values.
I like that idea of just setting up an arduino to a set pulse and test the speedometer before making it complicated

Ill work on that this week and see how it goes.
thanks again,
Clint
Re: mimicking a speed signal output from arduino
Posted: Mon Mar 18, 2024 5:33 pm
by dr bob
Tom wrote: Sun Mar 17, 2024 9:37 pm
All very true. Seems like processing power and high level programming has replaced engineering elegance these days. Of course, in my case, it's just that I lack the engineering skills.

Oh, and harking back to our conversation about the $4 freeze over sensor, there's this:
IMG_0477.jpeg
No worries. I've been marketing elegant and comprehensive programming solutions to power engineering shortcomings for decades. Keeps the lights on. For millions actually.

But sometimes I get a little carried away, and remember a simpler time.
Re: mimicking a speed signal output from arduino
Posted: Mon Mar 18, 2024 6:12 pm
by Tom
modularfox wrote: Mon Mar 18, 2024 5:32 pm
Thanks @Tom
step one is complete - read canbus and store values.
I like that idea of just setting up an arduino to a set pulse and test the speedometer before making it complicated

Ill work on that this week and see how it goes.
thanks again,
Clint
Sounds good. That will be the whole ball game for you I think. Once you figure out how to create a pulse that drives the speedometer, and map the frequency to the MPH output (maybe my formula above, but too much speculation involved to assume that's the right formula). Once you get to that point, I've had good luck using a LM2940N voltage regulator, which I've yet to fry in a car. It requires a couple of capacitors, but well worth it. I found it after frying more than my share of 7805 regulators in cars.
https://www.ti.com/product/LM2940-N
Similarly, I use a CA3240EZ op amp as a voltage follower, to buffer the Arduino's output pins. I am a hack, not an engineer, so my approach might make an EE cringe, but they've worked well for me in a number of electronic car gizmos I've made over the years.

Re: mimicking a speed signal output from arduino
Posted: Tue Mar 19, 2024 2:28 pm
by Latitude48
I'm facing the same issue with a 968 trans I was planning to install in the 951. When I purchased the trans, I asked the seller to include the G16 Frequency Converter, 964 618 220 51, with the trans. In the 968 the speedometer gets its 8/rev signal from this converter. The converter, in turn, converts the signal from the ABS sensor to that used by the speedometer. Since you have a 1986 unfortunately you don't have ABS but if you had late offset control arms, hubs, etc. you could rig up an ABS sensor.
I need to get a copy of the 968-wiring diagram and see if I can figure this out as I know others have not had great success with the Lindsey pickup.
One way around this "fooling around" is to do other "fooling around" and fit a GPS speedometer

Re: mimicking a speed signal output from arduino
Posted: Tue Mar 19, 2024 2:52 pm
by Tom
Latitude48 wrote: Tue Mar 19, 2024 2:28 pm
I'm facing the same issue with a 968 trans I was planning to install in the 951. When I purchased the trans, I asked the seller to include the G16 Frequency Converter, 964 618 220 51, with the trans. In the 968 the speedometer gets its 8/rev signal from this converter. The converter, in turn, converts the signal from the ABS sensor to that used by the speedometer. Since you have a 1986 unfortunately you don't have ABS but if you had late offset control arms, hubs, etc. you could rig up an ABS sensor.
I need to get a copy of the 968-wiring diagram and see if I can figure this out as I know others have not had great success with the Lindsey pickup.
One way around this "fooling around" is to do other "fooling around" and fit a GPS speedometer
It sounds like that G16 part would produce the necessary pulse for your speedometer, no? I have all the building blocks to drive the factory speedometer with GPS data, since I already make the GPS exhaust controller (track nanny) and speedometer calibrator (Speedobooster). Only issue is that it takes a minute or two for the GPS receiver to get a fix, so the speedometer wouldn't work for the first mile or two. Maybe a more sophisticated GPS receiver could fix that, not sure.
Re: mimicking a speed signal output from arduino
Posted: Tue Mar 19, 2024 6:38 pm
by modularfox
@Tom I did a spreadsheet with the formula... that's how I tend to plan some projects and I used the math you laid out I have some setpoints to try (setpoints = mph). The inverted 1/1.111 .. yeah, I would have never came to that conclusion.. I'm going to research more on timing interrupts (may not need it? , but more knowledge is good to have), but I used the blink without delay sketch and adjusted it for the 4000 pulse per mile set to 30 mph with the formula ... I keep forgetting my 12v dewalt tool battery at work. I use it with a 3D printed adapter to power small projects like this

[media]
http://87chevy.com/wiper_module_project ... y_demo.mp4[/media]
is the battery and the dewalt battery adapter that works and has this satisfying click like feel when sliding it on the battery pack
in the blink sketch, I changed the interval to
Code: Select all
const long interval = 30.00003; // interval at which to blink (milliseconds) speedo is 30mph
and need to change the output from LED_BUILTIN to an output pin
now I just need to bring the battery home, wire it up and upload sketch.
thanks again!
clint
Re: mimicking a speed signal output from arduino
Posted: Tue Mar 19, 2024 7:27 pm
by Tom
If you are doing other tasks with the Arduino, then a simple loop may bog you down. Timing interrupts or PWM with custom parameters would free up the processor, but will need lots of brain processing.

I'm not sure how the pulse per mile signal looks, but suspect it is a square signal -- meaning you will need to switch it on and then off at even intervals to create the desired frequency. In other words, to get 4000 pulses, you may need to cut the frequency interval in half and toggle the output on for half the cycle and then off for the other half. If so, your 30ms might need to be 15ms, where you turn it on, wait 15ms, then turn it off, wait 15ms, then turn it one, etc. Just depends on what 4000 pulses per mile really means. The Dewalt battery pack is cool. You seem to be sufficiently hacker-oriented to get yourself a variable voltage supply. They are great because you can just dial in whatever voltage you need for any giving task... And they are dirt cheap these days on Amazon, like this:
https://www.amazon.com/NICE-POWER-Varia ... r=8-4&th=1
Re: mimicking a speed signal output from arduino
Posted: Tue Mar 19, 2024 9:49 pm
by j1nx3d
Tom wrote: Tue Mar 19, 2024 2:52 pm
Latitude48 wrote: Tue Mar 19, 2024 2:28 pm
I'm facing the same issue with a 968 trans I was planning to install in the 951. When I purchased the trans, I asked the seller to include the G16 Frequency Converter, 964 618 220 51, with the trans. In the 968 the speedometer gets its 8/rev signal from this converter. The converter, in turn, converts the signal from the ABS sensor to that used by the speedometer. Since you have a 1986 unfortunately you don't have ABS but if you had late offset control arms, hubs, etc. you could rig up an ABS sensor.
I need to get a copy of the 968-wiring diagram and see if I can figure this out as I know others have not had great success with the Lindsey pickup.
One way around this "fooling around" is to do other "fooling around" and fit a GPS speedometer
It sounds like that G16 part would produce the necessary pulse for your speedometer, no? I have all the building blocks to drive the factory speedometer with GPS data, since I already make the GPS exhaust controller (track nanny) and speedometer calibrator (Speedobooster). Only issue is that it takes a minute or two for the GPS receiver to get a fix, so the speedometer wouldn't work for the first mile or two. Maybe a more sophisticated GPS receiver could fix that, not sure.
Thanks for this guys, I don't want to get this thread too off track with my stuff. I don't have the G16 control unit so I'll track one down. I have 968 control arms, rear trailing arms, suspension, hubs, etc, but I didn't swap over the ABS so I'll look into getting the sensors too.
My G16 in my fusebox is conveniently empty so maybe I can try and make it look stock. I know for US /CAN cars you have a warning chime for the doors, lights, etc, in G16. It looks like other markets didn't get this from what I've read. My '86 944 and a friends '91 944S2 don't have it anyway.
Re: mimicking a speed signal output from arduino
Posted: Fri Mar 22, 2024 3:53 pm
by 944er
So I've never used an Arduino, but I looked up what processor an original nano has in it. The Microchip processor used has PWM/Timer modules in it which would be ideal for generating the pulses. In this case, you would set up the PWM to be 50%, and use the timer value to control the pulse generation in a frequency generator mode. Then, it's a matter of getting the speed from the CANBUS, and calculating the value to shove into the timer register. Whenever the speed changes, update the timer. It would appear that it is easier to just let the hardware do the work.
Re: mimicking a speed signal output from arduino
Posted: Fri Mar 22, 2024 6:29 pm
by Tom
944er wrote: Fri Mar 22, 2024 3:53 pm
So I've never used an Arduino, but I looked up what processor an original nano has in it. The Microchip processor used has PWM/Timer modules in it which would be ideal for generating the pulses. In this case, you would set up the PWM to be 50%, and use the timer value to control the pulse generation in a frequency generator mode. Then, it's a matter of getting the speed from the CANBUS, and calculating the value to shove into the timer register. Whenever the speed changes, update the timer. It would appear that it is easier to just let the hardware do the work.
I looked at that early on. You need to write directly to the timer registers to change the frequency. It's been a while, but if I recall, the timers can't set the frequency low enough to drive the speedometer at low speeds. Googling just now, it looks like the PWM timer can be set to a minimum of 30.5hz, which equates to around 18mph if I'm doing the math right. I imagine a better programmer who knows the hardware better could figure something out, but I ended up punting on PWM and going with brute force processing.
