Week11-Input Devices
Group assignment:
- Probe an input device(s)’s analog levels and digital signals
- Document your work on the group work page and reflect on your individual page what you learned
Individual assignment:
- Demonstrate workflows used in sensing something with input device(s) and MCU board
Checklist
- Linked to the group assignment page.
- Documented what you learned from interfacing an input devicels) to your microcontroler and optionaly, how the physical property relates to the measured results.
- Documented your design and fabrication process or linked to the board you made in a previous assignment.
- Explained the programming process(es) you used.
- Explained any problems you encountered and how you fixed them.
- Included original design files and source code.
- Included a ‘hero shot of your board.
Group assignment
We used a button and a potentiometer for measurement.
button
I connected the button to my development board and the oscilloscope to the button’s “out” pin.
potentiometer
Individual assignment
This week, I used a tilt sensor and a temperature sensor.
tilt sensor
I programmed using Arduino IDE.
void setup() {
// put your setup code here, to run once:
pinMode(9, INPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
int tilt = digitalRead(9);
Serial.println(tilt);
}
temperature sensor
connected them to my board and programmed using Arduino IDE
void setup()
{
Serial.begin(9600);//Set Baud Rate to 9600 bps
}
void loop()
{
uint16_t val;
double dat;
val=analogRead(A0);//Connect LM35 on Analog 0
dat = (double) val * (5.0/102.4);
Serial.print("Tep:"); //Display the temperature on Serial monitor
Serial.print(dat);
Serial.println("C");
delay(500);
}
sorce file:
temp.ino
tilt_sersor.ino