Sunday, 24 December 2017

Week 14: Last week~

Greetings guyss its been week 14 and sad to say that it is the last week of the semester. This semester had been great, special, surprise and full of discovery with this open lab session prepared by our lecturer. Okay...let's have some update here...

Following from last week where my lecturer, Dr.Woon gives me a "discount" where I only need to code a programme which can calculate the sharpness of an image so that we can compare two similar/non similar image in term of their sharpness, glad to say that with the implementation of opencv library, code block and cmake (all those which I installed last week) had allowed me to success to come out with what Dr. Woon want.

Curious what does it looks like?? Worry not! Lets have a look on the pictures below. Basically, I created myself three image samples to test with, name it:
1) Clear
2) Blur
3) Very Blur

Lets test the image sample "Clear" first. As this is the clearest image among the three sample of mine, it therefore should give the highest sharpness value...

First sample. Clearest image.

Well yeah, the result shows sharpness of 0.999943. Hmm...not too bad, but who knows thats the highest value among three samples? Let's continue...

                                                   


Second Image Sample. Titled "Blur"


Okay, now that the sharpness shows 0.999875, it is what we expected, which is lower than the first sample (woohoo!!) This proves that we are half way success in testing our code already! If the third sample "very blur" shows lowest value, then our code works! Lets see!! (nervousss)

Third Image Sample. Titled "Very Blur"
Yess!! The sharpness show the lowest value among the three samples!! This means our code can works in order to measure the sharpness of an image and thus compare them!

And of course, the consistency is also tested. This can be done by running the same image for several times and the sharpness value shows the same for the same image, which is a good thing. 

Well guys, that's all for this semester. I hereby hope anyone that is having study week now all the best and do your best in the upcoming final exams! And for those who are still on their lecture weeks, always pay attention to your lecturer in class and remember to submit your works on time! For non students, I hope all of you stay healthy and happy always. And not to forget, MERRY CHRISTMAS EVERYONEEE~~~ ^.^!!

I will like to thanks a lot of people throughout this 14 weeks projects. First of all, my lecturer, Dr.Woon Kai Lin which give us the opportunity and platform to practically do something we seldom do. Open lab session is a great opportunity for students to get in touch with the practicals and develop student's interest and also talents. KLESF is also a great platform for student to show their work to the public so that we can have the sense of achievement and confirmation. Also thanks for Dr. to guide me, understand my situation/problems and give the best advice and resource in order for me to walk out from the jungle of lost. Again, thanks for all the effort Dr..

