• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 17:28
CET 23:28
KST 07:28
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10[ASL20] Finals Preview: Arrival13
Community News
[TLMC] Fall/Winter 2025 Ladder Map Rotation12Weekly Cups (Nov 3-9): Clem Conquers in Canada4SC: Evo Complete - Ranked Ladder OPEN ALPHA8StarCraft, SC2, HotS, WC3, Returning to Blizzcon!45$5,000+ WardiTV 2025 Championship7
StarCraft 2
General
Mech is the composition that needs teleportation t RotterdaM "Serral is the GOAT, and it's not close" RSL Season 3 - RO16 Groups C & D Preview [TLMC] Fall/Winter 2025 Ladder Map Rotation TL.net Map Contest #21: Winners
Tourneys
RSL Revival: Season 3 Sparkling Tuna Cup - Weekly Open Tournament Constellation Cup - Main Event - Stellar Fest Tenacious Turtle Tussle Master Swan Open (Global Bronze-Master 2)
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 499 Chilling Adaptation Mutation # 498 Wheel of Misfortune|Cradle of Death Mutation # 497 Battle Haredened Mutation # 496 Endless Infection
Brood War
General
FlaSh on: Biggest Problem With SnOw's Playstyle What happened to TvZ on Retro? SnOw's ASL S20 Finals Review BW General Discussion Brood War web app to calculate unit interactions
Tourneys
[Megathread] Daily Proleagues Small VOD Thread 2.0 [BSL21] RO32 Group D - Sunday 21:00 CET [BSL21] RO32 Group C - Saturday 21:00 CET
Strategy
PvZ map balance Current Meta Simple Questions, Simple Answers How to stay on top of macro?
Other Games
General Games
Should offensive tower rushing be viable in RTS games? Path of Exile Stormgate/Frost Giant Megathread Nintendo Switch Thread Clair Obscur - Expedition 33
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread SPIRED by.ASL Mafia {211640}
Community
General
Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread US Politics Mega-thread Artificial Intelligence Thread Canadian Politics Mega-thread
Fan Clubs
White-Ra Fan Club The herO Fan Club!
Media & Entertainment
Movie Discussion! [Manga] One Piece Anime Discussion Thread Korean Music Discussion Series you have seen recently...
Sports
2024 - 2026 Football Thread Formula 1 Discussion NBA General Discussion MLB/Baseball 2023 TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
Dyadica Gospel – a Pulp No…
Hildegard
Coffee x Performance in Espo…
TrAiDoS
Saturation point
Uldridge
DnB/metal remix FFO Mick Go…
ImbaTosS
Reality "theory" prov…
perfectspheres
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2112 users

[advice needed] Android + bluetooth + arduino

Blogs > evanthebouncy!
Post a Reply
evanthebouncy!
Profile Blog Joined June 2006
United States12796 Posts
Last Edited: 2014-01-28 09:38:03
January 28 2014 09:34 GMT
#1
Hello,

I need to learn how to develop an android app that communicates to an arduino controller via blue tooth.

A minimalistic app will be something like controlling the brightness of an LED from the android phone while monitoring the current brightness of it with a light sensor, displaying a reading on the phone. This includes a basic 2-way communication, adjusting brightness from phone to device, and reporting a reading from device to phone.

Here is where I stand:
I have completed the hello-world programming for android (activities, actionbars, etc)
I have 0 idea of how arduino works
I have years of software engineering experience (although I have not programmed a microcontroller before)
I have not touched circuits / electronics since undergrad, I know what is a capacitor (omg! haha) but that's about it.

So what I imagine I'll need is a very self-contained tutorial, from what parts to buy, to how to wire up the circuit, and detailed instruction of how to code up both the arduino and the mobile phone.

If anyone is an expert in this area and would like to recommend me an online tutorial for me it will be awesome. There are a lot out there but I cannot be sure if one is good or not. The tutorial should ideally be very simple but contains the basic elements of communication between the devices.

much love!
--evan

Life is run, it is dance, it is fast, passionate and BAM!, you dance and sing and booze while you can for now is the time and time is mine. Smile and laugh when still can for now is the time and soon you die!
Djagulingu
Profile Blog Joined December 2010
Germany3605 Posts
Last Edited: 2014-01-28 17:08:54
January 28 2014 11:22 GMT
#2
On January 28 2014 18:34 evanthebouncy! wrote:
So what I imagine I'll need is a very self-contained tutorial, from what parts to buy, to how to wire up the circuit, and detailed instruction of how to code up both the arduino and the mobile phone.

I'm not an expert at wireless communication devices, but i think you can easily find tutorials on the internet about it. I programmed wired communication using PIC microcontrollers and RS232 protocol, but not bluetooth and arduino.

What you need is:

