Vive la Resistance aka NanoSmano Sajica: Difference between revisions

From SGMK-SSAM-WIKI
Jump to navigation Jump to search
Line 37: Line 37:
void setup() {   
void setup() {   
                
                
   // initialize the digital pin as an output.
   // initialize the digital pins as output and input accordingly.
   // Pin 13 has an LED connected on most Arduino boards:
   // Pin 13 has an LED connected on most Arduino boards: but in this case its not connected to anything
   pinMode(pinOn, OUTPUT);   
   pinMode(pinOn, OUTPUT);   
   pinMode(pinInt, INPUT);
   pinMode(pinInt, INPUT);
Line 46: Line 46:
void loop() {
void loop() {
    
    
   digitalWrite(pinOn, HIGH);  // set the LED on
   digitalWrite(pinOn, HIGH);  // turns the whole circuit of the Sajica on, far enough power from the pin directly
    
    
   count = 0;
   count = 0;
Line 63: Line 63:
   Serial.println(count);   
   Serial.println(count);   


   delay(1);              // wait for a second
   delay(1);              // wait for a bit
}
}


</pre>
</pre>

Revision as of 17:25, 12 July 2011

Simple Version "Vive la Restistance!"

v.04 using 4093 - special edition for poolloop

here is the mask File:Sajica electronics v4 4093 poolloop.pdf

NanoSmano Sajica

In this expanded workshop we can build a simple circuit on a self-made pcb. It has an oscillator and a resistive gas sensor self-made out of soot aka saje (carbon particles). The output be both a blinking LED and also a speaker that produces sounds when you breath at it, put alcohol next to it or other changes in the gas around it. And it will sound cool when you attach it to a proper big amp :-)

Developed with the help of Borut Savski (SI) and Marc Dusseiller (CH), inspired by Prof. Gorazd Planinšič

Connect it to your Arduino

code coming soon... its just a simple integrator that counts, whenever the value changes from 0 to 1.

plug it in with ground next to pin 13. turn it on on pin 11 and measure on 12.

some lousy method, that kinda works...


uint8_t pinOn = 11;
uint8_t pinInt = 12;
uint8_t input = 0;
uint8_t inputNext = 0;
uint16_t count = 0;

void setup() {  
              
  // initialize the digital pins as output and input accordingly.
  // Pin 13 has an LED connected on most Arduino boards: but in this case its not connected to anything
  pinMode(pinOn, OUTPUT);  
  pinMode(pinInt, INPUT);
  Serial.begin(9600);   
}

void loop() {
  
  digitalWrite(pinOn, HIGH);   // turns the whole circuit of the Sajica on, far enough power from the pin directly
  
  count = 0;
  
  for (int i = 0; i< 10000; i++){
  
    input = digitalRead(pinInt);
    inputNext = digitalRead(pinInt);
  
    if(input > inputNext){
      count = count + 1;
    }
  }

  Serial.print("count = ");      
  Serial.println(count);   

  delay(1);              // wait for a bit
}