Automatic water purification system