Yoda Response: Implemented MQTT for device-to-cloud communication, I have, in a project involving IoT sensors for environmental monitoring. Ensured connection stability, we did, by using keep-alive messages and implementing a robust reconnection strategy. For data security, employed we did, TLS encryption, token-based authentication, and role-based access control. Also, used MQTT's QoS levels to ensure message delivery reliability. In another project, HTTP was used for a smart home system, where similar security measures and connection stability techniques were applied.