In modern smartphones, there are a lot of useful sensors for an ingenious arduino project. I have a motorola DEFY, for example and it has (at least) 6 sensors :
- light sensor
- proximity sensor
- aGPS (assisted gps)
- compass/magnetometer
- accelerometer
- orientation sensor
This instructable's purpose is to get you started using these sensors from your arduino. For this, we're going to use an application that was made for that single purpose : Amarino 2.0 . This app was first started by Bonifaz Kaufmann during his visit at the High-Low Tech Group in 2009 at the MIT Media Lab in Cambridge, USA and further developed at the University of Klagenfurt in Austria.
The overall cost of this project, considering you already have an arduino and an android smartphone, can be pretty low (it cost me about 12$).
If you liked this instructable, please rate it !
Remove these ads by
Signing UpStep 1: Required Parts/Tools
- solder iron with fine tip
- tiny solder wire
- good magnifying glass
- "Third hand" helping tool
- good soldering skills
Required parts :
- Arduino
- Android smartphone
- Bluetooth serial adapter (not needed if you happen to have an arduino BT)
- 10 and 20 kOhm resistors
- Breadboard
- Standard servo motor
- jumper wires and/or small wires
Since the ArduinoBT has Bluetooth functionality built-in, setup is much easier (no soldering, risks of messing up bt adapter, etc...) but since it costs pretty much, I went the cheap way, and bought a bluetooth to serial adapter from ebay.
Okay, so where do you buy those parts/components...
- Arduino : you can get this at sparkfun : (http://www.sparkfun.com/products/9950 ), from ebay or you can check the arduino website for other distributors (http://arduino.cc/en/Main/Buy )
- Android smartphone (I guess you already have that...)
- Bluetooth serial adapter : You can get this from sparkfun too, with a breakout board (http://www.sparkfun.com/products/10269 ). These don't need level shifting so if you buy this product, you don't need to buy the resistors. You can also get it from ebay, like I did, but they are more complex to set up and documentation isn't always accurate (mine was wrong on the default baud rate, for example) Here's the link to the one I bought : Bluetooth adapter.
- 10kOhm and 20kOhm resistors : these are needed to shift the 5v from the arduino serial pin to the 3.3v on the bluetooth adapter. You can get these at your local electronics shop.
- Breadboard : Not really necessary, but it is much easier (and cleaner) to wire the voltage divider on a breadboard, than to solder it and have wires everywhere. The breadboard isn't required if you choose to get the arduino BT or the bluetooth module from sparkfun. You can get a breadboard on ebay or again at sparkfun.com
- Jumper wires/small wires : you can get this from sparkfun too, but you can also salvage small wires from old electronics to keep the costs down.
- Servo motor : Not really required, but used in this instructable for an example with the accelerometer sensor. I'm using the futaba s3003. You can get this at your local hobby shop, ebay, or sparkfun .
Now It's the time to choose :
- you can go the pretty expensive, but also pretty easy way (no soldering) : go get an Arduino BT . (more than 100$)
- you can go the less expensive way, but less easier (a little soldering but no level shifting) : get a bluesmirf silver breakout board from sparkfun (approx. 40$)
- you can go the cheapest and hardest way (soldering AND level shifting required) : get a bluetooth module from ebay (less than 10$).
In this instructable,I'm going to get you started with the Bluetooth module from eBay.
So make your choice, get the parts/tools, and head to Step 2.










































Visit Our Store »
Go Pro Today »




that was the problem. I did manage to get an app that can 'discover' Class 0 devices..and I was able to pair the device to my phone. But, Amarino still tries to find new devices...and doesn't see the already paired Bluetooth device. So it doesn't connect. Any ideas ?
Thanks,
Nooman
Hope someone can help me. I am trying to pair my Android phone to a JY-MCU bluetooth module I bought from dealextreme. My phone can't find the device when it does a search (it finds other peoples laptops, etc. in my building but not the bluetooth device next to it).
I did try another non-Android old phone and it is able to both see and pair with the bluetooth module. Could this be a Baud rate issue ? Or an Android software issue ?
The Android phone can also detect my older non-Andriod phone and successfully pair with it also.
I think it has something to do with bug in the BroadComm bluetooth stack that is used by most Android phone manufacturers (LG, HTC, Samsung are affected, but not the Google Nexus phones) that prevents discovery to this and all other bluetooth devices that report their Class of Device (CoD) code as 0×00.
Do you guys have any suggestions ?
Kind regards,
Nauman
Hope someone can help me. I am trying to pair my Android phone to a JY-MCU bluetooth module I bought from dealextreme. My phone can't find the device when it does a search (it finds other peoples laptops, etc. in my building but not the bluetooth device next to it).
I did try another non-Android old phone and it is able to both see and pair with the bluetooth module. Could this be a Baud rate issue ? Or an Android software issue ?
The Android phone can also detect my older non-Andriod phone and successfully pair with it also.
Kind regards,
Nauman
Thanks
Nick.
In file included from Amarino_Servo.cpp:2:
C:\Users\Sally\Documents\Arduino\arduino-1.0.1-windows (2)\arduino-1.0.1\libraries\MeetAndroid/MeetAndroid.h:104: error: conflicting return type specified for 'virtual void MeetAndroid::write(uint8_t)'
C:\Users\Sally\Documents\Arduino\arduino-1.0.1-windows (2)\arduino-1.0.1\hardware\arduino\cores\arduino/Print.h:48: error: overriding 'virtual size_t Print::write(uint8_t)'
I am trying to upload the sketch on my arduino but i have some errors. I have put the meetamarino library and i get this error from my arduino IDE(arduino 1.0.2):
Compass_Led:10: error: 'MeetAndroid' does not name a type
Compass_Led:13: error: 'MeetAndroid' does not name a type
Compass_Led.ino: In function 'void loop()':
Compass_Led:40: error: 'meetAndroid' was not declared in this scope
Compass_Led.ino: In function 'void compass(byte, byte)':
Compass_Led:53: error: 'meetAndroid' was not declared in this scope
What arduino IDE did u use on this tutorial?
pls help me :)
I saw in your video, that the car is standing on the Arduino. Is it possible to change your project in the way that the car will move on the road? i mean instead of using bluetooth to connect to the smartphone, we can make the connection between the arduino, rc car and the smartphone through wireless?
I whant to go through this tutorial, and i don t really know what arduino microcontroller shoud i buy(i am not looking for a cheap one).
From what i understant from your tutorial, and from the other comments i understood that i can use a Arduino BT and no bluetooth adapter, or an arduino duemilanove with bluetooth adapter. Pls corect me if i am wrong.
I whanna know if i can use some other arduino board +/- bluetooth adapter.
A quick reply whoud be great.
I mean that if this arduino has an atmega 128, and i buy an arduino with a chipset atmega328(or any kind of chipset other than the atmega128) does this project will work?
pls reply :), sorry of my english is bad
Today i recived my BT module, going to solder it later, but now in trying to think about the code.
My goal is to make a rc car that you controll by tilting:)
How do I change the code to get the arduino to react when I tilt the phone another way?
Witch variable should I change??
Joachim!
P.s. Sorry for bad english(I'm Swedish)
It was very easy:)
I believe that this is the same BT module you can get for $6 ish at DealExtreme.com (dx.com ?). Look for datasheets on EGBT-046S and RF-0417C
When i'm installing the amarino arduino library it gives a "Deprecated file" and asks if i want to download the latest version and i download it.
When i try to run the compass_led.pde it gives me a error:
------D:\Programas\arduino-1.0\libraries\MeetAndroid/MeetAndroid.h:104: error: conflicting return type specified for 'virtual void MeetAndroid::write(uint8_t)'
D:\Programas\arduino-1.0\hardware\arduino\cores\arduino/Print.h:48: error: overriding 'virtual size_t Print::write(uint8_t)'--------
CAN ANYONE HELP ME, PLEASE !!!
processing.app.SerialException: Serial port 'COM5' already in use. Try quiting any programs that may be using it.
at processing.app.Serial.(Serial.java:144)
at processing.app.Serial.(Serial.java:76)
at processing.app.debug.Uploader.flushSerialBuffer(Uploader.java:75)
at processing.app.debug.AvrdudeUploader.uploadViaBootloader(AvrdudeUploader.java:88)
at processing.app.debug.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader.java:66)
at processing.app.Sketch.upload(Sketch.java:1664)
at processing.app.Sketch.exportApplet(Sketch.java:1624)
at processing.app.Sketch.exportApplet(Sketch.java:1578)
at processing.app.Editor$DefaultExportHandler.run(Editor.java:2314)
at java.lang.Thread.run(Thread.java:619)
processing.app.debug.RunnerException: Serial port 'COM5' already in use. Try quiting any programs that may be using it.
at processing.app.debug.Uploader.flushSerialBuffer(Uploader.java:99)
at processing.app.debug.AvrdudeUploader.uploadViaBootloader(AvrdudeUploader.java:88)
at processing.app.debug.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader.java:66)
at processing.app.Sketch.upload(Sketch.java:1664)
at processing.app.Sketch.exportApplet(Sketch.java:1624)
at processing.app.Sketch.exportApplet(Sketch.java:1578)
at processing.app.Editor$DefaultExportHandler.run(Editor.java:2314)
at java.lang.Thread.run(Thread.java:619)
any ideas? could it be because i am using an uno instead of a duemilanov?
' avrdude: stk500_getsync(): not in sync: resp=0x00'
if I try to upload with the Rx Tx pins connected to my UNO. I simply uploaded then connected the module and everything worked fine.
Thanks for the great tutorial!
Please help me with the bluetooth module, i want to change the baud rate and the pairing info, i used a usb to ttl adapter, connected TX, RX of USB to ttl to RX, TX of Bluetooth Module respectively and applied 3.7V to the Bluetooth module(made sure that its not in paired mode, Led flashing) - The problem i have is, as soon as i open session - hyper-terminal or putty or any com tool, the BT module is contentiously sending non stop 'Y' kind of characters
"ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ"
This is what i bought off ebay : "NEW Serial Bluetooth RF Transceiver Module RS232 Master + backplane 4 pin TTL"
Item No: 110805911219
I tried going through all the google searches but no vail, please help. Thanks in advance, Khan
motion sensor car?)
send it via email pls!!