Electronic device having a housing which can be attached to a carrier rail, having - a housing upper part which has two side walls (250, 251) which extend longitudinally in a longitudinal direction and are spaced apart from one another transversely with respect to the longitudinal direction in a transverse direction, and a receptacle chamber which is formed between the side walls (250, 251) and has the purpose of receiving an electronic assembly, wherein at least one of the side walls (250, 251) has a first opening (200, 201) through which a first electrical line can be connected to a first connection (410, 411, 415) of the electronic assembly, - wherein the housing upper part has a connecting chamber which is offset with respect to the receptacle chamber in the longitudinal direction and is formed between the side walls (250, 251) and is opened towards the receptacle chamber in such a way that a second electrical line can be connected to a second electrical connection of the electronic assembly via the connecting chamber, wherein at least one of the side walls (250, 251) has a second opening (210, 211) via which the second electrical line can be inserted into the connecting chamber, wherein the connecting chamber is separated from the receptacle chamber by a dividing wall which extends transversely with respect to the longitudinal direction, wherein the dividing wall has an opening via which the electrical line can be connected to the second connection of the electronic assembly, wherein the housing upper part has two end walls (252, 253) which extend transversely with respect to the longitudinal direction, are spaced apart from one another in the longitudinal direction and form end faces of the housing, to which a further housing can be respectively connected in order to connect a plurality of housings in a row in the longitudinal direction, and having an electronic assembly which is accommodated in the receptacle chamber of the housing, wherein the electronic assembly has a circuit board with an electronic component arranged thereon, wherein the first connection (410, 411, 415) is arranged on a first edge, which extends in the longitudinal direction, of the circuit board, and the second connection is arranged on a second edge, which extends in the transverse direction, of the circuit board. - a housing upper part which has two side walls (250, 251) which extend longitudinally in a longitudinal direction and are spaced apart from one another transversely with respect to the longitudinal direction in a transverse direction, and a receptacle chamber which is formed between the side walls (250, 251) and has the purpose of receiving an electronic assembly, wherein at least one of the side walls (250, 251) has a first opening (200, 201) through which a first electrical line can be connected to a first connection (410, 411, 415) of the electronic assembly, - wherein the housing upper part has a connecting chamber which is offset with respect to the receptacle chamber in the longitudinal direction and is formed between the side walls (250, 251) and is opened towards the receptacle chamber in such a way that a second electrical line can be connected to a second electrical connection of the electronic assembly via the connecting chamber, wherein at least one of the side walls (250, 251) has a second opening (210, 211) via which the second electrical line can be inserted into the connecting chamber, wherein the connecting chamber is separated from the receptacle chamber by a dividing wall which extends transversely with respect to the longitudinal direction, wherein the dividing wall has an opening via which the electrical line can be connected to the second connection of the electronic assembly, wherein the housing upper part has two end walls (252, 253) which extend transversely with respect to the longitudinal direction, are spaced apart from one another in the longitudinal direction and form end faces of the housing, to which a further housing can be respectively connected in order to connect a plurality of housings in a row in the longitudinal direction, and having an electronic assembly which is accommodated in the receptacle chamber of the housing, wherein the electronic assembly has a circuit board with an electronic component arranged thereon, wherein the first connection (410, 411, 415) is arranged on a first edge, which extends in the longitudinal direction, of the circuit board, and the second connection is arranged on a second edge, which extends in the transverse direction, of the circuit board.