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.

FAQ

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.

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.

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

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Building Brain-controlled Interfaces in JavaScript
JSNation Live 2021JSNation Live 2021
27 min
Building Brain-controlled Interfaces in JavaScript
Top Content
Neurotechnology is the use of technological tools to understand more about the brain and enable a direct connection with the nervous system. Research in this space is not new, however, its accessibility to JavaScript developers is.Over the past few years, brain sensors have become available to the public, with tooling that makes it possible for web developers to experiment building brain-controlled interfaces.As this technology is evolving and unlocking new opportunities, let's look into one of the latest devices available, how it works, the possibilities it opens up, and how to get started building your first mind-controlled app using JavaScript.
TensorFlow.js 101: ML in the Browser and Beyond
ML conf EU 2020ML conf EU 2020
41 min
TensorFlow.js 101: ML in the Browser and Beyond
Discover how to embrace machine learning in JavaScript using TensorFlow.js in the browser and beyond in this speedy talk. Get inspired through a whole bunch of creative prototypes that push the boundaries of what is possible in the modern web browser (things have come a long way) and then take your own first steps with machine learning in minutes. By the end of the talk everyone will understand how to recognize an object of their choice which could then be used in any creative way you can imagine. Familiarity with JavaScript is assumed, but no background in machine learning is required. Come take your first steps with TensorFlow.js!
Crafting the Impossible: X86 Virtualization in the Browser with WebAssembly
JSNation 2022JSNation 2022
21 min
Crafting the Impossible: X86 Virtualization in the Browser with WebAssembly
WebAssembly is a browser feature designed to bring predictable high performance to web applications, but its capabilities are often misunderstood.
This talk will explore how WebAssembly is different from JavaScript, from the point of view of both the developer and the browser engine, with a particular focus on the V8/Chrome implementation.
WebVM is our solution to efficiently run unmodified x86 binaries in the browser and showcases what can be done with WebAssembly today. A high level overview of the project components, including the JIT engine, the Linux emulation layer and the storage backend will be discussed, followed by live demos.
Atomic Deployment for JS Hipsters
DevOps.js Conf 2024DevOps.js Conf 2024
25 min
Atomic Deployment for JS Hipsters
Deploying an app is all but an easy process. You will encounter a lot of glitches and pain points to solve to have it working properly. The worst is: that now that you can deploy your app in production, how can't you also deploy all branches in the project to get access to live previews? And be able to do a fast-revert on-demand?Fortunately, the classic DevOps toolkit has all you need to achieve it without compromising your mental health. By expertly mixing Git, Unix tools, and API calls, and orchestrating all of them with JavaScript, you'll master the secret of safe atomic deployments.No more need to rely on commercial services: become the perfect tool master and netlifize your app right at home!
Effective Performance Testing to your Server with Autocannon
TestJS Summit 2021TestJS Summit 2021
36 min
Effective Performance Testing to your Server with Autocannon
Top Content
Performance testing expertise that is developed for a long time. In order to measure your server performance you need a tool that can efficiently simulate a lot of abilities and give you good measurements according your analysing criteria.Autocannon NPM library gave me exactly that - that library is super easy to install and has a very simple API to work with. Within a really short amount of time you can start do performance testing to your application and get good measurements in development environment and in your performance labs, and generate complicated testing scenarios.In this talk I will introduce Autocannon, explain how to efficiently analyse your server performance with it, and show how it helped me to understand complicated performance issues in my Node.js servers. At the end of this lecture, developers will be able to have the ability to integrate a fast and easy tool in order to measure your server performance.
Makepad - Leveraging Rust + Wasm + WebGL to Build Amazing Cross-platform Applications
JSNation 2022JSNation 2022
22 min
Makepad - Leveraging Rust + Wasm + WebGL to Build Amazing Cross-platform Applications
Top Content
In this talk I will show Makepad, a new UI stack that uses Rust, Wasm, and WebGL. Unlike other UI stacks, which use a hybrid approach, all rendering in Makepad takes place on the GPU. This allows for highly polished and visually impressive applications that have not been possible on the web so far. Because Makepad uses Rust, applications run both natively and on the Web via wasm. Makepad applications can be very small, on the order of just a few hundred kilobytes for wasm, to a few megabytes with native. Our goal is to develop Makepad into the UI stack of choice for lightweight and performant cross-platform applications. We intend to ship with our own design application and IDE.

Workshops on related topic

Automated accessibility testing with jest-axe and Lighthouse CI
TestJS Summit 2021TestJS Summit 2021
85 min
Automated accessibility testing with jest-axe and Lighthouse CI
Workshop
Bonnie Schulkin
Bonnie Schulkin
Do your automated tests include a11y checks? This workshop will cover how to get started with jest-axe to detect code-based accessibility violations, and Lighthouse CI to validate the accessibility of fully rendered pages. No amount of automated tests can replace manual accessibility testing, but these checks will make sure that your manual testers aren't doing more work than they need to.
Automated Testing Using WebdriverIO
TestJS Summit 2022TestJS Summit 2022
163 min
Automated Testing Using WebdriverIO
Workshop
Kevin Lamping
Kevin Lamping
In this workshop, I cover not only what WebdriverIO can do, but also how you'll be using it day-to-day. I've built the exercises around real-world scenarios that demonstrate how you would actually set things up. It's not just "what to do," but specifically "how to get there." We'll cover the fundamentals of Automated UI testing so you can write maintainable, useful tests for your website and/or web app.
JS Security Testing Automation for Developers on Every Build
TestJS Summit 2021TestJS Summit 2021
111 min
JS Security Testing Automation for Developers on Every Build
WorkshopFree
Oliver Moradov
Bar Hofesh
2 authors
As a developer, you need to deliver fast, and you simply don't have the time to constantly think about security. Still, if something goes wrong it's your job to fix it, but security testing blocks your automation, creates bottlenecks and just delays releases...but it doesn't have to...

