Does Ground Voltage Need Lowered As Well?
If what I understood from your question is correct, this circuit will help you. It is a voltage divider whose input is 9v and output is 3v (which can be given to your rasperry-pi)







simulate this circuit &ndash; Schematic created using CircuitLab