13 Online
1 Member And 12 Guest
Members present at the site
Today Visits : 2881
Yesterday Visits : 5452
All Visits : 517795

Welcome to Electronoobs Q&A, where you can ask questions and receive answers from other members of the community.



Categories


1 like 0 dislike
Hello Electronoobs,

I am Ralph an Electronics Engineering Student, thank you so much for the tutorials, i have learned things i dont get from school.

I need help!!!

Using your code, how do insert a code if temperature is higher than set point, i want my stepper motor to rotate clockwise but if temperature is lower than set point i want my stepper motor to rotaye cointer clockwise
by (300 points)

1 Answer

0 like 0 dislike
If you use the A4988 driver, just make a code something like this:

If(temp > setpoint)

{

digitalWrite(direction,LOW);

}

else

{

digitalWrite(direction, HIGH);

}

That will change the direction. Then all you need is to create a loop of square pulses for the steps.
by (34.7k points)
Thank you so much for the reply!  but i have a concern.

Will the PID control the speed of the rotation?
Is it ok to use L298N instead of A4988?
Like if the setpoint temperature is 100°C and the real value is 110°C i want my stepper motor slowly rotate the gas valve so that the temperature will be equal to the setpoint not rotate entirely to turn off the gas flow.

Which part in the PID code will I insert the stepper motor code
...