Gesture controlled smart light powered by PubNub.
Imagine a world where you walk in a smart home, look at a smart light in the room, make a gesture with your hands, and the light turns off or on. Swipe with a hand to change the channel on your TV. Glance at a thermostat and speak your preferred temperature aloud. This isn't the future. This is all possible now with the Magic Leap One and PubNub.
This project demonstrates how to control an RGB LED or a power strip with an Arduino using Magic Leap Gestures and PubNub. Learn more about how to build your own smart home with Magic Leap and PubNub from the tutorial.
This is part two of my Magic Leap series. Check out the other projects/posts Getting Started with Magic Leap and PubNub and Create a Multiplayer Augmented Reality Game with Magic Leap and Unity.
Developers have been building multiplayer games and other multi-user experiences with PubNub for years, and PubNub definitely sees AR as next on the horizon. PubNub is a natural fit in the AR world and their technology can power the realtime interaction between AR headsets or physical objects in the same location, or even across the Earth.
For example, when a Magic Leap user throws a ball in the virtual world, that motion is synchronized in realtime across every other connected user. Or if a user uses a hand gesture to turn on a light, PubNub is sending the message to that light to turn on. Multi-user experiences, or the relationship between the AR headset and the physical world around us, is where PubNub is required and excels.
- You’ll first need to sign up for a PubNub account. Once you sign up, you can get your unique PubNub keys from the PubNub Developer Portal.
This project consists of three components:
-
The Control app built in Unity for Magic Leap.
-
The LED Arduino sketch for controlling a RGB LED from the Control app.
-
The PowerStrip Arduino sketch for controlling a relay connected to a power strip.
Read the Getting Started with Magic Leap and Unity tutorial to familiarize yourself with Unity Video Game Engine development for Magic Leap and setup your development environment.
The tutorial Controlling Internet-connected Devices with Magic Leap Hand Gestures details how to run this project and correctly setup your development environment for Magic Leap and Arduino development with PubNub.
Use this project as a seed to build your own Magic Leap IoT application. A few ideas:
- Use a IR blaster to control your TV or game console.
- Use weather sensors and stream the information to a HUD on the Magic Leap device.
- Use the PowerStrip Sketch to control high voltage devices like a coffee maker or a fan (always be careful with high voltage electronics).
Have suggestions or questions about this project? Reach out at [email protected].
This is part two of my Magic Leap series. Check out the other projects/posts Getting Started with Magic Leap and PubNub and Create a Multiplayer Augmented Reality Game with Magic Leap and Unity.