All posts by uditmahajan

Final Project

Concept

Hacking a CRT monitor for distorting visuals and making glitch effects.

Project by:
Udit Mahajan
Jaskirat Singh Randhawa

Process

We made 2 electromagnets from  carbon steel rods (~7mm) as cores and magnet wires using a drill.

electromagnet1

electromagnet3

 

electromagnet2

We tried the electromagnets on the CRT at different locations and finally settled on this orientation because we found the distortion results quite interesting.

magsinTV

noise

 

Then we made a transistor circuit powered by arduino to control the amount of magnetisation on the electromagnets. The voltage being fed to the electromagnets from the voltage source is being modulated with the help of this circuit.

 

arduino ckt

arduino1

arduino2

arduino3

Then we connected the RCA connector from the TV to a Raspberry Pi to get some video output on screen instead of just noise.

rpi

Code

int ledPin1 = 12;
int ledPin2 = 13;
float fade1 = 0;
float fade2 = 0;
int c = 0;
int d = 10;
int fadeValue=100;
void setup() {
  Serial.begin(9600);
}
void loop() {
  c++;
  d+=5;
    fade1 = 1000*sin(2*PI*fadeValue*c);
    Serial.println(fade1);
    if(fade1>=1){
      digitalWrite(ledPin1, HIGH);
    }else
      digitalWrite(ledPin1, LOW);
    fade2 = 1000*sin(2*PI*fadeValue*2*d);
    if(fade2>=1){
      digitalWrite(ledPin2, HIGH);
    }else
      digitalWrite(ledPin2, LOW);
     Serial.println(fade2);
    delay(1000);
}

Final project Proposal

Concept Statement:
People complain about advertisements on websites all the time. I am making a device that lets you access your emails for a payment so that the host services can go ad-free.

A device aimed to create discussion and speculation.

ui

Precedent:
I drew inspiration from this speculation design project which uses a device interface and has printing capability too. The concept is totally different though.

http://www.creativeapplications.net/vvvv/therefore-i-am-fictional-instrument-to-explore-prenatal-diagnostics/

Materials:
Arduino Yun
LCD Screen
IR Sensor
Thermal Printer

 

LOL SHIELD

I made a short animation simulating rain/matrix effect in the lol shield.

CODE:

#include <avr/pgmspace.h>
#include <Charliplexing.h>

int blinkdelay = 100; //Sets the time each frame is shown

uint16_t BitMap[][9] PROGMEM = {
{ 16383 ,
0 ,
0 ,
0 ,
0 ,
0 ,
0 ,
0 ,
0 },

{ 16383 ,
4642 ,
514 ,
0 ,
0 ,
0 ,
0 ,
0 ,
0 },

{ 16383 ,
5802 ,
4770 ,
4642 ,
514 ,
0 ,
0 ,
0 ,
0 },

{ 16383 ,
12013 ,
16111 ,
5802 ,
4770 ,
4642 ,
514 ,
0 ,
0 },

{ 16367 ,
14333 ,
16383 ,
16111 ,
16111 ,
5802 ,
4770 ,
4642 ,
514 },

{ 16383 ,
12215 ,
16381 ,
15359 ,
16383 ,
16111 ,
16111 ,
5802 ,
4770 },

{ 16383 ,
14303 ,
15863 ,
12157 ,
15359 ,
16343 ,
16383 ,
16111 ,
15087 },

{ 16383 ,
14303 ,
13783 ,
9557 ,
10613 ,
11093 ,
15319 ,
16071 ,
15087 },

{ 16383 ,
14303 ,
13783 ,
9557 ,
8533 ,
8533 ,
10581 ,
10821 ,
15047 },

{ 7613 ,
14303 ,
13783 ,
9557 ,
8533 ,
8533 ,
8533 ,
8261 ,
10309 },

{ 7613 ,
5533 ,
5525 ,
10071 ,
8535 ,
8533 ,
8533 ,
8261 ,
8261 },

{ 7613 ,
5533 ,
5525 ,
10071 ,
8535 ,
8533 ,
8533 ,
8261 ,
8261 },

{ 0 ,
0 ,
7613 ,
5533 ,
5525 ,
10071 ,
8535 ,
8533 ,
8533 },

{ 0 ,
0 ,
0 ,
0 ,
7613 ,
5533 ,
5525 ,
10071 ,
8535 },

{ 0 ,
0 ,
0 ,
0 ,
0 ,
0 ,
7613 ,
5533 ,
5525 },

{ 0 ,
0 ,
0 ,
0 ,
0 ,
0 ,
0 ,
0 ,
7613 },
{18000}
};

