Does someone know what these components are? They seem to be the same thing, but one has 2 and the other 3 pins.

[![enter image description here][1]][1]


  [1]: https://i.sstatic.net/AyTMC.jpg