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.