Yantra-Mane

yantramane.jpg

YantraMane was a project undertaken by the Karkhana Team as part of an Art-Tech Exhibition in Nepal - Yantra 3.0.  Nepalese engineers and artists collaborated to blend art and technology while building this giant prayer-wheel that controls a set of animations projected onto a screen. I handled the electronics ( Sensors and XBees) in this project. 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Hello LMRians. Long time no see! Hope things have been going great!


"Yantra" and "Mane" translate to "Machine" and "Prayer-Wheel" respectively, in Nepali. Last November, I got an opportunity to get involved in creating this giant (and techy) prayer-wheel that had a tiny box filled with an Arduino, an accelerometer, and an XBee on the inside, with a beautiful art covering on the outside. It was a fantastic experience and while doing so, I had also prepared a small document describing the build-process of "Yantra-Mane". So yes, this post is just a classic "Ctrl+C ---> Ctrl+V" from my Google Docs to our beloved LMR. Sorry for the laziness! :D

 

 

 

(I just noted that the line-numbering isn't correct at a couple of places along the post. I can't get that sorted right away. It looks like "copy-paste" has hit back at me. )  )

 

Yantra-Mane


“Yantra-Mane” takes the form-factor of a prayer-wheel. It was exhibited in the Nepal Art Council from 8th-15th November, as part of Yantra 3.0, an art-tech exhibit. The prayer-wheel acts as a sort of interaction with the visitors. Upon rotating it, animations projected onto two different screens begin to play simultaneously. The direction in which the prayer-wheel rotates controls the direction of the animations - forward or reverse. All of this, in a way, creates an idea of linking Nepalese Art with 21st century technology.

 




0sH_GGT9pVZ-iyT4wte4jmNu8863u6nzJRzbg6jefe2xrFOhfSete4c6ze_XwV15GMnH7CG2bUT0fmZc95oUnrzePIIUkoAwcBdloPImR0oAjdYOtRRUDrO4_2eKPVcq6g.png



A smaller version of the “mane” was also put on display at the Danish Embassy in Nepal on the 10th of November. This smaller version, however, controlled only a single animation.


The major components that drive this particular project are briefly listed below:


  1. Arduino Uno - An Open Source Prototyping Platform

n-w9HSf7mzyyULNCMDE-CF5lG8Wi5pqO8v180LhGSzFnBtze46mtHCeiq239Qsh1clDgbx9-wNU7Mizd-ZpdR5mv9QiXTrdsYUND6lDExk_fKkkeXHeNGpTs9UzsYfah-w.png



2. Arduino IDE - The Software for compiling sketches for Arduino

mUgchs15ROCktSGb9HemhQfdzUm7A-RGwAcsw30FRvnQs_dzp2a-m9lKDvnFdyR6vuA_qvEH9R4mdBdJZpZloACW0WyUd8I1fL25-_y1ox5lkP3VBuA08uRWYtALy7myZw.png

3. Processing - Also an Open Source Software that mostly deals with visual data

O0wil6gIfhS1BEu35UCCXWi1Vo3sta5AZxoW3WPioOqpBUwGJ6w_iGiShtQlDbkKfB5_JS02w9glXbQr-cTX32YwA_VD8Ep77fyh5B0Q8vyXq70xXCsLFQS10uCX7uMmBQ.png


4. XBee Pro - Wireless Modules that handle the communication part

5. XCTU - An XBee Configuration and Troubleshooting Utility

 

6. MPU6050 Sensor - A 3-axis IMU that determines the orientation of the wheel

 

Flow-diagram of “Yantra-Mane”



CIrcuit Diagram of “Yantra-Mane” Transmitting End



THE BUILD PROCESS:


  1. Deciding on Sensors


What started out as a couple of blinking LEDs and an Arduino spinning on a table ended up with being a prayer-wheel that controlled the flow of animations. The Karkhana team came up with a lot of other ideas on the use of sensors in the beginning to bring “Yantra-Mane” to life. Some of them were:


  1. Using IR Sensors to determine the direction in which the prayer wheel spins



IR Sensors are one of the most efficient sensors. They are in use in small line-following robots to gas-detectors all the way to the television sets in our homes. However, these sensors are sensitive to ambient lighting conditions. We could not risk using these sensors throughout the art-tech exhibit as there was a possibility of getting unexpected readings during certain periods. While a calibration phase certainly could have been set up, we found the use of another sensor to be more effective and feasible.





2. Using an ultrasonic sensor to determine the the direction in which the prayer wheel spins


7hraPDid0O0vrDTKa71D7_AiqhLr7TnG9QftyD9hCoBwIerRN1j9N9NeDDVfBfyYTJqwOgYqRGLdzdScbSKNXe225NVmmGOE8fzQLR7Wf_W24xB437bTV_SVJBcLpT7tIw.png


We also tried out using an HC-SR04 Sensor that basically emits ultrasonic waves which

bounce off upon striking an obstacle. These reflected waves would then return back to the sensor. By knowing this time interval for the waves to return back to the sensor, and the speed of the sound waves, we could know how far the obstacle was from the sensor.



