I tell my kids as soon as I find out, and yes with one pregnancy, I lost the baby at 4 months and the whole family was sad together. We always felt like if something did go wrong they would be confused as to what was going on and that kids need to learn some points in life that maybe are not so happy.
As far as the sex talk with your oldest. He will ask questions, but in my opinion he is way to young for an all out sex talk. My oldest one is very inquisitive and he definitely asked questions about how it got there and how it will come out (he was almost 7 at the time). We are a Christian family which made it very easy to explain that God chose our family to raise another little person and that we are very blessed to have such an honor. As far as how it comes out, I just told him that I go to the hospital and the baby doctor helps the baby come out. Of course he asked if it hurt and I said "Yes! Very much!" but not to worry, my body was made for this and the short time of pain is worth the final outcome. One of my sons was very concerned about me being in pain so I reassured him that they give me medicine in my back so I don't have to feel it. He was fine then.
In short, be honest with them but keep it age appropriate. They will get by with some information but not all of it. Most kids are not even ready for the real detail until they are at least 9 or 10.
Good luck to you and congrats!