Is there any thing can i used to detect an bacteria or viruses for iot project?

Boil water for 30 minutes to inactivate all organisms, including bacteria and viruses. The water still might not be potable.