With the applications of Industrial Internet of Things (IIoT) and service based on manufacturing, the 4th industrial revolution which is termed as Industry 4.0, is believe to be proposed in the upcoming years, where the factories will not work as used to work. In this paper, we present a smart factory framework which combine industrial network, cloud and various control terminal with several work pieces such as conveyor, product and machine. This work has used 'Controllino mega' which is a controller to control the entire production as it has a cloud connectivity feature. It is an IoT Arduino compatible open source PLC device for industrial uses in automation and for controlling and monitoring. This will allow separate part of the production line to communicate to make the entire manufacturing process easier to control and monitor in real time. In this work, a lot of new features and functionalities have been incorporated, which will change the way, a factory used to look and be. A wireless communication using smart sensors has been used to demonstrate that the devices such as sensors and actuators work intelligently rather than depending on the main control hub. These devices will have its own microcontroller through which it comes to action. Another feature which will help the factories to continue the production rather than getting downtime issue has also been addressed successfully by adding "the notification feature".