At least at 17 weeks cause I found out when I was 17 weeks 1 day that I am having a boy. I'm 31 weeks 4 days now
I had mine done at 16 weeks and he wanted me to tell he was a boy. I'm 17 weeks now. All depends on the position of the baby
Usually around 20 weeks is a safe time. 16 is a bit early. good luck