Monday, 27 November 2017

Week 10: Learning New Things

Haiiiii guyssss it's me Chiam updating the weekly blog here....hmmm....continuing from last week, it is mentioned that there are actually two ways to do our autofocus function on the DIY microscope.
Where the first is to connect the Arduino controlling the lever to the smartphone directly and thus from there, using the smartphone camera that came with auto focus function to control the movement of the lever. The another method is to connect the smartphone camera to a computer. From the computer, image analysis is done using the MATLAB software, and again, from the software, signal is sent to Arduino to control the movement of the lever.

After some consideration and discussion with our lecturer, Dr. Woon, we decided to move on with method 1. This is because method 1 requires less platform and thus increases the efficiency of the auto focus. And also, since the main thing here is the smartphone, as mentioned in the title "Polarizing Microscope Using Smartphone", we think that it is more appropriate to have all the process done within the smartphone itself. Besides that, as smartphone camera comes with auto focus function, we strongly believe that it has the mechanisms that we are looking for and by changing or creating some programming code, we might gain access to it and utilize the function.

So, the next thing now is image analysis within smartphone. As I am having zero knowledge on smartphone coding, Dr. Woon therefore introduced me to a senior of Material Science few years back then named Raqif, as he works with smartphone programming, I believe that he is able to enlighten me and teach me a lot of newwwww thingsssss.... *excited*

Although software such as MATLAB are available on mobile version (and maybe some other image analysis software too are avalaible in the smartphone), senior Raqif suggested me to create my own app instead. This is because if I were to use apps created by other people, it is hardly there is one that will fulfill 100% of my need to come out with the auto focus function on the DIY microscope. Also, by using apps created by others, it will be a lot of trouble when it comes to troubleshooting part because we don't know the coding behind the apps and cannot manipulate the code at all to serve my very specific needs later. Therefore, the best way is to create my very own apps! Where I can manipulate anything I want to serve for me only (of course, if you want it after it really managed to be developed, you can ask from me too XD HAHAH!). Hmm okk...

To develop an android app(because I'm using android phone), it is necessary to have a software named "Android Studio" on your computer.


Android Studio is a software developed by Google. It is an official Integrated Development Environment (IDE) used for Android app development. Android Studio offer a variety of features that enhance productivity when building Android apps, such as flexible Gradle-based build system, fast and feature rich emulator, extensive testing tools and frameworks and many more! To download it, kindly go to the link provided below!


Because Android Studio runs with Java code, a series of Software Development Kit (SDK) is therefore required to run the translate the code and to run in Android Studio. This means that, you should have:

1) A PC or Mac with Java installed.

2) A PC or Mac with Java SDK installed.

3) A PC or Max with Android Studio installed. 
Link mentioned above.

When the Android Studio is first launched, another series of SDK is required and should be appearing automatically. Be patient enough to download all of them so that your software can run in the way it should.

With all these software and SDK, you should be ready to run your Android Studio (yeayyy).

However, with the Android Studio ready to run, I am not yet prepared to create my own software, as I am having no knowledge on Java language. Therefore, to begin, I started to learn Java language. This week was about basic concepts, conditional and loops, arrays, classes and objects. With all these, the basic skill of Java language is there. On week 11, it is expected that I will be learning exceptions, threads, list and files and should be able to run some simply coding in Android Studio. 

As a conclusion, for week 10, I have developed and confirmed the working method I'm going to work with after a series of discussion and consideration with my lecturer and senior, downloaded a series of software required to create my own app (trust me, it takes quite some time to figure out and download all of them as there are a lot of SDK required), trying to understand the basic layout and function in the software and learning basic Java language.

That's all for this week guys! Stay tune to catch my progress and hope I will managed to develop the auto focus function to imply on the DIY microscope in few weeks time! See ya!



Monday, 20 November 2017

Week 9: We never stop!

Hai guyss~~~

And so the exhibition had done successfully and we are really grateful for your visit! Also its always nice to see student/public that are interested in our project and asked us a lot of technical questions. During the 3 days exhibition, we really had a great experience as we received a lot of suggestion on how to continue to improve our DIY microscope, the way to market it and the best feeling is by knowing that we are the inspiration for school teacher/parent on what to let their student do for their school science project. Again, we, team sotong really grateful and appreciate for all of your support and interest!

Here's some photo of the exhibition day ! XD






So now, the question is that, will we just stop here???


The answer is a big NO!

Following from the project report and internal presentation done here in our faculty, we are told to further improvise on our microscope! yeayyyy!! The mission given by our lecturer Dr. Woon is that to make the microscope lever into auto focus mode. This meaning that, the up and down motion to bring the specimen into the focal length of the camera will now on it's way to become auto mode. Sounds interesting right??  For this part of the project, it will be conducted by our member, Chiam.

Therefore, week 9 start with some data collection on how to transform the lever into auto focus mode. In auto focus mode, there need to be "something" to tell the lever when to stop its up and down motion once the image is sharp and focused on the smartphone. Therefore, it is strongly believed that by doing some modification on the Arduino sketch (most probable by using boolean), we can "teach" the Arduino when to continue to adjust the specimen up and down accordingly and when should it stop by itself! Also, we need "something" to tell the lever what and when is the image considered focused and sharp enough so that there will be a standard. Once the mentioned standard is reached or achieved, everything should stop. For this, "image analysis" should be brought out to perform its action.

