You have a raspberry pi connected to all the sensors and a code running to trigger if the sensors are triggered. Each sensor and keypad would run to a different input on the pi. They should al be able to be powered with a single cell lipo. Is that what you are asking?
Answer:
1) Yes, Publisher relation should have a publisherID primary key.
2) NOT NULL and UNIQUE for the BookID, BranchID, CardNumber and name of the borrower in the Book, Book_Copies, Library_branch, and Borrower relations respectively. The DueDate field of the book_loan relation must be a time constraint. The BookID of the Book relation must be serial number for automatic addition and update of bookid across the database.
Explanation:
The Publisher relation should have primary key publisherID which should replace the publisherName in the Book relation to easily make a join query and attain a third-level database model.