วันจันทร์ที่ 23 มิถุนายน พ.ศ. 2557

Android Bluetooth control 8 devices with Arduino Board

-->




Android Bluetooth control 8 devices with Arduino Board
( ควบคุมอุปกรณ์ไฟฟ้า ผ่าน Bluetooth )

Arduino Bluetooth Control Device Application is to allow you to control various electrical devices up to eight devices and independently controlled.
Use Android Bluetooth mobile device to  remote control your device with Serial TTL Bluetooth Module and Arduino Board.

For Automation System ,Smart Home Automation ,light control etc.

The program features.
- Control up to  8 devices.
- Can be set Timer to ON / OFF the device and show the countdown timer.(Timer can be set to 1 minute, 15 minutes, 30 minutes, 1 hour, 2 hours, 4 hours).
- Change and Edit your Device Name. ( Version 1.6+)

Version 1.6+ your can set your device name.







Android App on Google Play


Hardware
1. Serial Port Bluetooth Module( TTL )
2. Arduino Microcontroller Board ( we use ET-BASE AVR EASY328 Arduino compatible)
3. 8 channel Output Relay Board

More info about hardware :
http://microcontrollerkits.blogspot.com/2012/02/arduino-control-8-devices-via-android.html




Arduino Development Kits on ebay
http://www.ebay.com/sch/marychanyanuch2012/m.html?



Wiring Arduino Pin Diagram

Output 1 to Pin 4 ( Arduino Board )
Output 2 to Pin 5
Output 3 to Pin 6
Output 4 to Pin 7
Output 5 to Pin 8
Output 6 to Pin 9
Output 7 to Pin 10
Output 8 to Pin 11

Bluetooth Module Tx to  Pin 0
Bluetooth Module Rx to  Pin 1




Hardware Kits









Android Control Kits


Order Hardware Kit  at  Android Bluetooth control  8 devices Kits

Visit Android Control Kits Shop


Android Bluetooth Control Device
Android Bluetooth Control Device Application is to allow you to control various electrical devices up to eight devices and independently controlled.
Use Android Bluetooth mobile device to  remote control your device with Bluetooth Receiver hardware Device.
เป็น Application ที่ทำให้คุณสามารถควบคุมอุปกรณ์ไฟฟ้าต่างๆได้ ถึง 8 อุปกรณ์โดย แยกควบคุมกันได้อย่างอิสระ
ผ่านระบบ Bluetooth ของเครื่องโทรศัพท์มือถือ Android เป็นตัว Remote Control ไปยังอุปกรณ์ภาครับ ( Bluetooth Receiver Hardware Device )

The program features.
- control up to  8 devices.
- Can be set Timer to ON / OFF the device and show the time.(the timer can be set to 1 minute, 15 minutes, 30 minutes, 1 hour, 2 hours, 4 hours).
- Use with Receiving device (Bluetooth Receiver Hardware Device - see below).
Design for the Android version 4 and a screen resolution of 480 x 800 (WVGA).
Freeware with AD (free software)


คุณสมบัติโปรแกรม
-          ควบคุมอุปกรณ์ได้ 8 อุปกรณ์
-          สามารถตั้งเวลา ปิด/เปิด แต่ละอุปกรณ์ได้ และแสดงเวลาการทำงาน และเวลาคงเหลือการตั้งเวลา ( เวลาที่สามารถตั้งได้ 1 นาที,15 นาที, 30 นาที, 1 ชั่วโมง ,2 ชั่วโมง , 4 ชั่วโมง )
-          ต้องใช้งานร่วมกับ อุปกรณ์ภาครับ ( Bluetooth Receiver Box )
ออกแบบ ค่าเริ่มต้น สำหรับ Android version 4 และ หน้าจอความละเอียด 480 x 800 ( WVGA )

A data transmission via Bluetooth. รูปแบบการส่งข้อมูลผ่าน Bluetooth
Device1 ON sent “A” , Device1 OFF sent “a”
Device2 ON sent “B” , Device2 OFF sent “b”
Device3 ON sent “C” , Device3 OFF sent “c”
Device4 ON sent “D” , Device4 OFF sent “d”
Device5 ON sent “E” , Device5 OFF sent “e”
Device6 ON sent “F” , Device6 OFF sent “f”
Device7 ON sent “G” , Device7 OFF sent “g”
Device8 ON sent “H” , Device8 OFF sent “h”



Hardware สำหรับ การสร้างอุปกรณ์ภาครับ
  จะใช้ Bluetooth Module และ Arduino Microcontroller Board และ Relay Output Board
