Hardware + Collaborative art
Tags: art, education, hardware, arduino
Published: 2018-02-05 18:42:28

---
title: Hardware + Collaborative art
published: true
description: How to use arduino electronics to create collaborative art.
tags: art, education, hardware, arduino
---

Not long ago I was asked to make a **hardware project with art involved** to show to high school students. I firstly thought about creating an electronic mural but I enjoy better collaborative work so I got inspired by distributed ledger system. The idea is to have a bunch of nodes, each of them have space for drawing and electronic random gadgets such as led lights. They also have conductive materials and wires. The idea is to let the students draw stuff in the "_nodes_" and then ask another "_nodes_" to connect to theirs. When connecting, the electronic devices in the nodes activate and so they are collaborating in the same work, instead of leaving their art individual. The result will be a **big mural full of different drawing styles and electronics**. Also bought a bunch of translucent paper so we can put _origami_ in the led lights and make it even more cute.

![](https://thepracticaldev.s3.amazonaws.com/i/a2j9amrzx32qwph2t0uu.jpg)
![](https://thepracticaldev.s3.amazonaws.com/i/r0ofuinvazffo1v87qa7.jpg)
![](https://thepracticaldev.s3.amazonaws.com/i/jxe53hgv1dz0y1br7xum.jpg)

This is the basic code for the RGB led pin in one of the nodes, as described in [adafruit](https://learn.adafruit.com/adafruit-arduino-lesson-3-rgb-leds?view=all):

```
//rgb_led.ino

int redPin= 7;
int greenPin = 6;
int bluePin = 5;

void setup() {
  pinMode(redPin, OUTPUT);
  pinMode(greenPin, OUTPUT);
  pinMode(bluePin, OUTPUT);
}
void loop() {
  setColor(255, 0, 0); // Red Color
  delay(1000);
  setColor(0, 255, 0); // Green Color
  delay(1000);
  setColor(0, 0, 255); // Blue Color
  delay(1000);
  setColor(255, 255, 255); // White Color
  delay(1000);
  setColor(170, 0, 255); // Purple Color
  delay(1000);
}
void setColor(int redValue, int greenValue, int blueValue) {
  analogWrite(redPin, redValue);
  analogWrite(greenPin, greenValue);
  analogWrite(bluePin, blueValue);
}
```

As an extra point, I'm also doing some conductive paint with graphite the students could use to experiment with drawing + leds. I already tried this one with my 12 years old student, who enjoyed it a lot. 

Here's the code for the capacitive stuff, as we made in our [class](https://github.com/terceranexus6/clases_con_rafa/blob/master/apuntes_curso_nuevo/clase_arduino_capacitivo.md):

```
//graphite.ino

#include <CapacitiveSensor.h>
CapacitiveSensor capSensor = CapacitiveSensor(4,2);

int threshold = 1000;
const int ledPin = 12;

void setup() {

    Serial.begin(9600);
    pinMode(ledPin, OUTPUT);

}

void loop() {

    long sensorValue = capSensor.capacitiveSensor(30);
    Serial.println(sensorValue);
    if(sensorValue > threshold) {
        digitalWrite(ledPin, HIGH);
    }
    else {
        digitalWrite(ledPin, LOW);
    }
    delay(10);

}
```

**Why physical nodes for collaboration?** My father is a psychologist and he explained me not long ago touching makes understanding better, for example when toddlers try to put different figures (triangles, circles and such) in easy puzzles. For this, for example, exist the kindergarten toys for teaching programming, which only works in basic programming logic without maths or words involved, only a robot and the directions (right, left, straight) indications. This is the same, in order to better understand hardware and collaborative ledger, I think it's easier to make a physical performance.  

I aim to upload every detail in an [open repository in github](https://github.com/terceranexus6/hardwart), it's still ongoing, tho, excuse the low quality of it right now.