Double Transducer: Temperature to Opacity

Justin Song and Peyton Moffatt

Final images

An overhead view of Peyton's Double Transducere, showing the thermistor on the left, the motor and proximity sensor on the top, breadboard in the middle, light valve on the right, LCD screen on the bottom, and arduino board on the bottom right

Peyton's double transducer, from an overhead view

Justin's transducer uses a thermistor, servomotor, IR proximity sensor, and LCD display

Justin's transducer uses a thermistor, servo motor, IR proximity sensor, and LCD display

Detail photos

An up close image of the Peyton's soldered breadboard, along with the motor in the background

Peyton's soldered breadboard, with motor in the background

An up close image of the light valve on Peyton's project

Up close photo of the Light Valve on Peyton's project

Justin's soldered breadboard and 2 regular breadboards. There is a thermistor and a servo motor in the back of the image

Justin's soldered breadboard and 2 regular breadboards. There is a thermistor and a servo motor in the back of the image

Justin's Arduino as well as a servo motor and a LCD screen in the back

Justin's Arduino as well as a servo motor and a LCD screen in the back

Final project movies

PeytonTransducer.mov

Video of Peyton's double transducer in action

justin_double_transducer.mp4

Justin's transducer video

Narrative description

There is a sensor that reads the temperature and when the sensor gets warmer or cooler, the motor will sping faster/slower which will be read by a proximity sensor. The proximity sensor then sends a reading to the light valve to make it less or more opaque.

Progress images

An overhead view of trying to figure out how everything would wire together. Shows a motor, thermsitor, light valve, LCD screen, and arduino board.

Trying to figure out how everything would wire together.

An overhead view of parts on a board. Trying to get a general layout for the project. Shows LCD screen, arduino, breadboards, light valve, and thermistor.

Laying everything out to get a general layout of the final project

Justin is working on the LCD display to make it functional

Working on LCD Display

Justin is working on the full circuit and making sure the connections are good

Working on full circuit and making sure the connections are good

Justin is working on the full circuit and organizing the placement of the devices

Working on full circuit and organizing the placement of the devices

Justin is soldering parts on the board

Soldering parts on the board

Discussion

In our process of developing our double transducer was first came up with 3 ideas for our middle step medium: rotation, distance, and sound frequency.  We then created electrical schematics and block diagrams and drew general ideas on what the projects would look like. We ended up deciding on rotation. We then tested every device on how to use them individually and made sure we knew how they worked. Then when we were able to know how to function the devices, we made the whole circuit and then soldered the middle actuators, wires, resistors, male headers, and female headers. Then we placed and designed the circuit well organized on the cardboard.

What was difficult in this project was how to trigger the IR proximity sensor and the code.  It was difficult to have the servo motor popsicle stick trigger the sensor that there is less light reflection shown using the code which was really important to make sure that the code would make the sensor know if less light then the light valve would be clear.  And we had to make sure there was fast detection and delay. We also learned to make sure that the LCD screen display would clear when one data is complete so the data would not be combined.  Also, the soldering of the middle deceives of the circuit was hard because we had to make sure to put the circuit parts in the right place in what is connected to what. Also, It was difficult to make sure not to be soldered with other pins together and not to over-solder pins. We also had to well planned what part must be placed in the pins and to double check we don't solder part in the wrong pins Since it was our first time soldering, we were a bit worried and stressed to make sure the connections were good and functional.  Also since there was no black solid wire for the ground it was difficult to put the stranded wires in the pins in the small protoboard with power rails to be soldered. We had to twist the wires to be together so they would be tight enough to be like a single wire. When it did not go well the wires would not go to the pin.

We grew in many skills from this project. We learn how to use new devices such as the light valve, LCD display, thermistor, and a servo motor that goes 360 degrees. We learned that the servo motor that rotates 360 degrees, the code controls the speed, and the motor with 180 degrees is controlled by degrees.

Our creativity was in our middle step actuators to use a servo motor and put a popsicle stick on top of the blade. As the popsicle hovers over the IR proximity sensor which will bring shadow on it, it will detect revolutions per minute.  In the future, with the opportunity to work more on our transducer to be more creative, one idea is maybe to add a buzzer and LED light.  When the IR proximity sensor is detected each time with lower reflected infrared light covered by the popsicle stick, the buzzer will go on and the LED light will blink.

Justin: In my own growth journey in physical computing, I want to continue to grow in managing my time well in how to function devices,  coding, debugging, asking for help in projects, having feedback, soldering, and building the structure of the circuit. In my transducer, only the thermistor and LCD display functioned. Even though my circuit did not function correctly because of soldering issues it taught me to always have a plan B and to practice soldering. 

