Akhilesh Sagar
Published

Automatic AC ON/OFF System using Bolt IoT

This system detects the temperature around and when the temperature is high, it turns on the AC and when it it is low, it turns off the AC.

IntermediateFull instructions provided2 hours794
Automatic AC ON/OFF System using Bolt IoT

Things used in this project

Hardware components

Bolt WiFi Module
Bolt IoT Bolt WiFi Module
×1
USB-A to Mini-USB Cable
USB-A to Mini-USB Cable
×1
5 mm LED: Yellow
5 mm LED: Yellow
×1
Breadboard (generic)
Breadboard (generic)
×1
Male/Male Jumper Wires
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
×1
Temperature Sensor
Temperature Sensor
×1

Software apps and online services

Bolt Cloud
Bolt IoT Bolt Cloud

Story

Read more

Schematics

Circuit Diagram

Connection between the LM35 Sensor, Breadboard and Bolt Module.

Code

Python Code

Python
 import json, time
from boltiot import Bolt

BOLT_API_KEY = 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'
BOLT_DEVICE_ID = 'BOLTXXXXXXX'
mybolt = Bolt(BOLT_API_KEY,BOLT_DEVICE_ID)
max_temp = 24
min_temp = 17

while True:
    response = mybolt.analogRead('A0')
    data = json.loads(response)

    sensor_value = int(data['value'])
    conversion = ((100*sensor_value)/1024)
    temp=int(conversion)

    if temp < min_temp:
        response = mybolt.digitalWrite('0', 'LOW')

    if temp > max_temp:
        response = mybolt.digitalWrite('0', 'HIGH')

    time.sleep(300)

Credits

Akhilesh Sagar
1 project • 0 followers
Thanks to Bolt IoT.

Comments