Mturk Jobs

Mturk Jobs
Mturk Jobs

Tank

Showing posts with label HC-06 Bluetooth Module. Show all posts
Showing posts with label HC-06 Bluetooth Module. Show all posts

Sunday, April 19, 2020

Arduino Motor Shield With L293D and Bluetooth Module

Here is a quick project I made using Arduino Shield that has L293D H-Bridge motor driver and HC-06 Bluetooth Module





You can use Arduino to control DC Motor using Bluetooth via Smartphone or Tablet.

Here is the shield diagram on Tinkercad





Here is how I connected the L293D to Arduino Uno Board
More Details on this project is on its way.

Stay Tuned for updates.

Subscribe to AeroArduino Channel on YouTube.


Tuesday, May 1, 2018

Bluetooth Arduino RGB Mood Light

In this post, I'll show you how to make a beautiful Arduino RGB Mood Light that can be controlled via Bluetooth.



The circuit is very simple.

You only connect Arduino to the Bluetooth module.

Most popular are HC-05 and HC-06 modules.

They are inexpensive and easy to use.

You can use them to send and receive data to and from Arduino like any serial device.




They have reliable Bluetooth connection with phones and there are many Apps out there that can be used with Arduino projects.


Components



• 1x Arduino uno 
• 1x Bluetooth module (HC-05) or HC-06
• 4x RGB LEDs 
• 1x 9v Battery 
• 4x 100 ohm resistor 
• 1x 9v Battery clip 
• Female-Male jumper wires
• Rainbow cable 
• Perfboard


Connections

Connect the BT module to Arduino
Vcc ---- Arduino 3.3v or 5v (according to your module)
Gnd ---- Arduino gnd
Rx ---- Arduino Tx

Tx ---- Arduino Rx


Picture of Connect the Bluetooth Module to Arduino

LED Connection to Arduino






Code


Android Software

The post says that there is a link for the Android App that controls the Bluetooth module.

But unfortunately, I couldn't find any link to the App.

Thus I searched and found many applications on Google play and Amazon that can make the function of controlling the Bluetooth module and Arduino board.

You can download any of them and start your own Arduino Application.

Here are some of them

ArduDroid
Arduino Bluetooth Control
Ardroid


//pins for the LEDs:
const int redPin = 3;
const int greenPin = 5;
const int bluePin = 6;

const int redPin2 = 9;
const int greenPin2 = 10;
const int bluePin2 = 11;

#define REDPIN 3
#define GREENPIN 5
#define BLUEPIN 6

#define FADESPEED 5

void setup() {
// initialize serial:
Serial.begin(9600);

// make the pins outputs:
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);

pinMode(redPin2, OUTPUT);
pinMode(greenPin2, OUTPUT);
pinMode(bluePin2, OUTPUT);

Serial.print("Arduino control RGB LEDs Connected OK ( Sent From Arduinno Board )");
Serial.print('\n');
}

void loop() {

// if there's any serial available, read it:
while (Serial.available() > 0) {

 // look for the next valid integer in the incoming serial stream:
 int red = Serial.parseInt();
 // do it again:
 int green = Serial.parseInt();
 // do it again:
 int blue = Serial.parseInt();

 int red2 = Serial.parseInt();
 // do it again:
 int green2 = Serial.parseInt();
 // do it again:
 int blue2 = Serial.parseInt();

 // look for the newline. That's the end of your
 // sentence:
 if (Serial.read() == '\n') {
           
   // constrain the values to 0 - 255 and invert
   // if you're using a common-cathode LED, just use "constrain(color, 0, 255);"
   
   // This is for COMMON ANODE
   //red = 255 - constrain(red, 0, 255);
   //green = 255 - constrain(green, 0, 255);
   //blue = 255 - constrain(blue, 0, 255);
  
   red = constrain(red, 0, 255);
   green = constrain(green, 0, 255);
   blue = constrain(blue, 0, 255);
  
   red2 = constrain(red2, 0, 255);
   green2 = constrain(green2, 0, 255);
   blue2 = constrain(blue2, 0, 255);

   // fade the red, green, and blue legs of the LED:
   analogWrite(redPin, red);
   analogWrite(greenPin, green);
   analogWrite(bluePin, blue);
  
   analogWrite(redPin2, red2);
   analogWrite(greenPin2, green2);
   analogWrite(bluePin2, blue2);

   // print the three numbers in one string as hexadecimal:
    Serial.print("Data Response : ");
   Serial.print(red, HEX);
   Serial.print(green, HEX);
   Serial.println(blue, HEX);
 }
}

}




Source: Instructables








Check our books on Amazon:





Learn By Making: Embedded Systems Tutorial for Students and Beginners









Embedded Systems, Electronics: My Projects Collection From Instructables






Friday, December 8, 2017

PS2 Keyboard Bluetooth interface to Android Smartphone

Do you like using the keyboard to record your thoughts and to code?

Have you ever thought of using the normal sized keyboard to type in your Android smartphone?

Can you make an Arduino project that connects your favorite keyboard with your smartphone via Bluetooth connection?

Today I came to the idea and loved it very much.

It's very simple to implement.

Using Arduino mini and HC-06 Bluetooth module and connect them to the PS2 keyboard.

You can then read text from keyboard and send it wirelessly to the smartphone.


Here is the PS2 Connection to Arduino and code for this project.

This project can be found on Arduino platform

https://playground.arduino.cc/Main/PS2Keyboard


And here is the connection for it.







Note:

Make sure you connect the Clock PIN to the digital PIN 3 on the Arduino. Otherwise the interrupt, and therefore the whole library, won't work.

In this project, we used the The PS2Keyboard library.

Usage:

This is sample code;

#include

#define DATA_PIN 4
PS2Keyboard keyboard;

void setup() {
  keyboard.begin(DATA_PIN);

  Serial.begin(9600);
  Serial.println("hi");
  delay(1000);
}

void loop() {
  if(keyboard.available()) {
    byte dat = keyboard.read();
    byte val = dat - '0';

    if(val >= 0 && val <= 9) {
      Serial.print(val, DEC);
    } else if(dat == PS2_KC_ENTER) {
      Serial.println();
    } else if(dat == PS2_KC_ESC) {
      Serial.println("[ESC]");
    } 
  }

}


HC-06 Bluetooth Module to Arduino Mini Connection




HC-06ARDUINO
VCC->+3.3V
GND->GND
TX->2
RX->3




 HC-06 ----- Arduino


VCC   ---   3.3v 


 GND --- GND 


TXD   ---   RXD 


RXD   ---   TXD



Now we can add the stuff together to make our complete project.

PS2 Keyboard

Adruino Mini Pro

HC-06 Bluetooth Module

3.7V Li-Poly Battery

Android Smartphone

Android App : Arduino Bluetooth Control
Arduino Bluetooth Control App


Cover art




Tank