How to do custom scaling for analog inputs?

All sensor specific discussions! Temperature, pressure, steering angle, brake and throttle, etc. Post adaptations of OEM-style sensors, and also your clever DIY hacks and custom designs here too!

Moderators: JeffC, rdoherty, stieg

Post Reply
GTIspirit
Posts: 249
Joined: Wed Jan 09, 2013 11:20 am
Location: SE Michigan

How to do custom scaling for analog inputs?

Post by GTIspirit »

How exactly are the raw values converted to voltage so the voltage can be converted to physical units?
Image
Since the analog inputs are 0-5V, is 0d (raw) =0V and 1023d=5V?

For example, if I wanted to log the wideband O2 sensor signal from an Innovate Motorsports LC1 where 0V=7.35AFR and 5V=22.39AFR I would configure 0 raw =7.35AFR and 1023 raw = 22.39AFR? And must monotony be observed, or could I put 0d=7.35AFR in slot 1 and 1023d=22.35AFR in slot 2 and then 1023d=22.35AFR in slots 3, 4, and 5? Or do I manually need to interpolate the points so that 0d=7.35AFR in position 1 and 1023d=22.35AFR in slot 5 with a straight line between them?

dimondjack
Posts: 101
Joined: Tue Jan 15, 2013 1:37 pm

Post by dimondjack »

You are right about 0V = 0 Raw and 5v being 1023 raw. I would imagine that you can put the value for 1023 in slot 2 (and then repeat values in the other slots, but I can't say for sure.

brentp
Site Admin
Posts: 6275
Joined: Wed Jan 24, 2007 6:36 am

Post by brentp »

If you had a straight linear scaling you could do a 2-point map as described previously with the first value in Bin #1 and the 2nd value in bin #2, and ignore the remaining bins. The additional bins just allow for more resolution and flexibility for a non-linear curve.
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

Alex W
Posts: 41
Joined: Tue Apr 16, 2013 5:57 pm
Location: Bozeman, MT

Re: How to do custom scaling for analog inputs?

Post by Alex W »

GTIspirit wrote:could I put 0d=7.35AFR in slot 1 and 1023d=22.35AFR in slot 2 and then 1023d=22.35AFR in slots 3, 4, and 5?
This is roughly how I configured my TPS, and it works fine. In my case, .33 volts is 0 TPS, and 3.33v is 100%, so I set it as such using the first two colums and set the rest to 4v, 5v, and 5v, all at 100%. Works great.

Post Reply