The implementation of a turkey farm brings with it severe environmental problems due to the deficient study of the physical space where the animals are placed. To counteract this situation and improve the quality of life in the hatchery, it is necessary to monitor and control the following variables: Temperature, Humidity, Ammonia Emission and Lux. The solution is based on a cyber-physical system which is composed of a network of sensors, controller and actuator. The sensors will provide information from the physical environment, the controller evaluates these parameters to execute an action to the actuator. Proportional, Integral and Derivative (PID) control defines the setpoint for temperature while Pulse-Width Modulation (PWM) adjusts the light intensity in a spotlight. The End Device executes these actions and its parameters will be sent to ThingSpeak which monitors system behavior the Internet of Things.