19 Online
3 Member And 16 Guest
Members present at the site
Today Visits : 1000
Yesterday Visits : 8679
All Visits : 930931

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


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, HIGH);


That will change the direction. Then all you need is to create a loop of square pulses for the steps.
by (34.8k 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