![]() Let us see what we would require to do this project. All the information sensed by the US sensor will be broadcasted to our Smart phone using Bluetooth Module (HC-05). Also we are mounting the US (Ultra Sonic) sensor over a servo motor, this servo motor can be either be set to rotate automatically to scan the area or can be rotated manually using our Mobile app, so that we can focus the ultrasonic sensor in our required direction and sense the objects present over there. ![]() This device senses objects with the help of Ultrasonic Sensor and hence can work even during night times. Hence let us make an economic device which does almost the same but without any video features. Installing a security camera that has night mode with tilt and pan option will burn a big hole on our pockets. Safety and Security has been our primary concern since ages. Now, when “t” is sent to the Arduino, it replies with the Temperature, Humidity, and Heat Index.This is an interesting project in which we explore the power of an Arduino and Android to create a Surveillance device which uses Arduino and Ultra Sonic Sensor to broadcast the information to a mobile application (Android) using Bluetooth. ![]() Pair with the HC-05 module by providing the correct passcode – 0000 is the default one. Power up the Arduino and turn on the Bluetooth from your mobile. The complete source code of the Android application is attached here: Arduino Bluetooth(Source) Testing To send data, pass the String to the OutputStream. The following part of the code deals with reading the data, int byteCount = inputStream.available() įinal String string=new String(rawBytes,"UTF-8") Toast.makeText(getApplicationContext(),"Device doesnt Support Bluetooth",Toast.LENGTH_SHORT).show() Use the following code to test if Bluetooth adapter is present or not, BluetoothAdapter bluetoothAdapter=BluetoothAdapter.getDefaultAdapter() The flow diagram of the Android app is illustrated below, Flow diagram of the Android appĪs this app will be using the onboard Bluetooth adapter, it will have to be mentioned in the Manifest. Serial.println("Failed to read from DHT sensor!") įloat hic = dht.computeHeatIndex(t, h, false) The code used to read data from the DHT sensor, process it and send it via Bluetooth: #include "DHT.h" Go here to download the library. When the letter “t” is received, the temperature, humidity, and heat index will be transmitted back via Bluetooth. To use the DHT-11, the DHT library by Adafruit is used. String setName = String("AT+NAME=MyBTBee\r\n") //Setting name as 'MyBTBee'īTSerial.print(setName) //Send Command to change the name The Arduino code to send data using Bluetooth module: //If youre not using a BTBee connect set the pin connected to the KEY pin high To program the module, a set of commands known as AT commands are used. Connect the Key pin to any pin on the Arduino and set it to high to allow the module to be programmed. To do this the module should be set to command mode. To use the HC-05 Bluetooth module, simply connect the VCC to the 5V output on the Arduino, GND to Ground, RX to TX pin of the Arduino, and TX to RX pin of the Arduino. If the module is being used for the first time, you’ll want to change the name, passcode etc. USB cable for programming and powering the Arduino.Android Studio (To develop the required Android app).An Android Smartphone that has Bluetooth.Any model can be used, but all code and schematics in this article will be for the Uno. In this project, data from a DHT-11 sensor is collected by an Arduino and then transmitted to a smartphone via Bluetooth. Hariharan Mathavan at designed a project on using Bluetooth to communicate with an Arduino. Bluetooth is one of the most popular wireless communication technologies because of its low power consumption, low cost and a light stack but provides a good range.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |