The official advice (in the UK at least) is that up to four or five cups of coffee a day is fine. This was according to leaflets in my doctor's waiting room produced by the coffee growers association or some group like that. I showed my doctor one of the leaflets and he went to the waiting room and removed them all.
He advised me to ditch coffee, which resolved what was otherwise going to be a diagnosis of chronic fatigue syndrome (which is a diagnosis of exclusion of a disease that not everybody agrees even exists). If you're feeling tired, try giving up any drugs that affect how awake you are.
(And go to a doctor. Plenty of engineers don't eat right as well as not sleeping right, anaemia feels absolutely terrible but is so easy to diagnose and treat)
From personal experience, if I didn't get enough sleep or haven't eaten well, the productivity of my work just go down the drain. I get cranky and I can't focus, but I have seen a lot of engineers who can work for days sleeping just few hours a day on just crackers. They don't mind not eating or sleeping well as long as they meet the deadline.
I can only encourage people to try the same. Coffee is cheating. You cheat your body and yourself that is telling you "I am too tired for this, stop right now". Drink 1-2 cups at maximum per day and make sure you get at least 8-9 hours of sleep.