Hi!
I read that you should not have a very long cable between the sensor and the arduino board because it could cause bad readings
from the information given by the sensor.
Does any know how long should the cable or wire not exceed in analog and digital sensors??
A few centimeters to hundreds (or more) meters. It depends on the sensors and the wires.
For example I2C can normally be up to 30 cm. But some have no problem with 2 meters. Then again, when an ribbon cable is used in a bad way, even 30 cm could be too much for I2C.
Analog sensors is something else. With a shielded coax cable long distances are possible. However, if that analog sensor requires current, the voltage drop of the cable has to be taken into account.
When using long cables, they might pick up electrical noise. That might destroy the Arduino board if it is very bad noise.