Updated diagram and evolved the Arduino code