Hi guys, I started out with Arduino about a month ago. And gosh, I ain't as bright as I thought :-[ If I'm saying anything that doesn't make sense, just fire away and correct me please.
A little background. I love everything that shoots, archery in particular. BBall, airsoft, pistol, potato gun, you name it. I want to improve my archery form and power, so I started looking into building myself a chronograph with Arduino. I read many articles in this forum as well as AVR, and I came across this from Nuts & Volts build a ballistic chronograph
I managed to build a single screen's circuit on the several breadboards in figure-1.jpg
I was hoping to connect the "PulseX" that's on the comparator "U1C" to Pin 2 on UNO to see what kind of reading I get. Here's the catch. I read up the spec of the 78L05 voltage regulator. It requires mininum of 7.5V input for a 5V output. So I powered my breadboard with the photodiodes and the op amp directly with a 9V battery. And I connected "PulseX" to UNO Pin 2. When I use the DigitalReadSerial sketch example, I see a long string of 0, then a long string of 1.
My problem is, quoting from the article:
The momentary decrease in reverse current develops a change in voltage across R10. This change in voltage is very small (approximately 12 mV), so the op-amps U1A and U1B (LM224) amplify it and feed it to the comparator U1C, producing a TTL level trigger pulse which is sent to the uC for timing purposes.
Am I doing it right to simply use digitalRead(2) to read the signal? Then why am I getting 0 and 1 (Low and High if I'm correct) when nothing goes between the IRs and the PDs?
Any suggestion will be much appreciated. While I'm waiting, I'll keep pulling my hair out.
What should happen is that you read 0's until something goes in front of the photo diode and the it should read 1. And then go back to 0 when the something is removed.
@Mark
I thought the same, too. But it turns out that ain't the case. But on the flip side, I assume I'm right using digitalRead(pulseX) to read the said TTL Signal?
The only way I can get a constant 0 in the Serial Monitor is when I place the IRs so close to the PDs that nothing can possibly fly through. When I do this, the multimeter reads 0.00V on the PulseX lead. As I move the IRs further away from the PDs, I get 1.45V max on the multimeter, but the Serial Monitor will read 0000000111111 and so on.
Grumpy_Mike:
So that means the circuit is actually working, it is just that you don't have enough gain in you amplifiers.
@Mike
phew!! So I don't have to take everything apart and build it again. Could you tell me whether it is the gain at U1C the comparator, or the U1A and U1B the amplifiers that falls short? Or could you give me pointer what I shall be looking at Op-amp Varieties please?
I would look at the ratio of R12 to R5, that is only giving you a gain of 10, the R8 to R9 is giving you a gain of 100, so the two combined give you a gain of 1000. So I would lower R8 and also make R10 much higher, something like 470K.
holmes4:
No you must use the voltage reg! Or you could use the 5v from the Arduino.
Mark
@Mark
My bad, I didn't put it clearly. Yes, I'm using the Voltage Reg. The 9V batt Pos goes into 78L05's In, what comes out of 78L05's Out (4.95V) powers the rest of the breadboard.
I'm gonna tidy up the breadboard and upload a photo for a record. Guess this will be easier for everyone.
Grumpy_Mike:
I would look at the ratio of R12 to R5, that is only giving you a gain of 10, the R8 to R9 is giving you a gain of 100, so the two combined give you a gain of 1000. So I would lower R8 and also make R10 much higher, something like 470K.
@Mike
Thanks for the pointer. Let me try out your approach while cleaning up the wiring on the breadboard for a photo op. I'll post the result here.
You do know that you will only get a pulse out when something breaks the beam. Once something breaks the beam and continues to break it it will be like nothing is breaking the beam.
Why are there so many IR diodes in parallel? That could cut down the signal you get by rapidly transferring the charge to the other diodes.
If you are getting a random of zero and one pulses it suggests your input is floating. Check the common ground connection back to the arduino.
@Mike
Really thankful for going into more depth with me.
Grumpy_Mike:
You do know that you will only get a pulse out when something breaks the beam. Once something breaks the beam and continues to break it it will be like nothing is breaking the beam.
Does it mean that this generated pulse is not simply 0 and 1, but a change of state?
Like "Init" > state "0" > shoot > breaks first beam > state changes to "1" > starts counting ...
So now the state of first beam is constantly at "1", until I shoot again and the state changes to "0"
Do I get it right?
Why are there so many IR diodes in parallel? That could cut down the signal you get by rapidly transferring the charge to the other diodes.
I guess the author wanted to cover a plain area of 8 by 8 inches window. I'm following all instructions to the letter because I believe that's how I can learn based on a working example. Once everything works, then I can start my own modification. In fact, it did drives me to dig deeper just by building the first screen. Function properly or not, that's another story
If you are getting a random of zero and one pulses it suggests your input is floating. Check the common ground connection back to the arduino.
The attached photo is how I connected the breadboards to the UNO. PulseX to Pin2 in Orange cable, and Ground to GND in Green cable. Am I doing it right?
Yes you did not make that clear at the start.
How fast do you recon that this pulse is going to be?
The pulse width is determined by the time the IR is obscured and also the resistor / capacitor values used in the amplifier coupling. You will get out the shortest pulse time of those two. Are you trying to measure that pulse time?
I'm following all instructions to the letter
Looks like you are following some one who does not know what they are doing.