void setup() {
LedSign::Init(); //Initializes the screen
}
void loop() {
DisplayBitMap(); //Displays the bitmap
}

void DisplayBitMap()
{
boolean run=true; //While this is true, the screen updates
byte frame = 0; //Frame counter
byte line = 0; //Row counter
unsigned long data; //Temporary storage of the row data

while(run == true) {
for(line = 0; line < 9; line++) {

//Here we fetch data from program memory with a pointer.
data = pgm_read_word_near (&BitMap[frame][line]);

//Kills the loop if the kill number is found
if (data==18000){
run=false;
}

//This is where the bit-shifting happens to pull out
//each LED from a row. If the bit is 1, then the LED
//is turned on, otherwise it is turned off.
else for (byte led=0; led<14; ++led) {
if (data & (1<<led)) {
LedSign::Set(led, line, 1);
}
else {
LedSign::Set(led, line, 0);
}
}

}

//Delays the next update
delay(blinkdelay);
frame++;
}
}

Step Sequencer for Generative art and music

step sequencer

step insides

It consists of 2 oscillators (40106), frequency divider (4040), shift register(4015), multiplexer (4051) and a teensy.

I found this really helpful: http://milkcrate.com.au/_other/sea-moss/

CODE:

const int numInputs = 12;
const int teensyPins[] = {5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
const int scaleMods[][numInputs] = {
{0, 2, 4, 5, 7, 9, 11, 12, 14, 16, 17, 19}, // major
{0, 2, 3, 5, 7, 8, 10, 12, 14, 15, 17, 19}, // minor
{0, 1, 3, 5, 7, 8, 10, 12, 13, 15, 17, 19}, // phrygian
{0, 1, 3, 5, 6, 8, 10, 12, 13, 15, 17, 18}, // locrian
};

int MIDIchannel = 1;
int velocity = 110;
boolean lastReadings[numInputs];
int lastNotes[numInputs];

void setup() {
for (int i=0; i<numInputs; i++) {
pinMode(teensyPins[i], INPUT);
}
}

void loop() {
int scaleSel = 0;
if (digitalRead(3) == HIGH) scaleSel += 1;
if (digitalRead(4) == HIGH) scaleSel += 1;

int octaveMod = 0;
if (digitalRead(17) == HIGH) octaveMod += 12;
if (digitalRead(18) == HIGH) octaveMod += 12;

for (int i=0; i<numInputs; i++) {
int note = 36+scaleMods[scaleSel][i]+octaveMod;
boolean reading = digitalRead(teensyPins[i]);
if (reading == HIGH && lastReadings[i] == LOW) {
usbMIDI.sendNoteOn(note, velocity, MIDIchannel);
lastNotes[i] = note;
}
if (reading == LOW && lastReadings[i] == HIGH) {
usbMIDI.sendNoteOff(lastNotes[i], 0, MIDIchannel);
}
lastReadings[i] = reading;
}
}

EgoBot

1

So this thing has an ego problem (or maybe its just shy). It looks away each time you get real close to it.

Code:

#define trigPin 10
#define echoPin 11
#include <Servo.h>

Servo myservo;

void setup() {
Serial.begin (9600);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
myservo.attach(9);

randomSeed(analogRead(0));
}

void loop() {
int duration, distance,pos=0,i;
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = (duration/2) / 29.1;
Serial.print(distance);
Serial.println(” cm”);
if(distance<15)
{
myservo.write(random(0,180));
//Serial.print(distance);
//Serial.println(” cm”);
}
delay(100);
}

BoxHead


2

I used a flex sensor to change tones coming out of the piezo. I used an additional potentiometer in the circuit to gain access to more variety/manipulation of tones.

1

CODE:

#include “pitches.h”
int speaker = 12;
int sensor = A0;
int sensorValue = 0;

void setup(){
Serial.begin(9600); //baud rate
pinMode(sensor, INPUT);
pinMode(speaker, OUTPUT);
}

void loop(){

sensorValue = analogRead(sensor);
Serial.println(sensorValue);
sensorValue = map(sensorValue, 1, 35, 31, 4978);
Serial.println(sensorValue);

tone(speaker, sensorValue);
delay(1000/8);
noTone(speaker);
}

Homework week 2 – Udit Mahajan

I took help from the SIK Guide and made this.  An RGB led that changes colors. It goes from primary to secondary and then displays the entire spectrum.

https://drive.google.com/a/newschool.edu/file/d/0B1d_zqYso7DgbU9NWFlCUVl3UFU/edit?usp=sharing

I did put it inside a box!

https://drive.google.com/a/newschool.edu/file/d/0B1d_zqYso7DgVHl6Um5rVUFrWEE/edit?usp=sharing

Code:

int red_pin = 9;
int green_pin = 10;
int blue_pin = 11;

void setup()
{

pinMode(red_pin, OUTPUT);
pinMode(green_pin, OUTPUT);
pinMode(blue_pin, OUTPUT);
}

void loop()
{
digitalWrite(red_pin, LOW);
digitalWrite(green_pin, LOW);
digitalWrite(blue_pin, LOW);

delay(1000);

digitalWrite(red_pin, HIGH);
digitalWrite(green_pin, LOW);
digitalWrite(blue_pin, LOW);

delay(1000);

digitalWrite(red_pin, LOW);
digitalWrite(green_pin, HIGH);
digitalWrite(blue_pin, LOW);

delay(1000);

digitalWrite(red_pin, LOW);
digitalWrite(green_pin, LOW);
digitalWrite(blue_pin, HIGH);

delay(1000);

digitalWrite(red_pin, HIGH);
digitalWrite(green_pin, HIGH);
digitalWrite(blue_pin, LOW);

delay(1000);

digitalWrite(red_pin, LOW);
digitalWrite(green_pin, HIGH);
digitalWrite(blue_pin, HIGH);

delay(1000);

digitalWrite(red_pin, HIGH);
digitalWrite(green_pin, LOW);
digitalWrite(blue_pin, HIGH);

delay(1000);

digitalWrite(red_pin, HIGH);
digitalWrite(green_pin, HIGH);
digitalWrite(blue_pin, HIGH);

delay(1000);

for (int x = 0; x <= 767; x++)
{
rgb(x);
delay(10);
}
}

void rgb(int color)
{
int red, green, blue;

if (color <= 255)
{
red = 255 – color;
green = color;
blue = 0;
}
else if (color <= 511)
{
red = 0;
green = 255 – (color – 256);
blue = (color – 256);
}
else
{
red = (color – 512);
green = 0;
blue = 255 – (color – 512);
}

analogWrite(red_pin, red);
analogWrite(blue_pin, blue);
analogWrite(green_pin, green);
}

Udit Mahajan – Introduction

Hey! I am Udit Mahajan. I am from New Delhi, India. I like experimenting in different fields using various mediums to create design, art, music, photography and poetry. You can check some of my works here! http://uditmahajan.tumblr.com
Coming from an electrical engineering background, I am not too sure which direction I want to go so I am exploring different fields here and trying to find my niche. I am really interested in learning Interaction Design and Wearable Technology among other things. Looking forward to the classes!