IdiotWare TeamRupin ChhedaGirish Nair
Published © GPL3+

Introduction to Bluetooth with idiotware shield

In this project i am going to demonstrate how you can use your mobile phone app talk to idiotware shield and display the text on the oled

BeginnerFull instructions provided1 hour1,069
Introduction to Bluetooth with idiotware shield

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
idIoTware Shield
idIoTware Shield
×1
HC-05 Bluetooth Module
HC-05 Bluetooth Module
×1
i2c Oled display
×1
USB-A to B Cable
USB-A to B Cable
×1
Generic Jumper (0.1")
Generic Jumper (0.1")
×2
Female/Female Jumper Wires
Female/Female Jumper Wires
×4

Software apps and online services

Arduino IDE
Arduino IDE
Bt terminal

Story

Read more

Schematics

idiotware-shield

Code

BluetoothNotifier

Arduino
// sets up and initialize idIoTware
#include <Adafruit_NeoPixel.h>
#include <idIoTwareShield.h>
#include <Wire.h>         // Require for I2C communication
idIoTware fs;             // Instanciate idIoTware instance

#include <SoftwareSerial.h>
#include "U8glib.h"
SoftwareSerial BTserial(10, 9); // RX | TX
// Connect the HC-05 TX to Arduino pin 2 RX. 
// Connect the HC-05 RX to Arduino pin 3 TX through a voltage divider.
 
U8GLIB_SH1106_128X64 u8g(U8G_I2C_OPT_NONE);	// I2C / TWI 
char receivedData[32] = "";

int BuzzerPin = A1;

void setup() 
{
    Serial.begin(9600);
    Serial.println("Arduino is ready");
    pinMode(BuzzerPin,OUTPUT);
    // HC-05 default serial speed for commincation mode is 9600
    BTserial.begin(9600);  
}
 
void loop()
{
 
    // Keep reading from HC-05 and send to Arduino Serial Monitor
    if(BTserial.available())
      {  
        int data = BTserial.readBytesUntil('\n',receivedData,32);
        receivedData[data] = '\0';
        Serial.write(receivedData);
        displayData();
        if(receivedData == "555")
           {
             buzzer();
           }
       }
        
        
    }


void displayData()
     {
         u8g.firstPage();  
       do 
        { 
          u8g.setFont(u8g_font_timB10);
          u8g.setPrintPos(0, 10); 
          u8g.print("Token Number" );
          u8g.setFont(u8g_font_fub25);
          u8g.setPrintPos(33, 50); 
          u8g.print(receivedData);
        } while( u8g.nextPage() );
        
       
     }      
        
void buzzer() 
    {
      for(byte i=0; i<10; i++)
         {
           color(0,100,0);
           digitalWrite(BuzzerPin, HIGH);   // turn the LED on (HIGH is the voltage level)
           delay(250); 
           color(0,0,0);               // wait for a second
           digitalWrite(BuzzerPin, LOW);    // turn the LED off by making the voltage LOW
           delay(250);               // wait for a second
        }
    }    
        
 /*
    // Keep reading from Arduino Serial Monitor and send to HC-05
    if (Serial.available())
    {
        receivedData =  Serial.read();
        BTserial.write(receivedData);  
    }
 
*/
//}

Credits

IdiotWare Team

IdiotWare Team

20 projects • 16 followers
The Idiotware Shield is a learning platform for quickly bringing to life hundreds of Arduino projects, whether you’re a novice or expert.
Rupin Chheda

Rupin Chheda

35 projects • 83 followers
Resident Maker at CuriosityGym! Electronics Engineer, CAD Modeller, Educator
Girish Nair

Girish Nair

8 projects • 4 followers
Founder, Curiosity Gym a leading makerspace in India. We also run Innovation Hubs and tinkering labs in schools & colleges. Love building learning environments.

Comments