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

I love how so many people think that inventing means dreaming up some possible use case and then grabbing an Arduino and asking around for a sensor.

The reason something like this doesn't exist is surely not because nobody thought of it yet. If you want to be an inventor then try to invent that sensor. Combining it with an Arduino is then just an application, not an invention.