There are tons of OS boards and software already developed around this problem, you don't have to do it all yourself.