The increasing use of wireless communication technologies has made IoT and machine-to-machine (M2M) connections crucial to a wide range of industries. Smart buildings are an excellent example of an IoT/M2M application. Issues such as a lack of a convergent solution, high costs, restricted wireless transmission range, user-unfriendly interfaces, and the inability to integrate IoT and M2M technologies. Consequently, this article suggests a more effective method for for Machine-to-Machine (M2M) and The Internet of things smart building systems: heterogeneous wireless networks that include both WSNs and MCNs. The suggested system is a cost-effective embedded system that includes Several functional actuators, sensors, and modules for Arduino and NodeMCU, ESP32CAM boards allow for data collection and control across a variety of heterogeneous communication methods like Bluetooth, Wi-Fi, and global system for Mobile (GSM). All collected data is issued to the ThingSpeak platform, allowing the building system to be monitored via the Thing Speak webpage or the UR Smarthome app. One of the researchs most important results is that it can give the server precise information with extremely little delay, allowing users to quickly control and monitor remotely the proposed system that consists of several innovative services names indoor applications(fire detection and gas leakage detection, intrusion alarm by ultrasonic, medicine reminder by RTC module, light and fan control, smart door) and outdoor applications(garden irrigation by soil moisture and DHT11, air quality, smart parking ). Our free mobile application UR Smarthome, which is a local server that controls and monitors the building from a distance, is used to plan and execute all of these services that provides remote control and monitor of the building via Bluetooth/ Cellular networks and Wi-Fi access. With its customizable features, this IoT/M2M smart building system can be tailored to the demands of its users, enhancing their quality of life and safety while using less energy. In addition, identifying and lowering risks, it assists in preventing the loss of resources and human lives. KEYWORDS— Converged networks, heterogeneous networks (HetNets), Internet of Things (IoT)/machine-to-machine (M2M), mobile application, mobile cellular networks (MCNs), smart building, wireless sensor networks (WSNs)