Design of an integrated chemical sensor based on a torsional microbalance with magnetic sensing