NeuraLegion's developer-first Dynamic Application Security Testing (DAST) scanner enables developers to detect, prioritise and remediate security issues EARLY, on every commit, with NO false positives/alerts, without slowing you down.

Join this workshop to learn different ways developers can access Nexploit & start scanning without leaving the terminal!

We will be going through the set up end-to-end, whilst setting up a pipeline, running security tests and looking at the results.

Table of contents:
- What developer-first DAST (Dynamic Application Security Testing) actually is and how it works
- See where and how a modern, accurate dev-first DAST fits in the CI/CD
- Integrate NeuraLegion's Nexploit scanner with GitHub Actions
- Understand how modern applications, APIs and authentication mechanisms can be tested
- Fork a repo, set up a pipeline, run security tests and look at the results
Build an IoT App With InfluxDB
JSNation Live 2021JSNation Live 2021
105 min
Build an IoT App With InfluxDB
Workshop
Miroslav Malecha
Miroslav Malecha
InfluxDB is an open source time series database that empowers developers to build IoT, analytics and monitoring software. It is purpose-built to handle the massive volumes and countless sources of time-stamped data produced sensors, applications and infrastructure.
This workshop showcases a fully functional sample application called IoT Center that is built on InfluxDB. This application demonstrates the capabilities of the InfluxDB platform to develop a JavaScript-enabled time-series-based application. It collects, stores and displays a set of values that include temperature, humidity, pressure, CO2 concentration, air quality, as well as provide GPS coordinates from a set of IoT devices. With this data stored in InfluxDB, the application can query this data for display as well as write data back into the database.
This hands-on workshop will show students how to install this open source code to learn how to query and write to InfluxDB using the InfluxDB JavaScript client, and gain familiarity with the Flux lang query language which is designed for querying, analyzing, and acting on time series data. And finally, collect and visualize performance data of the Node JS application.
Security Testing Automation for Developers on Every Build
GraphQL Galaxy 2021GraphQL Galaxy 2021
82 min
Security Testing Automation for Developers on Every Build
WorkshopFree
Oliver Moradov
Bar Hofesh
2 authors
As a developer, you need to deliver fast, and you simply don't have the time to constantly think about security. Still, if something goes wrong it's your job to fix it, but security testing blocks your automation, creates bottlenecks and just delays releases, especially with graphQL...but it doesn't have to...

NeuraLegion's developer-first Dynamic Application Security Testing (DAST) scanner enables developers to detect, prioritise and remediate security issues EARLY, on every commit, with NO false positives / alerts, without slowing you down.

Join this workshop to learn different ways developers can access NeuraLegion's DAST scanner & start scanning without leaving the terminal!

We will be going through the set up end-to-end, whilst setting up a pipeline for a vulnerable GraphQL target, running security tests and looking at the results.

Table of contents:
- What developer-first DAST (Dynamic Application Security Testing) actually is and how it works
- See where and how a modern, accurate dev-first DAST fits in the CI/CD
- Integrate NeuraLegion's scanner with GitHub Actions
- Understand how modern applications, GraphQL and other APIs and authentication mechanisms can be tested
- Fork a repo, set up a pipeline, run security tests and look at the results
IoT Center Workshop by InfluxData
Node Congress 2021Node Congress 2021
131 min
IoT Center Workshop by InfluxData
Workshop
Miroslav Malecha
Miroslav Malecha
InfluxDB is an open source time series database that empowers developers to build IoT, analytics and monitoring software. It is purpose-built to handle the massive volumes and countless sources of time-stamped data produced sensors, applications and infrastructure. This workshop showcases a fully functional sample application called IoT Center that is built on InfluxDB. This application demonstrates the capabilities of the InfluxDB platform to develop a JavaScript-enabled time-series-based application. It collects, stores and displays a set of values that include temperature, humidity, pressure, CO2 concentration, air quality, as well as provide GPS coordinates from a set of IoT devices. With this data stored in InfluxDB, the application can query this data for display as well as write data back into the database.
This hands-on workshop will show students how to install this open source code to learn how to query and write to InfluxDB using the InfluxDB JavaScript client, and gain familiarity with the Flux lang query language which is designed for querying, analyzing, and acting on time series data. And finally, collect and visualize performance data of the Node JS application.
Prerequisites
Registered free InfluxDB Cloud account at https://cloud2.influxdata.comThree options available (via Google account, via Microsoft account or via email)Test login after the registration and save credentials for the workshopInstallation of the git tool (e.g. from https://git-scm.com/downloads)IoT Center cloneRun: git clone https://github.com/bonitoo-io/iot-center-v2Installed nodejs (from https://nodejs.org/en/download)Installed yarn package manager (from https://classic.yarnpkg.com/en/docs/install)Installed required packagesIn the cloned directoryRun: cd appRun: yarn install