I am an embedded developer, often tasked with bringing up prototype hardware.
This tasks are highly variable in the tame it takes, mostly due to reasons outside of my control and this is not known before I start my work.
For example, if everything works fine bringing up a specific peripheral should take half a day to a day. But if there are issues with it, either due to a mistake in the circuit or faulty drivers, this can take a week or even longer.
What I usually do is give two estimates, for both cases, although the bad case one is usually very vague or very high. Depending on the task at hand it might be impossible to estimate.
I have also recently learned when to stop and state that it's not worth investing in this particular path (such as picking a different integrated circuit instead of writing drivers for it).
It has bugged me for quite some time since despite gaining experience my estimates do not improve. Is there anything I can do to improve this situation? Or should I just accept this as the reality of my job?
The answers suggest communication - this is not an issue here. Given the size of our company I report directly to the person handling client communications and give a short verbal status update daily.