Archive for the ‘Architecture & Design’ Category

Simple HIFI amplifier

Thursday, September 2nd, 2010

Almost a year ago I soldered up a pcb and ordered parts for putting together a small simplistic HIFI amplifier. Just recently I rediscovered the old project and finally got around to complete it.

The amplifier is based on the amp6-basic 2 x 25 W chip amp from 41hz connected to a standard switch mode power supply. It’s supplied only with a mini-jack input since thats what my ipod, phone and mac use anyway. A DACT Type 23 50K stepped attenuator acts as volume control. I put it all together in an anodized aluminum chassis with a thick custom frontplate.

Components laid out

I cut out the various holes in the back and frontplate using regular twist bits and flat wood bits on a column drill. I finished off the non round cutouts using a file. I ended up using a few hours with a dremmel to cut out the frontplate for the volume knob because I didn’t have a wide enough drill bit around. It turned out quite rough but I tried to use it as a design feature engraving the whole frontplate with the dremmel. I also mounted a blue LED as an on-off indicator, with a rather large resistor 13K Ohm to avoid it illuminating my whole room at nighttime.

I supply the amp6-basic with about 14 V which it can easily handle if it’s rather efficiently cooled. I mounted it to an aluminum plate in the side of the chassis furthest from the SMPS with cooling paste on the back of the chip. The power cables are wound around a large ferrite which should in theory reduce the noise.

The expenses add up to around DKK 1500 (~EUR 200). I am using the amplifier with two small Dali speakers and I am very satisfied with the overall sound quality.

Slackline for KulturSydhavn

Saturday, August 14th, 2010

I did a small interactive slackline project for KulturSYDHavn. A festival on the quay of Teglholmen and around the Illutron barge in conjunction with the annual KulturHavn festival on Islands Brygge on the 6, 7 and 8th of August. We created an interactive playground around the barge and together with Illutron I put up the slackline with RGB color feedback on the quay. I owe a great thanks to the Illutron crew who put a lot of energy into this festival, especially Troels Just Christoffersen who helped put the last pieces of the slackline installation up while I was gone in the week preceeding the festival. And I owe a thanks to the sponsors who made it possible, Slackline.dk and Rullegræsset.dk who sponsored a free feet slacklight15 kit and 1 metric ton of roll out grass respectively.

Documentation

The slackline is hooked up to a strain gauge that measures the weight on the slackline. An Op-Amp amplifies the signal for the arduino and two pieces of flexible high intensity RGB led strip are controlled with PWM via a ULN2003 Darlington transistor array.

Schematics

Code

// KulturSYDHavn Illutron Interactive slackline code by Johan Bichel Lindegaard

float h;
int h_int;
int r=0, g=0, b=0, intensity=100;
void h2rgb(float h, int &R, int &G, int &B);

// Select which analog input the strain gauge is connected to.
const int mPin = 0;

int m = 0;
int state = 0; // 0: inactive, 1: active, 3: pending inactive
int deactivationThreshold = 8;
int deactivationTime = 1000;
unsigned long stateTimeStamp;
unsigned long stateTime = 0;

// Select which PWM-capable pins are to be used.
const int redPin = 10;
const int greenPin = 11;
const int bluePin = 9;

long brbgPreviousMillis = 0;
long fadePreviousMillis = 0;
boolean blinkState = 0;
boolean fadeUp = 0;

// range calibration variables.
int lowPoint;
int highPoint;

void setup()          
{
  // start serial port at 9600 bps:
  // Serial.begin(9600);

  pinMode(redPin, OUTPUT);
  pinMode(greenPin, OUTPUT);
  pinMode(bluePin, OUTPUT);

  // calibrate
  lowPoint = analogRead(mPin);
  highPoint = lowPoint + 124;
  if(highPoint > 1024) {
    highPoint = 1024;
  }

  // test pins
  rgb(255,0  ,0  ); delay(500);
  rgb(0  ,255,0  ); delay(500);
  rgb(0  ,0  ,255); delay(500);
}

void loop()
{  
    int m = analogRead(mPin);

    // Check calibration, and expand range if needed.
    if(m < lowPoint) {
      lowPoint = m;
    } else if(m > highPoint) {
      highPoint = m;
    }

    // Serial.println(m);

    // keep track of how long the line has been active and inactive
    if(m > lowPoint + deactivationThreshold) {
      if(state == 0) {
        state = 1;
        stateTimeStamp = millis();
      }
      stateTime = millis() - stateTimeStamp;     
    } else if(state == 1){
      state = 3;
      stateTimeStamp = millis();
    } else {
      stateTime = millis() - stateTimeStamp;
      if(stateTime > deactivationTime) {
        state = 0;
      }     
    }

    if(state != 0){

      // Convert input to RGB through hue then output.
      h = ((float)map(m, lowPoint, highPoint, 1024, 0))/1024;
      h_int = (int) 360*h;
      h2rgb(h,r,g,b);

      // if active for a short while enter fancy blink mode then return to normal
      if(stateTime > 15000 && stateTime < 60000) {
        int btime = map(stateTime,15000,60000,1000,50);
        brgb(r,g,b,btime);       
      } else {
        rgb(r,g,b);
      }

    } else {      
      unsigned long currentMillis = millis();
      if(currentMillis - fadePreviousMillis > 100) {
        fadePreviousMillis = currentMillis;

        if(intensity > 99) { fadeUp = false;
        } else if (intensity < 1) {
          fadeUp = true; }         

        if(fadeUp) {  ++intensity;
        } else {      --intensity; } 

        rgb(255,0,0,intensity);   
      }

   }   
}

void rgb(int r, int g, int b) {
  analogWrite(redPin,r);
  analogWrite(greenPin,g);
  analogWrite(bluePin,b); 
}

