Hi, i started an automatic egg turner incubator for my final year project. there is a problem where the temperature varies automatically and changes within 5 to 10 seconds.. it went up to 40++ degree Celsius then it went down to 20 degree Celsius.
The components I used are as follows:
Arduino Uno R3
I2C LCD1602
28BYJ-48 Stepper Motor with ULN-2003 Driver
5v Relay module
12v DC Fan
2N2222 Transistor
LM35 Temperature Sensor
25W Bulb
9V battery
I include my code and circuit diagram on my project. Thankyou in advance.
The step() function blocks. How long does it take for the stepper to move 4096 steps? You can't measure or control temperature while the stepper is moving. Do the movement in a series of small steps, measuring and controlling between movements.
thankyou for the info. Tt first i was thinking of insufficient voltage due to many components connected with the Arduino. When i disconnect the stepper from the Arduino the problem has been solved.. the temperature varies stopped. i am thinking to add another separate Arduino just for the stepper motor. or maybe is there any possible ways to use one Arduino?
Hi,
Definitely power the stepper from another 5V supply as you have shown on your Fritzy diagram
You need to forget about Fritzy images and draw a circuit diagram using component symbols and labels.
You may need to add hysteresis in your code, at the moment you have the light turning ON if below 38C and OFF if above or equal to 38C.
It may give you better control to allow for lag between lamp on and the sensor seeing a temperature change to do this.
Temp above 2C + setpoint(38) Lamp OFF
Temp below 2C - setpoint(38) Lamp ON.
You may need to adjust the +/- 2C value to tune any oscillations.
Running a mixed 5V/12V system off 9V batteries is asking for problems of course.
Get a 5V power supply for the Arduino and stepper and other 5V stuff (of course it goes to the 5V pin of the Arduino, not the Vin) and a separate 12V supply for your 12V fan.
Also you should not be reading your LM35 with Vcc as reference, that's another major source of errors. It's an absolute voltage sensor. Read it against the fixed 1.1V internal reference (and get almost 5x resolution in the process to boot).
helpme11:
thankyou everyone. will try all your advice
May I add, you actually did a good job on the Fritz. I am sure that you would have the same skill with circuit diagrams. I'm starting to use Kicad for that, but pencil and paper work wonders... it's cliche but honestly even backs of envelopes will do.
But, you should look at how standard schematics are usually drawn, initially just to get a feel for the conventional ways of laying things out. They are actually time honoured time savers.