Double Transducer: Force to Sound

Final images

A 12 inch by 12 inch square of cardboard witha  arduino contraption. The arduino is connected to multiple devices: A Force sensor, Servo Motor,

A 12 inch by 12 inch square of cardboard with a  Arduino contraption. The Arduino is connected to multiple devices: A Force sensor (to the right), connected to a Servo Motor (top right of board), which holds a string by a pulley stem over a  laser distance sensor (top middle), which connects to a passive buzzer's tone. A 2 by 16 LCD display displays important information at the bottom middle of the board.

Force to sound double transducer seated on a square piece of cardboard, consisting of a force sensitive resistor (gold and green button in the front and middle of the board), Arduino Microcontroller (blue rectangular device in the center of the board), servo motor (blue  box-shaped device in the top left corner) controlled by the force sensitive resistor,  pulley system (wooden structure on the left) controlled by the servo motor which lifts an object above a laser distance sensor (small blue rectangular device in front of the pulley system), and a passive buzzer (small black circular device seated behind the Arduino) that outputs sound depending on the object's distance from the distance sensor.

Detailed Photos

A zoom in on the left side of the board. The force sensor and its wiring are in focus as most of the wiring goes through this section.

A zoom in on the pulley system on the upper side of the board. It shows a string attached to a servo motor arm. The string wraps around two pulley arms then lowers a piece of wood stuck to putty over a laser distance sensor.

Close-up of alternative pulley system. The system consists of a servo motor that turns a gear belt. A string attached to the gear belt is pulled and lifts a tube above the distance sensor.

Final Project Movies

Evan Alexander's Double Transducer

Evan Alexander Force Sound Video Doc.MOV

Evan applies pressure to the force sensitive resistor, which turns the servo motor.  A string is attached to the servo motor, so as it turns, it lifts a small object above the laser distance sensor. This in turn changes the pitch of the buzzer.

Nnenna Nwaigwe's Double Transducer

Nnenna.MOV

Similar to Evan's double transducer, when Nnenna presses the force sensitive resistor, it turns the motor. As the motor rotates, it turns a gear belt, which in turn pulls on a string that lifts a tube above the distance sensor. This in turn, changes the pitch of the buzzer.

Narrative description

A small round button that, when pressed with a certain force makes a motor turn to a certain angle. A string is attached to the tip of the motor an draped over  the top of a plastic cylinder held up by two sets of popsicle sticks. On the other side of the string is an object hanging above a small sensor that measures the distance between itself and the object. This distance measurement is then sent to a buzzer to tell it the pitch of the sound it needs to make. The harder the button is pressed, the more the motor turns and pulls on the object, the greater the distance reading, and the higher the buzzer pitch.

Progress images

A messy "block out" of the devices on the board. There is no soldering at this stage, only a breadboard with messy wire connections. In this Version the Arduino is to the left with the rest of the technology sprawled out in the middle and right of the board.

A more refined block out with almost all the soldering in place. The only thing missing was the servo motor. The Arduino in the center of the board now, and has yet to have any wires plugged in. The force sensor to the right of the Arduino. Display to the bottom, Laser sensor to the top middle, and the passive speaker held by wires to the right. 

Initial double transducer constructed on a small white breadboard. Like the final design, it consists of a force sensitive resistor, servo motor, distance sensor (not shown in the image above), and passive buzzer. Unlike the final design, it is much more disorganized with wire connections being jumbled together.

Beginning stages of transferring double transducer from the white breadboard to two green solderless breadboard. At this point, only the wires connected to the servo motor and wires connected to the laser distance sensor have been soldered to the solderless breadboards. 

Discussion

