Sensor is a device which is used to detect some object to collect some data. Sensor will deliver the data consisting of id and data to the computer and from the computer to another sensor using a data cable which consumes a lot of time. Nowaday, sensors have WiFi relay or Bluetooth built-in. It will make the sensor deliver the data without data cable or wire(wireless). Sensors can connect to WiFi and send the data to server, database or other sensor. Sensors communicate with other sensors which make the sensor work automatically. The connection between sensors with other sensors is called Wireless Sensor Network (WSN). There can be some delay when the sensor communicates. The delay will affect message delivery. It can make the data will not be sent or maybe corrupted. So, clock synchronization is needed to remove the effects of random delays from the timing message transmissions sent across wireless channels. When communicating, the node will make some network called topology. The examples are star, mesh, etc. Different topologies may also affect the clock synchronization. This will also affect when delivering data. There are many types of protocols used in WSN such as the Average TimeSync Protocol. Average TimeSync Protocol is a protocol which synchronizes the clock speed and clock offset. It will be implemented using Matlab. The data which will be processed by Matlab are clock from each node and when synchronized. By doing the analysis, it is expected to know if topology affects clock synchronization.