Heat flow diagram and sign convention on heat and $\Delta S$ Context
I'm working through examples of heat flow diagram exercises where you have system A and system B and between the systems, you have one of the following:


*

*heat engine moving heat from warmer to colder and gaining energy.

*refrigerator moving heat from colder to warmer by inserting energy.

*nothing and you just have the spontaneous flow of heat.


Sometimes the heat dump is a reservoir (i.e. not changing temperature).
Usually, I'm supposed to work out the minimum amount of work it takes/earns to reach a certain temperature.
One of the many different diagrams:

Problematic equations
The two equations I've got to work with which I'm having problems with the sign are:
$$Q_A = \int_{t_1}^{t_2} C_A dT \\
\Delta S_A = \int_{t_1}^{t_2} \frac{C_A}{T_A}dT
$$
Sometimes in the solutions there is a minus sign in front of any of them: $Q_A = - \int_{t_1}^{t_2} C_A dT $
Question regarding sign
Can I draw the arrows in any heat flow diagram in whichever direction want? I know that their directions affect the first law of thermodynamics (similar to Kirchoff's junction rule that the sum of what's going in and out is 0) but how do their direction affect the sign of the aforementioned equations?
 A: Perhaps the most important thing you need to keep in mind when deciding on the "sign" of an energy transfer, be it the sign for heat $Q$ or work $W$ is that it should be consistent with the version of the first law of thermodynamics you are using. 
The first thing you need to do is define the system. Everything else is, by default, the surroundings. 
In engineering and physics the first law for a closed system (no mass transfer) is
$$\Delta U=Q-W$$
In this version, heat $Q$ is positive if added to the system (energy into the system) from the surroundings, and $W$ is positive if the work is done by the system on the surroundings (energy out of the system).
In chemistry the law is sometimes written as
$$\Delta U=Q+W$$
Where $Q$ is as before. But for this version, work is positive if the surroundings does work on the system (energy into the system). 
The two versions are consistent in that they both properly account for increases or decreases in internal energy.
Whichever version of the first law you use make sure you define your system and then be consistent with the signs for heat and work.
Hope this helps.
