Implementing Robotics — JS your potential is endless!

The future is in your power!

Kunal Navhate
Globant
4 min readOct 6, 2020

--

What is Robotics? Well, it is the branch of technology that deals with the design, construction, operation, and application of robots. OK! So what is this gotta do with JavaScript? How is this distinctly connected to a web application? Hold on! I know you must be confused but, let me tell you — Robotics is now possible in a JavaScript as well! The days are gone when the detailed understanding of machine level languages like C, C++ and Go was required to start a servo motor on command.

Not convinced? Let me show you the real deal of Robotics using JavaScript!
Here comes Cylon.js 🚀

Credits — cylonjs.com

An amazing JavaScript framework which supports 43 different platforms, GPIO, I2C with the ease of Javascript

Enough of the hype — What does Cylon.js do?

As always — JavaScript Developer — More power to you.

Cylon.js is a JavaScript framework with cool integration features to support Robotics platforms, however, the most hidden aspect of using JavaScript is to interact with these platforms and to bridge them!

Imagine a scenario where multiple Robotics boards want to communicate with each other to share some data.

The only possible solution you could think right now is to write a bridge software/firmware to make them communicate.

No more!! Have a Robot programmed in Cylon.js and add the boards in devices and you’re done!

Woah! Seems interesting. How does this work?

Let’s get started!

Cylon.js can utilize local hardware resources. To demonstrate my point, we will be using locally installed ‘espeak’ software speech synthesizer to let your computer speak.

Let’s install espeak first

For linux
sudo apt-get install espeak

For OSX
brew install espeak

Install mighty Cylon.js now
npm install cylon cylon-speech

Let’s have our first Cylon.js code in place

Save the file with .js extension and run on terminal / command prompt by running following command

node <fileName>.js

Mind Blowing stuff, isn’t it?

Where can you use it you ask? Let's see that...

IoT

“Gartner Says 5.8 Billion Enterprise and Automotive IoT Endpoints Will Be in Use in 2020”

No, not because Gartner published the facts but we all have to accept that IoT is going to be the next mandatory thing where we will witness devices communicating with their own language (we call it protocol 😉)

“Let your JavaScript applications get out from the browsers and talk to devices..”

Using Cylon.js you can control and read multiple devices using standard protocols, Cylon also supports Socket.io, MQTT and HTTP API to send and receive data. So connect to multiple devices, get the data and push it to the cloud!

Limitless Opportunities

Imagine if all manual electric/electronic objects around you start working on voice commands?!

Yes, it is possible to achieve just by creating a nice achievable design and then coding it in Cylon.js

The implementations can start from your home and end to your daily commute, you can implement any idea using this powerful Node.JS based Robotics framework.

Let’s take an example of how we can automate our home using Cylon.js

Arduino — Open-source electronic prototyping platform enabling users to create interactive electronic objects.

Credits — https://www.arduino.cc/

Arduino can 🦾

  1. Log the temperature data of your refrigerator — watch it in action
  2. Turn on or off lights in your home — watch it in action
  3. Open the garage door — watch it in action
  4. Control camera at your home (IP cam on demand) — watch it in action
  5. Make your AC smart — watch it in action

If you’re using these many Arduino’s in your home Cylon.js can control all of them remotely!

Just put all of them in connections under a Cylon robot and you’re done!

Most affordable home automation is done without core expertise in Robotics and less learning curve!

Closing thoughts

If you’re a JavaScript enthusiast and want to do something out of the box, Cylon.js is the thing for you. Node is overpowering and challenging every known technology, why not Robotics?

Worth giving a try!
Are you ready?

Be hungry to explore more and create opportunities to keep learning something new, that will keep your heart young till it beats last time!

--

--

Kunal Navhate
Globant

Geek | Entrepreneur | JavaScript aficionado | Defence enthusiast | Live to drive