JavaScript and its libraries are already popular when it comes to building services, APIs, and products on the Web. For example, the jQuery library simplifies many online web browsing experiences. This book sketches how JavaScript has been evolving into hardware and systems for the IoT.
JavaScript might not be the right tool for every job. But JavaScript and its libraries can be a toolkit to connect and prototype hardware devices. As Eric von Hippel notes in his important book Democratizing Innovation (MIT Press, 2005):
Users apply a toolkit in conjunction with their rich understanding of their own needs to create a preliminary design, simulate or prototype it, evaluate its functioning in their own use environment, and then iteratively improve it until they are satisfied.
By using JavaScript, people with diverse backgrounds (especially nonengineers) can be empowered to design and prototoype their own hardware. With hardware boards such as Arduino, Intel Edison, or Tessel, users can start to innovate in a much shorter time compared to more “professional” solutions that require vendor-specific programming hardware and compilers.
To help you get a feeling for different aspects of hardware development, Chapters 2, 3, and 4 discussed different “blink” examples. From this experience, more complicated hardware boards (such as boards with embedded Internet that we discussed in Chapters 5 and 6) or different components for physical inputs and outputs (covered in Chapter 7) were explored.
The main power of JavaScript-based toolkits for hardware come from JavaScript modules. Eric von Hippel investigated the nature of good toolkits in detail. He formulates the importance of modules as follows:
Custom designs seldom are novel in all their parts. Therefore, a library of standard modules will be a valuable part of a toolkit for user innovation. Provision of such standard modules enables users to focus their creative work on those aspects of their product or service designs that cannot be implemented via predesigned options.
Node.js is built on the concept of modularity: npm, the Node package manager, is a massive library of tools for the developer. A given tool can be small, but because there are so many of these tools (freely licensed and contributed from thousands of developers), any given project can be much simpler. The smaller problems are abstracted away.
Important examples of JavaScript libraries and modules were discussed in Chapter 8. For example, the Johnny-Five library by Rick Waldron provides abstractions for many boards and components. This library is a good start to build connected systems with JavaScript.
With foundations in hardware and JavaScript libraries for hardware, Chapter 9 looked into the examples of network protocols and JavaScript. Understanding network protocols is an important aspect of building connected devices. Running a web server with Node.js only requires a few lines of code.
What’s more, because JavaScript and Node.js are usually used for the web, hardware that can be programmed in JavaScript and Node.js can tie into web-based libraries without additional complexity. Chapter 10 gave examples for web interfaces and Chapter 11 showed how to connect systems with an information “cloud.”
While toolkits in JavaScript empower users to innovate in software, sharing hardware and circuits is still a bit more challenging than sharing code. Open source hardware (OSHW)1 is not yet as far along as open source software. There are not as many tools available yet for the global community to share their hardware designs, and it is more difficult to turn shared designs into physical hardware. But these tools are in progress, and as they become more popular, the pace of innovation for hardware will increase just as it has with open and modular software.
Nathan Seidle, founder of SparkFun, provides a nice overview about the way the Internet revolutionizes hardware development. He emphasizes that our work as engineers no longer involves writing patents or preventing others from copying our ideas. In a connected world, our job is making products that sell. At SparkFun, selling is done via the Internet, which means that people also buy “information” and “content.” They want to see and understand schematics and board layouts.
The Tessel 2 is an especially interesting example of how a hardware device can link software developers to hardware products. Not only is the board (and the software it runs) open source by design, but it has been designed with open source software toolchains. The Tessel is a strong open source toolkit and module system for IoT products.
Inspired by the same ideas that drive open source software, you can easily extend the Tessel. Once you know the basics of CAD designs for printed circuit boards, you can design and prototype your own Tessel modules. Ordering at companies such as OSH Park, you can start building your own prototype boards for under $10.
We are beginning to see more modularity and sharing in the hardware space, but the progress is slow. Fortunately, we do not have to invent all of the ideas and tools of open source from scratch. Because open source is now widespread in software, we can adapt the tools and lessons from that movement to hardware.
For hardware products, social communities with engineers, designers, and users are still developing. For these information communities, the Internet is critical. These communities can learn from open source software. The open source software movement, often software engineers themselves, have built the tools they needed.
For open source hardware, tools to interact with blueprints and projects online are still developing. To build these tools, software engineers will play an important role, despite being members of a hardware-driven movement. For the movement to progress, software engineers must learn about hardware (likewise, hardware engineers should expand their knowledge of software). People who straddle both worlds are required to build the IoT.
The IoT is exciting to web developers because it gives them new capabilities to interact with the world. And by embedding Node.js, we make the web-to-hardware transition more natural. We create a community with software, hardware, Internet, and open source built in. This is how we create new modular hardware, and how we move the open source movement in the hardware direction.
Node.js doesn’t just drive innovation in the IoT. By bringing web developers into the hardware space, the IoT drives innovation in how physical technology is developed.
As we stand at the beginning of the physical Internet, it is our responsibility as creators to think deeply about what we are building. It’s the second version of the Internet, and you can have a hand in creating it.
As first creators, go out and build—learn what it is to create a new form of industry, one based on responsive human environments. As you progress in this journey, ask yourself: How does this new thing change the human experience? How does it impact the planet as a whole? Am I building technology that creates positive change? Iterate to create the world you hope for.
1 The Open Source Hardware Association is working to bring awareness to the movement.