Before beginning construction on our force to sound double transducer, we brainstormed ideas for transducers that would be both challenging to build and possible to finish by the time of the final critique. We came up with three designs: a force to light to sound double transducer and two force to motion to sound double transducers (with slightly different implementations of the middle step. One design used a button to detect motion, while the other used a distance sensor. We ended up settling on the latter design as we believed the former would be difficult to implement.

As we continued to the fabrication portion of  the project, we wanted to add features to our original transducer design that would make it more interesting. We decided on a pulley system made from tongue depressors and string and used a servo motor (motion) to move an object above a laser sensor (motion detector). We both deviated in the design of our pulley system, one of us using string tied to the servo motor to pull the object, the other using a gear belt that the servo motor rotated that then pulled the object.

We are proud of how we tackled learning each piece of technology and how it functioned in code. We learned how to better debug our circuits by breaking down our our Arduino and plugging in each device individually to test their functionality. Additionally, we learned how to control various different electrical components with the Arduino by reading sample code for those components and implementing them in our own code. After finding how each piece worked (and that it functioned) we started incorporating and wiring each one at a time to eventually get functioning code how we liked it. Transitioning from a prototype on a bread board to a "finished" product was more of a shot in the dark. We found that even with a electrical diagram, there were unknowns with soldering and whether our components would still function afterwards. Despite these obstacles, we were able to successfully turn our idea into a functioning final product.


Functional block diagram and electrical schematic

Code

/*

    Project Title: Double Transducer: Force to Sound

    Authors: Nnenna Nwaigwe and Evan Alexander


    Description: This code sketch reads the input force from a force sensitive resistor     and a distance from the

    laser distance sensor and outputs a motor turning angle and pitch frequency to a     servo motor and passive buzzer respectively.



    Arduino | Role | Details

    -------------------------

    A0       input    Force sensitive resistor

    8        output   Passive buzzer

    10       output   Servo motor


   

    Example code using LiquidCrystal_I2C library by Robert Zacharias at Carnegie Mellon     University, rzach@cmu.edu

    released by the author to the public domain, November 2018


    Example code using Adafruit_VL53L0X library by Limor Fried/Ladyada for Adafruit     Industries.

*/


#include <Wire.h>

#include <LiquidCrystal_I2C.h>

#include "Adafruit_VL53L0X.h"

#include <Servo.h>


const int LCDTIMER = 200;

int NEXTTIMETORUN = 0;

unsigned long timer = millis();


const int FORCEPIN = A0;


const int BUZZERPIN = 8;


Servo pulleyMotor;

const int MOTORPIN = 10;


LiquidCrystal_I2C screen(0x27, 16, 2);

Adafruit_VL53L0X lox = Adafruit_VL53L0X();


void setup() {

  Serial.begin(115200);


  //Laser Sensor Setup

  if (!lox.begin()) {

    Serial.println(F("Failed to boot VL53L0X"));

    while (1);

  }

 

  //LCD Display Setup

  screen.display();

  screen.backlight();

  screen.init();

  screen.home();


  //Servo Motor Setup

  pulleyMotor.attach(MOTORPIN);


  //Passive Buzzer Setup

  pinMode(BUZZERPIN, OUTPUT);


}


void loop() {

  //Step 1

  /* Here, force input from a force sensitive resistor is read

     and converted into an angle between 20 and 180 degrees.

     A servo motor is then told to rotate to that angle.

  */

  int force = analogRead(FORCEPIN);

  int servoAngle = map(force, 340, 1000, 20, 180);


  /* This part of the code reads the distance an object is from

     a laser sensor and converts that distance into a frequency

     between 0 and 1000. A passive buzzer is then told to output

     this frequency.  

  */

  VL53L0X_RangingMeasurementData_t measure;

  lox.rangingTest(&measure, false);


  int distance = measure.RangeMilliMeter;


  //Step 2

  int buzzerPitch = map(distance, 40, 50, 0, 1000);


  //Step 3

  tone(BUZZERPIN, buzzerPitch);

  pulleyMotor.write(servoAngle);


  //Step 4

  /* A timer that tells the arduino when to display data onto an

     LCD display. The data being displayed is the force reading

     from the force sensitive resistor and the distance reading

     from the laser distance sensor.

  */

  if ((millis() - NEXTTIMETORUN) >= LCDTIMER) {

    if (measure.RangeStatus != 4) {  

      Serial.print("Distance: ");

      Serial.print(distance);

      Serial.println(" mm");


      screen.setCursor(0, 1);

      screen.print("Distance: ");

      screen.print(distance);

      screen.print(" mm");


    }

    else {

      Serial.println(" out of range");


      screen.setCursor(0, 1);

      screen.print(" out of range ");

    }

    screen.setCursor(0, 0);

    screen.print("Force: ");

    screen.print(force);

    NEXTTIMETORUN = millis();

  }

}