Next, I will like to thanks all my teammates from team Sotong (yes I didn't forget all of you although its only 7 weeks we are together), thanks for enduring me, showing up whenever I called up for meeting at some random time and helping in the projects, your effort are really appreciated and happily we managed to born our own microscope muahahahah!!! 

Also, I would like to thanks Raqif senior, he is a material science graduate years back and have experience working with Android. He really helped me a lot in term of Android Studio and Java coding as from the beginning I have zero knowledge on those things. Despite of busying with his own work, he still willing to spend some time with me to help me in my hard time. And also thanks for introducing me in to the Android community in Telegram, I have really learned a lot from the masters there and I will not quit that community because I am sure I will definitely learn alooooooot more from the community in the future HAHAHAH!!! Okay seriously I really really appreciate all of the efforts ^.^.

Not forgetting my friend from FSKTM, Siong!! Hahah!! Thanks for giving me advise and guides in coding and software parts. Also he helped me with identifying various computer/compiler error showed up whenever I am clueless. Yeah as for those who worked with programming knows, the most scariest thing in this world is not ghost, but error that you never seen before pop out from nowhere. But the sense of joy and happiness when the error is solved and the moment you know the reason of the error is something money, credit cards, bitcoins or any property cannot buy!! XDD

Lastly, thanks to the Telegram community that taught me a lot of new things whenever i appear with questions. The guides you guys gave me are really clear and helped to solv my problems. 

That's all guys. Good luck !!



Monday, 18 December 2017

Week 13: When situation is not favorable, find ways!

Haiii guyss....it's week 13 here and here we come for another update again~

As for those who followed the previous week's post should know, I have met really a lot of obstacles while in the progress and it is really hard to complete the whole project by week 14. However, thanks to my lecturer's understanding toward my situation, he did gave me some "discount" on my current work, which really bright me up in the darkness (WOOHOO!!).

First, back to the camera part following from last week's post. As from last week, everything about the camera is developed but somehow, the camera did not work at the way it should and it really cost me a lot of brain juice to diagnose where is the problem. At the very hopeless stage, I decided to try the only thing I never tried before in diagnosing the problem, which is, to install the apps in another Android phone. Miraculously, the camera apps works fine and good in other Android device (Samsung A5 2015). The camera apps is able to be opened smoothly, takes full size picture with no pixelation and are able to store the image in the gallery with time stamp as the image name. After some discussion with my senior, Raqif, which previously helped me in developing the code, we believed it is because of the non-compatible API on my Android device (Samsung galaxy Note 5) which had caused the problem. Also, from the discussion with my lecturer, we believe that there might be extra protection and security implemented inside higher tech phone which caused to be not-so-easy to access the device fully, thus causing the problem.

Next, after the "discount" given by my lecturer, I will only need to develop a code in C++ which can calculate the sharpness of an image when it is run (of course, developing the full apps can be done next after this on my own will). To develop the code, a simple C++ software is definitely not enough because the normal library does not contain the "things" we need. Therefore, should we introduce and install some new software/library, which is the Code::Blocks, OpenCV and CMake.

Code::Blocks is free and open source integrated development environment(IDE) which can support various types of compiler such as the visual C++, whereas OpenCV is a library of programming functions mainly aimed at real-time computer vision. CMake is cross-platform free and open-source software for managing the build process of software using a compiler-independent method. It supports directory hierarchies and applications that depend on multiple libraries. 

The difficulties I faced while doing these is during the time to implement and "put in" the openCV into the IDE as it takes a series of process and did really consume some time. During the process, I had encountered a lot of error that tells me the library is unsuccessfully to be brought in the IDE.  I have tried a lot of methods to solve it such as search for the error code, system restoring (because I might have installed the incomplete openCV and it cannot be uninstalled so easily like other software), following different tutorials, referring to friends experienced in all these. Finally, the problem found is that the openCV file downloaded is not extracted properly in the way it should. It might sounds like an easy error, but it really takes me different tutorials, reference and help from experienced friend to identify and spot the problem.

From these, I have learned more about IDE, library, their installation process, precaution step to take care on and possible error to occur. On the moral side, I have learned to be more patience in identifying and solve problem, because dealing with the installation really takes a lot of time and effort, especially when you are sure you have followed the online tutorial fully but somehow error still occur. The online source is a big sea of knowledge, where you can find almost everything in it, when you are frustrated in unable to find the solution online, what you need just maybe some time, patience and help from others in translating the part you do not understand. 


Monday, 11 December 2017

Week 12: The Coding

Heyyy guyssss...we are back on week 12! This week, we gonna begin with the java coding part. And of course, when it comes to coding, a lot of problems and obstacles will come to us, well, seeing things at different prospective, it might be a good thing as the sense of achievement will come to you whenever you managed to solved the error or any obstacles came to you during the progress XD.

Discussing about the math part of the coding, it is believed that we should use "for" loop to deal with the summation (the sharpness function can be view on week 11 post). And also, things are not that easy of course. As the sharpness function will deal with the array of pixel as mentioned during week 11, we need to code the apps so that it will perceive the pixels as an array form and obtain information from there. After that, the multi color pixel should be converted to gray scale pixel, so that it will exhibit intensity between 0 to 255 (black to white) and thus will interpret and process with the contrast measure. The reason we convert the RGB pixel to gray scale pixel is because that RGB pixel would need vector or coordinate system to interpret their intensity, and it will be very complicated and hard to solve for the contrast measure, therefore, gray scale pixel is preferred to be refer for contrast measure no matter which part of the world it is.

However, before proceed to the math coding part, we should first have access to the phone camera. Different methods are used in order to access the camera on our smartphone and the apps are successfully developed in this week, unfortunately, things do not go as expected as there are few problems as listed below:

1) Image captured from the self build camera apps appear to be blurry and pixelated.
- This is due to that the image appeared are in thumbnail, meaning that the blurry image appeared is actually a small image representing the large image. Thus, we should get the full size of image from the camera directly. However, to convert thumbnail to a full size picture, the java codes related to it are implemented on the apps but it seems to be no effect and the same problem still appear! *sigh*

