At the very beginning i thought programming the accelerometer is the hardest part. However, after I took a look at this website:
the task became very easy. What actually turned to be the hardest part is mounting the electronics to the pillbox. Specifically, making the boxes covers act like switches especially that they have ting edges. So I tried:
1. Wires: did not work well because of tiny space and attaching them with a hot gun is just a pain.
2. Conductive paint: worked perfectly but after many trials, the paint start to take off from the box and that is absolutely not the desired result.
3. Finally, I have asked and done some research: CONDUCTIVE FABRIC solved my problems easily. they stick very hard to the box and stay after long number of trials of opening and closing the covers. Also, they are very flexible and can be easily mounted to the box. Moreover, you can shape them the way you want and their conductivity is high.