CategoryProgramming

Volumetric display and data visualization : 4 animations for the L3DCube

The L3DCube

The cube falls into the category of volumetric displays, meaning that it can be used to represent 3 dimensional shapes. It is composed of 8*8*8 512 RGB LEDs, namely the very popular WS2812 that you can find in Adafruit’s neopixel product line.

It is sold by a company called Looking glass factory. It is still a product at the kickstarter stage. You can read about the story of its development on this instructable.

They make an 8*8*8 and a 16*16*16 version. The small version will set you back 399$, not something that I can afford. I was able to play for a while with the one from WearHacks. The solution for you can be even more rewarding: build your own! You can start by having a look at these Instructables.
Continue reading

L3D Cube visualizations Part 1: real-time scatter plot with Thingspeak

Overview

Basically a demonstration of the plotting capabilities of the cube. We will retrieve some data from a public thingspeak channel (they correspond to
data points posted by a connected barometer installed in my living room).

The JSON returned by the Thingspeak API is parsed on processing and displayed on the cube. Each serie of data is represented by a 2 voxels thick scatter plot.

The client code on the photon is a variation of the main client: we use the accelerometer data to give the ability to change the plot displayed on the front frames of the cube by tilting it one way or another.

Continue reading

L3D Cube visualizations Part 2: real-time worldwide weather

Overview

We will make use of the OpenWeatherMap API to retrieve the temperature from cities around the world and displays the result on the cube. The result is a “real-time” (actually the free API key only gives access to hourly updates) visualization of the earth’s weather.

A Python script is used to select which cities are displayed: we start with a json file provided by OpenWeatherMap that contains every city accessible from the API as well as their ID and coordinates. The json is parsed and casted as a panda dataframe. The latitude and longitude of each city are transformed in voxel coordinates over a sphere of 4 voxel radius. The cities that fall on the same voxel are grouped and a random one is picked up from each group to represent that voxel.

The result is saved in a csv file that is loaded in Processing and used to query the API. The temperatures of each city are then shown on the cube using a gradient of color.

Continue reading

L3D Cube visualizations Part 3: webcam stream projection

Overview

The video stream’s frames are divided into 8×8 squares of equal surface. The average RGB values of every pixel in the square is extracted and used to recompose a smaller image. The image is then projected on to the cube.

With enable3d option set to true, the past 7 frames are stored and displayed on the back frames of the cube with a delay set by the variable updateFrameRate.

The webcam stream could easily be substituted for any video stream if need be.

Continue reading

L3D Cube visualizations Part 4: depth and color projection with the Kinect

Overview

The Kinect is a traditional camera doubled with an Infra Red Camera, enabling it to perceive depth in addition to the color information.

Originally sold for Xbox, it is now available for PCs under the brand Kinect for Windows. Don’t let the name fool you, it will work just as well on OSX or Linux.

Similarly to what we did for the webcam, we connect to the video stream of the Kinect, analyze each frame and downsize them so that they can be displayed on the cube’s 8*8 resolution.

But this time, we will also extract the depth information that the Kinect returns along with the color information of every pixel. In the same way that we averaged the RGB values to recompose a smaller output image, we will compute the average depth of each new pixel. This depth will be used to position the voxels on the z axis of the cube.

Continue reading

Make your own data platform for the Internet of Things using Node.js and Express.js

Prologue

I recently wrote a tutorial explaining how to make a connected barometer in which I used Thingspeak as an endpoint for the data. With the current buzz around the Internet of Things, a lot of similar services popped up : Plotly, the Wolframe data drop, Xively and even IBM Cloud to name a few.

What I find problematic with theses services is that you loose control over your data. What are they used for, what happens if the company closes ? You don’t want to lose your preciously collected data.

One solution is to create your own data platform. This way you keep full control over your database. You can set-up backups and are sure that your digital property wont be used for commercial purposes behind your back.

We will thus be making IoT.me, a web application using Node.js as a server, Express.js for the framework and MongoDB as the database (the MEAN stack, without the A).
Continue reading

Control your home appliances from the web – using a Raspberry pi

Prologue

I recently moved in a new apartment in which the living room lights could be controlled with a remote. Having already played with IR signals in order to incorporate remote control to some of my projects I knew that I would probably be able to emulate the signals sent by the original remote and thus operate the lights of my living room from a web based application.

My first reflex was to think of using an Arduino with a wifi/ethernet shield. I could have used the ever usefull aRest library in order to build a REST api on the microcontroller. The web-app would have been hosted on a remote server and used as an graphical interface in order to make the right calls to the Arduino.

But this time I wanted to take a less low-level approach and it was a perfect opportunity to get my hands on a raspberry pi. With its computing and networking capabilities plus a direct control over the GPIO pins, the pi allows me to run the web-server and manage the IR signals from the same device. Furthermore I can use packages that will make my life so much easier, and use the full potential of the Pi to create a very complete hub for my domotics needs.
Continue reading

Make a Snake game for Android written in Python – Part 3

I hope you enjoyed the first two sections of the tutorial. If you got through it, rest assured that the hardest part is behind us. The game engine is at 90% done at that point, and handling screens is very straightforward in kivy. We’re just going to make a few arrangements here before packaging the app. It’s a good front-end exercise because this time we’ll rely a lot more on the kivy language.

Continue reading

Make a Snake game for Android written in Python – Part 2

If you followed Part 1 of this tutorial, hopefully your development environment should be all set. We’re ready to get down to business (in France we would say : “mettre les mains dans le cambouis”. Because you can learn coding, and useless french idioms at the same time!)
Continue reading

Make a Snake game for Android written in Python – Part 1

I wanted to code my first android app for a long time but I didn’t really know where to start. I wasn’t really excited at the idea of having to learn Java and was worried that my current level of C++ wouldn’t be enough. So I began to look for a way to code the app in my go-to language : Python. Using Python allows for reuse of the native libraries, which can come in very handy. And it obviously comes with the usual Python magic and agility.

Continue reading

© 2016 DigitalJunky

Theme by Anders NorenUp ↑