IoT(Internet of Things, 사물인터넷)는 일상 사물에 센서와 통신 기능을 내장해 인터넷으로 연결하는 개념이다. 스마트 홈, 스마트 팩토리, 헬스케어, 농업에서 활용된다.
IoT 아키텍처
[센서/기기] → [엣지 게이트웨이] → [클라우드/플랫폼] → [앱/서비스]
온도 센서 → Raspberry Pi → AWS IoT Core → 모바일 앱
(로컬 처리) (데이터 저장) (알림)
주요 통신 프로토콜
Python MQTT 예시 (Raspberry Pi)
python
import paho.mqtt.client as mqtt
client = mqtt.Client()
client.connect("mqtt.example.com", 1883)
# 센서 데이터 발행
import json
data = {"temperature": 25.3, "humidity": 60}
client.publish("home/livingroom/sensors", json.dumps(data))
# 구독
def on_message(client, userdata, msg):
print(f"{msg.topic}: {msg.payload}")
client.subscribe("home/#")
client.on_message = on_message
client.loop_forever()
관련 개념
참고문헌
- •Ashton, K. (2009). That "Internet of Things" Thing