Laboratory session the challenge

Put in practice what you have learnt so far in terms of Arduino programming.
This is also the only session you should describe in your group report. No detailed guidance is
provided in this lab script, as this lab is meant to replicate what you may experience as Mechatronic
Engineer. However, feel free to contact the module coordinator and the technicians if you need
some clarification or help during the session.
Imagine that a customer contact you to implement a control system for an air conditioning unit. The
system needs to offer the following functionalities:
1) Be turned only during the day: the system should turn off when the overall brightness
detected by a light sensor is below a user-defined threshold.
2) When the system is on:
a. The user can select a desired temperature by pressing a button, the minimum
temperature is 15°C and the maximum is 25°C. Every time the button is pressed the
desired temperature increments by one degree until it reaches the maximum and
restart from the minimum (i.e. the temperature sequence is

b. The desired temperature is shown on an 8-segment display as surplus with respect
to 15°C, i.e. the display should show “0” for 15°C, “1” for 16°C etc;
c. The room temperature is read by an analog temperature sensor, with 1V
corresponding to 10°C and 4V corresponding to 30°C - use the potentiometer to
emulate the temperature sensor on your board;
d. If the room temperature is above the desired temperature, the cooling circuit (red
channel of RGB led) should be turned on with a PWM proportional to the difference
between room and desired temperature;
e. If the room temperature is below the desired temperature, the heating circuit (blue
channel of RGB led) should be turned on with a PWM proportional to the difference
between room and desired temperature;
3) If the system is off, both the heating and cooling circuits should be turned off and the 8-
segment display should show “

Sample Solution