Aims. The physical conditions and chemical structure in the dark cloud of
Barnard5 and its surrounding atomic halo is studied. The impact of the halo on the line emission emerging from the molecular cloud is investigated. We present observations of the [CI]
3P
1⟶
3P
0 transition of neutral carbon and the low-J transitions of
12
CO and
13
CO. The CO maps extend from the core (A
v>7) to the northern cloud edge and into the halo (A
v≲1). They are complemented by deeply integrated [CI] spectra made along a 1D cut of similar extent. Escape probability and photon-dominated region (PDR) models are employed to interpret the observations.
12
CO and
13
CO are detected in the cloud and the halo, while [CI] is detected only toward the molecular cloud. This occurs even though the neutral carbon column density is >5 times larger than the CO column density in the halo, but it can be understood in terms of excitation. The [CI] excitation is governed by collisions even at the low halo densities, while the CO excitation is dominated by the absorption of line photons emitted by the nearby molecular cloud. The upper limit on the neutral carbon column density in the halo is 6x10
15/cm2. The PDR studies show that even small column densities of H
2 and CO, such as those in the
B5 halo, can significantly change the [CI] and CO line emission (pre-shielding). Since this effect decreases the [CI] intensity and increases the CO intensity, the largest impact is noted for the [CI]/CO line ratios. For the
B5 cloud, a PDR model with a molecular hydrogen column density of ∼6x10
19/cm2 in the halo matches the observed [CI]/CO line ratios best. Models with no pre-shielding, in contrast, suggest high gas densities that are in conflict with independently derived densities. The PDR models with a χ<1 demonstrate that the [CI]/CO ratios cannot be attributed solely to a reduced FUV field.