# Speed LCD DISPLAY

Hi,

I am very new to Arduino, I just received my ARDUINO Starter Kit.

I am planning to create a speed LCD display to display the speed of RC cars on my 1/24 Circuit ( Mini Z if some of you knows).

I do have a 3 meters straight line, i was thinking the best would be to put two lights detectors in the center, 1 meter between each of them.

I don't know if what is provided in the Arduino starter kit would helps.

If some of you could give me a hint on a how to program it.

Thanks,

David

There is more than one "Arduino Starter Kit" out there, so which one do you have? Or rather, if you can not see or read from your content list if you have two lighsensors, then your problem is first to learn (google, wikipedia) what lightsensors you do have (or order two from any of the hobby/arduino shops)

Assuming that is not a problem, you're doing fine: Keep reading the lightsensor one until it is blocked, store the millis() value in a variable and start polling the 2nd sensor until it blocks, subtract the noted millis() value from the current and print the value ( distance/milisdiff to get it as a speed)

Thanks

I bought 2 infrared 950nm emettor and reçeptor to make infrared barriers

They are 10 degrees angle, but i hope it will work with a 60cm gap between emetor and receptor

Could you please help me with the coding lines ?

The first exercise is to verify that your programming enviroment is working. Start the IDE, read in the example Blink sketch, modify it so the LED blinks in a heart rythm - short on, short off, slightly longer on, long off.

The second is to verify that your sensor hookup is good. You probably need a resistor in series with the emitter, to limit the current. I do not know exactly what kind of sensor you have, but probably you put a resistor between sensor and 5V and the other sensor leg to ground. Check polarity. The joint beween the resistor and sensor goes to an analog input. Load the example AnalogInOutSerial and thus you can read the sensors reaction in various positions and cars blocking.

You may find that you can hook it to a digital input pin instead, it depends on the sensor and your choice of the resistor. In which case your loop simply copies the read value to the LED value.

Lastly - the actual problem. I outlined the general program in previous post. Here I just give the central piece - you need to fill in setup and some other stuff - pretty printout, choose pin, trigger values (if not using digitalRead) and you may need to change < to > depending if the values is high or low when the beam is clear. The TrackLength should be a float. You choice of units determines if the result is cm/s or km/hour

while ( analogRead(StartSensor) < TriggerValue )
/* code waits here until 1st beam is interrupted */ ;
StartTime = millis() ;
while ( analogRead(EndSensor) < TriggerValue )
/* code waits here until 2nd beam is interrupted*/ ;
EndTime = millis() ;
Serial.println(TrackLength/(EndTime-StartTime));

This is very simple code. You need to chage the Serial.print to use the LCD - but first get this bit to work, then get the LCD. This way if the LCD shows “wrong” you know it is not the measurement if that showed right. Build your devices in steps, and get each step working.

Hi

Thanks for your help

I bought two IR emetors and two IR receptors ( 940nm)

the emetor is a LED with 2 legs - Uf = 1.3V ; If = 100mA the receptor has 3 legs - U = 2.5 to 5,5V

I don't know how to plug everything and which resistance i should use, can some one help me

The diode emittor is simple, in the sense there are a number of webpages with "diode resistor calculator". Otherwise a simple knowledge of Ohms law (and Kirchhoff to be pendandic) you can work it out with one subtraction and one division. You know your voltage drop (1.3) and you know the current you want given the 5V supply (100mA - seems a bit high to me, half will probably work too). Wiring wise it is a simple : 5V - Resistor - Emitter anode(+) /cathode(-) - Ground. Yes, it does matter which way round you connect the LED.

The receptor is a bit trickier. 3 legs implies something more than a simple photodiode/transistor, but rather some intelligence. The legs being supply (which can be anything from 2.5 to 5.5 V), ground and "data". No clue if "data" is a simple analog value or something more complex. Link to the specs you have quoted from, so we can identify which leg does what. Or it could just be the packaging has a redundant leg.

It is this kind of component : http://www.vishay.com/docs/82459/tsop48.pdf

It seems that a more simple 2 pins ir receiver would be easier ( and it s cheap)

Ah, well, as you notice my anwers change as you reveal more of what you ACTUALLY have. Much of the earlier wiring suggestions are not applicable.

That receiver will look for a MODULATED IR signal. So you must either have a special matching package that makes the emmitor IR LED blink at 38Khz (or whatever frequency your particular detector uses) or you must make a circuit that does it. http://electrosome.com/ir-transmitter-receiver-led-tsop1738/ Google around for more.

Otherwise my experience with these modulated IR bems is great! Much more reliable than a simple LED - photodetector, unaffected by ambient light and other disturbances; very suitable for this application. Well worth the money. The simple method is acceptable inside a machine where it is dark.

The programming remains the same, by the way.

dilncoly: They are 10 degrees angle, but i hope it will work with a 60cm gap between emetor and receptor

I am kind of hoping you meant 60*mm*.

No i am really looking for 60cm, it is nothing extraordinary as any remote control for television can do so

I am really a newbie in electronic, i have been trying with photodiodes and i don't even understand