Thursday, April 28, 2011

Bluetooth remote

This is a project I made for school. It is a controller for blinds. It consists of an atmega board, with a servo and a light sensor, which is connected to the computer via an USB-Serial adapter. On the PC you can view the light level and control the servo position. You can also connect an Android terminal to the PC via Bluetooth (SPP) and command the servo or view the light level.

I could've used a dedicated bluetooth module for the communication between the phone and the atmega board, but those were the instructions :)


 The board schematic will be uploaded soon
(board schematic)

Source code (for the mega8 board, android and windows) is available here:

17 comments:

  1. can you post the schematic also??

    ReplyDelete
  2. i was make a project to control a sliding door. can you explain more about how to communicate between android and atmega...
    thanks a lot

    ReplyDelete
  3. The communication with the android terminal is done via bluetooth with SPP (serial port profile). So basically on the android part you have a socket that you write/read to/from and the data arrives on the PC via a normal serial port or on a bluetooth adapter that has a serial port. I'm working now on v6.1 of the music player which will have a bluetooth module and an android terminal will be used as a remote.

    Stay tuned! :)

    ReplyDelete
  4. I want to use bluetooth headset as module.
    but i still confuse how to communicate headset and atmega. do have any idea?
    bluetooth headset use headset profile

    ReplyDelete
  5. hi..can you give your schematic board?
    im comfused what pin i use for data servo...
    i need your instruction... :(

    ReplyDelete
  6. not run,, :(
    can we chat? via gmail or ym?? i need to ask you some question ..
    i want make project like this,,but i want control servo via android.just android comunicate with atmega8,,not via PC
    i hv use bloetooth in kit atmega8,

    my gmail andichyme@gmail.com

    ReplyDelete
  7. Which bluetooth adapter did you use? I am looking to find a bluetooth adapter to work with an atmega32, so I figured this would be a good starting point.

    ReplyDelete
    Replies
    1. I actually used the netbook as a bluetooth adapter but you can use those cheap serial port bluetooth modules all over on ebay.

      Delete
  8. Hi! I am trying to use HC 05 with mega 16. Can you suggest me the UART code for it. I have tried alot of bauds and F_CPU's but all in vain! The data being TX n RX is still gibberish!!!

    ReplyDelete
    Replies
    1. Try getting it working on the PC first (with a USB->UART converter). The code on the AVR is the same as any UART code.

      Delete
  9. Replies
    1. There's a link in the blog entry
      https://www.dropbox.com/s/vb6fkl9xtlj16dj/Android_Remote.zip

      Delete
  10. Hello! I have one question... How can I install this Android app to my phone? Thank you!!

    ReplyDelete
    Replies
    1. You would need to compile it and package it into an apk file. This file would need to run on the phone.
      Check Android Development Kit (ADK), it can do all of the above.

      Delete
  11. could you share the schematic, so far the app works fine I did a import eclipse project to android studio but I still need to get the atmega working

    ReplyDelete