Sunday, September 28, 2014

Sinhala font installation on Sony Xperia V (Android)

You can install any Sinhala font from your mobile itself and use it in any browser you like with following instructions.

Preparation:

1) Root your device.
I rooted my Sony Xperia V (LT25i) with "towelroot" tool. No need to run complex scripts, just one click is enough.

2) Download a Sinhala ttf font to your phone and rename it to "DroidSansFallback.ttf" (or get a renamed file from here)
I have put this font file to "/sdcard1/DroidSansFallback.ttf" in the beginning.

3) Install a terminal emulator app from Google play store", I used this "terminal emulator"


Procedure:

Open the terminal emulator app and run the following commands in the given order.

1) Get root access
#su

2) Grant super user access to terminal emulator in the pop up window.

3) Get read/write access to /system
#mount -o rw,remount /system

4) Copy DroidSansFallback.ttf file /system/fonts
#cp /sdcard1/DroidSansFallback.ttf /system/fonts




































Now you can open your favorite browser and read Sinhala text, I used Firefox browser to test it.


Monday, March 17, 2014

Experimenting Near Field Communication (NFC) with NXP MIFARE MF1S50 tags with Sony Xperia V

I have a Near Field Communication (NFC) capable Sony Xperia V mobile phone and I was able to communicate phone to phone.  Then, I found some cheap NFC tags on ebay which are based on NXP MIFARE MF1S50 chips. I got 5 tags for US$ 3.95 from this seller. They have free space of 716 bytes which can be used to store user data.












First you have to enable NFC at the android settings. Then, you can communicate with tags by placing them in the bottom of the mobile phone.






















I used NFC TagInfo by NXP on Google play to identify the tags in the first place.






















I was able to format the tags and write data to them using NFC TagWriter by NXP in Google Play.In this example, I'm going to write plain text "hello" to the NFC tag.








































I was able to read the tag using the same application and also by using other applications such as NFC Tools.


Thursday, January 2, 2014

Gerber viewer for your Android mobile phone

When we are working with PCB fabrication systems, "Gerber" files are widely used as the input to the fabrication device from the CAD drawing. So, It is very useful to have a Gerber viewer on your mobile phone. Recenlty, I had to work with some microstrip designs and I had to check and compare the finished product at the fabrication facility. So, I found this free Gerber viewer at "Google Play" and you can find this at here. Here are some screeshots from this application showing a microstrip patch antenna in my mobile phone.





Interfacing sensors from Android mobile phone via Bluetooth

Most of the Android powered mobile phones have many in-built sensors. Android API gives us access to these sensors in API level without low level programming. Hence, we can use Bluetooth and these sensors to get sensor data to our embedded systems (may be for your robot). I modifed the "Blutooth Chat" application sample included in Android SDK to send accelerometer data via Bluetooth from my Sony Ericsson Xperia X8.




Modifying cheap servo motor for continuous rotation

You can buy cheap servo motors from ebay for a price of less than a gear motor. But these servo motors can't be used for continuous motion. A simple modification can be done by removing the locking mechanism as in the below photos. I'm using a metal geared servo motor from ebay for this. You should also glue the potentiometer in the middle postion after cutting the lock in the gear. You can use different pulses with varying pulse width and frequency to get continuous motion in the clock wise and anti-clock wise directions.



Tuesday, August 20, 2013

Ultrasonic distance measurement using HC-SR04 ultrasonic module + Arduino Pro

Ultrasonic sensors (Ping sensors) are widely used in distance measurement as they are cheap and has a quite good accuracy. I got this cheap HC-SR04 ultrasonic module from ebay and wanted to test it.
I found the datasheet for it from here.

According to the datasheet ;
Max Range = 400cm
Min Range = 2cm

This algorithm should be used to get the echo from the module:
1. Give 10uS pulse to the TRIGGER pin.
2. Measure the pulse width at ECHO pin.
3. Calculate  distance = (echo high level time×velocity of sound) / 2

I connected the module to my Arduino Pro (Techduino) and wrote a small code for the testing. The code will send the calculated distance value to PC via its UART port.

























The code :

#define echo 8
#define trigger 9
long duration,distance;

void setup() {
 Serial.begin (9600);
 pinMode(trigger, OUTPUT);
 pinMode(echo, INPUT);
 digitalWrite(trigger, LOW);
}

void loop() {
 digitalWrite(trigger, LOW);
 digitalWrite(trigger, HIGH);
 delayMicroseconds(10);
 digitalWrite(trigger, LOW);
 duration = pulseIn(echo, HIGH);
 distance = duration/58;
 if ((distance >= 400) || (distance <= 2))
 distance = -1;
 Serial.println(distance);
 delay(60);
 
}
I checked the output from the Arduino to PC using a terminal program.


















After that I coded a small software to get the distance data and show it in a nice way using Visual C#. This is my first C# application and I referred here and here for coding. You can download the source code and application from here.




Thursday, August 8, 2013

Computer controlled automated guided vehicles (AGV) using Parellel port interfacing

As we built a relay board to interface with "parallel port" in my earlier post. Today I'm going to talk about the control software for it. I wrote this software long time ago using Visual Basic 6 and inpout32.dll as the interface. I used this to control some modified toy cars as autonomous vehicles similar to automated guided vehicles (AGV). The path can be programmed to the software in realtime or in advance. So, the vehicle will follow the route as we need. You can download the program with source code from here.

The software interface:













This was first designed as a school science exhibition project in 2007 and recently used to control a mars rover model in a local astronomy exhibition at Sri Chandananda Buddhist College:













The mars rover model:

















The control circuit: