Saleh Hamadeh's Blog

Sharing my knowledge, thoughts, and actions

13 Jun 2016

Using Google Voice to Control my Garage Door

Over my break, I decided to start getting into IoT by making my home smarter. I did not want to purchase any of the plug and play devices. The fun part is building these devices. My first idea of home automation is the garage door, since I had all the parts needed to automate it in my junk box.

Parts

  • Garage door with remote or switch
  • Breadboard
  • Microcontroller
  • ESP8266
  • 2 resistors
  • Transistor
  • Wires
  • Screwdriver
  • Solder and soldering iron (optional)

The Hardware

Screenshot

The easiest way to open a garage door is to push the button on the remote. That would be a good starting point for my device.

First, I opened the remote with a screwdriver. On the PCB, I saw the switch that is pushed when I pushed the button. The switch had four pins. To figure out which pins will open the door, I used a small wire to short every two pins until the door opened.

Now that we know which pins need to be connected to open the garage door, we want to connect the pins using a digital signal. That's where the transistor comes in. I did not have any MOSFETs in my junk box, so I had to settle with an NPN bipolar transistor and a resistor.

We connect the transistor's collector and emitter to the pins of the switch and connect the base to a digital output pin on the microcontroller (with a resistor). I used a Teensy 3.2 microcontroller since it's small and inexpensive.

Finally, we connect the ESP8266 to the microcontroller to be able to use Wifi.

Screenshot

The Software

The code on the Teensy is pretty straightforward. All it does is start an HTTP server that has a single route (/toggledoor). When a client hits this route, the microcontroller sends a HIGH signal to the transistor for 500ms. This emulates a button press and causes the door to open.

I did not have to write any code on my phone. I used two apps to control the door. The first app is AutoVoice. This app captures whatever I say to Google Now. It has many features for filtering commands and responding to them. I used another amazing app called Tasker to send the HTTP request to my microcontroller. Tasker works with AutoVoice to trigger an action when AutoVoice recognizes a command.

This is all it takes to control a garage door using Google Voice. The next step is to see if I can program the ESP8266 to do all of that without using another microcontroller.

12 Sep 2015

My Internship at Yahoo!

Interning at Yahoo! was a once-in-a-lifetime opportunity for me. At the time of my internship, Yahoo had a lot of cash from its investments, and it was investing heavily on new products. It was a time of big change for the company. This gave me the opportunity to work on multiple cutting-edge products in the short span of my internship.

Work at Yahoo

At Yahoo, I worked on the search front-end team. My work involved lots of reading, programming, and communicating. Yahoo is a large company, and the products that they build are huge as well. A fun fact that I learned is that no one at Yahoo understands how the search engine works. Each team knows about its own domain, and each team helps other teams integrate with them. For that reason, the ability to communicate effectively is a requirement for success at Yahoo.

The best thing about working at Yahoo is that I got to meet many like-minded young people. Yahoo has an amazing cafeteria with an Italian cuisine, Indian cuisine, Asian cuisine, Mexican cuisine, and much more. The cafeteria is a great convenience for getting food and socializing with colleagues.

Silicon Valley Life

What most people do not know about Silicon Valley is that it is much more than a technology hub. The bay area has a nice weather throughout the year. It is the perfect place for people who like the outdoors. There are mountains all around the valley, all of which have hiking trails with wonderful views. My favorite trail was Castle Rock Trail.

Aside from all the natural beauties, San Francisco is only an hour and a half train ride away. San Francisco is a beatiful city and has a spectacular view of the bay. The walk from Fisherman's Wharf to Pier 39 is my favorite. I have done that five times over the past summer.

One thing I did not like about Silicon Valley is that it does not have nice beaches nearby. The only good beach I could find was at Santa Cruz, which takes an hour and a half to reach by car.

27 Jan 2015

Why I still do not have a data plan

Almost every week I get asked the question, "Why don't you have a data plan?". Everyone assumes that the reason is to save money. When I say that I just do not want one, people move forward to the next question, "Why not?". In this post, I hope to clearly show you why I am against having a data plan.

Attention Killer

Imagine that a professor is giving a complex lecture. A student raises his hand, and the professor takes the student's question. After the professor answers it, two other students raise their hands. The professor answers both of their questions. By the time the professor goes back to the lecture, the professor and the students will lose track of the point at which the lecture was interrupted.

The same rule applies to your everyday life. You may be reading a book at a coffee shop. Then, your phone whistles (I am an Android fan). You check your phone and find that Facebook sent you a notification saying that some of your friends have birthdays. You click on it to see whom and wish them happy birthday. Then, you go back to your book. After a couple of minutes, your phone whistles. You check your phone to find the message, "Log in to sync Facebook with your other apps." Clear notifications. Go back to your book.

Push notifications are attention killers, no matter whether you open them or not. Hearing them makes you feel uncomfortable, seeing them distracts, and opening them takes you on an endless tangent.

"Connected" Friends

When I am hanging out with friends or attending social events, nothing bothers me more than seeing people scrolling through their phones. Sometimes I hold myself and stare at them until they stop. One time I did that, and my friend asked me to keep on talking. I did and then asked him a question. His reply was, "I am hearing you. Go on." He surely was hearing me, but he had no idea what I was saying.

This 24/7 access to fast Internet is deteriorating our social skills. When friends sit together, they no longer have anything to say. What they end up doing is taking selfies, posting them online, and spending the rest of the night commenting and liking each other's photos. These behaviors are a threat to our society because they take us away from deep thought and philosophy. As Albert Einstein said, "I fear the day that technology will surpass our human interaction. The world will have a generation of idiots."

Fleeting Memory

