1/9/20 Project Update #1

Ganesh, Javier, Nicholas J. Holden (pen name)

This week we finished soldering the leads from the LED diode and Photodiode to wires. We initially encountered errors with soldering, but this was resolved by changing the soldering iron. We designed and built the current-to-voltage circuit as well as the current limiting circuit for the LED. We have encountered errors in this process as when ported to Arduino the values showed no changes in the voltages regardless of distance between the LED and photodiode. We tried to solve this issue by changing the amplification of the current-to-voltage circuit, but this didn’t yield any results.

The code below was an attempt to gather data as the arm sweeps. We simplified the code without the porting to Matlab and getting rid of the sweeping to test the circuit. We are planning to get the servo motor to sweep and also fix the current-to-voltage converter till we can see a measurable change in the voltage based off distance. We are also planning to start writing the Matlab code to read the serial data.
int servoPin = 9;

Servo servo;

int angle = 0; // servo position in degrees

void setup() {
// sets up serial ports and output pins
Serial.begin(9600);
servo.attach(servoPin);
}

void loop() {
//starts a data collection
Serial.println(“Start”);
// scan from 0 to 180 degrees
for(angle = 0; angle < 180; angle++)
{
servo.write(angle);
double sensorvaluea = analogRead(A1);
//Prints to serial to be picked up by matlab
Serial.print(sensorvaluea/1023*5);
delay(15);
}
// now scan back from 180 to 0 degrees
for(angle = 180; angle > 0; angle–)
{
servo.write(angle);
double sensorvaluea = analogRead(A1);
//Prints to serial to be picked up by matlab
Serial.print(sensorvaluea/1023*5);
delay(15);
}
//Ends Data collection
Serial.println(“End”);
}

Leave a Reply

Your email address will not be published. Required fields are marked *