We investigate the use of the rest-frame 24microns luminosity as an indicator of the star formation rate (SFR) in galaxies with different metallicities by comparing it to the (extinction corrected) Halpha luminosity. We carry out this analysis in 2 steps: First, we compare the emission from HII regions in different galaxies with metallicities between 12+log(O/H) = 8.1 and 8.9. We find that the 24microns and the extinction corrected Halpha luminosities from individual HII regions follow the same correlation for all galaxies, independent of their metallicity. Second, the role of metallicity is explored further for the integrated luminosity in a sample of galaxies with metallicities in the range of 12+log(O/H) = 7.2 - 9.1. For this sample we compare the 24microns and Halpha luminosities integrated over the entire galaxies and find a lack of the 24microns emission for a given Halpha luminosity for low metallicity objects, likely reflecting a low dust content. These results suggest that the 24microns luminosity is a good metallicity independent tracer for the SFR in individual HII regions. On the other hand, metallicity has to be taken into account when using the 24microns luminosity as a tracer for the SFR of entire galaxies.