Detecting traffic light color

Hello,

I want to develop a project that detects the color of the traffic light and depending on that, do different actions. Which hardware/sensor should I use (I will use Arduino Mega)? Or I would like to detect if cars are approaching or not.

Thanks!

You need something that can do image processing. That rules out anything Arduino. Maybe ask on an RPi forum. Arduino isn't fast or powerful enough for what you want.