Sunday, January 27, 2019

Lab 10 - Using the Serial Port

1/22/19

Serial port in an microcontroller is very useful in getting values. Values, for what? There are sensors that will be connected to the analog port of the microcontroller which when given the command serial print read, the computer monitor will display the value that the microcontroller is seeing from the device connected to the port. The picture below shows a LDR (Light Dependant Resistor) that has a different resistance value depending on the amount of light that reaches the sensor, hence Light Dependant. The microcontroller on the analog port will be able to read the value, and the program can use that value to control whatever we command the controller to do.
LDR Hooked up





















Serial connections has a Receive and a Transmit pin. There is also a shared pin of common Ground Reference. The arduino microcontroller in this setup will receive intel from the computer's keyboard, and transmit a command to the computer monitor and the arduino's pins. In the picture below, the computer keyboard is entered with a 1 or a 0, in which the arduino reads it, and on the code, the LED will turn either ON or OFF depending on the keyboard stroke entered. #Success




LED hooked up







No comments:

Post a Comment