Tuesday, March 26, 2019

Machine Learning



If you are a regular internet user you might be using Social media like Facebook and use Google daily as a search engine. Have you ever wondered how Google predicts what are you going to search when you just type a word or two or how Facebook identifies faces of your friends and suggest you to tag them? Well in today's article we are going to discuss the phenomenon behind those wonders and more wonders like that.
I'll just shoot the term Machine Learning. The term suggests that the machine behind those phenomena has incorporated with some sort of a learning process. Well, that's exactly what is happening inside the machine. Each web application that we use like Google, Facebook, Twitter, and Instagram has machines that processing all the data that we shared within. Those data are the inputs of the machine learning process. There are different types of learning algorithms for different tasks.
Let's look at the three main algorithms of Machine Learning.

Supervised learning
It uses inputs and relevant outputs to learn about something to perform a specific task. Each output will be labeled with their inputs in this case. Let's take the Facebook auto-tagging mechanism as an example. It uses previously tagged photos for inputs and outputs respectively to the person's name and the face. Those labeled data can be used to identify a person's face before the photo being manually tagged; after the system has enough labeled data to learn from.

Unsupervised learning
In this system, it collects only the input data. That data will be clustered or grouped together using the similarities of the data set. To understand this model let's take a list of cricket players. If we graph their wickets over the runs scored in their carrier, we can see that some of the players have more runs than the wickets and vice versa. If we group them we can identify who are the batsmen and who are the bowlers.

Reinforcement learning
This is a reward based learning system. The system predicts what the output is when an input is given. The user has to tell whether it is correct or wrong until it gives the correct answer. After a period of training, it can give the correct output once. We can train a system like that to identify animals by providing so many different images per animal.

Saturday, March 16, 2019

ThingSpeak


In today’s article I’m going to talk about ThingSpeak. Just for the beginning just consider as ThingSpeak is a website which provides IoT services. This article is great for electronic enthusiasts and university students. If you are familiar with IoT you may know that setting up an IoT server is somewhat difficult and you have to pay if you want to access data outside the network.

When I did my final project at the university I did setup a MQTT server to connect my devices. If you are interested in today’s topic just Google the term MQTT if you are not familiar with it. I had to keep all my devices in the same network when I did the demonstration. It was actually not a problem. Yet the biggest problem was to collect data to prove the concept. My project was related to GPS tracking therefore I had to carry my laptop turn on with me as the MQTT server was my laptop. I had to create a mobile hotspot from my phone to keep the devices on the same network. Somehow I manage to collect the data.

Then I heard about ThingSpeak. Some of its features are free and those are more than enough to conduct a project. It is very easy to setup. You can create a profile there for free. You can connect your first device within few minutes. ThingSpeak is associated with Mathworks which is the maker of MATLAB and Simulink. Electronics and engineering students are familiar with MATLAB and Simulink. Those are software which are used for advance mathematical calculations and modeling. You can analyze data and do simulations. Most of the features in MATLAB are embedded in ThingSpeak. Therefore it is also a great tool for data visualization.

As I mentioned earlier, once you have setup an account in ThingSpeak, you can connect your IoT devices. It supports Arduino, Raspberry Pi, ESP8266 and Particle Photon and Electron. Next best thing about ThingSpeak you can take action according to the sensor readings. It has APIs for Mobile and Web applications. You can setup a twitter account to automatically tweet when needed. You can also send SMS using Twilio.

Screenshot of my ThingSpeak Channel Stats

Why Electric Cars?


In this article, let’s discuss about electric cars. In modern era we can see different types of electrical vehicles on the road. More people are considering these vehicles as an alternation for the conventional combustion engine vehicles because of its fuel cost and inefficiency in highway traffic. Are these vehicles really energy efficient and cost effective? Let’s find out.

Electrical car is not a recent transportation method. In fact first electric car was produced 20 years before the Ford Model T was built. Thomas Parker built the first practical electric car in London in 1884. This car was powered using a specially designed rechargeable battery. In late 19th century and early 20th century electric cars were the preferred automobiles considering the level of comfort and ease of operation that was not provided by combustion engine automobiles of the time.

Electric car built by Thomas Parker, photo from 1895
Electric car built by Thomas Parker, photo from 1895 Source: https://en.wikipedia.org


In modern days one can say the most popular electric vehicles are produced by the American company Tesla because of its elegant and futuristic designs and technology poured into their vehicles. Before I come to the modern electric car phenomenon, I would like to talk about the qualities of electrical vehicles a century ago, then you can understand where we are now. Morris & Salom Electric Carriage and Wagon Company is the first electric car company in America. Their first commercial car was named Elecrobat.  It was slow, heavy and had steal tires. Batteries were weigh more than 700 kilograms. It was not a very good example for what I mentioned earlier. 

Morris and Salom in the 1894 Electrobat
Source: https://en.wikipedia.org


Another company named Caffrey Carriage Company in Camden, New Jersey built a car which was lighter and had pneumatic tires. It had two 1.1 kilo watt motors which can drive the car up to 40 kilo meters per charge at 32 kilo meters per hour. It was steered by its rear wheels.

Late 20th century was all about combustion engine cars. With the rise of oil companies, the world had turn their back on electric vehicles. Therefore gasoline cars flooded the automobile market. Then manufactures were reluctant to produce electric vehicle to drive on highways.

I personally think that today’s electrical car revolution has begun with the Tesla. In 2004, Elone Musk led a team at tesla to re spawn the electric car for the masses. Tesla signed a contract with group lotus to build Roadster in 2005. The Roadster used an AC motor descended directly from Nikola Tesla's original 1882 design. If you are interested you can research about how the name “Tesla” came to this company.

Tesla Roadster
Source: https://www.tesla.com


In 2008 Tesla Roadster was the first electric car to use lithium-ion battery cells. It can drive up to 320 kilo meters per charge. Tesla stopped taking orders for the roadster in the US market in 2011 after selling 2,250 cars around the world. Tesla began shipping Model S sedan in 2012 and Model X crossover SUV in 2015.

Tesla Model S
Source: https://www.tesla.com

 

 


Machine Learning

If you are a regular internet user you might be using Social media like Facebook and use Google daily as a search engine. Have you ever...