A sensor includes a first element part and a second element part. The first element part includes a first upper main electrode part, a first upper sub electrode part and a first lower electrode layer. In the second element part, a configuration of electrodes is inverse to that of the first element part. It includes a second lower main electrode part, a second lower sub electrode part and a second upper electrode layer. The first upper main electrode part and the second lower sub electrode part are connected. The first upper sub electrode part and the second lower main electrode part are connected. The first lower electrode layer and the second upper electrode layer are connected.