2) The image captured cannot be saved in the phone storage.
- Codes related to access of public storing (built in SD card) within the smartphone are implemented. However, there seems to be lacking of "something" which does not allow the image to enter the storage.

Figure 1: Camera Apps Built. Camerag and CameraHanCheng.
A lot more of camera apps built before this two was made, however, all are uninstalled as they posses the same problem.

Figure 2: Layout of "Camera HanCheng" apps.

Figure 3: Blurry Image Capture


On the process of solving for the two problems mentioned above, different project files, methods, coding are used. The direct related code to "cure" for the problem are also been modified and implemented, unfortunately, things don't seem to work well. 

Another problem faced in week 12 is that the antivirus detect some of the SDK (Software Development Kit) in Android Studio as Malware and quarantine them. This causes the Android Studio to be not able to run the apps either on the emulator or a real smartphone. Upon releasing the quarantined component of Android Studio in the antivirus, it seems that part of the component are gone missing or deleted by the antivirus, thus causing the error of
IllegalArgumentException: Unable to locate adb in Android Studio " to appear whenever we try to run the code in the emulator(or on a real smartphone). This error simply means that there is some missing component in the Android Studio that causes it to be not able to perform at its finest. This can be solved by going to Tools >> Android >> SDK-Manager >> SDK-Tools. Uncheck "Android SDK Platform-Tools" and press Apply to uninstall it, and then, reinstall the SDK again. Based on StackOverFlow, it seems to work for some people, but for me, it does not work that way. Upon unzipping the re-downloaded component, the progress somehow stopped halfway and eventually the error " Installing Android SDK: Stopping ADB" appeared. This means that some component in the zipped file are still missing and are unable to unzip the whole file in order to give the complete SDK for Android Studio to run normally. This problem has caused me to stuck for days finding ways to troubleshoot and configure the problem. In the process, I had uninstalled the whole Android Studio and reinstall again, but somehow the problem still occur. But then, I had finally found the way to solve it, which is by copying adb.exe from the AppData/Local/Android/Android-SDK/Platform-Tools folder and copied it to AppData/Local/Android/SDK/Platform-Tools. This is to give back what the file is missing directly to it's file location and Android Studio seemed to be run normally again after that! 

Week 12 is definitely a week of sorrow. But however, looking things at a brighter side, I did learned a lot more on the Android Studio. Including how to create a new class of Java, have a better and deeper understand on the SDK required to run and support the Android Studio, how to solve for different type of error, meaning of different Java code, arrangement and structure of the code in the way it should, how to direct a file path, meaning of XML code and an overall better understanding and handling of the Android Studio software. 

Besides, on the moral side, I have learned to be more humble, willing to accept other's advice and polite to seek for help from others whenever I feel that situation is not under my control. I also make sure that I'm the one taking initiative to ask for consultation and request to meet up because we should not let other people to come to us as we are the one who are seeking for help, this is the basic respect for the people that are going to help us. We must also always remember to say "Thank You" whenever help or consultation is given as a sign of appreciation to the helper.

Well, that's all for this week! Continue to check on us on week 13 to see what will happen! See ya guys ^^.

Monday, 4 December 2017

Week 11: Understand the math!

Hai guys, it has came to week 11 and things is really getting harder and harder now. But fortunately, I have got the help from the lecturer and senior and hopefully things will work out.

So, before begin to develop the code, first, of course we must know what to be included in the code, and also the rough plan on how to code. Back to week 9 update, it is mentioned that the resolution of an image whether it is brought to be focused enough or not can be determined by the "Sharpness Function". Therefore, week 11 is all about understanding equations! The sharpness function is as follow:

