Hello everybody,
let me introduce myself: my name is Antonio and I live in the UK, I work in the audiovisual industry.
I would like create a sync tester. Basically I would like to show a clip on a screen, with a white flash coming in in sync with a "beep" and have Arduino assess whether those two things are in sync or not, and possibly give me the amount of ms of delay.
I am thinking of using a mike and a photodiode. I guess I need to create a simple amplification circuit to adapt the tool to different scenarios, and then ask Arduino to read the input of some ports, apply a timestamp to it, and do the math!
I am a beginner with Arduino. I just have the board! It would be nice if some of you could give me some directions and, possibly, let me know if this is doable or not!
Thanks in advance for your time!
Tony
Sounds like perfectly possible, if you check the reference section there are several sketches that do partly what you need. Spending some time there will learn alot about the possibilities.
Do you know if one allways comes first?
some code t get started, assuming both signals come in via analog port.
unsigned long t1 = 0;
unsigned long t2 = 0;
void setup()
{
Serial.begin(115200);
Serial.println("time meter 0.1");
}
void loop()
{
if (t1 == 0)
{
if (analogRead(A0) > THRESHOLD1) t1 = micros();
}
if (t2 == 0)
{
if (analogRead(A1) > THRESHOLD2) t2 = micros();
}
if (t1 !=0 && t2 != 0)
{
Serial.print("Difference: ")
Serial.println(abs(t1-t2));
t1 = 0;
t2 = 0;
}
}
Hello Rob,
Very kind of you to give me some directions. I'll spend some time in the reference section. Despite I'm not familiar with the syntax of the code, the one you've written for me looks very easy and makes sense!
No, the sound could be before or after the picture. But I can adjust the sound, not the picture, so I could make sure the sound is always late, or in sync eventually.
Any ideas on how to connect the photodiode and the mic?
Thanks
Tony
Thanks Rob, I know how annoying newbies are on forums, so I do appreciate your help!
I will keep you posted with my progresses!
Cheers
Tony
An ldr may not be the best device for this as the response time is pretty slow, a true photodiode is probably needed, or even a regular led could work , the led would need amplification to be read as a logic high unless you use a blue led, which will create a voltage around 3.5-3.8 and may work directly to an input if the flash is bright enough,
Well, I will have the chance to calibrate the device against a professional one, but yes, the flash will be 1/24th of second, even though I could create a test clip with a longer flash.
I did not know that a normal LED would generate voltage! Anyway, there is no problem in trying a photodiode. I'll see what I can find, and get back to the forum!
Thanks
Tony
Yeah its kinda cool that they work in reverse, the led pits out its forward voltage, idk how much current tho,
The recieved light has to be a smaller wavelength or the same to put out
So blue light will work with a red led and blue, but red light will only work with a red led,