One cannot deny that technology is pervasive, nor can one deny that it had a negative effect on our memories. What makes people distinctive is their memories and thoughts. When our memories are not capable of remembering the past, we would no longer act as humans. Technology will control our actions, and we follow what all other human beings do.

With the rise of ephemeral social networks such as SnapChat, people are no longer forming any memories. They live the moment, and the next day they live the other day's moment without remembering or reflecting on the past. For example, when I attended the New Year's party in downtown Atlanta, I couldn't but notice how everyone was using SnapChat. During the countdown, I looked at the sky anticipating fireworks and at that minutes all that I saw were screens running SnapChat. Why are people taking the New Year's countdown on SnapChat? As soon as they release the record button, everything will be gone. If they did not take a video, it will live in their memories. If they took one using the phone's camera, it will live in their smartphones. However, in SnapChat it does not live. It fades away.

The Need to Disconnect Arises

With negative effects on my attention, social skills, and memory, why in the world will I want to get a data plan? Later, I learned that SnapChat users had points. The more views their stories get, the more points they win. Having a stress-free brain is worth much more than the points or likes that I can get if I had a data plan.

Some people argue that I could get a data plan and only turn the Internet on when I want to. This can help me in situations where I need GPS. However, that does not bring the comfort that one gets from disconnecting. I would like to conclude with this amazing rap that sums up my argument.

09 Dec 2014

Coding on a Tablet

Yesterday, the first day of finals, my computer decided to stop functioning. Since most of my finals are in Computer Science classes, I had to be able to program to study. The only devices I have in hand are my smartphone and my tablet. What can I do?

I chose to try the tablet since it had a bigger screen. Of course, iOS does not give me any freedom. So, how do I overcome that? I remembered my cloud Ubuntu virtual machine. If I could only access my server's shell, I can run emacs to edit code and compile all my Java programs from the command line. I did a Google search and stumbled upon a nifty tool called Serverauditor. This is my SSH client to freedom.

Screenshot

Using Serverauditor, I was able to both practice for my data structures final and write this blog post. As I do that, I continue to believe the saying, "if there is a will, there is a way."

10 Oct 2014

Transfer Students are Smarter than the Average Student at Their University

Yesterday, I met with a friend who, like me, transferred from Kennesaw State University. We had a good conversation, and after we parted, I had a strange thought: "Why aren't Georgia Tech students as intelligent as KSU students?"

Georgia Tech has one of the top engineering programs in the United States, while KSU is only well-known in the Southeast; therefore, there must be an error in my formula.

I pondered over the idea for a moment and thought specifically about the KSU students whom I thought were extraordinary. Among those students, 6 transferred to Georgia Tech, 1 transferred to Georgia State University, 1 joined the PhD program at Emory University, 3 transferred to University of Georgia, and 3 are still at KSU.

This made me realize an unusual fact. My friends from KSU are not smarter than Georgia Tech students because they went to KSU. They are smarter because most of them are transfer students.

After reflecting on my experience as a tranfer students, I feel confident about generalizing my hypothesis to include all students across all universities. Here is why:

All Transfer Students Embrace Challenge

During my senior year of high school, I applied to the top universities in the United States, and my backup plan was to go to Kennesaw State University. As you would expect, I was rejected everywhere except in KSU, so I ended up going there.

At KSU, I was admitted into the honors program. I had an amazing time there. School was easy. The atmosphere was relaxing. I had a good relationship with all my professors. Everything was wonderful. However, occasionally I felt that I was different from the majority of the students at the university. For some reason, my brain was telling me that I was not in the right place. I never wanted to earn an easy degree. I want my college experience to be challenging and to give me the greatest amount of knowledge possible. I also want to be surrounded with people who thought like me. For these reasons, I decided to transfer to Georgia Tech.

Students who transfer do that because they are looking for more challenge. They know that it will be harder than what they are used to, yet they take the leap.

Many Non-Transfer Students go with the Flow

After students graduate from high schools, they go to universities. Some go to top-notch and Ivy League universities, others go to average universities that serve their local area, and yet others go to community colleges. All these students have one thing in common: they do not know what is ahead of them.

I have countless friends who went to community colleges or smaller universities planning to transfer in the future. Later, most of them decided to stay where they were. They found university to be more difficult than they had expected, and they gave up the idea of transferring.

At Georgia Tech, I met many people from the other end of the spectrum. They were admitted to Georgia Tech as freshmen. Later in their lives, they struggled a lot with their studies. Now, their main goal is to pass and earn a degree from Georgia Tech. They are accepting the reluctantly accepting the challenge.

Older Posts

Hackathons for a Better World 29 Sep 2014
How Agile Changed the Software Development Workplace 06 Sep 2014
CULC on a Wednesday Morning 20 Aug 2014
Back to Tech 18 Aug 2014
How to verify phone numbers using Twilio and Parse 31 Jul 2014
How to host multiple websites using Express.js 4 20 Jul 2014
How to build a scalable REST API using Node.JS and Express 26 Jun 2014
My Internship at BrainJocks 28 May 2014
Web Security: Unvalidated Redirects 06 Apr 2014
Assess your Collaborative Programming Skills 16 Mar 2014
Web Performance Trends: One Load, That's All 24 Feb 2014
Why You should have a Virtual Machine in the Cloud 09 Feb 2014
Computer Science VS Software Engineering 12 Jan 2014
Make a Blog Social (Without a Database) 28 Dec 2013
What if Cars had APIs 26 Dec 2013
Moving the Blog to Jekyll 24 Dec 2013
Kennesaw State University Student Barbecue 10 Sep 2012
Diclopedia is 1 Month Old 14 May 2012
Diclopedia Statistics: First Week 20 Apr 2012
Beginning Android App Development 13 Apr 2012
Beginning Android App Development 21 Mar 2012