While others in the thread have already stated the obvious (don't think of doing it for money; negotiate everything; under promise, over deliver etc...) - there are a few things you should be aware of as a first-time book author.
1: It will take a LOT longer than you ever thought possible. For every page of final product, you will have written 3-4 pages of text.
2: It's a full-time job. Expect to spend 5-6 hours a day, just writing.
3: The workflow between you and your editor is crucial. Treat the book the same way you would treat a complex software project - your editor will want regular progress reports, and you want to provide work-in-progress manuscript revisions or chapters. A good editor is going to send back lots of editorial comments, questions, requests for expanding (or sometimes contracting) on varying topics and so on. Approach this the same way you would approach a very thorough code review.
3b: Ask to meet in person with your editor before you sign the contract. The two of you have to be able to work together over written media.
4: You will learn a lot about how to use written and spoken language. You may want to consider the entire project an opportunity for an extremely intensive course on written communications.
5: Before you embark on the project, find out what activity helps you relax. Then find a way to record audio. When you feel blocked, take up the activity but keep the audio recording device at hand. When your mind comes unhinged and ideas pop up, record them immediately.
6: Don't even try to write your book "in order". Focus on one or two chapters at a time, and think of them as 90% independent results. The time to tie the chapters together comes towards the end of the project, as you and your editor realise that a previously "logical" chapter order may not work after all. Leave yourself some wiggle room to make the chapter shuffle easier to handle.
And because we in engineering discipline are even more likely to suffer from existentialism...
7: Do your best to maintain an emotional distance. You are not your book, and your value as a human being is not dictated by the progress of writing or the (lack of) success of the published book.
Basically, writing a book is easy. You sit down, open your veins, and pour the blood out.
P.S. Having an ISBN to your name is one hell of a CV item. But don't ever imagine that you're doing this to buff up your Publications section.