Using a TFT screen to read speed from a laser chrono

Hi.
New at this but getting there.

Timing a school project - my CO2 powered car (like this www.pitsco.com/Technology/Dragsters )

I have written a code (well…copied and edited) that will measure a drop in reading on a LDR from a laser as my dragster moves through the beam, starts a timer and then stops time when a second laser is crossed 100mm away.
The code calculates the speed (average) over the 100mm.
I am using 2 analog inputs for the LDRs to read from. Works well using the Print Monitor.

I would like to place this onto a track and have a tft screen print out the speed.

I have purchased the following equipment:
2.4inch TFT
3.5inch TFT

Both fit straight onto the Uno without any wiring. Only problem is there is only 1 analogue channel left when the TFT shield is on. Can I use one of the TFT pins for my 2nd LDR input?

I have also purchased the Uno, mega and due. Hoping one of these will work (hopefully the Uno with the 3.5tft screen as preference)

I have been looking at writing code to make a simple 2 line read out - “Dragster Speed is… XXX KPH”.

I would appreciate any help as the tutorials and help guides on these TFT’s is confusing. I am a going crazy! They are very complicated and I want something simple.

I would be happy to donate $20 to your chose charity / arduino organisation if you can help. (I will place a screenshot of receipt). I have already spent too many nights stressing while looking for code to use -simple for some but impossible for me.

Current code (which prints to a serial monitor currently) below. Would love to know how to make this print out on a 2.4 or 3.5 inch screen.

I have attached pictures of my ‘basic’ set up.

int firstsens = 4;
int secondsens = 5;
unsigned long time, time2;
float kph, elap;
int val;
int val2;

void setup()
{
Serial.begin(9600);
pinMode (firstsens, INPUT);
pinMode (secondsens, INPUT);
}
void loop()

{
Serial.println(“Waiting for Co2 car to launch…”);
val = analogRead(firstsens);
val2 = analogRead(secondsens);
while (val > 200)
{
val = analogRead(firstsens);
}

while (val <= 200)
{
time = micros();
val = analogRead(firstsens);
}

while (val2 > 200)
{
val2 = analogRead(secondsens);
}

while (val2 <= 200)
{
time2 = micros();
val2 = analogRead(secondsens);
}
elap = time2 - time;

kph = (elap*1000)6060;
Serial.print(kph );
Serial.println (" kph");
}

image000001.jpg

image000002.jpg

Using a TFT screen to read speed from a laser chrono

Do you REALLY think you can do that? Displaying the speed on a TFT that the Arduino computed is a different story.

val = analogRead(firstsens);
val2 = analogRead(secondsens);
while (val > 200)
{
  val = analogRead(firstsens);
}

If you are going to wait for the analog reading from the first sensor to exceed some value, what was the point in reading the other one?

while (val <= 200)
{
time = micros();
val = analogRead(firstsens);
}

Why are you then waiting for the reading to drop?

I started to say that you have everything but the kitchen sink in the first picture, but wait, you do have a kitchen sink in the picture.

What kind of receiver are you using? An analog sensor is far to slow for what you are trying to measure.

Thanks for getting back to me so fast!

Yeah, kitchen sink. Getting desperate. Trying it all.

I have 5v laser that aims directly at a LDR. Reading is over 900 but when a car goes through and breaks the beam the sensor value drops to 100 (ish).

Is the LDR is an analogue receiver??? Could I use a faster one (digital??? and what type of digital thingy?)

Code works so far. I modified it from a youtube paint ball chrono video. He used infra-red lcd and receiver. My gap is larger than the 20mm he used, so I swapped in a laser and LDR.

Am I on the right track or should I try another method??????

Is the LDR is an analogue receiver?

Yes, a light-dependent resistor is an analog device.

Could I use a faster one

Yes, there are phototransistors that are orders of magnitude faster.

Am I on the right track

I don't think so.

ok.
I have Photo transistors and Infra-red LED’s.
Will they work across a 200mm gap?

Any tips on getting the time to print out on a 3.5 inch TFT? or should I stick to a 2 LCD display.

well,

PaulS - your response "I don't thinks so we neither helpful or useful". I comprehend that it's not always possible for the experts to assist, I understand when you are stepping beyond your limit. Next time a "sorry mate, can't help you" would have been more useful and honest.

So....

I got this thing working. Spits out the time onto a TFT 3.5 inch screen. Using 2x lasers and 2x LDR's.

I will upload a photo / video in the next 24 hours.

3 photos

  1. before car goes through lazers
  2. while car is in the lazer timing zone
  3. speed print out.

Guess i do have an Idea PaulS.
Thanks for helping.