Excessive speed and violating traffic rules may cause dangerous road accident. Some reports show that around 3700 people die every day due to road accident. Controlling vehicle speed and proper automated street lighting system may mitigate this problem. This work implements an automated internet of things and machine learning based system to control streetlamps with vehicle speed tracking. The developed machine learning model is capable to guesstimate the speed of the vehicle on the highway and report if there is any excessive speed. The automated streetlamp is integrated with the system that can provide proper illumination considering the environment condition. The proposed system showed good results after practical implementation.