Detecting Majorana modes in one-dimensional wires by charge sensing