Hardware อุปกรณ์ที่ใช้
1.       Serial Port Bluetooth Module( TTL )
2.       Microcontroller Board (ET-BASE AVR EASY328 )
3.       8 channel Output Relay Board





Bluetooth information form Android Developers ) ( ภาษาไทย ด้านล่าง )
Quickview
  • Android's bluetooth APIs allow your application to perform wireless data transactions with other devices
Key classes
  1. BluetoothAdapter
  2. BluetoothDevice
  3. BluetoothSocket
  4. BluetoothServerSocket
Related samples
  1. Bluetooth Chat
  2. Bluetooth HDP (Health Device Profile)
The Android platform includes support for the Bluetooth network stack, which allows a device to wirelessly exchange data with other Bluetooth devices. The application framework provides access to the Bluetooth functionality through the Android Bluetooth APIs. These APIs let applications wirelessly connect to other Bluetooth devices, enabling point-to-point and multipoint wireless features.
Using the Bluetooth APIs, an Android application can perform the following:
  • Scan for other Bluetooth devices
  • Query the local Bluetooth adapter for paired Bluetooth devices
  • Establish RFCOMM channels
  • Connect to other devices through service discovery
  • Transfer data to and from other devices
  • Manage multiple connections
·         The Basics
·       This document describes how to use the Android Bluetooth APIs to accomplish the four major tasks necessary to communicate using Bluetooth: setting up Bluetooth, finding devices that are either paired or available in the local area, connecting devices, and transferring data between devices.
·         All of the Bluetooth APIs are available in the android.bluetooth package. Here's a summary of the classes and interfaces you will need to create Bluetooth connections:
·         BluetoothAdapter
·       Represents the local Bluetooth adapter (Bluetooth radio). The BluetoothAdapter is the entry-point for all Bluetooth interaction. Using this, you can discover other Bluetooth devices, query a list of bonded (paired) devices, instantiate a BluetoothDevice using a known MAC address, and create a BluetoothServerSocket to listen for communications from other devices.
·         BluetoothDevice
·       Represents a remote Bluetooth device. Use this to request a connection with a remote device through a BluetoothSocket or query information about the device such as its name, address, class, and bonding state.
·         BluetoothSocket
·         Represents the interface for a Bluetooth socket (similar to a TCP Socket). This is the connection point that allows an application to exchange data with another Bluetooth device via InputStream and OutputStream.
·         BluetoothServerSocket
·         Represents an open server socket that listens for incoming requests (similar to a TCP ServerSocket). In order to connect two Android devices, one device must open a server socket with this class. When a remote Bluetooth device makes a connection request to the this device, the BluetoothServerSocket will return a connected BluetoothSocket when the connection is accepted.
·         BluetoothClass
·         Describes the general characteristics and capabilities of a Bluetooth device. This is a read-only set of properties that define the device's major and minor device classes and its services. However, this does not reliably describe all Bluetooth profiles and services supported by the device, but is useful as a hint to the device type.
·         BluetoothProfile
·         An interface that represents a Bluetooth profile. A Bluetooth profile is a wireless interface specification for Bluetooth-based communication between devices. An example is the Hands-Free profile. For more discussion of profiles, see Working with Profiles
·         BluetoothHeadset
·         Provides support for Bluetooth headsets to be used with mobile phones. This includes both Bluetooth Headset and Hands-Free (v1.5) profiles.
·         BluetoothA2dp
·         Defines how high quality audio can be streamed from one device to another over a Bluetooth connection. "A2DP" stands for Advanced Audio Distribution Profile.
·         BluetoothHealth
·         Represents a Health Device Profile proxy that controls the Bluetooth service.
·         BluetoothHealthCallback
·         An abstract class that you use to implement BluetoothHealth callbacks. You must extend this class and implement the callback methods to receive updates about changes in the application’s registration state and Bluetooth channel state.
·         BluetoothHealthAppConfiguration
·         Represents an application configuration that the Bluetooth Health third-party application registers to communicate with a remote Bluetooth health device.
·         An interface that notifies BluetoothProfile IPC clients when they have been connected to or disconnected from the service (that is, the internal service that runs a particular profile). 

 Class Bluetooth นี้จะทำงานสนับสนุนเครือข่ายบลูทูธสแต็คที่ช่วยให้อุุปกรณ์ไร้สาย แลกเปลี่ยนข้อมูลกับอุุปกรณ์บลูทูธอื่น ๆ ให้การเข้าถึงฟังก์ชันการทำงานบลูทูธ ผ่าน Android API   APIs จะขอเชื่อมต่อกับอุปกรณ์บลูทูธอื่น ๆ ที่เปิดใช้งานแบบ point-to-point และมีคุณลักษณะหลายแบบรูปแบบ

