Trigger a video file from computer to play when sensor Tcs3200 detects a color

Hi everyone! I am making an installation where a video starts playing based on the color the Tcs3200 sensor detects. I'm new at this and I don't have any idea if it's possible. Please, if someone knows if it is something possible to do or knows how to do it, let me know! Thank you :slight_smile:

Edit: I'll explain what I'm trying to do with a little more detail. I want to control two videos saved on my PC with Arduino. The sensor should detect colors to trigger a file video to play. For example, when the color Blue is near the sensor, it should start playing video 1 in my PC, but when Red is near, the video 2 should start playing.

Not nearly enough information, but it sounds like you have a PC that you want to control a video from an Arduino.

I can think of a few ways to do this- none elegant.
You could have an HTTP server running on the PC and you POST a command to the server to play the video file.
You could have an MQTT client on the PC and publish the MQTT message from the Arduino.
You could have the PC polling another server looking for a semaphore posted by the Arduino.
You could write a program on the PC to monitor a 433MHz receiver and send the start command from the Arduino.

Give this post a few minutes and you will have a dozen more suggestions.

1 Like

What's playing the video what starts the video?

If you are using a computer controlling the video player software will be the tricky part...

I'd look for a different color sensor. That one puts-out a "frequency" and although the Arduno can read frequency (within it's limits) it's not a very-direct way of doing things.

I'd look for a sensor that puts-out digital color data (probably I2C), or maybe you can find one that puts-out 3 analog signals for red, blue, and green.

If the video player is a computer the Arduino can send data to the computer via the serial monitor (USB) or there are add-on Ethernet or Wi-Fi boards or versions of the Arduino with Ethernet or Wi-Fi built-in.

1 Like

You could have a BAT file running a loop, looking for a semaphore file on a shared device. When the semaphore file is found, delete the file then start VLC Media Player using a command line.

1 Like

The simplest solution is probably to ditch the PC and use a small computer that is capable of playing videos and also has easy access to sensors with lots of documentation and tutorials. e.g., a Raspberry Pi.

Now finding one for sale might be difficult these days, but that's a whole other story...

1 Like

I bought a used Intel NUC for less than the Rpi4 is going for on ebay.

With the prices I've seen, I'm not surprised at all.

Can you initiate the Videos simply by typing a set of keystrokes on your PC ?
If so, there may be a possibility of using a keyboard emulation device to trigger the desired video.
Keywords: Leonardo HID

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.