Hi new poster i dont know if this is the right place to post this.
I am trying to finish up this project. I got the code from a guy a while back but i dont fully understand it and i am looking to change a few things on it.
If anyone can help please do.
This is what is going on.
i want to re scale this for my 2.4 bar sensor vs his 2.5 bar sensor.
i would like for it to display only whole numbers. No decimal
if anyone has a full break down of the code please let me know. I understand most but i am getting lost here and there.
rawval = analogRead(0); // Read MAP sensor raw value on analog port 0
I believe this code is for reading the raw voltage of the sensor.
next is
barboost = (((rawval * 0.19) - 69.45) + 10); // Calculate boost value for the graph
This is the bar graph code. all i know is changing the +10 will change where the graph starts at 0 other then that i dont know what the "* 0.19) - 69.45)" part is. All i can say is math.
display.println(((boostmbar * 0.001) - 0.865)*14); // calibrated for a 2.5 bar sensor in Denver (+/- 1psi)
This code seems to be the one i am looking for.
It would seem to take the input voltage and do some math and output the display numbers.
The creator (which i can no longer get in touch with) says that changing the 0.865 was an offset to calibrate for sea level.
This is different from overall scaling of the sensor. So i am not sure which numbers need to be changed.
Any help anyone can give would be great. please and thank you.
original code attached.
Please read the leading topics, like "How to use this Forum", "How to attach code" etc.
I can't download Your code into my equipment, so no help this faar.
It looks like the author of your code is in Denver and has removed atmospheric pressure from the measurement to get the amount of boost. You'll need to replace this with your ambient pressure based on your altitude.
I would have thought that it might be better to start the arduino before the engine and then you can just measure what the atmospheric pressure is that day.
Either way, get that number into a const or variable - having the same literal number scattered around the code is asking for trouble - when you change it, one inevitably gets overlooked.
Yes, I would start by checking the voltage as various levels of boost. You need to be sure that your Arduino can handle it. Also it will be useful to figure out how to map voltage to psi.