This Wednesday, we wrapped up year two of Scripts & Things, our meetup on JavaScript development for the microcontrollers and embedded systems that make up the Internet of Things. We concluded 2019 with a demo night featuring a variety of great demos from Scripts & Things members.

Each of the projects presented at the meetup embodies the Scripts & Things ideal: making IoT devices more personal and more useful by making them customizable. It was fun to see how our community built their own practical solutions to their own real problems, including holiday lights with colorful effects that you don’t see in off the shelf lighting options, a lightswitch that bridges artificial boundaries imposed by Wi-Fi lighting manufacturers, and an unusual use of BLE to make a physical pinball table into an input device that works with any PC.

We hope that these projects will inspire others to tackle their own embedded product designs in JavaScript.

Holiday Decorations

I started the night off by sharing my progress on IoT holiday decorations for the Moddable office. The first was inspired by last year’s Christmas lights by Mike Kellner, shown in the video below. Mike used strands of NeoPixels that you can buy online and developed APIs that make it easy to create interesting patterns and effects.

I’m starting our office Christmas tree with the same type of NeoPixel strands and using Mike’s APIs to create fun animations. I created a remote control for the lights running on Moddable One. The controller displays a list of effects, so all you have to do to change to a new effect is tap its name.

A Moddable One running a Christmas lights control app

The second decoration-in-progress is a wreath with six Moddable One devices arranged in two rows. Together the displays create a digital sign. You change the text they display by sending an HTTP request to the device in the top left corner. That device broadcasts the text in an mDNS packet, which all of the other devices receive at approximately the same time. Each device knows its position relative to the other devices, so they all know which portion of the text they should display.

Wi-Fi Light Switch

Peter Hoddie shared an inexpensive Wi-Fi light switch he built. With about $6 of hardware (an ESP32 and a rotary encoder) Peter created a software to control all of the Wi-Fi lightbulbs in the Moddable office. This includes Nanoleaf panels, Yeelight lightbulbs, and LIFX lightbulbs. All of these lights can be controlled by mobile apps, but they come from different manufacturers and use different APIs. There’s no mobile app or Wi-Fi switch available to control all of them simultaneously, so Peter used the Moddable SDK to build his own.

In addition to demoing the switch, Peter showed snippets of code from the switch app and discussed some of the software challenges he faced, such as deciding what toggling a set of lights in different states should do and how to group lights together so one controller doesn’t unintentiobnall turn off all of the lights in your home.

BLE HID Devices

Andy Carle presented a variety of custom input devices he built using ESP32 microcontrollers and the Moddable SDK. Each of the demos was a Bluetooth Low Energy Human Interface Device. These BLE peripherals can connect to a macOS or Windows computer without any additional drivers or setup on the PC.

The demos Andy gave to the group were:

  • A touchpad and a keyboard running on Moddable Two. The touchpad example operates like a laptop touchpad, using the Moddable Two touchscreen for mouse movement and clicks. The keyboard demo is built on the expanding keyboard example from the Moddable SDK. Andy also showed how a BLE keyboard can be scripted and can quickly send entire strings of text and commands to the connected computer.
  • A gamepad built with two Adafruit two-axis analog joysticks and four push buttons. The gamepad emulates an Xbox 360 controller and can be used to play video games on the PC.
  • A pinball controller with a plunger from a real pinball table and two digital buttons. The plunger is monitored by a VL6180 range finder to determine when it is pulled back. That action is mirrored via the BLE HID gamepad interface and causes the digital plunger in Pinball FX on the computer to be pulled back synchronously. Similarly, the physical buttons on the controller drive the digital flippers in the game.

The SwiftLink

Steven Swift shared a project of his called The SwiftLink™. The SwiftLink is a set of devices and a radio network interface that allow you to establish wireles connections between multiple Arduino systems. The goal is to make it as easy as possible to share variables across multiple systems and allow them to be used in multiple programs at the same time.

Steven once sold these devices, but eventually moved on to other projects. Still, the website he created includes documentation and video demonstrations that may be of interest. For example, this video from Steven’s website shows the SwiftLink being used to create a system where pressing a button attached to one Arduino controls a buzzer attached to another.

Moddable Two Nametag

Johannes Ernst showed off a nametag he built with a Moddable Two and a battery pack. The display shows his name, company name, and icons that relate to his interests and affiliations. Tapping the screen switches between icons. The app was built using the Piu user interface framework from the Moddable SDK.

Johannes has worn this to a few events and mentioned that it’s a great conversation starter, both because the icons help to find common interests with other event attendees and because it’s colorful and eye-catching.

Energy Harvesting BLE Buttons

Carl brought three buttons he got at a recent lighting trade show. At a glance these buttons look unremarkable, but they are much more interesting than you might guess. Each buttons becomes a BLE beacons when powered on, transmitting a BLE signal when they are pressed and when they are unpressed.

Even more interesting, none of them require batteries–they’re energy harvesting buttons. Clicking a button generates enough energy to power the button up and transmit the BLE signals.

Mini Clock

Mike Kellner brought a new version of his hackable, classic LED style clock that he first showed at Scripts & Things in July. The new version is more compact, but has all the great features of the larger versions including the ability to configure Wi-Fi, animation settings, and trigger OTA updates from a web browser. These clocks can also be attached to the same NeoPixel strands mentioned earlier. Mike demonstrated how easy it is to do that using my tree lights.

You can read more about Mike’s clocks in this blog post.

See You Next Year

This was our second year hosting Scripts & Things, and we have really enjoyed getting to know members of our growing community. We look forward to hosting more meetups and hearing from more voices from the JavaScript and embedded communities. The first meeting of 2020 will be in early January.

If you have a proposal for a presentation, demo, or workshop that would be a good fit at Scripts & Things, please reach out to us via our Meetup page or on Twitter!