compile stage, but we can use the
Serial.print
function to print the results or
intermediate results on the serial monitor to see if they look reasonable.
Once the program code has no errors, connect the PC or laptop with the Arduino UNO
board without any wire or pin plug-ins using the USB cable. Check if the selections for
the type of board and port options under “Tools” in the main menu are still right. Use
the “upload” button in the IDE to upload the program code to the Arduino board.
Disconnect the USB cable from the board, and now plug in all the wires and pins. Re-
connect the board and open the “Serial Monitor” from the IDE. The current ambient
temperature should display in the serial monitor, and the LED lights color and blink
accordingly. If any further errors occur, they will show in the message area at the
bottom part of the IDE window. Go back to debugging if this happens. If there are no
errors and everything runs correctly, test how the measurement system works by
changing the temperature around the sensor to see the corresponding response of the
LED color and blinking frequency. This can be done by breathing over the sensor or
placing it close to a cup of iced water or in a fridge for a short time. When the room
temperature is in the set point range (about 18°C to 20°C) the green LED should be
lit. Once the temperature is too high, only the red LED should be lit. When the
temperature is too low, only the blue LED should be lit. If this does not work, check
that you have created different temperatures by using a laboratory thermometer and
then check the program code.
Dostları ilə paylaş: