S2000 Electronics Information and discussion related to S2000 electronics such as ICE, GPS, and alarms.

My Arduino based datalogging project

Thread Tools
 
Old Apr 28, 2021 | 08:12 AM
  #21  
_valtsu_'s Avatar
Thread Starter
5 Year Member
Liked
Loved
 
Joined: Nov 2016
Posts: 192
Likes: 22
From: Finland
Default

Ok. You got it quite messy. There are lot of lines what are not needed on your project.
Are all three sensors same Bosch temperature sensors what I used on my project?

I used this example for thermistor readings:
https://learn.adafruit.com/thermisto...g-a-thermistor
Might help understanding how it works.
Reply
Old Apr 28, 2021 | 08:22 AM
  #22  
Jomppe Nurmi's Avatar
Registered User
 
Joined: Apr 2021
Posts: 5
Likes: 0
Default

Originally Posted by _valtsu_
Ok. You got it quite messy. There are lot of lines what are not needed on your project.
Are all three sensors same Bosch temperature sensors what I used on my project?

I used this example for thermistor readings:
https://learn.adafruit.com/thermisto...g-a-thermistor
Might help understanding how it works.
Yes. All three sensors is the same that you used. Can you tell me what i need to change in the code?
Reply
Old Apr 28, 2021 | 09:51 AM
  #23  
_valtsu_'s Avatar
Thread Starter
5 Year Member
Liked
Loved
 
Joined: Nov 2016
Posts: 192
Likes: 22
From: Finland
Default

What you mean by this line: "float Ryla = 1055; // Pull up resistor value for analog input 1 (oil temperature)1191ohm vastaa 1055 arvoa" ?

I would suggest you to start from the beginning and copy the lines you really need on your project. First try go get all sensors to read correctly and print them to serial monitor on Arduino IDE.
After you get them work, then move to lcd.

From my code loop section this is all you can use in your project:
// Averaging thermistor measurement for better readings
uint8_t i;
float average;
// take 5 samples in a row, with a slight delay
for (i = 0; i < NUMSAMPLES; i++) {
samples = analogRead(1);
delay(10);
}

// average all the samples out
average = 0;
for (i = 0; i < NUMSAMPLES; i++) {
average += samples;
}
average /= NUMSAMPLES;

// Calculate temperature
R2 = R1 / (1023.0 / (float)average - 1.0);
logR2 = log(R2);
T = (1.0 / (A + B * logR2 + C * logR2 * logR2 * logR2));
Temp = T - 273.15;
}

You can use just simple delay function on loop to control update rate. With Racechrono update rate accuracy was quite crucial , but not on your project.
Reply
Old Apr 28, 2021 | 11:31 AM
  #24  
Jomppe Nurmi's Avatar
Registered User
 
Joined: Apr 2021
Posts: 5
Likes: 0
Default

Hi.
The float Ryla is coped from the copied code
"float R1=1000 //means the resistor 1000ohms.
I have 1200ohm resistor and i calculated the sensor in water and and it shows exactly right if i change the R1 to 1055. If it is like the 1200ohm resistor" R1=1200" so it shows in the serial monitor allways about 4 degrees to high temperature. Did you get it now?
Its littlebit messy because im a beginner and did not get anymore solutions to get it correctly showing right temperature.

I think that line is littlebit cheated because there is not coming full 5V?

But i get the code very goof with one sensor in the code but the problem is coming with 2 or more sensors.
Reply
Old Apr 28, 2021 | 11:14 PM
  #25  
_valtsu_'s Avatar
Thread Starter
5 Year Member
Liked
Loved
 
Joined: Nov 2016
Posts: 192
Likes: 22
From: Finland
Default

Ok. The 1055 value just seemed strange. I get it now!

Try this: https://filedn.com/lKOo3aQn9ubHtKC7D...nsorilleV2.ino

I didn't find any obvious wrong on the code. Just did a bit of cleening, I disabled all the lcd related lines, because I tested in on Tinkercad simulator. It worked on the simulator.
You could have some kind of wiring issue.
Reply
Old Jun 19, 2021 | 05:24 AM
  #26  
whitedxi's Avatar
10 Year Member
Liked
 
Joined: Feb 2012
Posts: 209
Likes: 10
Default

Are you also looking into reading serial data from the aem ecu's? Was thinking of using this data through an arduino mega and displaying using a nextion screen
Reply
Old Jun 20, 2021 | 05:39 PM
  #27  
_valtsu_'s Avatar
Thread Starter
5 Year Member
Liked
Loved
 
Joined: Nov 2016
Posts: 192
Likes: 22
From: Finland
Default

Hi! I don't have AEM Ecu, so no I haven't. But it should be totally doable if you find the information how to read serial stream with an Arduino.
Reply
Old Oct 30, 2021 | 08:41 AM
  #28  
whitedxi's Avatar
10 Year Member
Liked
 
Joined: Feb 2012
Posts: 209
Likes: 10
Default

Originally Posted by _valtsu_
Hi! I don't have AEM Ecu, so no I haven't. But it should be totally doable if you find the information how to read serial stream with an Arduino.
Well really little help by AEM or gauge art.. info should be out there but can't find any yet on the web.
Just one YouTube vid but poster isn't replying
Reply
Old Apr 20, 2024 | 06:55 AM
  #29  
whitedxi's Avatar
10 Year Member
Liked
 
Joined: Feb 2012
Posts: 209
Likes: 10
Default

Originally Posted by whitedxi
Well really little help by AEM or gauge art.. info should be out there but can't find any yet on the web.
Just one YouTube vid but poster isn't replying
Have it running see vid. Took a lot longer..



Reply
Old Mar 28, 2025 | 02:15 PM
  #30  
whitedxi's Avatar
10 Year Member
Liked
 
Joined: Feb 2012
Posts: 209
Likes: 10
Default


Reply



All times are GMT -8. The time now is 09:39 AM.