During deep inspiration, our body thinks we have little amount of blood in circulation and so it tries to maintain the cardiac output by increasing the heart rate.
Having said that, I'll try to explain further.
When we breathe in, the pressure in our thoracic cavity reduces. This causes a couple of things to happen:
There is an increase in the venous return from the superior and inferior vena cava to right atrium of the heart. This causes an enormous flow of blood to the right ventricle,and ultimately to the lungs
The lungs expand. This makes them reserve more blood. So, blood pools in the lungs and less return to the left atrium.SO WHAT?
Well, since there is a decrease in the amount of blood that gets back to the heart, the heart pumps less amount of blood to the systemic circulation. This decrease in the amount of blood coming from the heart is sensed by baroreceptors located in the arch of the aorta and the carotid bifurcation. These 'guys' are known as the carotid and aortic bodies. They trigger the sympathetic nervous system to produce adrenaline which causes the heart rate to increase.
WHY?
This is all in the aim of maintaining cardiac output.
Cardiac output is calculated as:
CO (cardiac output) = Heart rate X Stroke Volume (the volume of blood released from the heart with each heart beat)
Hence, if the stroke volume decreases, the heart rate increases.
When we exhale deeply, the opposite happens. There is an increase in the venous return to the left atrium from of the heart, leading to an increase in stroke volume, and a decrease in heart rate. (to maintain cardiac output, as explained earlier).