Building a cheap portable artificial horizon.

Is this to be used in a moving vehicle/vessel, or just static? For static use you just need a dual axis accelerometer - or a plumb line. To solve it in a moving system is much harder and you probably want to start by looking at home the autonomous drones do it - they often use Arduino clones with the required sensors integrated, and their hardware and software might be a good starting point for your project.