Temperature Controlled DC Motor | Arduino TINKERCAD
by asfaqmoideen in Circuits > Microcontrollers
7554 Views, 3 Favorites, 0 Comments
Temperature Controlled DC Motor | Arduino TINKERCAD
.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
.png)
Components used
Components used procedure
Virtual prototyping:
- Arduino UNO R3
- Temperature sensor TMP36
- NPN Transistor.
- DC Motor
- Bredboard
- connecting wires.
Procedure
.png)
.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
.png)
.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
.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.