Hi,

No need a Pic here !!!

a simple LM393 comparator or a "741" OPA should do the job...

Alain