Introduction: Temperature Controlled DC Motor | Arduino TINKERCAD

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 .

Step 1: ​Components Used

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.

Step 2: Procedure

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.

Step 3: Programming

#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));

}

Step 4: Working

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.