Question

In: Electrical Engineering

Draw the schematic and code for an Arduino controlled system using a temperature sensor and fan.

Draw the schematic and code for an Arduino controlled system using a temperature sensor and fan.

Solutions

Expert Solution

Arduino code:-

int val;
int tempPin = A0;
const int fanpin = 2;

void setup()
{
Serial.begin(9600);
pinMode(fanpin, OUTPUT);
}

void loop()
{
val = analogRead(tempPin);

//conversions from analog to celsius and farenheit
float a = ( val/1024.0)*5000;
float cel = a/10;
float farh = (cel*9)/5 + 32;

//these lines are used to display the temperature in the serial monitor.
Serial.print("TEMPRATURE = ");
Serial.print(cel);
Serial.print("*C");
Serial.println();

int threshold = 28; // you can change the threshold value according to your requirement.
if (cel > threshold )
{
digitalWrite(fanpin, HIGH);
}
else
{
digitalWrite(fanpin, LOW);
}
delay(1000);
  

/* uncomment this to get temperature in farenhite
Serial.print("TEMPRATURE = ");
Serial.print(farh);
Serial.print("*F");
Serial.println();
*/


Related Solutions

We need to code an LCD with a temperature and humidity sensor for the arduino UNO...
We need to code an LCD with a temperature and humidity sensor for the arduino UNO board. The LCD should simply display the temperature and humidity reading from the DHT11 sensor. We must do this without the use of arduino or lcd libraries, and only use raw c code. For example we need to use PORTD |= (1<<5); to set the pin to 5. The LCD is connected to pins A0 and A1, and it is using I2C. The temperature...
THIS IS FOR ARDUINO PROGRAMMING Write code that checks the sensor data and meets the following...
THIS IS FOR ARDUINO PROGRAMMING Write code that checks the sensor data and meets the following conditions: For night conditions, turn on white LED 1 For day conditions, turn off white LED 1 Code should check intervals every 5 seconds. NEED THE BELOW CODE TO FIT THE ABOVE REQUIREMENTS. const int lightSensor = 5; //light sensor variable float sensValue = 0; //variable to hold sensor readings const int button = 3; //pin for button reads const int LED1 = 5;...
this is code to Temperature and Humidity Monitoring over ThingSpeak using Arduino UNO and ESP8266 i...
this is code to Temperature and Humidity Monitoring over ThingSpeak using Arduino UNO and ESP8266 i need someone explain the steps for me #include <stdlib.h> #include <DHT.h> #define DHTPIN 5         // DHT data pin connected to Arduino pin 5 #define DHTTYPE DHT11     // DHT11 (DHT Sensor Type ) DHT dht(DHTPIN, DHTTYPE); // Initialize the DHT sensor #define SSID "WiFi Name"     // "WiFi Name" #define PASS "WiFi Password"       // "Password" #define IP "184.106.153.149"// thingspeak.com ip String msg = "GET /update?key=Your API...
Write an Arduino Program that detects a reflective surface using the line sensor array of a...
Write an Arduino Program that detects a reflective surface using the line sensor array of a QTR-3RC (*Must be specific to this sensor! please this is important*) Must include a function that when called returns.. 0 (line to the left of the robot) 1 (line under the robot on the left side) 2 (line under the robot on the right side) 3 (line to the right of the robot) Output the results to the serial port in 0.5 second intervals...
Write an Arduino Program that detects a reflective surface using the line sensor array of a...
Write an Arduino Program that detects a reflective surface using the line sensor array of a QTR-3RC (*Must be specific to this sensor! please this is important*) Must include a function that when called returns.. 0 (line to the left of the robot) 1 (line under the robot on the left side) 2 (line under the robot on the right side) 3 (line to the right of the robot) Output the results to the serial port in 0.5 second intervals...
Using Arduino to blink an LED in morse code. Morse code is used as one of...
Using Arduino to blink an LED in morse code. Morse code is used as one of the methods for communications. It consists of a series of “dit” and “dah” symbols. (i) Develop an Arduino program to produce a Morse code to express the phrase “We are students” using Pin #13 (connect an LED that is in series with a 220-Ω resistor to Pins #13 to view the information sent via the Morse code). Express one “dit” with LED on for...
Draw a schematic representation of a portal system. What is different with respect to the common...
Draw a schematic representation of a portal system. What is different with respect to the common arrangement that you will find in typical capillary beds? What is the function of portal systems and why do they require this peculiar arrangement?
Using an arduino, breadboard,  ultrasonic sensor, buzzer, lcd and red led display distance in centimeters, If needed,...
Using an arduino, breadboard,  ultrasonic sensor, buzzer, lcd and red led display distance in centimeters, If needed, use a rotary potentiometer, male to male cable (m-m) female to male cable (f-m) or any resistor provided in the kit. display distance in centimeters to lcd. If the object is in distance, turn on Active buzzer(play sound) and turn on red led. If the object is not in range, display out of range or "Object now close'.  on the lcd, make sure the buzzer...
Note: Draw the schematic and code for each of the following question. All question carries equal...
Note: Draw the schematic and code for each of the following question. All question carries equal marks. 1. Design heat control system as follow. Design a system to maintain the temperature of the system at 37 degree celcius.A temperature sensor is attached with the Arduino analog input. A fan (220 volts) and heater (220V) is placed in a room. If temperature is greater than 37 degree, turn the fan on and if temperature is less than 37 turn on heater....
draw a schematic diagram of an activated sludge system that includes a "selector". describe the function...
draw a schematic diagram of an activated sludge system that includes a "selector". describe the function of the "selector" and describe how this process configuration and associated operating strategy is different from a "conventional" activated sludge system.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT