Temperature Controlled DC Motor | Arduino TINKERCAD
by asfaqmoideen in Circuits > Microcontrollers
7545 Views, 3 Favorites, 0 Comments
Temperature Controlled DC Motor | Arduino TINKERCAD
![Screenshot (112).png](/proxy/?url=https://content.instructables.com/FI7/38YT/KQXS1MMD/FI738YTKQXS1MMD.png&filename=Screenshot (112).png)
Hello there
This is my first ever project which i had published on Instructables.
This is the project which have been prototyped virtually using TINKERCAD website.
t .
​Components Used
![Screenshot (117).png](/proxy/?url=https://content.instructables.com/F6N/ZPLU/KQXS1KW7/F6NZPLUKQXS1KW7.png&filename=Screenshot (117).png)
Components used
Components used procedure
Virtual prototyping:
- Arduino UNO R3
- Temperature sensor TMP36
- NPN Transistor.
- DC Motor
- Bredboard
- connecting wires.
Procedure
![Screenshot (118).png](/proxy/?url=https://content.instructables.com/F4Q/KF13/KQXS1KW9/F4QKF13KQXS1KW9.png&filename=Screenshot (118).png)
![Screenshot (119).png](/proxy/?url=https://content.instructables.com/F23/XUNV/KQXS1KWA/F23XUNVKQXS1KWA.png&filename=Screenshot (119).png)
Connection should be given as per in the picture.
- First connect power pins to the breadboard
- connect vcc to the emitter
- Base to pin5
- collector to DC motor
- Connect vout to the analogue inout A0
- Power and ground connections should be given properly.
Programming
![Screenshot (121).png](/proxy/?url=https://content.instructables.com/F9F/BUV9/KQXS1KWC/F9FBUV9KQXS1KWC.png&filename=Screenshot (121).png)
![Screenshot (115).png](/proxy/?url=https://content.instructables.com/FSI/J60T/KQXS1KW5/FSIJ60TKQXS1KW5.png&filename=Screenshot (115).png)
#define TEMPERATURE A0
#define MOTOR 5
void setup()
{
Serial.begin(9600);
pinMode(MOTOR, OUTPUT);
}
int speed_decider(int temp)
{
if(temp<35)
return 0;
else if(temp>40)
return 255;
else
return map(temp, 35, 40, 0, 255); }
void loop()
{
int temperature = analogRead(TEMPERATURE);
temperature = map(temperature, 20, 358, -40, 125);
Serial.println(speed_decider(temperature));
analogWrite(MOTOR, speed_decider(temperature));
}
Working
![Screenshot (116).png](/proxy/?url=https://content.instructables.com/FCQ/M7VF/KQXS1KW6/FCQM7VFKQXS1KW6.png&filename=Screenshot (116).png)
After giving the same connections you can simulate this on tinkercad.
- the temperature values are given to the microcontroller as analogue input via pi A0
- the input value is variable of the function
int speed_decider(int temp)
- The value is returned to the calling statement on void loop()
- To the DC motor speed control
- The speed of motor will be varied from 4360-7800 Rpm with respect to 35-40 degree celcuis.
- There is no motor driver used here instead of that we are using NPN transistor.
And the real prototype also will work with the same circuit.