Noise in phototransistor due to packaging has been investigated via theoretical models and measurements. A new design of package for phototransistor to reduce noise is proposed and tested for commercial photoelectric sensors. Generally, there are two kinds of materials, namely, metal and plastic used for the package, and a metal case made of aluminum or copper is the more popular. However, a metal case could pick up noise from electromagnetic fields, such as radio frequency noise caused by micro controllers. The noise could go into a phototransistor because of the metal case connected to the collector of the phototransistor, and amplified further, and could turn on a photoelectric sensor. Surface current induced by electromagnetic waves on a metal case due to skin effect is analyzed using theory of electrodynamics. Comparison of phototransistor packaged using the new design in photoelectric sensor and one in commercial is carried out. The latter is locked on under radio frequency noise environment, but, the former is not.