Jennie & Myles
jennie: final device
myles: final device
Detail 1: Opacity input- Photoresistor facing an LED with space between for object being opacity tested. Opacity is determined by LED light shined through to photoresistor.
Detail 2: Middle step- thermistor touching incandescent light bulb to measure emitted heat
Detail 3: Rotational motion output using servo motor
Detail 4: LCD display showing input middle step and output values
Detail 5: Middle Step -> Thermistor touching incandescent light bulb to measure emitted heat through resistance in action.
Jennie Wei: Documentation video
Myles: Documentation Video
A white board has a small oval shaped sensor and a small white light. Put an object between the oval shaped sensor and white light and the big light bulb will turn brighter. The big light bulb heats up over time and the white arm on a motor will move to the other side.
Each image with caption and alt text.
Initial incandescent light bulb and thermistor setup before protoboard soldering
Test Breadboard Wiring
soldered incandescent light and thermistor setup
pretty messy wiring before I properly set it up
Jennie - This project was quite a good and challenging learning experience for me! As someone who's never worked with hardware before, "debugging" physical parts was really challenging because especially when there's a mess of wires and multiple inputs/outputs, it oftentimes takes really long to find a simple problem. When writing software, it was easier to find issues since the software gives you error messages and you can print out values live to pinpoint exactly which step was causing an issue. When initially reading the project brief, I thought soldering the middle step was just extra work, but for me,I think it saved me some time debugging things afterward since the wiring in the soldered area was very easy to understand with shorter wires and being stuck in place, which meant I could be certain no issues were from that part.
In retrospect, I think choosing a middle step that wasn't as time-dependent would've changed this entire process. Our middle step was creating heat through an incandescent light bulb, which takes time to heat up, so as a result testing and coding this project required a lot of different steps to a more instant process. We found that thermistors are really finicky to work with and even with our final builds, the output to the servo was really twitchy(nothing we can do about it). Also for the light we had to use a transistor, which we were very confused about at first since it wasn't covered in the initial modules, but I'm glad we had that experience so we know for future projects!
Myles - This project was a great chance for me to become familiar with the tools and resources in the lab. One of the most helpful experiences of the project was the requirement to solder the intermediate transducer module. At a high level, it was a tedious task because I had to rebuild the working wiring segment of my intermediate transducer by copying components and their positions from the breadboard. This required more attention and focus than I expected, and I spent a considerable amount of time rewatching the soldering tutorial video, in addition to familiarizing myself with the soldering setup in the physical computing lab. A big learning experience occurred when tinkering with the soldering temperature, which required me to find the temperature at which the board and the iron were hot enough to melt the solder properly and have it slide into the correct connection slot. In the beginning of this process, I found myself painting solder onto pins, and by the end, I got the hang of itᅳsloppily allowing solder to slide down into large mounds on the pin. In the next project, my goal is to improve my soldering as I aim to make smaller, more functional components.
My proudest moment in the process occurred when assembling the light bulb with intermediary brightness. This, like most of the project, took more time and effort than I expected. In the end, I learned how a transistor works. If I were to change anything about this project, I would aim to supply more voltage to the device, with a step-down component to regulate the voltage being consumed by each module of the double transducer. Doing so would alleviate some of the jitteriness in the incorporation of the second step in the double transducer and allow for a more consistent LED display. Taking this knowledge about voltage regulation from this first project, I plan to use a voltage step-down device in my next project
/*
Double transducer: Opacity to Rotation
This code takes in input from a photoresistor which determines the output brightness through analogWrite to an incandescent lightbulb. This bulb emits heat that is measured by a thermistor which this code collects input from to determine the degree of rotation for a servo motor.
1) reads all inputs from photoresistor, thermistor, and button
2) decides whether or not to use the middle step from button input, uses other inputs to determine corresponding outputs
3) drives output to incandescent light and servo
4)Displays values to LCD
Pin mapping:
Arduino pin | role | details
------------------------------
6 output incandescent light bulb
3 output servo motor
12 input button
A2 input thermistor
A3 input photoresistor
*/
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <Servo.h>
Servo rotationMotor;
const int bulbPin = 6;
const int photoresPin = A3;
const int thermPin = A2;
const int servoPin = 3;
const int buttonPin = 12;
unsigned long HALFSECONDWAIT = 500; // half a second
unsigned long nexttimetorun = 0;
LiquidCrystal_I2C screen(0x26, 16, 2);
void setup() {
// setting up pin variables
pinMode(bulbPin, OUTPUT);
pinMode(photoresPin, INPUT);
pinMode(thermPin, INPUT);
pinMode(buttonPin, INPUT);
nexttimetorun = millis() + HALFSECONDWAIT;
rotationMotor.attach(servoPin);
Serial.begin(9600);
// setting up screen
screen.init();
screen.backlight();
screen.home();
}
void loop() {
float tempVal;
float photoresVal;
int motorPos;
int bulbVal = 0;
int buttonVal = digitalRead(buttonPin);
photoresVal = analogRead(photoresPin);
tempVal = analogRead(thermPin);
if (buttonVal == 0) { // button not pressed=0, when button is not pressed, double transducer
bulbVal = map(constrain(photoresVal, 150, 600), 150, 600, 0, 255); //using constrain to limit outliers without having a too large range
analogWrite(bulbPin, bulbVal);
motorPos = map(constrain(tempVal, 450, 500), 450, 500, 0, 180);
rotationMotor.write(motorPos);
} else { //button pressed=1, photoresistor value directly controls servo
analogWrite(bulbPin, 0);
motorPos = map(constrain(photoresVal, 150, 600), 150, 600, 0, 180); //using constrain to limit outliers without having a too large range
rotationMotor.write(motorPos);
delay(5);
}
if (millis() >= nexttimetorun) {//time counter so LCD updates at a reasonable speed
screen.clear();
//opacity value from photoresistor, lower value is greater opacity, higher value is more opaque(photoresistor is more covered)
screen.setCursor(0, 0);
screen.print("i: ");
int LCDopacity = map(constrain(photoresVal, 150, 600), 150, 600, 0, 99);
screen.print(LCDopacity);
//light brightness, lower value is dimmer light, higher value is brighter light
screen.setCursor(6, 0);
screen.print("m: ");
int LCDlight = map(bulbVal, 0, 255, 0, 99);
screen.print(LCDlight);
//Temp val(from thermistor), lower val is more heat, higher val is less heat
screen.setCursor(8, 1);
int LCDTemp = map(constrain(tempVal, 425, 500), 425, 500, 0, 99);
screen.print(LCDTemp);
//servo angle, lower value is closer to 0 degrees (LCD's right side), higher is closer to 180(LCD's left side)
screen.setCursor(11, 1);
int LCDservo = map(motorPos, 0, 180, 0, 99);
screen.print("o: ");
screen.print(LCDservo);
nexttimetorun = millis() + HALFSECONDWAIT;
}
}