In other words, we tried using an ultrasonic sensor to compare varying distances upon the rotation of the prayer-wheel. We constructed a spiral slide-like structure on the axle of the prayer-wheel and fitted the ultrasonic sensor at the top. A clockwise rotation of the prayer-wheel reported decreasing distances from the ultrasonic sensor. An anti-clockwise rotation of the prayer-wheel reported increasing distances. In this way, we succeeded in differentiating the direction of turns of the prayer-wheel using an ultrasonic sensor.


Although using an ultrasonic sensor turned out to work well, it wasn’t free from jitters. Some ultrasonic waves, upon striking the obstacle never returned as they took an entirely different path. At some points, we were still getting strange readings. We thought of incorporating a sensor that was entirely based on the physical interactions of the person rotating the wheel.







3. The third idea was to use an accelerometer + gyroscope sensor i.e. an IMU (Inertial Measurement Unit). This became the most effective solution and is the current sensor used in “Yantra-Mane”. A typical IMU looks like this :



67NN4IH8ghtT7FiqdmBS6zmAJLZlTG17Da-CiWA8iLeNKs4QKMCq7svBl6xSbRIG4sAOCfHg1JmZ4_UiPPTQC_Be5YBfQ1aANwdIfgf7TXdGR9lIOyXQ1Nf2QKCcSVZcZA.png


We used an MPU6050. It is a 3-axis accelerometer + gyroscope + temperature sensor combo. Using a combination of a gyroscope and an accelerometer, it behaves as an inertial measurement unit (IMU) that gives accurate information on the orientation of the prayer-wheel. This sensor not being affected by the ambient light (unlike the IR Sensors) and the physical layout of the prayer-wheel (unlike the ultrasonic sensors) was an added bonus that gave flawless readings throughout the operation of this project.



B. The Developments


“Yantra-Mane” underwent a series of builds, improvements, and prototypes before arriving to it’s present state.


  1. Blinking LEDs : The very first system was simply loaded with electronics and lines of code. It consisted of a pair of LEDs - one red and one blue - that correspondingly lit up based on an algorithm loaded onto the Arduino. When the Arduino was spun in a clockwise direction, the red LED lit up. When it was spun in an anti-clockwise direction, the blue LED lit up. This was the same idea that formed the foundation of “Yantra-Mane”.


  1. Installation on the first prototype: We constructed a small version of the “mane” and set up the electronics to see the results. The output was still limited to the LEDs. The prototype was simply a set of wooden pieces attached to each other to form a cylindrical structure. This structure then rotated around an axle tightened with bolts.



What was left was to transfer this information to a computer so that animations/slides could be controlled.

 

Expanding the electronics: Certain characters needed to be sent over wirelessly based on the rotations of the prayer-wheel. For handling this communication, we thought of using locally available low frequency RF Modules. They, however, were limited by their short range. So, XBee Modules were a much better idea.


XBees were capable of transmitting and receiving data over a longer range. They could also communicate with other groups of XBees, and also came with their own separate configuration software called “XCTU”. Setting up the XBees was simpler and more importantly, reliable. We could easily address the “PAN IDs” and “Destination Addresses” of the corresponding XBees between/among which data transfer needed to take place.There are several XBee models available in the market. This project used the XBee Pro.


After integrating XBee Modules in this project, we were able to transmit characters to a computer wirelessly.  An ‘f’ was sent over when the mane was rotated in a clockwise direction and a ‘b’ was sent over when an anti-clockwise rotation took place. In other words, the LED outputs were replaced with characters.


  1. Merging the system with Processing: After successfully establishing communication between the XBee Modules, it was time to play the animations upon the arrival of each subsequent character. We used an open-source software called Processing. As the name suggests, it is a great tool for processing and manipulating visual content.


  1. The Final Product:



ytGH5MIC9ecUjy3ENdtzndR09yd58nT6ktcqtmnmkoN2jqxKwH8wnBPOYLWSLBIZTqYrREfnY57gYgvSF5RXQepF3ouw6-uhZoSMXzKDAd5_pCRJ7DZANr7pCbocTN-WtQ.png


B. The Programs and Codes Behind the Scene



As mentioned earlier, the major software used were Arduino, XCTU, and Processing. These components are described here in detail - from their introduction to how they were used in this project.




Arduino




Arduino was developed in 2005 by a group of engineers and makers, that kickstarted the open-source movement in the microcontroller era. Arduino is an open-source electronics platform based on easy-to-use hardware and software. It’s intended for anyone making interactive projects.


“Yantra-Mane” uses an “Arduino Uno”, one of the many varieties of Arduinos available in the market. It is the most common platform of the Arduino family.




vcq2wq62R6TR2o5Ye3lKcGMh68pXRxeQ-D9ibuU3TYEJkitNFug-xvFqP3m6_i49aaiM5SiA2ASNB9oPxRrTBO46yz6uFj-5DL4bDIRP6tyc4-Xtmik1nd3TNpkbmANtGw.png

An Arduino Uno with labelled components


A sample program in the Arduino IDE


Arduino is not only a hardware component, but also, a software component. In this project, the Arduino Uno is the hardware platform whereas the Arduino IDE is the software component.


