System is designed to provide a temperature controlled functionality. The system shall provide the ability to reach a targeted temperature requested by a user interface. The system shall provide information for the user about the system state, the current temperature and the selected set temperature.
System is consisted of the following:
- Atmega32 Microcontroller.
- LM016 character LCD.
- TC72 SPI to temperature convertor.
- 4X3 Keypad.
- PWM to voltage convertor module.
- Calibration resistor.
-
1. Welcome screen:
-
- After power on, system shall display an animated welcome screen.
- After power on, system shall display an animated welcome screen.
-
- The welcome Screen shall display the word “WELCOME” on the Character LCD.
-
- The welcome word shall move from right to left until the end of the screen.
-
- The welcome word shall move from left to right until the other end of the screen.
-
- The time of each movement step shall be 100ms.
-
- Steps from 3 to 5 shall be repeated 3 times.
-
- System shall then switch to IDLE screen with the last saved set temperature.
-
-
2. IDLE screen:
-
- IDLE screen consists of three sections, Set temperature, current temperature and system state.
-
- Set temperature section shall be allocated on the left side of the screen from Row0 col0 to Row0 Col5.
-
- Set temperature section shall be written on the form SET:XX where XX is the Set temperature value.
-
- Set temperature value shall be changed based on a user entry from the 4X3 Keypad.
-
- If Set temperature is less than 10, its value shall be written on the form 0X.
-
- Current temperature section shall be allocated on the right side of the screen from Row0 Col10 to Row0 Col15.
-
- Current temperature section shall be written on the form CRT:YY where YY is the current temperature value.
-
- Current temperature shall be changed based on the current value read from the LM35 Temperature sensor.
-
- System state section shall be allocated on the down left of the screen from row1 Col0 to row1 Col15.
-
- System state section shall be written on the form STATE: SSSSS. Where SSSSS is equal to the system state.
-
- System state shall vary from STANDBY, OPERATIONAL, NORMAL and ERROR based on the current system state.
-
-
3. System states:
-
- After power on, Systems state shall be STANDBY.
-
- STANDBY state means system is not operational, no temperature reading and no Voltage module control (PWM output is 0).
-
- Upon the click on the # button in Keypad, system shall move from STANDBY to OPERATIONAL.
-
- In operational state, System shall read the current temperature periodically every 200ms.
-
- In operational state, System shall drive PWM to voltage convertor based on the
following equation:
V = ((Set temperature – Current Temperature) / 100) * 5 if Set temperature > Current Temperature.
V = 0 if Set temperature <= Current Temperature.
Where V is the delivered voltage from the PWM to Voltage convertor.
- In operational state, System shall drive PWM to voltage convertor based on the
-
- In operational state, if Current temperature > Set temperature and (Current temperature – Set temperature) <= 5 system shall enter NORMAL state.
-
- In operational state, if Current temperature < Set temperature and (Set temperature – Current temperature) <= 5 system shall enter NORMAL state.
-
- In operational state, if Current temperature > Set temperature and (Current temperature – Set temperature) > 10 system shall enter Error state. In operational state, if Set temperature > Current temperature and (Set temperature – Current temperature) > 5 for more than 3 minutes, system shall enter Error state.
-
- In operational state, if # key is pressed, System shall enter STANDBY State.
-
- In Normal state, Periodic temperature reading is exist with voltage V = 0.
-
- In Error state, no temperature read and no PWM to voltage module control.
-
- The only exit from Error state is to power off the system. Keypad shall not be functional.
-
-
4. Calibration Resistor:
-
- Calibration resistor is used to define the percentage of average voltage to be delivered to the PWM to Voltage convertor.
-
- Calibration resistor is a three terminal potentiometer formulate a voltage divider circuit. One terminal on VCC, other terminal on Ground and the middle terminal shall be read by the microcontroller.
-
- The Calibration resistor voltage shall be read every 500ms in both Operational and normal states.
-
-
5. PWM to voltage convertor:
-
- The PWM transfer voltage module LC-LM358-PWM2V converts the PWM digital signals into 0 to 10V analog signals.
-
- The device shall be connected to the microcontroller only via PWM input.
-
- The accepted PWM frequency is from 1KHZ to 3KHZ.
-
- The value of the delivered PWM duty cycle is dependent on the targeted voltage and value of the calibration resistor voltage. Duty Cycle percentage = (((Vr * 2)/10) * Vt) / 10. Where Vr is the calibration resistor voltage, Vt is the target voltage as described in system states.
-
-
6. Temperature sensor:
-
- TC72 is a temperature to SPI convertor.
-
- Recommended system mode is the continues mode.
-
- More information about the sensor constraints is located in its datasheets.
-
-
7. General constraints:
-
- Refer to 4X3 phone keypad for keypad interface.
-
- Refer to Chapter 12 in AVR mazidi for LM016 LCD interface.
-
- LCD shall be used in 4 pin data mode.
-
- All timing constraints shall be respected.
-
- No delay loops is allowed for a time higher than 100us.
-
- Code shall not have any unjustified MISRA violations.
-