Printed circuit board antennas degrade considerably when the wireless node is placed on or near metallic surfaces. One such application is wireless alarm network where nodes are placed on a metallic fence. As wireless transmission is regarded as the most expensive operation in terms of sensor node energy, it is more than a necessity to have a good antenna design. We simulate the performances of typical printed circuit board (PCB) antennas with proximity to metallic fence and simulations show that traditional antenna structures exhibit poor performance for these applications. Instead, we propose a low-cost two-antenna diversity system that utilizes two PCB antennas with different radiation pattern coverage. Antenna diversity by means of radio frequency switches was implemented for two configurations: single state antenna selection and equal-gain diversity combination. Diversity gains were calculated for free-space and over-the-fence operating conditions, and the best antenna configuration is suggested for practical applications.