The rough explanation of this equation is that, assuming an image is made up of pixel with threes= sub components, that is, the red, green and blue (RGB) colour component, and the pixels are arranged in the form of array of x and y. The intensity of the RGB will light up differently and individually to give different colour on that particular pixel so that a desired colour is obtained. 

I(x,y) is the intensity value of an image pixel located at (x,y)
Parameter J and K is the height and width of focusing region in the image.

By inserting the sharpness function in the java code, it is believed that the software will detect the peak point when the specimen is brought to be focused and should stop when that particular point is reached. 

Next, on how to connect the Arduino to the Android Studio. This is definitely a hassle project because it involves manual configuration of a lot of stuff. The program flow is as follows

A lot of coding is involved in this process and should be included in week 12 where we start to program the app step by step. Hopefully it's a good and progressive week. Thanks for staying tuned! See ya guys next week!

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



Sunday, 29 October 2017

Week 7: Solution Oriented

 WEEK 7: SOLUTION ORIENTED

Hello again guyssss! 😉
new update is here again! 
Check out for more on our team progression and obstacles faced!

Yes, as the title mentioned itself, "solution oriented", we definitely faced a lot of problems and obstacles on this week. From zero knowledge on Arduino until the stage we are at today at such a short and rush time, it is not easy at all, but we are still on our effort and never give up. Thats the spirit!


Following from last week where the motor spinning direction is some how out of control and lack of sensitivity, we have solved it by using a sliding switch with 3 terminals instead of tact button. The sensitivity is greatly enhanced by doing this and now the motor can spin in either clockwise/anticlockwise direction and are fully under our control, YAY! 😆

As there are an extra terminal on the push button compared to the previous tact button, the middle terminal was connected to the ground row on the breadboard, and the remaining two terminals (most left and right) are connected in the same way as the tact button (see the breadboard layout on week 6 post for more info).






Push button
(To the left is anticlockwise and to the right is clockwise spinning direction)

Now that we have solved the sensitivity problem. The problem arises next is that how to let the motor stop?
Because the motor is programmed to spin in clockwise/anticlockwise direction by the control of a switch. No one teaches it how to stop 😟😟 

We tried to modify the sketch code but some how things doesn't seems to work. And we guess that it's time to look for help from our lecturer, Dr.Woon.


Dr. Woon suggested us that we does not need to focus on the programming part to let the motor stop, instead, focus on the breadboard connection. 

Yes!

This is very useful and fruitful tips for our team. If we can add a switch in between the motor connection, that means we can control the current flow to the motor and therefore controlling its activation!

 
Initial breadboard layout

