Power Tool Design

Two Wheeler Helmet Safety Improvement

Course Project Ideation

Website Development for Course

Step 1: To make a basic "Hello World" website using HTML principles

Step 2: To host this basic website on the IITD intranet using kerberos credentials and WinSCP software


Step 3: Create a folder called "private_html" where all the webpages and associated files will be stored


Step 4: To identify the class of website you want to build (either using templates or building your own template)

Step 5: Identify the structure and pages in the website

Here I have built a website using HTML and formatting using inline CSS. CSS could be stored in a separate file on the private_html folder and used in common with all the webpages. The kind of website I have built is by using a technique called as image mapping where all the elements are in the form of jpg or png images and specific coordinate boundaries could be given as hyperlinks on these images

Make sure that you compress all images to a smaller file size before uploading on the

Programming assignment files

Logic is a very important part of writing a code. Logic drives how a code is written in any programming language. If the logic is sound, it's just a matter of writing it in proper syntax in the required programming language. For example, finding the factorial for a number, the logic is that all the numbers upto the given number starting from 1 are multiplied to the factorial variable. This is achieved using loops which can be used when doing large number of repititive actions (more on loops can be found here). Finding out the sum of two digits is straighforward, just get the two numbers as inputs from the user and display the sum. For calculations involving more number of inputs, it is advisable to use arrays and loops for getting information from the user, this reduces the number of variables you have to define at the beginning of the code.

The source code files for the programming assignments can be found in the links below

C Programs

Sum of two numbers
To check a number is odd or even
To find the factorial of an integer

Python Codes

Sum of two numbers
To check a number is odd or even
To find the factorial of an integer

Arduino LED Matrix Assignment(using Charlieplexing)

