An optoelectronic device comprising a rib waveguide (210, 310, 510, 610, 710, 810), a lateral PN diode (205, 305, 505, 605, 705, 805), and at least one CMOS transistor, - wherein the rib waveguide (210, 310, 510, 610, 710, 810) comprises: -- a slab of monocrystalline silicon (204, 304, 504, 604, 704, 804), -- a silicon dioxide layer (213, 313) formed on the slab of monocrystalline silicon (204, 304, 504, 604, 704, 804), and -- a rib (212, 312, 512, 612, 712, 812) of a silicon or polysilicon strip (212, 312) formed on the silicon dioxide layer (213, 313); - wherein the lateral PN diode (205, 305, 505, 605, 705, 805) comprises: -- first and second doped regions (220, 230, 320, 330, 520, 530, 620, 630, 720, 730, 820, 830) formed in the slab of monocrystalline silicon (204, 304, 504, 604, 704, 804), where the second doped region (230, 330, 530, 630, 730, 830) is oppositely charged to the first doped region (220, 320, 520, 620, 720, 820), -- first and second contacts (221, 231, 321, 331, 521, 531, 621, 631, 721, 731, 821, 831) formed in the respective first and second doped regions (220, 230, 320, 330, 520, 530, 620, 630, 720, 730, 820, 830) in the slab of monocrystalline silicon (204, 304, 504, 604, 704, 804), -- where a PN junction (206, 306, 506, 606, 706, 806) is formed at the boundary of the first and second doped regions (220, 230, 320, 330, 520, 530, 620, 630, 720, 730, 820, 830), and -- a depletion region at the PN junction is substantially in the center of a guided optical mode propagating through the rib waveguide (210, 310, 510, 610, 710, 810); and - wherein the slab of monocrystalline silicon (204, 304, 504, 604, 704, 804) and a silicon body of the CMOS transistor are formed from a same monocrystalline silicon layer of a substrate (201, 301, 501, 601, 701, 801); and - wherein the silicon dioxide layer (213, 313) and a gate oxide layer of the CMOS transistor are formed from a same silicon dioxide layer of the substrate (201, 301, 501, 601, 701, 801). - wherein the rib waveguide (210, 310, 510, 610, 710, 810) comprises: -- a slab of monocrystalline silicon (204, 304, 504, 604, 704, 804), -- a silicon dioxide layer (213, 313) formed on the slab of monocrystalline silicon (204, 304, 504, 604, 704, 804), and -- a rib (212, 312, 512, 612, 712, 812) of a silicon or polysilicon strip (212, 312) formed on the silicon dioxide layer (213, 313); -- a slab of monocrystalline silicon (204, 304, 504, 604, 704, 804), -- a silicon dioxide layer (213, 313) formed on the slab of monocrystalline silicon (204, 304, 504, 604, 704, 804), and -- a rib (212, 312, 512, 612, 712, 812) of a silicon or polysilicon strip (212, 312) formed on the silicon dioxide layer (213, 313); - wherein the lateral PN diode (205, 305, 505, 605, 705, 805) comprises: -- first and second doped regions (220, 230, 320, 330, 520, 530, 620, 630, 720, 730, 820, 830) formed in the slab of monocrystalline silicon (204, 304, 504, 604, 704, 804), where the second doped region (230, 330, 530, 630, 730, 830) is oppositely charged to the first doped region (220, 320, 520, 620, 720, 820), -- first and second contacts (221, 231, 321, 331, 521, 531, 621, 631, 721, 731, 821, 831) formed in the respective first and second doped regions (220, 230, 320, 330, 520, 530, 620, 630, 720, 730, 820, 830) in the slab of monocrystalline silicon (204, 304, 504, 604, 704, 804), -- where a PN junction (206, 306, 506, 606, 706, 806) is formed at the boundary of the first and second doped regions (220, 230, 320, 330, 520, 530, 620, 630, 720, 730, 820, 830), and -- a depletion region at the PN junction is substantially in the center of a guided optical mode propagating through the rib waveguide (210, 310, 510, 610, 710, 810); and -- first and second doped regions (220, 230, 320, 330, 520, 530, 620, 630, 720, 730, 820, 830) formed in the slab of monocrystalline silicon (204, 304, 504, 604, 704, 804), where the second doped region (230, 330, 530, 630, 730, 830) is oppositely charged to the first doped region (220, 320, 520, 620, 720, 820), -- first and second contacts (221, 231, 321, 331, 521, 531, 621, 631, 721, 731, 821, 831) formed in the respective first and second doped regions (220, 230, 320, 330, 520, 530, 620, 630, 720, 730, 820, 830) in the slab of monocrystalline silicon (204, 304, 504, 604, 704, 804), -- where a PN junction (206, 306, 506, 606, 706, 806) is formed at the boundary of the first and second doped regions (220, 230, 320, 330, 520, 530, 620, 630, 720, 730, 820, 830), and -- a depletion region at the PN junction is substantially in the center of a guided optical mode propagating through the rib waveguide (210, 310, 510, 610, 710, 810); and - wherein the slab of monocrystalline silicon (204, 304, 504, 604, 704, 804) and a silicon body of the CMOS transistor are formed from a same monocrystalline silicon layer of a substrate (201, 301, 501, 601, 701, 801); and - wherein the silicon dioxide layer (213, 313) and a gate oxide layer of the CMOS transistor are formed from a same silicon dioxide layer of the substrate (201, 301, 501, 601, 701, 801).