Things used in this project

Hardware components

Hand tools and fabrication machines

Soldering iron (generic)

Rotary Tool (like Dremel)

Story

;

;

1 / 5

I bet as a child you tried at least once if you can move objects with your thoughts and hand movements like a Jedi knight... Well, I tried but of course with no success. My followers probably know that I am a huge Star Wars fan, and the Star Wars universe or the SW Saga inspired a few projects that I shared with you. This time we are going to build a home automation system that is working only with hand gestures.

You will be able to control your TV, your house lights, your toaster, your charger... Everything, just like a Jedi knight (or a Sith, I don't know which side do you prefer).

And now you are probably thinking how is this even possible but don't worry I am here to explain you all that you need to build this project. If you think it is interesting just read each step carefully and then you can start your own project. Don't worry if you are a beginner I am sharing schematics, codes and full explanation on how to build it. We will learn to code in JavaScript and Arduino and some C language.

I am going to show you how to make applications on a Pebble smartwatch, it is very simpe... I hope will also teach you some new tricks in Arduino. We will use an Arduino like microcontroller, the Particle Photon that has an on-board WiFi module. I found some great insipration in TVMillers's project.

Now let's get started!

Step 1: Video

In this short video I am going to show you how this device actually works. I am not a native speaker sorry for my very accent, but I hope you like it. I explain the theory behind my device and how to make it yourself. Don't forget to watch it in 1080p.

Step 2: The Idea - Being Able to Use the Force

;

;

1 / 3

I think that even those who don't really like the Star Wars series like the idea of moving objects only with your thoughts. I wanted so bad to make this real and then I started thinking then one day the idea came in like a lightning. I could use my smartwatch as a gesture sensor...

But what is the Force?

After Wookipedia: "The Force was an energy field that connected all living things in the galaxy. The power of the Force could be used by individuals who were sensitive to it, a power that was tapped through the midi-chlorians." You can give your girlfriend fruits and move warships with the Force, but for me is the most majestic and beautiful movie element ever used. Let me explain why. It made my childhood richer and I think if you read this as a Star Wars fan you can say the same thing. Fighting with wooden rods thinking they are lightsabers is one of the the best things in my life. I bet you have memories like this. This is why we all love this mysterious thing... The "Force" gave us so many good experiences.

"It’s an energy field created by all living things. It surrounds us and penetrates us; it binds the galaxy together." - Ben Kenobi

Now that we now more about the Force, it's time to learn some science.

Step 3: How It Works?

;

;

1 / 5

In JavaScript programming language I made a relatively simple application on my Pebble smartwatch, that I bought last year and really like to use it. It is probably one of the most elegant smartwatches no the market and it is programmable so you can make any application on it. And also made a program on my Particle micro-controller that actually controls our home.

To make it clear:

The Accelorometer in the Pebble Smartwatch detects special hand gestures.

Via Bluetooth the watch transmits signals to the phone.

The phone sends signals to a web address.

The Particle Photon reads signals with its WiFi module.

Depending on what signal he gets controls the TV, lights, toaster...

Why do we need home automation?

For me one of the most annoying things is when I have to walk to the other corner of my room just to turn off the lights before I sleep. With this gadget and IoT things get a lot easier.

How easy is to make it?

It is not a beginner's project but I am going to explain how the codes and the circuits work. It is not that hard, we will learn some JavaScript and Arduino.

How easy is to use it? What is so special about it?

I designed a SmartPlug basically. (That is smarter than the average.) All you have to do is plug in your device in a wallplug then wait until it is connected and make hand gestures. You will be able to turn on your TV or lights and switch channels, then turn them off. It is so simple to use. Don't worry it will never happen that you accidentally control something, because I made a build-in filter in the code.

Why do I use Particle Photon?

The Particle Photon is an Arduino-like microcontroller, with the same price and the size of an Arduino Mini Pro but has an on-board WiFi module that makes everything so much easier.

If you decided to make this project please be careful, we will be working with high voltage.

Step 4: What Is Pebble?

Pebble (https://www.pebble.com/) is one of the worlds best smartwatch brands. I think they are making the most elegant watches worldwide with amazing e-Paper screens and extra-long battery life. The reason why is my No. 1 smartwatch is that it is open source so you can do many stuffs with it.

What happened to them? Does it still worth to buy a Pebble?

Ufortunately Pebble went bankrupt... That is probably because their bad growing or marketing strategy, but I am not sure about why did they fail. You can still buy Pebble watches from Amazon and their servers are still functioning, so the project works fine, just makes me sad that such an amazing company ended up like this. I bought my Pebble Time Steel a few months ago and love it. You can see the PTS update at the bottom of the article.

Step 5: Based on One Sensor - What Is an Accelerometer?

;

;

1 / 4

In this project we will learn how to use an accelerometer in a smartwatch. I did a documentation on the Development Guide I found a good description about the accelerometer. An accelerometer is a device that measures proper acceleration; proper acceleration is not the same as coordinate acceleration (rate of change of velocity). For example, an accelerometer at rest on the surface of the Earth will measure an acceleration due to Earth's gravity, straight upwards (by definition) of g ≈ 9.81 m/s2. By contrast, accelerometers in free fall (falling toward the center of the Earth at a rate of about 9.81 m/s2) will measure zero.

Actually is a tiny chip that can detect acceleration in 6 directions, this is more than enough for us to create this project, because we can detect a few special gestures this way. What makes a gesture detectable? If you take a look on how the Jedi knights move their hands you can figure out what physical forces affect on that. I just had to make a program for it.

Let me show what do you need for this project!

Step 6: Gathering Parts and Tools

;

;

1 / 2

I can't say that this is the cheapest project that I have ever made, but the truth is that I had all parts at home, and most of them is salvaged from old electronics. The Particle Photon costs $19 and the Pebble watch only $39.95 on the Amazon so I can say that is relatively cheap. You can use any version of Pebble watch, but I am using the basic model, that I like the most. Everything else is salvaged. You will also need some soldering and crafting tools.

I gave Amazon purchase links for three components. Everything else is salvaged from old electronics but you can buy them from a local hobby shop. As you see the hardware parts in this project is simple, but we will have to suffer a little bit with progamming... (Well you don't, you just have to copy + paste, I had to suffer.)

Step 7: Using the Pebble Cloud IDE

;

;

1 / 4

Coding is easy on the Pebble Cloud IDE... In this step I teach you how to begin a project.

Then pair your smartwatch with it. (I am using Android) Go in the app settings, and enable Developer Connection. Voila, now sign in to your Pebble account here: https://cloudpebble.net/ide/. And create a new project. Go to the next step to find out how to make a project.

Step 8: Starting a Project

;

;

1 / 4

Press "Create" button to make a new project and you will be redirected to a page like me on the second picture. On the APP SOURCE part you can find the code. Copy-paste here the code that I will share in the next step. At the RESOURCES you can add pictures and icons to make your app look much better. I actually used a selfmade pixel Darth Vader.

See the project files in the next step.

Step 9: Project Files

;

;

1 / 6

Download the ZIP file below and import in your Cloud Pebble. Now you actually made an application. You can add other images or icons. See up there. If you want to, chech out the code. Feel free to use but don't forget to credit. Compile in JavaScript.

Step 10: Particle Web IDE

;

;

1 / 3

In this project you can program from the internet. Isn't that awesome? All you have to do is to plug in your circuit, your Particle Photon in a 5v source and with the help of the Particle phone app (https://play.google.com/store/apps/details?id=io.p...) connect to your local WiFi. This is very easy... Create a Particel account here: https://build.particle.io/build/ and you can start coding. It is the same as Arduino but with a better user interface with online libraries and etc...

Step 11: Writing the Code

;

;

1 / 4

I am sharing the code with you here. Copy and paste to your project file then "Verify" and after this press "Flash". And you are actually done. Now your system should work. The tutorial did not allowed me to paste my code here so please download this.TXT file. I have used a SAMSUNG TV so the commands and those long numbers are only available for Samsung TV users. If you have a different TV just Google it: "xyz brand arduino tv remote codes".

Step 12: Testing the Codes - Making a Prototype

;

;

1 / 5

In this project we use digital pin D1, D7 and D6 on the Particle Photon. Build a circuit using LEDs to test if the code is working properly. At this point parts should connect to each other wirelessly with no problem. Make Force movements like I did in the video and if the relay switches on at D7 that means you did a good work. Congratulations! Now we have to make it useful and user friendly.

Step 13: The Circuit

I made this circuit in Fritzing and I haven't found a normal AC adapter, but that Hi-Link module does the same thing that our salvaged phone charger does. Following this schematic and the next steps build the circuit.

Step 14: Soldering

;

;

1 / 6

As the schematics shows solder the wires to a piece of PCB that has two lines of header pins soldered to it. Plug in your Particle Photon to test if it fits correctly. After this you can solder a wallplug connector to the 5v adapter circuit, just like I did. Just take apart an old smartphone charger and you will find a circuit like this for free. This way you don't have to work so much with dangerous voltages. These are very well designed circuits, it is safe to use.

Step 15: Making a Case

;

;

1 / 7

I found this plastic case in project inventory and its size seemed to be perfect! Not too small and not too big. It is the same size like a laptop charger. I used my rotary tool to cut one hole for the 230v input voltage and one for the 230v output voltage on next to the input connector. Cut another 5MM hole for the IR LED that controls your TV.

Step 16: Final Product

;

;

1 / 3

With some glue gun I fixed all parts inside the project box so it is safe to use. You can open the plastic case anytime but if it is plugged in never try this! ONLY UNPOWERED! I can say that looks great and needs small space. From now just plug in your device to a connector and then wait until your Particle's LED has a light blue color.

Step 17: Testing

;

;

1 / 3

Plug in your gadget and connect a lamp to it for example. Make a hand movement and wait until switches ON or OFF. If everything works enjoy it!! From now you can enter your like a Sith or a Jedi. Just make a Force pull and your light will b turned on!

Step 18: Use the Force!

;

;

1 / 3

Enjoy your new ability! The smartwatch's battery lasts for about three days with intensive use and charges up in one hour. From now you can use your smart-plug with no external wires or other embarrassing things. You will have a simple and elegant system, I really like to use...

Step 19: Thank You Very Much for Watching!

;

;

1 / 2

I really hope you enjoyed my project tutorial, it would make me very happy if I succeeded to show you something mind-blowing. Follow my tutorials page for more projects like this. Huge thanks for Basa András who made the filming and the editing of this video.

If all goes well next time we will build intelliegent drones!

May the Force be with you!

Step 20: 2018 Update!

I just bought a new Pebble, because I liked my previous watch so much. Everything should work fine. Install the Pebble app like you normally would.