Here, the goal is to use the I/O pins of arduino to control the action of LEDs in the form of a 3x3 matrix. Adding buttons to it and doing specific actions with the press of buttons(glowing all LEDs 5 times and to spell out some pre-specified pattern). With normal methods, 10 pins are required for controlling the LEDs(with common ground) and couple of extra GPIO pins for the push button/switches. If that number seems extra for making a bunch of LEDs glow, you're right. In forward bias, LEDs convert electrical energy into light and in reverse bias, generally don't flow of electricity due to high resistance(more on this here. So this means we can technically use the same two I/O pins to make two LEDs glow, albeit not at the same time(or can we?). This property of microcontroller port is called as tri-state logic, where the I/O pin can assume either a positive high value, a zero value or simply switched off/disconnected. This method with multiple pins, is called Charlieplexing, where n pins can be used to drive n(n-1) LEDs(or 2*nC2 for you math nerds). With 3 pins, we can drive 6 LEDs or with 4 pins 12 LEDs. We used 4 pins to drive 9 LEDs here. That's still more than a 100% saving on I/O pins compared to directly driving the LEDs. Then we have the additional matter of driving multiple LEDs at the same time for which we will use a form of visual trickery called Persistence of Vision. This basically means that if we switch the LED cycling fast enough, then all LEDs will seem to glow at the same time.

In the GIFs above, the delay is varied from 1000ms to 2ms. 2ms equals to 500Hz frequency in changing LEDs and looks like continuous glow, and for all practical purposes, it can be assumed to be since we see it that way. You can see the banding by switching on video stabilization in your camera or changing the refresh rate to 50Hz

The circuit diagram for this exercise along with charlieplexing is below.



and the code for this can be found here. Serial input along with functions for button press is also included in the code as in the attached code snippet below.


      	  	 if (Serial.available()) {
    input = Serial.read();//read the input
    if (input == 'a' || input == 'A') 
    {
      for(i=0;i<=50;i++)
       {
          A();
       }
    }

    if (input == 'b' || input == 'B') 
    {
      for(i=0;i<=50;i++)
       {
          B();
       }
    }


	void set_pins(int high_pin, int low_pin)
{
   reset_pins();
   pinMode(high_pin, OUTPUT);
   pinMode(low_pin, OUTPUT);
   digitalWrite(high_pin, HIGH);
   digitalWrite(low_pin,LOW);
}

void reset_pins()
{
   pinMode(LED_1, INPUT); 
   pinMode(LED_2, INPUT);
   pinMode(LED_3, INPUT);
   pinMode(LED_4, INPUT);
   digitalWrite(LED_1, LOW);
   digitalWrite(LED_2, LOW);
   digitalWrite(LED_3, LOW);
   digitalWrite(LED_4, LOW);
}

void A()
{

   

   set_pins(LED_1, LED_2); //LED 1A
   delay(2);                
   set_pins(LED_2, LED_1); //LED 1B
   delay(2);
   set_pins(LED_1, LED_4);  //LED 1C
   delay(2);
   set_pins(LED_4, LED_1); //LED 2C
   delay(2);
 //  set_pins(LED_3, LED_2); //LED 2B
   delay(2); 
   set_pins(LED_2, LED_3); //LED 2A
   delay(2); 
   set_pins(LED_2, LED_4); //LED 3C
   delay(2);
  // set_pins(LED_3, LED_4); //LED 3B
   delay(2); 
   set_pins(LED_4, LED_3); //LED 3A
   delay(2); 
   
 
}

When the first button is pressed, the LEDs are programmed to spell "IITD". This can be changed to anything by including the defined function for all letters(numbers are not yet included in the code and can also be added easily).

When the second button is pressed, the all LEDs blink 5 times.

and finally, accepting serial input from the PC and displaying the characters on the LEDs which in this case are the names involved in this exercise, Anand and Ganesh.

Input Devices and Experiment

Here we use ultrasonic sensors as input devices to measure the distance and display them in the serial monitor of the PC. Ultrasonic sensors have a trigger and a sensor which are made up of piezoelectric materials. Here power is supplied to the trigger side which produces ultrasonic waves which can be reflected off surfaces and sensed by the "Echo" sensor. Detailed working can be found here in this datasheet. The output of the ultrasonic sensor is the time in milliseconds from the start and detection of the pulse. The circuit is simple and can be found in tinkercad below.

This code is to measure distance using one HC-04 sensors that is mounted horizontally in a breadboard. The time is measured after giving a pulse from the trigger pin and time is measured in ms to the echo pin. This time and speed of sound (340m/s at 20 degree celsius) is used to then calculate the distance to the target in front. We print this output in serial monitor as the distance. In the first iteration, we use one sensor just the calculate distance to target in front and in the second iteration, we add two sensors to calculate vertical distance as well. The code for which can be found here

The circuit was built on arduino and tested with near and far objects for measuring distance

And the sensor output visible on the serial monitor



Sensors in Android Phone


I use an android device which has a variety of sensors like

  • GPS
  • Accelerometer
  • Gyro Sensor
  • Magnetometer
  • Orientation Sensor
  • Gravity Sensor
  • Rotation Sensor
  • Light level Sensor
  • Audio Sesnor (Microphone)
  • Proximity Sensor

etc...

A variety of apps and services use these to function and these data can be accessed by the user as well. We can develop our own apps for taking logs of the sensors or use any of the existing apps like SensoDuino which i'm using for this exercise.

They can be connected to bluetooth and their data can be read on the specific COM ports using some applications for windows like Tera Term.

Output Devices and Experiment

Here we use a speaker/beeper as an output device from the arduino and can use it to create sound in various frequencies. First we'd be using just the speaker as an output from the arduino and re-create some MIDI music. Reacreate some old video games music from the age of Windows 95 and 98.

For this we use the Playtunes library which is available for download from GitHub. We also use tone converter which can convert MIDI music format to one which is recognized by arduino using the playtunes library. MidiTones is one such software which runs on the commandline and can be used to convert .mid file types to .c file types which can be pasted in the arduino code to play the file on a piezo buzzer.

Use the following code and copy paste the c file generated by MidiTones



#include Playtune.h
 

//copy paste content of converted midi file here.ie: (yourtone).c

 

Playtune pt;

void setup() {
pt.tune_initchan (10);
pt.tune_initchan (11);
pt.tune_initchan (12);
}

void loop () {
pt.tune_playscore (score); /* start playing */
while (pt.tune_playing) ; /* wait here until playing stops */
}

The circuit was built on arduino and tested with the generated code



Code and Circuit can be found in the TinkerCad link below.


For both input and output device in use, Please check the theremin project tab

Displaying text on a LED Matrix through Bluetooth module using app

Steps in this assignment - Connecting a bluetooth module to arduino, Connecting the LED Matrix MAX 7219 to the arduino, Making the app using MIT App inventor and Making the connections and uploading the code for the same.

The bluetooth module is connected to the arduino as shown below

For testing out the module, the following code can be used by connecting an LED between pin 7 and GND



#define ledPin 7
    int state = 0;
    void setup() {
      pinMode(ledPin, OUTPUT);
      digitalWrite(ledPin, LOW);
      Serial.begin(38400); // Default communication rate of the Bluetooth module
    }
    void loop() {
      if(Serial.available() > 0){ // Checks whether data is comming from the serial port
        state = Serial.read(); // Reads the data from the serial port
     }
     if (state == '0') {
      digitalWrite(ledPin, LOW); // Turn LED OFF
      Serial.println("LED: OFF"); // Send back, to the phone, the String "LED: ON"
      state = 0;
     }
     else if (state == '1') {
      digitalWrite(ledPin, HIGH);
      Serial.println("LED: ON");;
      state = 0;
     } 
    }

Next, the MAX 7219 can be connected to Arduino as shown below and tested for functionality using the LEDControl.h header file. The MAX7219 LED matrix has 8x8 LEDs or 64 individual LEDs which can be controlled.

Using the MIT App inventor

The MIT app inventor was used here to build the android app for LED control and displaying the text on the LED matrix. We start here by defining the layout of the app and building further on that

The .APK file for the app that was build can be found here.

The connections are made on the breadboard as shown below

Project Proposal for DSL810

Digital Music Mini Orchestra (Theremin, Chaldni Plate and Musical Floppy drive)

Ganesh Ram


The project proposal can be found here




For the first iteration, a Theremin using Two Ultrasonic Sensors were built.



Project on TinkerCAD


First Code for Theremin (Working)
Second Code for Theremin (Under Progress)



Prototype and Testing

The arduino theremin was designed as a self contained unit with just the external power supply and the code for this is the same as in the previous iteration, with the addition of a compliant mechanism body to reduce part count and complexity and time of assembly. The angles are designed to be used as a tabletop device that can be operated by hand or holding something flat like a card to increase sensitivity of the device.

Arduino Theremin using Ultrasonic Sensors


Finding the natural frequency of the plate using Spectroid App on android


Chladni Plate with a circular actuator