การใช้บลูทูธ APIsโปรแกรม Android สามารถดำเนินการต่อไปนี้:

     สแกนหาอุปกรณ์บลูทูธ อื่น ๆ
     อะแดปเตอร์บลูทูธ แบบสอบถามในท้องถิ่นสำหรับการจับคู่อุปกรณ์บลูทูธ
     สร้างช่องทาง RFCOMM
     เชื่อมต่อกับอุปกรณ์อื่น ๆ ผ่านทางบริการการค้นหา
     ถ่ายโอนข้อมูลไปและกลับจากอุปกรณ์อื่น ๆ
     จัดการการเชื่อมต่อหลาย


ข้อมูลพื้นฐาน

เอกสารนี้จะอธิบายวิธีการใช้บลูทูธ Android API เพื่องานหลักที่จำเป็นในการติดต่อสื่อสารโดยใช้บลูทูธ : ตั้งค่าบลูทูธ , การหาอุปกรณ์ที่จะจับคู่หรือบริการในพื้นที่ท้องถิ่นที่เชื่อมต่อ อุุุุปกรณ์และการถ่ายโอนข้อมูลระหว่างอุปกรณ์ทั้งหมดของบลูทูธ APIs ที่มีอยู่ในแพคเกจ android.bluetooth นี่เป็นบทสรุป และอินเตอร์เฟซที่คุณจะต้องสร้างการเชื่อมต่อบลูทูธ


BluetoothAdapter
หมายถึงอะแดปเตอร์บลูทูธ  (บลูทูธคลื่นวิทยุ) BluetoothAdapter เป็นการควบคุมบลูทูธ ทั้งหมด ใช้นี้คุณสามารถค้นพบอุปกรณ์บลูทูธ อื่น ๆ สอบถามรายชื่อของการจับคู่บลูทูธ อุปกรณ์ยกตัวอย่าง BluetoothDevice ใช้ที่อยู่ MAC รู้จักและสร้าง BluetoothServerSocket ฟังสำหรับการสื่อสารจากอุปกรณ์อื่น ๆ


 BluetoothDevice
หมายถึงอุปกรณ์บลูทูธ จากระยะไกล เพื่อร้องขอการเชื่อมต่อกับอุปกรณ์จากระยะไกลผ่าน BluetoothSocket หรือข้อมูลเกี่ยวกับอุปกรณ์ต่างๆ เช่น ชื่อ ที่อยู่ ระดับ Class


