Temperature Controlled DC Motor | Arduino TINKERCAD

by asfaqmoideen in Circuits > Microcontrollers

6958 Views, 3 Favorites, 0 Comments

Temperature Controlled DC Motor | Arduino TINKERCAD

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

Components used

Components used procedure

Virtual prototyping:

  1. Arduino UNO R3
  2. Temperature sensor TMP36
  3. NPN Transistor.
  4. DC Motor
  5. Bredboard
  6. connecting wires.

Procedure

Screenshot (118).png
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
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

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.