To do this, the motor yellow cable (pin 3 on L293D IC) is plugged out, a jumper cable is connected to replace the yellow cable and another point of the new jumper cable is connected to any unused pin on the opposite part of the breadboard (let's assume we plug it in at row 20). 

A tact switch is needed next. The tact switch (with 4 terminals) was tested on it's resistance first to ensure which terminal are connected to each other, this can be done by connecting any two points of the four terminal to a multimeter, press the switch and observe the resistance drop. After the two connecting and functioning terminals are identified, label it for convenience. 

The two functioning switch terminals is soldered to a jumper cable for convenience purpose (or else you will face difficulties when pressing the switch if you connect it directly to the breadboard because all the wires are so messy on there , it's like you are sitting on a helicopter and try to find a lost person in a big jungle filled with trees from above). 

Now that the terminals is soldered, lets name them terminal A and B. Cable A is connected under the same row (row 20) to the cable connecting to the IC pin 3 just now. Cable B is connected under row 20 too but on the another side of the breadboard(the main part we are using). Finally, under the cable B, plug in the yellow cable that is connected to the motor. 

Testing the switch terminals by using a multimeter.

Circuit connection

Feeling too much of explanation, information and get confused??

Hahahah! Worry not!

Feel free to approach us on the KLESF exhibition held this 3,4,5 of November at The Mines exhibition center and we will give you a consultation on this!(You can reach there by taking KTM Komuter and disembark at station Serdang, then take a cab or car to the venue).

 Can't come over?? 😭

Awww don't be sad, you can leave us a comment below and we will reply you as soon as possible too! 💜💜💜

However, there is a problem arises next. Now that there are a switch, another extra 3 cables connected which means there is an increase in the resistivity! The current supplied to the motor therefore dropped and it can't really have the enough the power to spin unless we initiate it by giving it a manual push. This problem is to be diagnosed and hope to be solved before the exhibition day.

However, the rough idea to solve this is to give the motor an extra external power supply, so to do this, we would need a lithium cell 18650 rechargeable battery. The maximum current Arduino board can hold is 1A, giving the extra current of 3800mAH from the lithium cell should not burn the Arduino out. As the IC (L293D) acts as motor driver, by modifying some connecting pins and cables on pin 8 (+V motor), we believe that it can gives the motor an extra push. Stay tuned on the next post for this! 😀


Lithium Cell 18650

MECHANICAL PART

Back to the mechanical part. As the rough design layout we suggested on last week doesn't seems to work (due to lack of stability and power to turn the roller), we found another initiative, which is by using the mechanical part from a DVD player. 

DVD Mechanical Part

You might wonder why do we choose this? 
Check out the video below!



As the lever is controlled by gear, the smallest gear should be the lightest to move the lever up and down, therefore, the motor should be having enough power to rotate the smallest gear and in turn rotate the larger gear, resulting in the up and down motion of the lever. By connecting the motor pin to the smallest gear and adjust the smallest gear to gently connect and touch the following gear, the mechanical part should be ready to serve our needs!

 However, time is short and we have some faulty motor happens at such a critical moment! 
We then bought a new motor and things work out as expected, however, there is some part to be improvised further, such as how to let the motor stay at the height where the smallest gear gently connect to the following gear. We still have a few days before the exhibition and this problem should to be solved before the day. 

That's all for week 7 update guys!

It is indeed a hectic week with a lot of problems and obstacles. fuhhhh! 😫😫 

However, most of the problems are solved (or in good progression to be solved, that's why the title for this week is named in such a way). 

Wish us luck and remember to come and visit us on 3,4,5 November at The Mines Exhibition Center KLESF 2017.



Oh ya, this is our group poster.

 Recognize this poster and find us at the exhibition! Team Sotong waits you! 💚

 See you there! 💘💘💘



XOXO 💘,
Team Sotong


Monday, 23 October 2017

Week 6: Making Things To Be More Convenient.

              WEEK 6 : MAKING THINGS TO BE MORE CONVENIENT


Hi guysss!
We are back again with some exciting updates, progress and also ideas!
Here we go! ☺☺☺

Now that our microscope looks fine and should be ready to serve our needs. However, because we are using the camera from smartphone, we realized a problem which is the image resolution. The sample specimen somehow need to be brought close enough but yet not too close to the lens in order to produce a nice and sharp image. This can be done simply by holding the specimen and adjust it accordingly using hand, while adjusting the level of the specimen holder, but the problem is, different specimen has different focal length and sometimes even we adjusted the specimen holder to the maximum top height, the specimen is still too far away to be focused! Although this problem can be solved simply by holding the specimen and stay static (never move your hand away!) so that it can be brought focus, but imagine, what if the user is using the microscope alone and there is no other extra hand(s) available around! He/she might have not enough hand to take the image picture, record down the observation or to do other things, because one or both of his/her hand is holding the specimen !


Nobody wants that to happen! 😓

Therefore, we came out with an idea. To build something that can move up and down accordingly while holding the specimen! And yes, this is the part that we are going to involve some computer programming.

To begin with, we have constructed a rough plan about how the lever should roughly looks like. The motor will control one of the roller attached with belt to control the ascending/descending motion.



However, a draft is a draft. There is still some details to be modified still. For example, how to make sure the clip is hung properly and stable on the belt. These are the mechanical parts that are to be discussed among our group again. But anyway, let's start with the electronic part first. 

Now, we need a "brain" to control the lever. The "brain" is actually a microcontroller in which we can program the things we hope the machine will do into it. In our case, we brought an Arduino UNO and DC motor from a robotic store located at South City Plaza, Seri Kembangan.





DC Motor
i) 3.7V coreless 60000rpm motor (smaller in size)
ii) 3.7V coreless 50000rpm motor (larger in size)

Arduino UNO microcontroller

Some major component of an Arduino microcontroller


The tutorial about how to use an Arduino UNO can be easily available on the internet. We found the tutorial at http://www.funduino.de/Arduino-tutorials-08092014.pdf.

The LED on the pin 13 is served to test out if the Arduino board is functioning well or not. The default setting should be blinking of the LED once per second. However, we can easily change this setting by changing the programming code(we called it 'sketch') that is uploaded into the Arduino. The sketch can be constructed and uploaded through a software named "Arduino IDE". Below is the link to download the software. 

https://www.arduino.cc/en/Main/Software
Arduino IDE

Homepage of Arduino IDE



Basically, the sketch (code) contain three main parts. The first part is the "Name Variable", second part is the "Setup", and finally the third part is the "Loop". Let's start with first part.

1) Name Variable
In this part, the elements of the program are named. This part is not really necessary and can be avoided most of the times, but can be useful when it is to be used.

