The 29-year-old striker suffered the injury during the goalless draw against Doncaster last weekend.
Although the problem is not as bad as initially feared, scans have revealed the damage will sideline Earnshaw for around a month, ruling him out of Wales` Euro 2012 qualifier against England at Cardiff`s Millennium Stadium on March 26.
"Robert has a grade one hamstring injury, which is good new for us," said boss Billy Davies.
"We are probably looking at him being out for three or four weeks. Anything above that would have been a disaster for us."