To correctly detect whether the inserted end of a hopper is normally inserted into a bag mouth in a bagging machine for opening the bag mouth of a bag 1 pinched by a pair of grippers 2 and 2 provided around an intermittently rotary table 3, inserting the hopper 4 into the bag mouth, filling an article 5 to be packaged into the bag 1 through the hopper 4, then drawing out the hopper 4 from the bag mouth, sealing the bag mouth, and thereafter discharging the product bag out of the machine.
Photoelectric sensors 7 and 7 are provided at a position in a supplying process of the article 5 to be packaged. The deformation of the bag mouth caused by the insertion of the hopper 4 is detected, and whether the hopper 4 is normally inserted into the bag mouth is determined from the detection result. If the leading edge of the lowering hopper 4 is caught on the bag mouth and the bag mouth is pressed and bent (as shown by a virtual line and then a solid line), a bag surface comes out of a detection part 9 (light passage) of the sensors 7 and 7, light emitted from light emission parts of the sensors 7 and 7 enters a reflector 6, and reflected light is detected by light receiving parts of the sensors 7 and 7.