Ridyumna Garain
Created July 1, 2020 © GPL3+

Interfacing Bolt Wi-Fi module with Arduino

Simple tutorial for interfacing Bolt Wi-Fi module with Arduino

BeginnerProtip30 minutes1
Interfacing Bolt Wi-Fi module with Arduino

Things used in this project

Hardware components

Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
Bolt WiFi Module
Bolt IoT Bolt WiFi Module
×1
Male/Male Jumper Wires
×1

Software apps and online services

Bolt IoT Bolt python library

Story

Read more

Schematics

bolt_arduino_OyrnlFNtFP.fzz

Code

LED.ino

C/C++
Arduino code for turning LED off or on using Bolt Wi-Fi module
int LEDpin = 13;
String status;
// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  Serial.begin(9600);
  pinMode(LEDpin, OUTPUT);
}

void loop() {
  
Serial.println("what to do? ON or OFF"); //print to serial monitor
while(Serial.available()==0){            //wait for input in serial monitor
  }
  
status=Serial.readString();             //read inout from serial monitor
if (status=="ON"){
  digitalWrite(LEDpin, HIGH);       //Turn the LED on if "ON" in serial monitor
  delay(1000);
  }
if (status=="OFF"){                    //Turn the LED off if "OFF" in serial monitor
    digitalWrite(LEDpin, LOW);      //turn the LED off by making the voltage LOW
    delay(1000); 
  }                   
}

bolt_arduino.py

Python
Code for controlling LED status on Arduino
from boltiot import Bolt #import necessary libraries
import conf, time #conf contains Bolt device id and API key, available from Bolt cloud dashboard



mybolt = Bolt(conf.API_KEY,conf.DEVICE_ID) #Create bolt object


while True:
    response = mybolt.serialRead('10') #read serial data from arduino
    print(response)
    out=input("ON or OFF?") 
    mybolt.serialWrite(out) #write value for led on arduino
    time.sleep(10)

Credits

Ridyumna Garain

Ridyumna Garain

1 project • 0 followers
I'm a dentist, and have been developing things for dental applications for a while. I've just gotten into electronics, hardware and coding.

Comments