Arduino is clearly the brain of “YantraMane”. It is the electronic component that gives life to the prayer-wheel. The attached MPU6050 Sensor is capable of giving data on the orientations of the prayer-wheel but to manipulate this data, we need to use a micro-controller platform. Arduino does this in the easiest way possible. With the help of the Integrated Development Environment, it can be easily programmed using simple C-like language.


Here is a basic overview of what the program running on the Arduino does:





The entire code can be viewed at www.github.com/dipeshwor/yantramane



XBee Configuration and Testing Utility (XCTU)



After sending characters to the serial buffer, the Arduino needs needs to wirelessly transmit them to a computer so that animations can be played. For this, we have used XBee Modules, as mentioned earlier. The XBee Modules, just like the Arduino, come along with their own software known as XCTU. Through this utility, we can easily establish communication between or among the XBees.



XCTU has a user-friendly interface that allows many configurable options


XCTU scans serial ports for available XBee Modules.



The discovered devices are listed.


Devices to be configured can be selected



We can specify various values such as “Personal Network Address (PAN) ID” and “Destination Addresses” (DH and DL).  MAC Addresses of the modules are just a combination of the Destination Addresses (DH and DL) of the modules. XBee Modules under the same PAN ID can communicate with each other. They should however have their serial addresses specified as destination addresses on the other pair.


For eg: XBee Module C1, C2 and C3 has the following Serial Numbers(MAC Address):


C1 SH = 0013A200 SL = 40BE11A0

C2 SH = 0013A200 SL = 40BE11A2

C3 SH = 0013A200 SL = 40BE11B5


To establish two-way communication between C1 and C2, we must set the Serial Numbers of C1 as the Destination Addresses of C2 and vice-versa. In other words,



DH of C1 = SH of C2 and DL of C1 = SL of C2

DH of C2 = SH of C1 and DL of C2 = SL of C1


Like this:



This is the configuration used in the smaller version of the prayer-wheel where only one animation will be controlled.


However, in the bigger version of the prayer-wheel, 2 different animations need to be controlled. In other words, one XBee Module needs to send data to two different XBee Modules.



In our setup, we have used C3 to send characters to both C1 and C2. To do that, we need to do two things:


  1. Set the PAN IDs of all three modules to the same value.

  2. Set the DH and DL of C3 to 0 and FFFF respectively.


This configuration is also known as “broadcasting”.


Like this:



Using this configuration, we can establish communication among multiple XBees setting up a single transmitter and multiple receivers.



PROCESSING:


Processing is capable of handling and processing visual content. Using this software, we can draw lines and circles, track faces and objects, and create simple animations. This software handles the third and final part of this project.





Upon the arrival of a character through XBee, a processing sketch scans the serial port to identify whether it’s an ‘f’ or a ‘b’. If it’s an ‘f’, a series of images stored in a specific folder are loaded in the ascending order. Every image is named numerically according to the folder number in which it is placed.


In our setup, we have included all the images in a folder named “data” which contains other folders named as “a01”, “a02”, “a03” and so on. Inside every folder are the 31 different frames of our animation. For a convenient purpose, the images inside folder “a01” are named in the order :

“a01001.jpg”, “a01002.jpg”, “a01003.jpg”,…,”a01031.jpg” and similarly for the rest of the folders for other animations.


The processing sketch is capable of gathering various information such as total number of images, and of course,  loading the corresponding image. The entire code can be found at : www.github.com/dipeshwor/yantramane .




THE END

 

I’ll try to refine this cluttered post in he coming days. I’ll also post more pictures of the initial prototypes, as well as other pictures from the event. Thanks for passing by.

https://www.youtube.com/watch?v=EDct92nGzJQ

yantra-mane

This is a really nice presentation. I liked the way your team merged art with technology.

I am sure that I can speak

I am sure that I can speak for all of us by saying: “We are proud of you Ashim!” 

Yeah, it’s not only that somewhere in the world but on top of the world in your small kindom the name Letsmakerobots is standing for creativity, innovation and fun. I think none of us would have expected that LMR someday is even connected with praying items :slight_smile:

Also you provide the important information about your task, even if you are a hopeless lazy dude and copy pasted that into the text box…but you’ve got your punishment when the formating got messed up…see, there is always something coming back :slight_smile:

Thank you for showing us
Thank you for showing us this project.

I’ve always like the juxtaposition of the very old and the very new. Prayer wheels are extremely old, while the electronics is recent. And you and the rest of the Karkhana Team did an extraordinary job on this.

@lumi - It’s always nice to

@lumi - It’s always nice to hear those encouraging words from you. It was fun being part of this project and a pleasure to post this on LMR. Hopefully, the format will get better soon :smiley:

@Duane - Happy that I could share it with you and LMR! Thanks :slight_smile:

@ggallant - Glad that you like it! There are lots of engineering projects that are carried out in Nepal but little emphasis is given to the design structure of the projects. Collaborating with artists and bringing up this project together taught a bunch of new things.

@DT: Thank you so much for admiring this small effort! And thanks for catching the connection! As you said, prayer-wheels are everywhere in temples around Kathmandu and it was a nice experience turning one into something “electronic”.