How I've been Using JavaScript to Automate my House

Rate this content
Bookmark

Software Programming is naturally fun but making something physical, to interact with the world that you live in, is like magic. Is even funnier when you can reuse your knowledge and JavaScript to do it. This talk will present real use cases of automating a house using JavaScript, Instead of using C++ as usual, and Espruino as dev tools and Microcontrollers such as Arduino, ESP8266, RaspberryPI, and NodeRed to control lights, doors, lockers, and much more.

This talk has been presented at JSNation 2022, check out the latest edition of this JavaScript Conference.

FAQ

JavaScript can be used in hardware through platforms like Esperino, which allow developers to write JavaScript code to control and interact with hardware devices over a network.

Integrating IoT devices with cloud platforms allows for better management, scalability, and access to advanced computational resources, enhancing the functionality and efficiency of IoT solutions.

Using JavaScript on microcontrollers can be challenging due to memory and processing limitations, which may require careful management of resources and possibly compromising on some features.

Updates to IoT devices can be deployed remotely over the network using SSH or similar protocols, which allows for updating code and functionality without needing physical access to the device.

DIY IoT projects can be cost-effective, with microcontrollers costing as little as $1, but costs can rise with the need for additional components like sensors, relays, and enclosures.

Raspberry Pi is a small but powerful computer with its own operating system that can run multiple applications, while microcontrollers are simpler devices designed for specific tasks like controlling lights or sensors, often used in automation.

Yes, people use Raspberry Pi for production applications, often running Node.js, although it's not recommended for all production environments due to its limitations compared to full-scale PCs.

Microcontrollers are used in home automation for controlling devices such as lights and door locks, and for monitoring environments through sensors like temperature and humidity sensors.

Erick Wendel
Erick Wendel
22 min
16 Jun, 2022

Comments

Sign in or register to post your comment.

Video Summary and Transcription

The Talk covers various experiments with JavaScript and C++, including controlling lights and creating a car control system. The speaker shares his experiences with home automation and the challenges of hiding wires. He explores using JavaScript with Esperino for face recognition and discusses the benefits and limitations of the platform. The Talk concludes with suggestions for using JavaScript in hardware projects and learning opportunities.

1. Introduction to JavaScript and C++ Experiments

Short description:

Hello, my friends. I'm excited to share some tips and experiments with JavaScript and C++. Software development is not simple, and I'll show you some of my hardware burnouts. Raspberry Pi is like a supercomputer with its own OS, while microcontrollers are smaller and cheaper. They have limited memory but can run on walls and control lights.

Hello, my friends. How's it going, everyone? Going well? I'm so excited. It's been a while since my pandemic and this whole stuff. I'm kind of nervous, but I think this is something like my experience at work at home making my wife crazy at home, so I'm gonna give some tips about it as well, okay?

So I've been speaking about JavaScript, sharing a bit of my knowledge as well. And today I'm gonna show you some content I've been doing. So everything here is already online, so you can take pictures, publish. Please mention the event as well, so it helps us a lot as well. And here I'm gonna show some experiments using both JavaScript and C++. But don't blame me, I'm not a C++ developer, I'm just trying to experiment and actually to make my wife crazy, right? All this talk is just to make her crazy.

Well, we know that software is not just something simple, right? We know that we struggle a lot. I'm not an expert in what I've been doing, this is just experiments. So later on the QA I can show you some burnouts that I did on my hardware. Okay. When I started working with IoT stuff, the first thing I was like, oh, I should use Raspberry Pi for everything. And then I figured, well, it's not actually it, right? So I could use Raspberry and microcontrollers. And I wasn't aware of what does it mean.

Well, to fix this first question, a Raspberry Pi is actually a supercomputer, right? It has its own operating system. You can run games, you can run processing. You can use it for programming as well if you wanted. You can use Linux, Windows, and a lot of other operating systems. And actually, you can expand memory. This is crazy. People are using Node.js inside it to make production apps. I don't recommend it, right? But you can do it as well. Okay. When we go to the microcontroller world, the microcontrollers are a bit smaller, right? We call them like the microservices of hardware. It's like a small unit of processing. You can run on your walls, control your lights, but it's much cheaper, right? You can buy it for $1 sometimes on Aliexpress. Well, as you can see, the whole thing is like 320 kilobytes run, right? JavaScript developer doesn't care much about memory, right? So this was my first struggle, and I'm going to show you later. It's a single core, but we can simulate threads and other things as well.

2. Introduction to Beer Cane Project

Short description:

But you might have heard of Arduinos as well. This is the Brazilian version. I'm Brazilian, so I brought some of our country as well. I was like, why not make my own assistant? Let's first understand the project. This is my first demo, running inside the beer cane. The whole project was good, but turning on an LED, it's like a hello word on harder, right?

But you might have heard of Arduinos as well. Who have heard about Arduino? So popular, right? So this is the Brazilian version. I'm Brazilian, so I brought some of our country as well, just to show you.

Okay, now I introduce you about what I've been doing or what the difference is for you to get some context. And now I'm going to show you some experiments and some not good things that I've been doing as well. The first stuff I was like, man, Raspberry Pi, people are using Raspberry to create HTTP servers. This is so boring. Curds. I don't care about curds anymore. Creating products and this kind of stuff. I was like, I should do something interesting.

So I like beers. I was like, why not make my own assistant, right? So here I have my beer cane, and there I have a Raspberry Pi. I'm going to show you later how it's working. Let's first understand the project, right? So I could have my beer cane on my main wall. I have a camera right there. And when I see a friend, I will just recognize. And my beer cane will say, oh, welcome home. Or just make some jokes. And that's it. I was like, yeah, let's make it.

Well, this is my first demo. Right here I have a Raspberry Pi, a supercomputer, running inside the beer cane, and on the other side, I have another one to recognize friends, right? Here I have a camera, and I'm using, like, Azure API. I don't know anything about machine learning here. Just using APIs. But then I recognize my friends. And then it sends a message through the beer cane. When it recognizes, it says, oh, welcome back. This is so... Like, the whole project was good, but turning on a LED, it's like a hello word on harder, right? Well, I was like...

QnA