Monday, February 17, 2014

SMART - The Automated Food Concocter! - First Review Experience

Since the time the idea of a food making machine came to my mind, I was in a  browsing spree, looking out for files related to this topic. I wanted my project to be an unique one, as I didn't want to replicate the works of other people. Thankfully, such a robot did not exist.

Thanks to the learning at  iRobotricks workshop conducted by Robosapiens India at NIT, Trichy. It gave a good start for me into the field of robotics and gave me the much required hands on experience. Following this, we had a theory subject, along with lab sessions at college on Microprocessors and Microcontrollers. Here, we learnt to control stepper motors, interfacing keypads and using LED displays. By this time, I had enough online resources and hands on experience to kick start the project.

I teamed up with Mr. Swaminathan Sankaran and Ms. Saranya Murugan. Together, we started working on fabricating the arm. We contacted several fabricators, only to learn that the design posed a grave threat to our goal. We had a clear goal to create a simple, user friendly machine, yet keeping the costs low. With our initial designs, the cost of fabricating the base and arm was so high that we wouldn't be able to commercialize this product in the future. We, thus, had to change the complete design.

The new design was an inspiration from our senior's project titled "Wireless control of a robotic arm". Prof. Sunderaraman was the project guide for that project.

Thus, the new arm looked like this...


Taking inspiration from how a human would pick up an object, we designed the arm with two axis; one for controlling the shoulder (Limb 1) and the other for controlling the elbow (Limb 2). We replaced all the stepper motors with simple DC geared motors. We added another third axis, to actuate the scooper. But this time we used a stepper motor, since we wanted the scooper to open and close precisely. Here is how we designed the various actuators.

Controlling the shoulder...


Controlling the elbow...


Design of the scooper...


We were able to control the individual motors with a development board sporting an ATMEGA16 microcontroller. We had used L293D Dual H-Bridge motor driver to boost the digital output of ATMEGA16. We had also tried interpolating all the three axis. The process required turning certain digital outputs ON and OFF at specific times. All these operations were controlled by digital inputs from the user as well as position sensors. To make the shoulder stop at positions where the ingredient containers were placed, we used feedback from a limit switch. Here's how we interfaced the limit switch on the body of the shoulder.


We had to submit a basic algorithm of the overall process to the review committee. After a lot of brainstorming, we cooked up this algorithm.


Here is a pic of the control board we had developed for controlling the motors.



The first review was a grand success!



Android app development - how to create an APK file

Now that we have developed an app, whats the fun without showing it off to our friends?

Most of us will be aware of what an .apk file means. According to wikipedia, Android application package file (APK) is the package file format used to distribute and install application software and middleware onto Google's Android operating system, and certain other operating systems, such as Blackberry 10 Devices with the OS version 10.2.1. For tech savvy people, here is the link which gives complete details about APK file format.

Here's how we create an .apk file from our Temperature Converter project. The same procedure may be followed for any other project.

Right click on the Temperature Converter project (the required project) from the project explorer and select export.


Select "Export Android Application" under the "Android" folder of the Export window.


Click Next in the Export Android Application window. This window checks if there are any errors in the developed application.


Now, we have to create a key for the application. Select Create new keystroke, select a location to save the keystroke and create a password for the key.


Give specific details about the key. Validity of the key is generally 25 years.


Click finish in the final window. Now, you have successfully exported the project to an .apk file. You can share this file with your friends. Just transfer this file to your android phone and install the file from your phone. 


Sunday, February 9, 2014

SMART - The Automated Food Concocter! - Zeroth Review Experience

I was browsing some old folders on my home PC, while I stumbled upon the folder where I used to store all information I had gathered for my final year project. I was instantly reminded of the good old college days and this nostalgia struck me. I always wanted to blog about how my final year undergraduate project evolved, and clinging on to that nostalgia, I'm penning down what happened back then!

The idea of making a food making machine was lingering in my mind for quite sometime. At that time, I didn't have the idea nor the resources to realize that dream. During that time, I had attended a workshop that taught how to control motors using sensor inputs. As time passed by, I also got myself acquainted with some microprocessor and microcontroller programming skills. I felt that my undergraduate project was the right place to implement the food making machine.