1- An(y) Arduino board (I'm guessing that it is a hobby project, so I'll recommend Arduino Uno)
2- A bluetooth transceiver device that is compatible with Arduino well, I guess all of them are compatible with Arduino. Mobile phone probably has its own bluetooth transceiver, so you will need only 1 bluetooth transceiver.
3- The system that will be actuated by control signals from Arduino (it might be a DC Motor, a LED whose lighting frequency or brightness will be determined by Arduino or even a speaker which will be used by Arduino to generate different sounds by feeding it by different frequencies, that is totally up to you and your creativity)
4- A current amplifier (I didn't read Arduino Uno's datasheet or datasheets of any Arduino boards but I don't think it supplies enough current for anything but a simple LED)

Connections will be pretty simple and straightforward (I'm serious, you'll have input(s) from the bluetooth transceiver and outputs to the system itself), programming Arduino is so fucking much easier than any other microcontroller (due to the simple fact that it is programmed using embedded C and not assembly).

After that, you need to hit the online tutorials about Android programming and Arduino programming. There are lotsnlots of hobbyists around, using various Arduino boards for their hobby projects, so I don't think you'll be having difficulties finding tutorials for programming the Arduino board, I'm not sure about Android programming though. Actually, you can PM me if you have good tutorials about it, because I don't.

EDIT: Oh, it involves measuring brightness and sending it to the phone. Here is how you do it:

1- FUCK light sensor. Seriously. You'll have a fuckton of interference. Use a simple resistor instead, measure the voltage across it. The more current LED draws, the brighter it lights. Simple as that.

2- You'll need to configure arduino pins that are connected to bluetooth transceiver as input pins/output pins when you expect to receive/send. Just configure then as output when you want to send stuff and input for the rest of the time.

3- Use timer interrupts. When you get a timer interrupt, measure the current, configure as output, send stuff to phone, configure as input, return from interrupt.

EDIT 2: For the brightness control, you might need to use 4 (or 8, or 16, or whatever number that can be expressed by 2^n where n is an integer) pins for output and a Digital-to-Analog Converter so that the raw integer number (that is between 0-(2^n-1)) which is sent by your phone can be expressed as different voltage levels and consequently different brightness levels. You can find different DAC circuits on the net. My favorite one is n-2n ladder circuit.
"windows bash is a steaming heap of shit" tofucake
RoyGBiv_13
Profile Blog Joined August 2010
United States1275 Posts
Last Edited: 2014-01-28 20:02:49
January 28 2014 20:01 GMT
#3
On January 28 2014 20:22 Djagulingu wrote:
Show nested quote +
On January 28 2014 18:34 evanthebouncy! wrote:
So what I imagine I'll need is a very self-contained tutorial, from what parts to buy, to how to wire up the circuit, and detailed instruction of how to code up both the arduino and the mobile phone.

I'm not an expert at wireless communication devices, but i think you can easily find tutorials on the internet about it. I programmed wired communication using PIC microcontrollers and RS232 protocol, but not bluetooth and arduino.

What you need is:

1- An(y) Arduino board (I'm guessing that it is a hobby project, so I'll recommend Arduino Uno)
2- A bluetooth transceiver device that is compatible with Arduino well, I guess all of them are compatible with Arduino. Mobile phone probably has its own bluetooth transceiver, so you will need only 1 bluetooth transceiver.
3- The system that will be actuated by control signals from Arduino (it might be a DC Motor, a LED whose lighting frequency or brightness will be determined by Arduino or even a speaker which will be used by Arduino to generate different sounds by feeding it by different frequencies, that is totally up to you and your creativity)
4- A current amplifier (I didn't read Arduino Uno's datasheet or datasheets of any Arduino boards but I don't think it supplies enough current for anything but a simple LED)

Connections will be pretty simple and straightforward (I'm serious, you'll have input(s) from the bluetooth transceiver and outputs to the system itself), programming Arduino is so fucking much easier than any other microcontroller (due to the simple fact that it is programmed using embedded C and not assembly).

After that, you need to hit the online tutorials about Android programming and Arduino programming. There are lotsnlots of hobbyists around, using various Arduino boards for their hobby projects, so I don't think you'll be having difficulties finding tutorials for programming the Arduino board, I'm not sure about Android programming though. Actually, you can PM me if you have good tutorials about it, because I don't.

EDIT: Oh, it involves measuring brightness and sending it to the phone. Here is how you do it:

1- FUCK light sensor. Seriously. You'll have a fuckton of interference. Use a simple resistor instead, measure the voltage across it. The more current LED draws, the brighter it lights. Simple as that.

2- You'll need to configure arduino pins that are connected to bluetooth transceiver as input pins/output pins when you expect to receive/send. Just configure then as output when you want to send stuff and input for the rest of the time.

3- Use timer interrupts. When you get a timer interrupt, measure the current, configure as output, send stuff to phone, configure as input, return from interrupt.

EDIT 2: For the brightness control, you might need to use 4 (or 8, or 16, or whatever number that can be expressed by 2^n where n is an integer) pins for output and a Digital-to-Analog Converter so that the raw integer number (that is between 0-(2^n-1)) which is sent by your phone can be expressed as different voltage levels and consequently different brightness levels. You can find different DAC circuits on the net. My favorite one is n-2n ladder circuit.


The above post mentions quite a few low level requirements for driving the bluetooth modem and measuring the light sensor. This would be the case if you were using a PIC, or had to write your own driver level code. Fortunately, the Arduino platform is a very well developed library with most of this already written for you, so your project on that side will be relatively easy. I would suspect that a weekend would be enough time to dig through the examples and build your arduino led/light sensor toy.

Most Arduinos have an ADC/DAC on-chip peripheral. It should be pretty straight forward to use for dimming the LED and reading the light sensor (many of which output just a straight voltage).
http://www.adafruit.com/products/1384
http://www.adafruit.com/products/161

For bluetooth, the easiest route is to use a bluetooth modem, which will effectively emulate a serial wire between the phone and the arduino: http://www.adafruit.com/products/1588

Adafruit or Sparkfun comes with enough examples and tutorials to get you going on that front. From the links I sent you, just click on the "tutorial" tab to get you going! It should have a software example for you.

For the mobile part of your project, I don't have any great resources as I tend to avoid bluetooth at all costs these days, and go with websockets instead.
Any sufficiently advanced technology is indistinguishable from magic
Please log in or register to reply.
Live Events Refresh
The PiG Daily
20:30
Best Games of SC
Serral vs Clem
Solar vs Cure
Serral vs Clem
Reynor vs GuMiho
herO vs Cure
PiGStarcraft322
LiquipediaDiscussion
BSL 21
20:00
ProLeague - RO32 Group C
Tarson vs Julia
Doodle vs OldBoy
eOnzErG vs WolFix
StRyKeR vs Aeternum
ZZZero.O323
LiquipediaDiscussion
OSC
19:00
Masters Cup #150: Group B
davetesta56
Liquipedia
PSISTORM Gaming Misc
15:55
FSL teamleague CNvsASH, ASHvRR
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
PiGStarcraft322
Nathanias 119
ProTech70
StarCraft: Brood War
Shuttle 935
ZZZero.O 323
NaDa 58
Dota 2
LuMiX1
Counter-Strike
fl0m1107
Super Smash Bros
AZ_Axe111
Other Games
tarik_tv6434
Grubby5300
summit1g4453
gofns4093
DeMusliM420
Pyrionflax195
Fuzer 191
Dewaltoss14
ViBE11
Organizations
Other Games
EGCTV935
gamesdonequick798
StarCraft 2
angryscii 33
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 19 non-featured ]
StarCraft 2
• StrangeGG 58
• musti20045 19
• Dystopia_ 3
• IndyKCrew
• Migwel
• AfreecaTV YouTube
• sooper7s
• intothetv
• Kozan
• LaughNgamezSOOP
StarCraft: Brood War
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• masondota2715
• Ler80
Other Games
• imaqtpie1667
• WagamamaTV495
• Shiphtur261
• tFFMrPink 13
Upcoming Events
Sparkling Tuna Cup
11h 33m
RSL Revival
11h 33m
Reynor vs sOs
Maru vs Ryung
Kung Fu Cup
13h 33m
Cure vs herO
Reynor vs TBD
WardiTV Korean Royale
13h 33m
BSL 21
21h 33m
JDConan vs Semih
Dragon vs Dienmax
Tech vs NewOcean
TerrOr vs Artosis
IPSL
21h 33m
Dewalt vs WolFix
eOnzErG vs Bonyth
Replay Cast
1d
Wardi Open
1d 13h
Monday Night Weeklies
1d 18h
WardiTV Korean Royale
2 days
[ Show More ]
BSL: GosuLeague
2 days
The PondCast
3 days
Replay Cast
4 days
RSL Revival
4 days
BSL: GosuLeague
4 days
RSL Revival
5 days
WardiTV Korean Royale
5 days
RSL Revival
6 days
WardiTV Korean Royale
6 days
IPSL
6 days
Julia vs Artosis
JDConan vs DragOn
Liquipedia Results

Completed

Proleague 2025-11-14
Stellar Fest: Constellation Cup
Eternal Conflict S1

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
SOOP Univ League 2025
YSL S2
BSL Season 21
CSCL: Masked Kings S3
SLON Tour Season 2
RSL Revival: Season 3
META Madness #9
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025

Upcoming

BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter 2026: Closed Qualifier
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.