The first traffic light was used in 1868 whereas the modern automobile was invented in 1886. It wasn’t electric, though, but a gas lamp that was used to keep carriages from bumping into each other. Unfortunately, it exploded a month after and so it was abandoned and was not used again until 1912, when it was already electric.