In recent years, Internet of Things (IoT) has made extraordinary progress in human lives from healthcare applications to daily chores. The IoT enables everyday object to be connected to the Internet. These devices are embedded with sensors and actuators in order to collect and share data. However, the transmission of the collected data may face several security and privacy concerns. To overcome this problem, we propose a Secure Data Transmission Scheme (SDTS) that improves communication security in cluster-based Wireless Sensor Networks (WSNs). The SDTS is based on Elliptic Curve Cryptography (ECC) due to its ability to provide high security level with small key size. The proposed method achieves several security requirements including confidentiality, integrity, and authentication. Moreover, it resists different security attacks like brute force attack, replay attack, and sinkhole attack. The performance analysis shows that SDTS is relatively efficient in term of communication cost.