I'm currently working on building a density based traffic light model. I want to use the magnetic hall effect sensor to detect the number of the cars passing, so the idea that I have is to place the sensor under the road surface which will be made of wooden material, then place magnets under the cars. I'm not really sure if this will work because the road surface will be between the sensor and the magnet! Any idea if this gonna work or not?
Yes it should work, though you may have to play with the sensitivity depending on how far the magnet is from the sensor. The wood in between will make little difference assuming it is dry enough.
What the output from the sensor is will depend on how you orient the magnets and the type of hall sensor. If they are oriented vertically with the pole facing down you should get a nice signal.
Oriented horizontally with say North facing the front of the car, using a linear HE sensor, you will get a bipolar signal as each pole passes the sensor. This might be useful to you since you should be able to tell which direction the car is moving.