Source code will be published soon.
Saturday, 10 December 2011
Bidirectional communication implemented
Source code will be published soon.
Thursday, 3 November 2011
Tuesday, 27 September 2011
Finally it worked!
The communication is biderectional, it can go from the Arduino to the Android device and vice versa. When you start the application, it is ready to be sent and received in ASCII mode. The data received is stored in a buffer and then will appear on the screen, there is no real-time display.
After stablishing the communication in both ways, I decided to obtain real data from real world, so I decided to measure the temperature of my workroom.
I connected a thermistor to one of the Analog input pin in the arduino and using the data it obtains I am able to read them in my Andorid device through the audio port. The speed of communication I get is around 315 bps, it is not to much, but for the moment it is enough for the data I'm testing. In a future I will try to increase the amount of data I can send.
Monday, 12 September 2011
Demodulation in Android device (II): Reading sound.
In order to do this, I used the ByteBuffer class:
public ByteBuffer wrap (byte [] array, int start, int byteCount)
The new buffer's position will be
start
, limit will be
start + byteCount
, capacity will be the length of the array.Parameters
array | the byte array which the new buffer will be based on. |
---|---|
start | the start index, must not be negative and not greater than
array.length . |
byteCount | the length, must not be negative and not greater than
array.length - start . |
Returns
The created byte buffer.
public abstract short getshort()
The 2 bytes starting at the current position are composed into a short according to the current byte order and returned.
Returns
the short at the current position.
public static final ByteOrder LITTLE_ENDIAN
Friday, 2 September 2011
They are here!!
Disclaimer
Connection
Connect to Arduino as follows (right side is the Arduino's pin.)
FSKOUT → D3
GND → GND
VCC → VCC
FSKIN → D6
AIN1 → D7
Volume Adjustment
Measure the voltage on AIN1 with tester to make it (VCC / 2) + 300mV.5V VCC: 2.7V AIN1
3.3V VCC: 1.95V AIN1
Thursday, 1 September 2011
LG GT540 is alive!!!
Issues to consider:
- I will NOT take responsibility for possible errors that could affect the device.
- I suggest to back up every app, docs, contacts...
- Download the firmware, you can choose from this list. I used and suggest: V20A
- Download and extract the KDZ UPDATER ENGLISH.
- Download and install the LG GT540 driver from offical website.
- LG GT540 -> Settings->Applications->Development-> Enable USB debugging.
- Settings->SD card & phone storage->Disable Mass storage only.
- Connect your LG to your computer with the USB link.
- Execute KDZ_FW_UPD.exe and select 3GQCT.
- Look for the archive KDZ that we previously downloaded and press the long button down there.
- The GT540 will star a process that might take for 5 minutes, the device will be set up in Emergency Mode several times, but don't worry about that. You don't need to do anything. DON'T TRY TO DISCONNECT THE DEVICE, DON'T INTERRUPT THE PROCESS, DON'T SHUTT IT OFF. Once it finishes the proecces it will be restarted by default. It will be like the first time you used it, like if it were recently made.
- KDZ Updater will anounce that the process is over, so here is when we can disconnect the GT540,
Wednesday, 31 August 2011
Upgrading LG gt540
One solution for this trouble:
1. Unplug USB
2. Remove the battery
3. Hold the volume down button (LHS of phone) and reinsert USB lead at the same time
4. I then re-ran the update program.
LG Program Download
USB Driver Download
When you install the update be patient!!!!!! It takes forever
Wednesday, 24 August 2011
Demodulation in Android device (I): Recording sound.
While I was updating it, my computer stuck so I had to restart it. Then I tried to power on my LG device and never came back on again, I could only see the LG logo. That's why I need to reboot my device, but I don't think this take my long time because there is a lot of information about it on the internet.
Well, while I try to fix this accident I'm working on how to demodulate the signals from the arduino in an Android device.
I'm trying some classes in API Level 3:
read(byte[], int, int)
, read(short[], int, int)
or read(ByteBuffer, int)
. The choice of which method to use will be based on the audio data storage format that is the most convenient for the user of AudioRecord. public AudioRecord (int audioSource, int sampleRateInHz, int channelConfig, int audioFormat, int bufferSizeInBytes)
public static int getMinBufferSize (int sampleRateInHz, int channelConfig, int audioFormat)
- AudioTrack
write(byte[], int, int)
and write(short[], int, int)
methods.public AudioTrack (int streamType, int samplieRateInHz, int channelConfig, int audioFormat, intBufferSizeInBytes, int mode)
Monday, 22 August 2011
Nice find: Getting source code from an APK file
"procedure to decoding .apk files---step wise method-->
step 1:
make a new folder and put .apk file (which you want to decode) now rename this .apk file with extension .zip (eg:rename from filename.apk to filename.apk.zip) and save it..now you get classes.dex files etc...at this stage you are able to see drawable but not xml and java file...so cont...
step 2:
now extract this zip apk file in the same folder(in this eg or case NEW FOLDER). now dowmload dex2jar from this link http://code.google.com/p/dex2jar/ and extract it to the same folder (in this case NEW FOLDER).....now open command prompt and reach to that folder (in this case NEW FOLDER)....after reaching write "dex2jar classes.dex" and press enter.....now you get classes.dex.dex2jar file in the same folder......now download java decompiler from http://java.decompiler.free.fr/?q=jdgui and now double click on jd-gui and click on open file then open classes.dex.dex2jar file from that folder...now you get class file...save all these class file (click on file then click "save all sources" in jd-gui)..by src name....at this stage you get source...but xml files are still unreadable...so cont...
step 3:
now open another new folder and put these files
put .apk file which you want to decode
download apktool using google and put in the same folder
download framework-res.apk file using google and put in the same folder
Open a command window
Navigate to the root directory of APKtool and type the following command: apktool if framework-res.apk
apktool d "fname".apk ("fname" denotes filename which you want to decode)
now you get a file folder in that folder and now you can easily read xml files also.
step 4:
it's not any step just copy contents of both folder(in this case both new folder)to the single one
and now enjoy wid source code... "
Video Tutorial APKtool
Found in: stackoverflow.com
Friday, 5 August 2011
System Architecture
This project aims to build an Arduino-powered interface to get data from any real-world, analog sensor into a smartphone (Android device) using the audio port as the communication channel between both platforms.
Sensor: obtain some values we want to know, they can be temperature, pressure, humidity, amount of light... These values are related to a voltage, a continuous value that is measured in certain periods of time.
We can measure current temperature of the environment using a simple temperature sensor LM335 and an Arduino with the help of a small circuit and a simple Arduino code.
With this what we obtain is an analog signal related to the value from the sensor, this is the modulation part.
Now we want to work with this signal in our mobile device, as we already decided and commented here, this is going to be done through the audio port. That's why we need and are going to use the Softmodem board, which allows us to connect the arduino board and our mobile device with an audio jack cable.
Using compatible FSK libraries on both the Arduino side and the Android side, we can actually accomplish bi-directional communication between our sensor rig and our mobile device. The Arduino gives us the onboard computing power to be able to both write and read data using FSK. As a first example, we’ll try to establish a unidirectional connection, sending data from the sensor to de Android device only. Still, we need to do FSK on both the Arduino side (modulation, or encoding the sensor data as audio) and the Android side (Application) (demodulation, or decoding the audio as data). So, all the raw materials are here for a bi-directional connection.
We need to decide in which frequencies we are going to encode:
This library is setup to encode data in shifts between audio frequencies 4000Hz (LOW) and 8000Hz (HIGH).
First, you need the sensor, Arduino and supporting circuitry for gathering data. For this we connect the sensor which will feed the Arduino.
You will also need to build some simple circuitry and load some code onto the Arduino.
Final objective: Android device <- (softmodem)->Arduino<-(rs232) are communicating said configuration->PC.
Thursday, 21 July 2011
Friday, 15 July 2011
Great Alliance
Arduino and Telefonica alliance: "Is easy to connect to the world, any object. [Blodic.us]"
El internet de las cosas crece. [El País]
Arduino y Telefónica fácil conectar al mundo cualquier objeto. [Xataka]
Break time for 'Gadgeting'
After a time looking for a lot of useful info on the web, now I have in my hands a Chumby. It's the first time I heard about this gadget, so I decided to find out the different possibilities it offers.
At first sight, when I started to discover its performance, I thought, this is a modern clock/alarm clock, but later I found out more interesting options. Chumby can acts as:
- Digital Photo Frame/web, where you can see your Facebook/Flickr photos.
- RSS Feed/News Reader: You can be informed about the news around the world.
- Gaming device: several basic games, Sudoku, sliding puzzles...
- iPod speaker, thank to the speaker it has behind. (the only thing I didn't like, is that i couldn't connect my iPhone...)
It's called Webby and it's an evolution of the Chumby developed by Avantis. As I said, the main difference is the implementation of Android over a Linux kernel.
How can I connect Arduino to a smartphone (Android)?
Arduino is, also an Open microcontroller platform which allows to interact with a bunch of sensors, so these devices can be easily implemented.
Now I'm going to present different options that I found on several blogs to implement the connection:
- Sensor Data to iPhone Through the Headphone Jack: http://bit.ly/mcmQN4
- Project Hijack: http://bit.ly/enJiUX
- iPhone Thermometer - Temperature Logger: http://bit.ly/c7RNNe Important: FSK Link
- SoftModem Interface Board: http://bit.ly/nMahcu
- SoftModem tested on Android: http://bit.ly/pJFurJ
- Additional OpenHardware: SOFTMODEM BOARD http://bit.ly/or5irV
- Connecting Nokia phone to Arduino (USB cable): http://bit.ly/pqp3Pn
- Experimenting with Android and Arduino: http://bit.ly/hr2Ebt
- Amarino: http://www.amarino-toolkit.net/index.php
- Zigduino: http://www.logos-electro.com/zigduino/
Tuesday, 5 July 2011
Twitter Account
I've created a Twitter account for this blog: @Tec_Androino, I think is a good way to share my work with everybody.
Hi everyone!!
After a time spent taking my last exams in college, I will have plenty time to develop this project as my Final Project.
First of all, I would like to introduce myself:
I'm Alberto Pascual, Telecommunications Engineering. I studied at the University of Navarra (TECNUN), in San Sebastián, and I also spent a period of six months in Sweden at Linköping Universitet this academic year. That's why I'll try to do my best writing this project in English.
I would like to annotate that I'm really excited with the project I chose, because I think that is a great opportunity to learn about some technologies that are taking a great impact nowadays.
I hope you enjoy this project as much as I do.
See you around here.