I told my boss right away. Part of my job includes lifting heavy equipment, and I wanted to be taken off that duty right away as I'm no longer comfortable doing it.
I have recently discovered there may be a complication to my pregnancy. I am undergoing piles of blood testing to find out, but if I do have it, I will have to tell my team earlier than I wanted because it's possible that an emergency could happen at pretty much any time and I will need them to be able to backfill me. If my tests come back negative, I don't plan to tell them until either after my 9 week scan, or else after the first trimester, I haven't decided which yet.