Image analysis is to process an image into its fundamental components in order to extract data. This is such that a kid trying to dismantle on a toy building built by Lego blocks of different sizes, shapes and colors, and then try to study the appearance on every single Lego block used to build the toy building. The tasks that are involved in image analysis is such as finding shapes, detecting edges, removing noise, counting objects and also measuring region and image properties of an object. A very apt example of image analysis is such as "Face Recognition" system that are available on the Iphone X launched recently. Besides that, the camera of our smartphone too uses the technique of image analysis, this can be seen when your camera focus on an image by itself or when you tapped it. Image analysis is getting wider and wider in the world and also in social media, as image is getting preferred to be used as communication medium nowadays.

Image Analysis

There are two types of auto focus(AF) available in our technology. The active AF and passive AF. Active AF uses an external sensor to tell whether the image is focused already or not. It's advantage is that it can even focus under situation with different lighting condition, however, due to the infrared or ultrasound emitted by the sensor, one may find it's not easy to focus on specimen with window or glass. Another type of AF is the passive AF. Passive AF relies only on image information to determine if the image is in focus. Therefore, worrying that our specimen might involve glass piece (for example, the specimen is sandwiched in between two glass pieces), the choice of using active AF is eliminated and passive AF comes to our priority.

In the initial phase of making the AF microscope, there is two rough plan in which can be taken into consideration. First is that to move the Arduino to be connected to smartphone directly and thus from there, controlling the lever up and down motion, and the second is that, to connect the smartphone to the computer in order to analyse the image in the smartphone (with the help of processing software, such as, MATLAB), and then, from the computer, the instruction and result is sent to the Arduino. Both of the method requires further research to determine which are the more convenient and effective method in directing and instructing the Arduino.

Auto focus are related to the sharpness function. Sharpness function is a quantitative description of the sharpness of the image in the mathematical term. It is a numerical measure that provides a value where the value stands for the degree for an out-of-focus image. As contrast of an image is directly related to the sharpness, therefore it is convenient for us to take contrast measure to solve for the sharpness function. Therefore, by using this technique, we believe that an image can be "set to a standard" where it is said to be "focused" and in turn to instruct the Arduino to continue adjust it's position automatically until this "standard" is obtained.

Different lens position gives different contrast. The optimum contrast is to be obtained when the lens position is in the focal length area. But then, for our case, the matter is not the lens position, but the specimen position as the lens position is fixed.

Xu, X., YingLin, W., JinShan, T., XiaoLong, Z., Xiaoming, Liu. (2011). Robust Automatic Focus Algorithm for Low Contrast Images Using a New Contrast Measure. Sensors, 11(1), 8282-8284. doi:10.3390/s110908281



The potential software to be used for this technique is the MATLAB.


MATLAB is a software used mainly for math, graphics and programming, where it suits all our needs. It is able to analyze data, develop algorithms and creating models. It is also able to signal processing, undergo computer vision and robotics to serve most of our needs.

That's all for the week 9 update. Stay tuned for more on the auto focus progress ya! See ya!

Thursday, 2 November 2017

Extra update: A Night Before The Exhibition!

EXTRA UPDATE: A NIGHT BEFORE THE EXHIBITION!


Hiiii guysss!!!  💙💙💙

Tomorrow is the day of exhibition !!! 

Are you exciteeeeeeeeeeeed yet!!!??? 😆😆😆😆

Because we are already hyped enough over here! 😁

Hmmm....what to do a night before the exhibition??

First of all, of course its makan time!! 😋😋😋😋
Thanks to our member Qyla for bringing back foods from her hometown to serve our starving stomach while preparing for the very last stage on our project!





Wew!! Chicken, beef, fish, karipap and SAMBALLL!!!! 😋😋😋

Now that we have filled our stomach and its time for seriousness. As from last week, the mechanical part is not fully solved yet, we still haven't figure out a way to let the DVD mechanical part stand and how to let the motor gently connect to the gear. But for now, everything is solved by doing some mechanical build up work, we managed to come out with a stand that are able to stand firmly. Also, the motor can now connect to the gear wheel and there is also a long and stable stage for us to place our specimen! yeayy!!!

Mechanical look of the lever.

Also, following from week 7, we faced a problem where the current supplied to the motor is not high enough, causing the motor to be not able to spin. We need to give it a manual push for it to spin and to move out the gear. The good thing is that, we bought a lithium ion 18650 and an AA battery and that solved our problem!

The reason we are using 18650 and AA cell is because 18650 provide voltage of 3.7V and AA cell provide 1.5V (total of 5.2V) which are still able for the motor and IC/motor driver to hold and function. If we were to use two 18650 cell, that will be a total of 7.4V and the motor together with the IC might burn out anytime because the maximum input voltage for L293D is 7V and for motor DC is 6V. We connect the 18650 and AA cell in series and they managed to give the motor enough current to spin without the need to give it a manual push in order to initiate spin.

Lithium ion 19650 and AA cell connected in series

The exact way to do this is to connect the IC pin 8 to positive terminal of the lithium ion, and the negative terminal of the AA cell is connected to the breadboard ground. the positive terminal of the AA cell is connected to the negative terminal of the lithium ion cell. A battery holder is strongly recommended to be used in this case to provide a stable connection between the batteries and the cables. By doing this, our motor now have enough power to move and yet it is not over voltage! (yeayyyy woohoo!)


Now that the lever can move up and down without the need to give it a manual push to start the spinning motion.

Upper view of the robotic lever

After the hard work of 7 weeks, our microscope with a robotic lever is now fully ready to see you all and perform at its best tomorrow! 😉😉

See you there guys! 😃😃

Event Details

Kuala Lumpur Engineering Science Fair (KLESF) 2017
(Booth C34 & C35)
The Mines Exhibition Centre


9am - 6pm
Polarizing Microscope Using Smartphone



XOXO 💘,
Team Sotong