2) Setup
This is the part where no one can escape. Here, we need to tell the program for example what pin(slot for cables) should be the input and which one should be the output. The input means that the board should read out a voltage, and the output means that the pin should give out a voltage. For example, when a switch is on, the board recognize this action because there is incoming votage (input) and causes the LED to be lighted up(output).

3) Loop
Looping causes the action to be repeated continuously by the board. It reads the sketch from the beginning till the end all over again and therefore performing the action repeatedly.

A test on the Arduino board is then done. The test is done by manipulating the blinking frequency of the LED on pin 13. The sketch and tutorial can be seen as from page 12/100 in the tutorial link posted above. Greatly, everything work out just fine.


Blinking frequency: 1 second (default setting)






Blinking frequency: 100millisecond

Of course, an Arduino board and motor is totally not enough to complete our project. This time, we choose to visit an electronic component shop called Nixie Electronic which are located at Jalan Pasar to buy our stuff. 

Nixie Electronics. 
(We're unable to take the photo straight in front of the signboard because there are some mamak stalls located there)

Alligator clip

Belt pulley set (roller)

Drive shaft

Jumper wire

Solderless breadboard

L293D IC

LED and resistor (100ohm x2 and 200ohm x2)

Rubber belt set

Strip board in line

Tactile push switch

10k ohm variable resistor

Multi core wire

6V DC motor


The LED and the resistor are brought in order to learn some basic skills and the function of the Arduino board first. Following the tutorial, we managed to test the alternating blinking of LED and also fading of LED which are controlled by the Arduino.
Alternate blinking LED - pg16-17
Fading LED - pg18-20


Alternate blinking of LED

Fading LED



Next is to make the motor to be able to turn in either clockwise/anti-clockwise direction so that the clip can move up and down. The circuit is connected as shown below.


The difficulties and obstacles faced while doing this is that, although the motor did really turn in reverse direction when the switch button is clicked, however, the sensitivity is not there yet. This means that let's say the motor is turning in clockwise direction initially, then, after clicking the switch for one time, the direction did not change yet. The direction is only to be changed after a few clicking on the switch. But for sometimes, only by clicking the switch once, the spinning direction changed immediately. Also, sometimes after the switch is clicked, the motor slowed down (ready to change spinning direction) but somehow, it spins in the same direction again after slowing down. The problem is to be continue diagnosed and solve on the following weeks.

Beside doing all these thing, we also think of something to let the audience have an optimum view on the image our microscope shows. We borrowed a mini LCD projector from Chiam's elder brother and connect it to the computer so that the image can be projected to a larger screen on the exhibition day. However, as projector requires a dark surrounding and we are not yet sure about the environment of the exhibition spot, we should see again if we can bring the LCD and bring it to action on that day! Fret not, guys! a laptop should be enough to get a very good view already and you guys will see our image clearly that day! 😏😏😏

Testing the LCD projector.

Ok till then, guys!
Time is running out! we gotta prepare the gear for the remaining work!
Pray for us, ya! 👄



XOXO 💘,
Team Sotong