I have a EMF meter app, similar to the teslameter source code given by apple. the app works perfectly on the 3gs reading the numbers fine but on and iphone 4 it does not work at all. Is there some major difference in the compass hardware?
The app is based on the magnetic readings from the compass
No, there isn't any relevant hardware differences. The iPhone 4 also has a gyroscope, but it shouldn't alter magnetometer data.
Which behavior do you have? Any data at all?