void rgb(int r, int g, int b, float intensity) {
  if(intensity > 100) {
    intensity = 100;
  } else if(intensity < 0){
    intensity = 0; 
  }

  rgb(r/100*intensity, g/100*intensity, b/100*intensity);  
}

void brgb(int r, int g, int b, int interval) {
  unsigned long currentMillis = millis();
  if(currentMillis - brbgPreviousMillis > interval) {
    brbgPreviousMillis = currentMillis;
    if (!blinkState) {
      blinkState = 1;
      rgb(r,g,b);
    } else {
      blinkState = 0;
      rgb(0,0,0);
    }
  }
}

void h2rgb(float H, int& R, int& G, int& B) {

  int var_i;
  float S=1, V=1, var_1, var_2, var_3, var_h, var_r, var_g, var_b;

  if ( S == 0 )                       //HSV values = 0 √∑ 1
  {
    R = V * 255;
    G = V * 255;
    B = V * 255;
  }
  else
  {
    var_h = H * 6;
    if ( var_h == 6 ) var_h = 0;      //H must be < 1
    var_i = int( var_h ) ;            //Or ... var_i = floor( var_h )
    var_1 = V * ( 1 - S );
    var_2 = V * ( 1 - S * ( var_h - var_i ) );
    var_3 = V * ( 1 - S * ( 1 - ( var_h - var_i ) ) );

    if      ( var_i == 0 ) {
      var_r = V     ;
      var_g = var_3 ;
      var_b = var_1 ;
    }
    else if ( var_i == 1 ) {
      var_r = var_2 ;
      var_g = V     ;
      var_b = var_1 ;
    }
    else if ( var_i == 2 ) {
      var_r = var_1 ;
      var_g = V     ;
      var_b = var_3 ;
    }
    else if ( var_i == 3 ) {
      var_r = var_1 ;
      var_g = var_2 ;
      var_b = V     ;
    }
    else if ( var_i == 4 ) {
      var_r = var_3 ;
      var_g = var_1 ;
      var_b = V     ;
    }
    else                   {
      var_r = V     ;
      var_g = var_1 ;
      var_b = var_2 ;
    }

    R = (1-var_r) * 255;                  //RGB results = 0 √∑ 255
    G = (1-var_g) * 255;
    B = (1-var_b) * 255;
  }
}

Wire Storage

Thursday, August 12th, 2010

Put up a wire for storage, and conceptualized a bit; Wires are versatile, almost invisible when not in use and there is no surface to keep clean of dust. A lot of different shapes can rest on the wires and other stuff can hang from the wire in carabiners.

Building my new bicycle

Thursday, June 17th, 2010

After having spent a few months gathering parts I have now fully assembled my new bike. After my last single speed Specialized bike was stolen I needed a new ride and since I really enjoyed riding single speed I set out to build a flip-flop single speed/fixed bike based on an old italian steel road frame. I wanted something simple, yet fast in the flat urban environment of Copenhagen. Here it is.

Johan's bicycle

The most essential parts are from Matuzmaster a retailer in Budapest selling mainly vintage NOS components, the rest is mainly from VeloSolo an English shop specializing in single speed and fixed gear. The wheels and chain are from highonbikes, the brake levers from eBay user angpatten357 and the saddle, tires and improved brake shoes for the front brake caliper from the Danish retailer Bikebuster.

I had my local bike mechanic PH cykler install the bottom bracket and headset since I didn’t have the tools, but the rest I assembled myself.

Here is rundown of the components, where I bought them and for how much.

Component Price Shipping Supplier
Fausto Coppi italian steel road frame with seat post and fork, NOS kr 1,315.99 kr 329.00 geoff9939 (Matuzmaster) eBay auction
Kore Gradient II Wheel Set kr 1,333.33 kr 177.39 Higonbikes eBay
KMC 1/8" Chain kr 97.37 Higonbikes eBay
Campagnolo Nuovo-Triomphe 170mm, 46t crank set, NOS kr 833.15 kr 111.58 Matuzmaster
Campagnolo Veloce, 111mm, Italian, bottom bracket, NOS kr 223.16 Matuzmaster
3ttt, 120mm, quill stem kr 260.35 Matuzmaster
Miche, 1" threaded head set kr 238.04 Matuzmaster
SR Sakae 25.4 dropbar kr 224.98 kr 218.00 VeloSolo
MKS Sylvan Track Pedals kr 206.78 VeloSolo
Tektro 510A Brake Caliper set kr 198.00 VeloSolo
Shimano DX Screw-on SS Freewheel 16t kr 179.75 VeloSolo
VeloSolo 7075-T6 1/8" Track Cog blue 16t kr 126.00 VeloSolo
Cinelli Standard Bar Tape black kr 90.00 VeloSolo
CNC Threaded Cog Spacer Kit (5 spacers) kr 71.63 VeloSolo
Continental Race Inner Tubes kr 71.60 VeloSolo
Dia Compe BRS Black Brake Cable kr 49.56 VeloSolo
Dia Compe Brake levers kr 106.61 kr 26.59 angpatten357 eBay
Selle Italia C2 FEC alloy saddle kr 209.00 Bikebuster
Continental Grand Prix 4000S Tires kr 449.00 Bikebuster
Kool Stop brake shoes kr 149.00 Bikebuster
Headset and bottom bracket installation kr 160.00 PH Cykler

In the end the total price of components came to kr 6,593.31 and shipping to kr 862.56 leaving the bike with final pricetag of kr 7,455.86. It is not a major bargain considering the ours put into purchasing components and putting it together. However I would not have been able to buy one like it anywhere and the feeling of riding a bike you just put together yourself is priceless.