Incubator project

I am building my own home incubator. I already controlled the Temperature sensor, Humidity sensor, heater and Fan. However I do not have Idea of how to control the servo to over the eggs every 10 minutes without affecting the reading data of the other two sensors (Humidity and Temperature). I am new working with Aurduino one. I know that I need to use some additional libraries such as Timer1 or other. However is quite difficult to implement without any similar example. Any help?

Jorge

you need to explain better what you already did or post the code you have so far, otherwise probably nobody will help you... i guess
good luck :slight_smile:

do you mean, you want to turn over the eggs ?

Do they need to be turned over every ten minutes ? Really ? How do people normally do this ?

Look at the blink without delay example. If will show you how to do something peridocally. You can do all of your existing activities in loop as I assume you already have them and use the technique in the example to move the servo at whatever interval you need.

You can use millis() function to check your predefined cycle! Or use a timer interrupt!

I do not have Idea of how to control the servo to over the eggs every 10 minutes without affecting the reading data of the other two sensors (Humidity and Temperature).

Do you really need a servo to turn over the eggs every certain amount of time? Do you really need that angular control precision?

Maybe you can simplify things by using a regular motor with a simple cam attached to the shaft activating a microswitch to stop the motor after the angular rotation you want which is probably fixed and always the same. if the angular rotation required by your desing is less than 360 deg per egg turn, then you may need more than one microswitch.

You will just start the motor when required and then just monitor the input pins where the switches are connected with a simple if(digitalRead(SwitchPin)==LOW) on every loop. Your sensors will continue operating on every loop with no problem as the rate of change of the temp and humidity is way slower than the Arduino loop speed.

The eggs are turned to prevent the embryo from sticking to one side of the shell. A typical turner will flop a tray of eggs over about 90 degrees, pointy end down, every two hours (example). Some smaller, bowl-shaped units will use paddles rotating from the center to "roll" the eggs around the bottom. And of course sometimes you do it by hand (not fun). The eggs will be taken out of the turner a couple days before hatching date so the chicks have time to reposition themselves for hatching -- seeing them break out of their shells is an amazingly precise process.

IMHO the easiest way to schedule events like this is with the TimeAlarms library. It's a bit overkill but certainly keeps your code nice and tidy.