113
edits
Cesardaher (talk | contribs) |
Cesardaher (talk | contribs) |
||
(15 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
='''Twitter-Controlled LED Matrix'''= | ='''Twitter-Controlled LED Matrix'''= | ||
[[File:TCLM_video03.mp4|500px]] | |||
=='''The concept'''== | =='''The concept'''== | ||
Line 6: | Line 8: | ||
At first, the idea was to collect and analyze information from tweets all around the world, so as to generate inputs. However, as this was my first time working with both microcontrollers and APIs, it was preferred to lower the complexity of this interaction to the level of generating inputs from individual tweets using the search feature. | At first, the idea was to collect and analyze information from tweets all around the world, so as to generate inputs. However, as this was my first time working with both microcontrollers and APIs, it was preferred to lower the complexity of this interaction to the level of generating inputs from individual tweets using the search feature. | ||
The conceptual interest in developing this project is the idea of having an unconscious collaborative experience. Through Twitter, users can engage in fast and easy communication with friends, but also with people all around the world. There is a lot of fear regarding how the data generated though Twitter and other social media platforms can be used to profile people, creating an environment that lacks privacy. However, since common people such as myself also have access to this data, it is possible to think of harmless interactions using it. In this case, people are unconsciously participating and influencing this project when they produce tweets with directional words. Though just an experiment, the principles used in this project could serve as reference for ways in which we can use social media to create collective artworks. | |||
The Arduino file for this project can be downloaded here: | |||
[[File:TCLM.ino]] (Uploaded on 9. March 2020) | |||
=='''Requirements'''== | =='''Requirements'''== | ||
Line 13: | Line 21: | ||
* ESP8266 NodeMCU microcontroller; | * ESP8266 NodeMCU microcontroller; | ||
* Elegoo UNO R3 Super Starter Kit (or similar, such as Arduino Uno); | * Elegoo UNO R3 Super Starter Kit (or similar, such as Arduino Uno); | ||
** | ** LEDs; | ||
** | ** 220 resistors; | ||
** Power supply module; | |||
** Jumper wires; | ** Jumper wires; | ||
** Breadboard; | ** Breadboard; | ||
* Adafruit WS2812 8x8 Matrix | |||
* Arduino software; | * Arduino software; | ||
* [https://github.com/debsahu/TwitterWebAPI Twitter API | * [https://github.com/debsahu/TwitterWebAPI Twitter API library] for Arduino; | ||
* Adafruit NeoPixel library for Arduino | |||
* Twitter developer account; | * Twitter developer account; | ||
The core of this project is the use of ESP8266 in order to connect to the internet and access the Twitter API. It is worth mentioning, though, that I was required to apply for a developer Twitter account in order to access the API. | The core of this project is the use of ESP8266 in order to connect to the internet and access the Twitter API. It is worth mentioning, though, that I was required to apply for a developer Twitter account in order to access the API. | ||
Line 114: | Line 124: | ||
These functions were adapted and used both for columns and rows and can be expanded into different sized matrixes. | These functions were adapted and used both for columns and rows and can be expanded into different sized matrixes. | ||
==Prototyping== | =='''Prototyping'''== | ||
==='''3x3 LED Matrix'''=== | ==='''3x3 LED Matrix'''=== | ||
Line 129: | Line 139: | ||
nor up nor down | nor up nor down | ||
right | right | ||
MSG: "@ | MSG: "@▄▄▄▄▄ | ||
that's right #Elizabeth @ | that's right #Elizabeth @▄▄▄▄▄ Call 1-800-Jason | ||
@ | @▄▄▄▄▄ not the police" | ||
nor up nor down | nor up nor down | ||
right | right | ||
MSG: "@ | MSG: "@▄▄▄▄▄ | ||
that's right #Elizabeth @ | that's right #Elizabeth @▄▄▄▄▄ Call 1-800-Jason | ||
@ | @▄▄▄▄▄ not the police" | ||
down | down | ||
Line 165: | Line 175: | ||
nor up nor down | nor up nor down | ||
right | right | ||
MSG: "@ | MSG: "@▄▄▄▄▄ @▄▄▄▄▄ You’re right; he don’t know bout that life" | ||
nor up nor down | nor up nor down | ||
right | right | ||
MSG: "@ | MSG: "@▄▄▄▄▄ @▄▄▄▄▄ You’re right; he don’t know bout that life" | ||
</pre> | </pre> | ||
Line 184: | Line 194: | ||
==='''8x8 LED Matrix'''=== | ==='''8x8 LED Matrix'''=== | ||
[[File:TCLM_video03.mp4|400px]] | |||
For this version, there is no need to assign digital pins to each LED. Instead, I assigned one digital pin and the number of "pixels" in the matrix. With that, each pixel is assigned a number (from 0 to 63), going from left to right and top to bottom. Because of that, I arranged a 2D 8x8 array containing each pixel, so that I could reuse the previous functions. | For the next prototype, I used a Adafruit WS2812 8x8 Matrix instead. This LED Matrix has the advantage of being built-in for microcontroller use, with many functions available in its library (Adafruit NeoPixel library). It also has the advantage of using only three pins and having no need for additional resistors, which made its connection very easy. The downside is that it needs an external power supply. The way it's connected to the microcontroller is as follows: | ||
<pre> | |||
DIN -> D6 | |||
5V -> 5V (Power Supply) | |||
GRD ->GRD (Power Supply) | |||
GRD (ESP8266) -> GRD (Power Supply) | |||
</pre> | |||
In this version, there is no need to assign digital pins to each LED. Instead, I assigned one digital pin and the number of "pixels" in the matrix. With that, each pixel is assigned a number (from 0 to 63), going from left to right and top to bottom. Because of that, I arranged a 2D 8x8 array containing each pixel, so that I could reuse the previous functions. | |||
<pre> | <pre> | ||
Line 205: | Line 224: | ||
</pre> | </pre> | ||
To deal with the duplicate tweets, in this version I also changed the code in a way that each tweet collected is reassigned as another variable right before the next search. That way, if the new tweets are equal to the previous ones, the lit up | To deal with the duplicate tweets, in this version I also changed the code in a way that each tweet collected is reassigned as another variable right before the next search. That way, if the new tweets are equal to the previous ones, the lit up LED is not changed. | ||
<pre> | <pre> | ||
Line 217: | Line 236: | ||
columnIndex(findDirHor(search_msg.c_str())); | columnIndex(findDirHor(search_msg.c_str())); | ||
} | } | ||
</pre> | |||
This version is almost perfect in terms of what I expected to achieve. The only problem found is that certain tweets containing the directional words would not cause the LED to change. The reason for that is that the Twitter API search is case unsensitive, but the Arduino indexOf() function, used to detect the directional words in the tweet is case sensitive. To fix this, I added the toLowerCase() function to turn former case unsensitive. That way, tweets with "UP" or "DOwn" for example should still be able to trigger a new LED. | |||
<pre> | |||
//previous | |||
else if (check.indexOf("right") != std::string::npos) { | |||
//new | |||
check.toLowerCase(); | |||
else if (check.indexOf("right") != std::string::npos) { | |||
</pre> | </pre> |
edits