Sol

André Sier, 2014


Sol (pt)

Cada Sol é uma escultura emergente única criada pelo percurso de agentes autónomos na superfície de uma esfera. A escultura é conjugada com electrónica onde um micro-computador e 2 leds com padrões ondulantes infindáveis habitam o núcleo dos planetóides generativos impressos em 3d que acumulam o mapa dos percursos na sua superfície.

Esculturas com electrónica: código, impressão 3d em pla, attiny, leds, electricidade ou painel solar.
Dimensões aproximadas 7x7x7cm.

Sol (en)

Each Sun/Sol is an emergent unique sculpture created by the trajectory of autonomous agents on the surface of a sphere. The sculpture is conjugated with electronics where a micro-computer and 2 leds with endless ondulating patterns inhabit the core of the generative planetoids printed in 3d which acumulate the routes in its surface.

Sculptures with electronics: code, 3d print in pla, attiny, leds, electricity or solar panel.
Aproximate dimensions 7x7x7cm.





Sol (images)



Sol (software/hardware)

Each Sol's electronic is made of an attiny45 connected to 2 bright led's running a special firmware which is open-sourced below. Sol is powered with 3.3v either from a electric transformer or a solar panel.

The Sol sculpture which encloses the electronics is made with special custom software through progressions of finely tuned mathematical parameters for the autonomous agents, whose routes are in turn transformed into volumetric space for sculpture making.

Sol sculpture software is built with openFrameworks and s373.libraries. The application produces STL files for 3d printing. Sol firmware standalone runtime program is built with Arduino.

Sol (open source)

Sol has an open source firmware for you to play, licensed under CC-BY-NC 3.0. Please note you cannot use this code commercially. You can however build your own Sol Firmware on your Sol Objects for your own personal usages.

Each Sol's electronic is simple:

The circuit on the attiny is:

Usually led 1 is mounted on the front surface of the attiny, and led 2 on its back.

The Sol runtime program is uploaded to the micro-computer with Arduino.

Sol firmware source code:


/*
 
 Sol
 
 single attiny with 2 analog leds
 
 André Sier, 2014
 
// Sol Firmware 077.2014, mar 2014

// cc-by-nc http://creativecommons.org/licenses/by-nc/3.0/

// attiny: Binary sketch size: 2,394 bytes (of a 4,096 byte maximum)


 */




unsigned int numsamplesminusone = 87;
unsigned int costable88[88] = {  
        255,255,254,252,250,247,243,239,
        235,230,224,218,211,204,196,189,
        180,172,163,155,146,137,127,118,
        109,100,92,83,75,66,59,51,44,37,
        31,25,20,16,12,8,5,3,1,0,0,0,1,3,
        5,8,12,16,20,25,31,37,44,51,59,66,
        75,83,92,100,109,118,128,137,146,
        155,163,172,180,189,196,204,211,
        218,224,230,235,239,243,247,250,
        252,254,255
};



class SUNRIDER {
public:
  unsigned int ledcounter, ledspeed;    // * 100
  int ledpin;
  unsigned long nextMillisChange;

  SUNRIDER(int pin){  
    ledpin = pin;
    pinMode(ledpin, OUTPUT);
    randomSeed(analogRead(0)); // unconnected pin seeds random
    resetSpeed();
    ledcounter = 0;
  }

  void resetSpeed(){
    int prob = random(100);    

    if(prob < 76){
      ledspeed = random(1, 28);// * 0.01;    
      nextMillisChange = millis() + 10*1000; // fixed 10 seconds beat
    } 
    else if (prob >= 76 && prob < 97 ){
      ledspeed = random(25, 85);// * 0.01;
      nextMillisChange = millis() + random(2, 10) * 1000; // 2-10seg
    } 
    else {
      ledspeed = random(400, 2500);
      nextMillisChange = millis() + random(1, 5) * 1000; // 1-5seg
    }    
    
  }

  void update(){

    // outside for harmonics
    //    if(millis() > nextMillisChange){
    //       resetSpeed(); 
    //    }

    ledcounter += ledspeed;

    unsigned int idx = ledcounter / 100;

    if(idx > numsamplesminusone){
      idx = numsamplesminusone;
      ledcounter -= numsamplesminusone * 100; 
    }


    analogWrite( ledpin, costable88[idx] );

  }

};




//SUNRIDER sun1(10), sun2(9);   // arduino testing
SUNRIDER sun1(0), sun2(1);      // attiny sculpture



void setup(){
    // rnd ++
    randomSeed(analogRead(A0));
}


void loop(){
  delay(25);

  sun1.update();
  sun2.update();

  if(sun1.nextMillisChange < millis() ) {
    reset(); 
  }

}


void reset(){
  int prob = random(100);
  if( prob < 50) {
    // rnd harmonic
    sun1.resetSpeed();
    sun2.ledspeed =  sun1.ledspeed * random(2,4);
  } 
  else {
    sun1.resetSpeed();
    sun2.resetSpeed();
  }  
}