For the first stage, we had to submit the project title and an abstract before the committee for their approvals. Luckily, my department's HOD, Dr. K.R.Santha, agreed to be my project guide. Thus, we began the "titling process". Thanks to my friend Mr. Lakshmi Narayanan Srivatsan for giving us a catchy keyword for the title. "Concoction" is defined as "The act of creating something (a medicine or drink or soup etc.) by compounding or mixing a variety of components". We thus named our robot "SMART - The Automated Food Concocter!". Here the acronym SMART stands for Simple Meal Automated through Robotic Technology. When I tried explaining the concept of this robot to several of my friends, they couldn't understand the idea. Thus, I made some 3D sketches with Google SketchUp (now its Oracle SketchUp) to explain such abstract ideas.







With all these tools, we were able to better convince the review committee to acknowledge our project and also succeeded in luring our department's HOD as the project guide! The project kick starts now...

Wednesday, February 5, 2014

Android app development - Temperature Converter

We displayed our "Hello world!" message in our last post. Now, we'll get our hands on some basic coding. We'll be doing our very own converter app that converts temperature from degree Celsius to Fahrenheit and vice-versa.

We'll start off with a New Android Application.


Create some custom icon for the launcher, like the one below.


Use a blank template for the app and click finish.

We will now create some static attributes for the elements that are going to hold our temperature values. We can also add the static attribute for color, to change the background color of the app.
To add an element, open the file res/values/strings.xml and press the add button.


Now select the Color entry as shown.


Edit the attributes for the Color attribute.


Similarly, create three more String attributes with the following values.


The below image shows the created static attributes placed besides the automatically generated xml code.


Now switch to layout editor by double clicking the activity_main.xml and then switching to Graphical Layout. Right click on the "Hello world!" text and select delete option to delete it. Now add a text field by dragging and dropping the text field box into the layout of the application. Also, drag a RadioGroup and one push button from the Form Widgets tab as shown. Delete one of the radio buttons, as we'll require only two of the three buttons.





Next, we'll proceed by assigning the static attributes which we had previously created to these user interfaces. We'll begin by right clicking on the first radio button and selecting the edit text option.


Select the string attribute "celsius" in the Resource Chooser and click OK.


Similarly assign the attributes "fahrenheit" and "calc" to the second radio button and the push button respectively. Set the checked property of the first radio button to true by right clicking on it.


Set the Input type property of the text input field to numberSigned and numberDecimal.


Now, we'll create the main program. Open the MainActivity.java from the src folder. Type the following code and save the program.

package com.example.temperatureconverter;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.Toast;
public class MainActivity extends Activity {
private EditText text;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
text = (EditText) findViewById(R.id.editText1);
}
// This method is called at button click because we assigned the name to the
// "OnClick property" of the button
public void onClick(View view) {
switch (view.getId()) {
case R.id.button1:
RadioButton celsiusButton = (RadioButton) findViewById(R.id.radio0);
RadioButton fahrenheitButton = (RadioButton) findViewById(R.id.radio1);
if (text.getText().length() == 0) {
Toast.makeText(this,"Please enter a valid number",
Toast.LENGTH_LONG).show();
return;
}
float inputValue = Float.parseFloat(text.getText().toString());
if (celsiusButton.isChecked()) {
text.setText(String.valueOf(convertFahrenheitToCelsius(inputValue)));
celsiusButton.setChecked(false);
fahrenheitButton.setChecked(true);
} else{
text.setText(String.valueOf(convertCelsiusToFahrenheit(inputValue)));
fahrenheitButton.setChecked(false);
celsiusButton.setChecked(true);
}
break;
}
}
// Converts to celsius
private float convertFahrenheitToCelsius(float fahrenheit) {
return ((fahrenheit - 32) * 5 / 9);
}
// Converts to fahrenheit
private float convertCelsiusToFahrenheit(float celsius) {
return ((celsius * 9) / 5) + 32;
}
}