P0102 could also mean that the wiring connection could be faulty. Check the sensor wiring, and make sure it has a proper connection, and that they're aren't any broken or frayed wires. Also, when you unplugged the battery, how long did you let it sit? It can sometimes take 30 mins or so for the ecu's working memory to clear.
You wouldn't have, by any chance been cleaning/oiling your air filter at the same time you installed your new sensor? If you over oiled the filter, you could have already contaminated the new sensor. It's not likely, but I thought I would ask just in case.
After you reset the ecu, turn the key to the accessory position, but don't start the car. Sit there for 15-20 secs. Then start it, and let it idle for 10 mins or so. You want to allow ample time for the ecu to calibrate idle and warm up values. Drive it around normally for a 5-10 mins, then get into the throttle, and do some hard driving for a bit. This will give the ECU a decent baseline for it's trim values matched to the engine and ancilliary components condition, like a new MAF sensor.