Question: Write a full program in C for the circuit diagram shown below based on Mbed operating system. Your program should read an analog voltage from

Write a full program in C for the circuit diagram shown below based on Mbed operating system. Your program should read an analog voltage from temperature sensor TMP36. Convert voltage reads to Celsius using float tempC = (V *5 -0.5) * 100. If the room temperature was greater than 30, turn on the air conditioner. If the room temperature was less than 10, turn on the heater using connected relays. Otherwise, all devices should be turned off. Access peripheral devices using the pins number shown in the figure.

Q2- Write a full program in C for the circuit diagram shown below based on Mbed operating system. Your program should read an analog voltage from temperature sensor TMP36. Convert voltage reads to Celsius using float tempC = (V *5 -0.5) * 100. If the room temperature was greater than 30, turn on the air conditioner. If the room temperature was less than 10, turn on the heater using connected relays. Otherwise, all devices should be turned off. Access peripheral devices using the pins number shown in the figure. 57 Microcontroller VOO RES-TAMPER-TC ROSEN PISOSCOUT ROOSEN Poscount Pe BOOT Ac relay Loe TMP36 Temperature Sensor STM32F103 DO leee PRE Heater relay 11 5V Microcontroller 48 VBAT VDD_3 47 PC13-TAMPER-RTC VSS_3 PC14-OSC32_IN PB9 PC15-OSC32 OUT PB8 45 44 BOOTG PDO-OSC_IN PD1-OSCOUT PBZ Ac relay NRST PB6 B 41 T17 VSSA PB5 40 VDDA PB4 10 39 PAO-WKUP PB3 ele 2 Vout 38 PA1 PA15 TMP36 Temperature Sensor 12 PA2 12 STM32F103 PA14 VDD_2 14 35 PA4 VSS 2 15 34 PA5 PA13 16 33 PA6 PA12 17 PAZ PA11 32 eee 18 | P PA10 19 PA9 30 20 29 PB1 PB2 PB10 PA8 21 28 PB15 Heater relay 22 PB11 27 PB14 23 25 PB13 VSS1 VDD 2 24 PB12 25 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
