Champaign County Circuit Judge John Kennedy imposed those conditions on 20-year-old Clasance Botembe on Wednesday.
Health officials and prosecutors say Botembe failed to take precautions to avoid spreading the disease. Court records say his girlfriend got TB after being exposed to him.
Botembe is being treated at home. He, the judge and others wore masks during the hearing.
Botembe will be isolated for 30 days. He could be charged with a Class A misdemeanor if he defies the judge's order.
Slideshow archive | ABC13 wireless | Help solve crimes