Functional block diagram and electrical schematic

Block diagram of the project, showing thermistor and IR proximity sensor pointing to the arduino board, which is then pointing towards the servo motor, light valve, and lcd display module.
Schematic of our double transducer, showing the thermistor, servo motor, proximity sensor, light valve, lcd screen and arduino board.

Code

/*

Double Transducer - Temperature to Opacity


Justin Song & Peyton Moffatt


This code will take in a reading from a thermistor, send it to the servo motor to make

it spin faster or slower, get a reading of the speed of that motor from an IR proximity

sensor, and then send that signal to a light valve to make it less or more opaque.


Pin mapping:


Arduino pin |  role  | details

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

A0            input     thermistor

A1            input     IR proximity sensor

3             output    servo motor

6             output    light valve


*/


const int THERMISTORPIN = A0; //Set pin for Thermistor

const int SENSORPIN = A1; //Set pin for IR Sensor

const int SERVOPIN = 3; //Set pin for Servo Motor

const int VALVEPIN = 6; //Set pin for Light Valve

const int THERMLOW = 100; //Adustable thermistor low point

const int THERMHIGH = 538; //Adjustable thermistor high point

int servo_speed = 0; //Speed of servo motor

int adj = 0; //Variable to account for length of stick


#include <Servo.h>

#include <Wire.h>

#include <LiquidCrystal_I2C.h>


LiquidCrystal_I2C screen(0x27, 16, 2);


Servo myMotor;


unsigned long runlcd = 0; //For delaying lcd screen

unsigned long lcdwait = 100; //LCD screen delay

unsigned long servotime = millis(); //Assisting in getting servo speed


void setup() {

  pinMode(THERMISTORPIN, INPUT); //Set pin mode for Thermistor to input

  pinMode(SENSORPIN, INPUT); // Set pin mode for IR sensor to input

  pinMode(VALVEPIN, OUTPUT); //Set pin mode for Light Valve to output


  Serial.begin(9600);


  myMotor.attach(SERVOPIN);


  screen.init();

  screen.backlight();

  screen.home();

  runlcd = millis() + lcdwait;

}


void loop() {

  

  //Step 1: Gathering Information


  int therm_val = 0; //Thermistor Value

  int sens_val = 0; //Proximity Sensor Value

  int therm_to_servo = 0; //Themistor to Servo conversion value

  int sens_to_valve = 0; //Proximity sensor to light valve conversion value


  therm_val = analogRead(THERMISTORPIN); //Getting thermistor value

  sens_val = analogRead(SENSORPIN); //Getting proximity sensor value


  //Step 2: Compute and make decisions


  therm_to_servo = map(therm_val, THERMLOW, THERMHIGH, 20, 75); //Turning thermistor value into servo value


  if(sens_val >= 100 & adj == 0){ //Finds servo speed if stick is above sensor; only does it once while stick is above

    servo_speed = millis() - servotime;

    servotime = millis(); //Setting last time stick was sensed to right now

    adj = 1; //Makes sure we don't count the speed again while stick is still above sensor

  }

  else if(sens_val < 100){

    adj = 0; //Resets whether the stick is above the sensor

  }


  sens_to_valve = map(servo_speed, 200, 350, 0, 50); //Turning servo speed value into light valve value


  //Step 3: Driving outputs


  myMotor.write(therm_to_servo); //Changing speed of motor


  analogWrite(VALVEPIN, sens_to_valve); //Changing opacity of the light valve


  if(millis() >= runlcd){

    int therm_lcd = map(therm_val, THERMLOW, THERMHIGH, 0, 99);

    int servo_lcd = map(therm_to_servo, 20, 85, 0, 99);

    int sens_lcd = map(servo_speed, 200, 350, 0, 99);

    int valve_lcd = map(sens_to_valve, 0, 100, 0, 99);

    screen.clear();

    screen.setCursor(0,0);

    screen.print("i:");

    screen.setCursor(2,0);

    screen.print(therm_lcd);

    screen.setCursor(6,0);

    screen.print("m:");

    screen.setCursor(8,0);

    screen.print(servo_lcd);

    screen.setCursor(8,1);

    screen.print(sens_lcd);

    screen.setCursor(12,1);

    screen.print("o:");

    screen.setCursor(14,1);

    screen.print(valve_lcd);

    runlcd = millis() + lcdwait;

  }


  //Step 4: Reporting information back to the user


  Serial.print(therm_val);

  Serial.print(", ");

  Serial.print(therm_to_servo);

  Serial.print(", ");

  Serial.print(servo_speed);

  Serial.print(", ");

  Serial.println(sens_to_valve);

}