“I cannot read two fast sensors simultaneously with my Arduino. What happens and how to solve the problem?”

 

If the sensors are very fast-acting, for example, two on-off sensors that send short pulses when they are triggered you have a latency problem. The Arduino, like other microcontrollers reads the sensor inputs sequentially, that is, one after the other and between the readings there is a certain time interval (latency). Thus, if the two inputs are activated at the same time producing pulses, when the second will be read it has already disappeared and instead of recognizing two high levels, the circuit indicates 1 and 0. There are some software devices to solve this, but the best solutions are the ones that touch the hardware. One is to prolong the pulses generated by the sensors, using monostables (555. For example). Another solution can be made with logic gates that provide signal 1 for reading the instant the two sensors are activated. See more in our article “Latency”.

 

Datasheets


N° of component