Introduction to Bluetooth with Idiotware Shield

/**/

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

 

Things used in this project

Hardware components

  • Arduino UNO x 1
  • Idiotware Shield x 1
  • USB-A to B Cable x 1
  • Generic Jumper (0.1″) x 2
  • HC-05 Bluetooth Module x 1
  • i2c Oled display x 1
  • Female/Female Jumper Wires x 4

Software apps and online services

  • Arduino IDE
  • Bt terminal

Story

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 display.

Download the BT terminal app on android phone.

Working

If you enter the 489 number The function displayData() will get activated and the buzzer is switch on with green colour showing on the shield.

This Device acts as token number notifier that shows that the next Token number is 489 and that person with 489 token number can go inside the room.

Note

You have to set the Bluetooth module Hc-05 to baud rate 9600 . However HC-05 default serial speed for communication mode is 9600.

If your hc-05 is not working you need to change it to 9600 or find the baud rate of hc 05 module with “AT” command.

BTserial.begin(9600);

The following code will tell you when does the buzzer and green color turns on.

displayData(); if(receivedData == "489") { buzzer(); } } 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 } }

Configuring idIoTware Shield

Upload the code and input the text on the Bluetooth terminal app in your phone.You will see the text showing on oled display.

Schematics

Code

// 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);  
    }
 
*/
//}

Video