Use a voltage divider, it's cheaper
And if you want to separate the 3.3V and 12V completely, use an optocoupler.
Your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with (nor for advice on) your project
See About the Installation & Troubleshooting category.