BluetoothSocket
หมายถึงอินเตอร์เฟซสำหรับซ็อกเก็ตบลูทูธ (คล้ายกับ TCP Socketตรงนี้คือจุดเชื่อมต่อที่ช่วยให้แอพลิเคชันเพื่อแลกเปลี่ยนข้อมูลกับอุปกรณ์ Bluetooth อื่นๆ ผ่านทาง InputStream และ OutputStream


BluetoothServerSocket
·หมายถึงซ็อกเก็ตเซิร์ฟเวอร์เปิดที่ฟังการร้องขอเข้ามา (คล้ายกับ TCP ServerSocketเพื่อที่จะเชื่อมต่ออุปกรณ์สอง Android, เครื่องหนึ่งจะต้องเปิดเซิร์ฟเวอร์ซ็อกเก็ตที่มีชั้นนี้ เมื่ออุปกรณ์บลูทู ธ จากระยะไกลทำให้การร้องขอการเชื่อมต่อกับอุปกรณ์นี้ BluetoothServerSocket จะกลับ BluetoothSocket ที่เชื่อมต่อเมื่อเชื่อมต่อได้รับการยอมรับ
 

BluetoothClass
อธิบายลักษณะทั่วไปและความสามารถของอุปกรณ์บลูทูธนี้ เป็นคุณสมบัติที่กำหนดของอุปกรณ์หลักและรองในระดับชั้นอุปกรณ์และบริการของบริษัท แต่นี้ไม่ได้อธิบายโปรไฟล์บลูทูธ และบริการทั้งหมดได้รับการสนับสนุนโดยอุปกรณ์ แต่จะมีประโยชน์เป็นการบอกข้อมูลเบื่องต้นของประเภทของอุปกรณ์
 

BluetoothProfile
เป็นอินเตอร์เฟซที่แสดงถึงรายละเอียดบลูทูธ เป็นข้อกำหนดอินเตอร์เฟซแบบไร้สายบลูทูธ สำหรับการสื่อสารที่ใช้ระหว่างอุปกรณ์ ตัวอย่าง คือรายละเอียดของข้อมูลแฮนด์ฟรี


BluetoothHeadset
เป็นให้การสนับสนุนสำหรับชุดหูฟังบลูทูธ ที่จะใช้กับโทรศัพท์มือถือ ซึ่งรวมถึงชุดหูฟังบลูทูธ และแฮนด์ฟรีโปรไฟล์ (v1.5)


BluetoothA2dp
เป็นการกำหนด ข้อมูลเสียงที่มีคุณภาพสูงสามารถสตรีมจากเครื่องหนึ่งไปยังอีกกว่าการเชื่อมต่อบลูทูธ "A2DP" หมายถึงรายละเอียดการส่งข้อมูล ระบบเสียงขั้นสูง


BluetoothHealth
หมายถึง พร็อกซี่ ที่ควบคุมการให้บริการบลูทูธ
 ด้านอุปกรณ์เพื่อสุขภาพ หรือเครื่องมือแพทย์

BluetoothHealthCallback
เป็นการดำเนินการเรียกข้อมูลกลับมาจาก BluetoothHealth ใช้วิธีการส่งข้อมูลกลับเพื่อรับการปรับปรุงเกี่ยวกับการเปลี่ยนแปลงในสถานะการลงทะเบียนของโปรแกรมประยุกต์และ ปรับปรุงช่องทางการสื่อสารของบลูทูธ


BluetoothHealthAppConfiguration
หมายถึงการกำหนดค่าโปรแกรมประยุกต์บลูทูธด้านสุขภาพของบุคคลอื่น ที่ลงทะเบียนในการสื่อสารกับอุปกรณ์บลูทูธ จากระยะไกล


BluetoothProfile.ServiceListener
เป็นอินเตอร์เฟซที่แจ้งให้ BluetoothProfile IPC เมื่อได้รับการเชื่อมต่อไปยังหรือตัดการเชื่อมต่อจากการให้บริการ (นั่นคือการให้บริการภายในที่ทำงานรายละเอียดตามที่กำหนดไว้)










 รับเขียนโปรแกรม Android Application และสอนการเขียนโปรแกรม สอน online ได้

อดุลย์ 081-6452400  e-mail fongwe_a@hotmail.com
 สอนเขียนโปรแกรม Android Application สอนแบบ online ได้ทั่วประเทศ กำหนดเวลาเรียนได้
การเรียน Android Application แบบ online สามารถกำหนดเวลาเรียน เองได้ ตามแต่ตกลงกัน

Course
1.JAVA Programming สำหรับผู้ที่ยังไม่มีพื้นฐานทางด้าน การเขียนโปรแกรม JAVA
เรียน 3-5 ครั้ง ครั้งละ 2 ชั่วโมง 

2.Beginning Android Development เริ่มต้นการพัฒนาด้วย Android ( ต้องมีพื้นฐาน JAVA แล้ว )
เรียน 5-7 ครั้ง ครั้งละ 2 ชั่วโมง 

3.Android Application สอนตามความต้องการในการเขียนโปรแกรม ใช้งานจริง เช่น โปรแกมเกม หรือ โปรแกรมใช้งานด้านต่างๆ
ระยะเวลา และ ค่าเรียน ตามแต่ความยากง่ายของโปรแกรม ซึ่งอาจจะรวมสอน JAVA Programming ด้วยสำหรับผู้เริ่มต้นเลย

more info about Android Development
http://androiddevelopersthai.blogspot.com/

Android example code 
http://androidcodeexample.blogspot.com/




24 ความคิดเห็น:

  1. Really this is one of the useful post.I like your blog tips.thanks for share with us.Good work.
    Android app developers

    ตอบลบ
  2. ผมสนใจ Android Bluetooth control 8 devices with Arduino Board อยากจะขอโค้ดไปศึกษามีให้โหลดมั้ยครับ ขอบคุณครับ

    bangkkub99999@gmail.com

    ตอบลบ
  3. ผมก็อยากได้อีกคนครับแต่ขอเป็นกดติดปล่อยดับครับ paramotorplay@gmail.com ขอสั่งบรูทูตโมดุล และบอร์ดไมโครคอนโทรลเลอร์ และรีเลย์ครับ ส่งเมลมาได้เลยครับผมโอนแล้วส่งของครับ

    ตอบลบ
  4. ผมสนใจ Android Bluetooth control 8 devices with Arduino Board อยากจะขอโค้ดไปศึกษามีให้โหลดมั้ยครับ ขอบคุณครับ

    sriputtakhun@gmail.com

    ตอบลบ
  5. I want to project "Android Bluetooth Control Device" to be aims to develop. You can sent to email vantrung290292@gmail.com . Thank you so much !

    ตอบลบ
  6. I want to project "Android Bluetooth Control Device" to be aims to develop. You can sent to email vantrung290292@gmail.com . Thank you so much !

    ตอบลบ
  7. ผมสนใจอยากศึกษาcode ช่วยส่งโค๊ตมาให้ทีได้มั้ยครับ fs_per_ice@hotmail.com ขอบพระคุณมากครับ

    ตอบลบ
  8. ผมสนใจ code.กลอุปกรณ์. ครับขอข้อมูลเพิ่มเติม
    Sakchaichoorat@hotmail.com

    ตอบลบ
  9. ผมอยากศึกษาโค้ดแอพของandroidครับ ช่วยส่งมาที่ earth_rockseed@hotmail.com ขอบคุณครับ

    ตอบลบ
  10. ผมก็อยากได้โค้ด Android Bluetooth control 8 devices with Arduino Board ครับ ช่วยส่งมาที่
    nack_lampard@hotmail.com ขอบคุณครับ

    ตอบลบ
  11. Hi,
    I would to ask, how are working bluetooth communication android with external device. How android send data by bluetooth exactly? I need read data with external device and I don't know "where"? Could you tell me, how are you sending message and how are you reading in external device. My email is rihajan9@fel.cvut.cz
    All the best
    John

    ตอบลบ
  12. อยากได้ code Android Bluetooth control 8 devices with Arduino Board ครับ ช่วยส่งมาที่ boat.zeen@gmail.com รบกวนด้วยนะครับ ขอบคุณมากครับ

    ตอบลบ
  13. ผมสนใจลงทะเบียนเรียน online ทำอย่างไรบ้างครับ ต้องลง Program อะไร บ้าง ค่าใช้จ่ายอย่างไงครับ
    รบกวนขอรายละเอียดด้วยนะครับ ขอบคุณครับ
    yanyongsy@gmail.com

    ตอบลบ
  14. Sir I loved your project very much your projects very very much. Please give give the source code....

    ตอบลบ
  15. excelente aporte ala comunidad amigo.. me podrías pasar el código fuente por favor me salvarías de antemano gracias. balmori_06@hotmail.com

    ตอบลบ
  16. Please send me Android source code for this project to mohamad.dani@gmail.com. thanks.

    ตอบลบ
  17. พอดีเป็นนักศึกษากำลังทำโปรเจคเกี่ยวกับการ Monitoring ไฟฟ้า
    อยากขอ Code Andriod มาศึกษาหน่อยครับ

    ตอบลบ
  18. เห็นมีแต่คนขอฟรี ๆ แล้วนัดพัฒนาที่ใหนจะมีแรงคิดละครับเนี่ย

    ตอบลบ
  19. สังคมไทยน่าห่วงนะครับเนี่ย คนทุกวันนี้ เห็นแต่ได้ประโยชน์เป็นของตัวเอง สิ่งที่ตัวเองทำมองว่ายาก สิ่งที่คนอื่นทำมองว่าง่าย ๆ ไม่กล้าลงทุนแต่อยากได้้ผลประโยชน์ ไม่แปลกที่สังคมทุกวันนี้ มันแย่ลง ด้วยความเป็นห่วง ต่อสังคมไทยครับ

    ตอบลบ
  20. Thailand social concern, but I think people now see it's own benefit. What made ​​themselves look tough. What others do not dare look simple, but would not benefit investors. Not surprising that today's society it worse with worry. Thailand on social

    ตอบลบ
  21. ฉันสามารถส่งรหัสเพื่อ Arduino บลูทู ธ โปรด

    ตอบลบ
  22. Can HC-05 be used to send as well as receive data? My module can send but not receive data.wat should I do? If u have a code that can help me, plz send it to me at sehrishajmal @hotmail.com

    ตอบลบ
  23. ผมสนใจโค้ด เชื่อมต่อ แอดดอย กับบรูทูด และคำสั่งงานการทำงาน พอดีผมจะเอาไปประยุก นะคับใช้กับอย่างอื่น พี่ช้วยส่งมาที่ yacusa.g@hotmail.com ด้วยนะคับ ขอบคุณอย่างสูงคับ (อธิบายด้วยก็ดีนะคับ ผมมือใหม่อยู่)

    ตอบลบ
  24. Hay Bro can you please tell us about your applications development

    ตอบลบ