Control Light Intensity using BOLT IOT Module is a simple project that shows the use of WIFI modules for IOT applications. The primary use of this project is to control the intensity of the light that is emitted by the LED. For this, we have a user interface that has access to the BOLT Cloud. In the interface, we can see a Pulse Width Modulation(PWM) value that ranges from 0 to 255, 0 being LED OFF and 255 being LED ON at maximum intensity of brightness. The interface is accessible on the bolt cloud as well as on the the smartphone BOLT application.
With further modification on this project, we can control large lighting systems with just the use of our mobile phones.
Follow the steps below to see how this project is configured.
HARDWARE SETUPGiven below is the diagram to the simple hardware setup that this project uses.
Visit https://www.boltiot.com/ and login in to get access to the BOLT Cloud.
- Select the Products tab, and click on ADD PRODUCT.
- Enter Product Name and add an Icon.
- Click on Configure this product symbol, and go to the Code tab.
- Give a name and select file type as html and paste the following code in the code window.
<html>
<head>
<title>Bolt IoT Platform</title>
<script type="text/javascript" src="https://cloud.boltiot.com/static/js/boltCommands.js"></script>
<script>
setKey('{{ApiKey}}','{{Name}}');
var last_pwm_value=-1;
function updateBuzzer(){
var pwm_value=document.getElementById('pwm_value').value;
if(last_pwm_value!=pwm_value){
analogWrite(0,pwm_value);
document.getElementById('pwm_value_display').innerHTML=pwm_value;
}
last_pwm_value=pwm_value;
}
setInterval(updateBuzzer,1000);
</script>
</head>
<body>
pwm value:
<input type='range' id='pwm_value' min="0" max="255" value="0">
<div id='pwm_value_display'>0</div>
</body>
</html>
- Click on Save your configuration icon, and return to the product screen.
- Click on Link device to this product, and select your BOLT WIFI module.
- Click on Deploy configuration icon to successfully deploy the application.
- Now, either use your smartphone app for BOLT or click on View this device on your computer to see the interface.
- Control the light intensity using the knob on the interface.
Watch the video below to get step by step instructions on how to do the project.
Congratulations! You have successfully set up your IOT project. May this be a stepping stone to all your future endeavors in IOT.
CreditsMentors and staff of the BOLT IOT community.
Rudra DIY Crafts on youtube.
Comments
Please log in or sign up to comment.