Public street lighting (PJU) is essential infrastructure for nighttime security. This research develops an automatic PJU control system based on IoT using light and motion sensors with an ESP32 microcontroller. The system allows for PJU lamp control via a website, providing high flexibility for users. The ESP32 microcontroller is connected to a PIR sensor to detect motion. When the sensor detects movement, the intensity of the PJU lamps is increased, and when no movement is detected, the light intensity is reduced to save energy. Users can control the PJU lamps from any internet-connected device. Testing results show an increase in energy efficiency, with an average power consumption reduction of 13.77 watts and an efficiency increase of 42.67%. An R-squared value of 0.629 indicates that the model is quite good at explaining the variability in power consumption data. This system can automatically turn on street lights and be monitored in real-time, And hopes to contribute to the development of smarter and more efficient street lighting systems.