A sensor device (100; 200; 300; 400; 500) for sensing a property of a biological material, said sensor device (100; 200; 300; 400; 500) comprising: a biocompatible enclosure (102; 202; 302; 402; 502) defining at least one compartment (104, 106; 204, 206; 304, 306; 404; 504), the biocompatible enclosure (102; 202; 302; 402; 502) comprising a barrier (108; 208; 308; 408; 508) having a first surface and a second surface opposite to the first surface, wherein the barrier (108; 208; 308; 408; 508) is formed from biocompatible and electrically insulating material; at least one sensor receptor element (110; 210; 310; 410; 510) arranged at the first surface of the barrier (108; 208; 308; 408; 508); an electronic or photonic circuitry (114; 214; 314; 414; 514) comprising at least one sensor transducer element (116; 216; 316; 416; 516) for reading out signals from the at least one sensor receptor element (110; 210; 310; 410; 510), wherein the electronic or photonic circuitry (114; 214; 314; 414; 514) is arranged at the second surface of the barrier (108; 208; 308; 408; 508) and wherein the at least one sensor receptor element (110; 210; 310; 410; 510) and the at least one sensor transducer element (116; 216; 316; 416; 516) are configured to communicate through the barrier (108; 208; 308; 408; 508); and wherein the at least one compartment (104, 106; 204, 206; 304, 306; 404; 504) is configured to control transport of the biological material into the compartment (104; 204; 304; 404; 504) and wherein the at least one sensor receptor element (110; 210; 310; 410; 510) is arranged within the compartment (104; 204; 304; 404; 504); wherein the sensor device (100; 200; 300; 400; 500) is configured to be arranged with the at least one sensor receptor element (110; 210; 310; 410; 510) making contact with the biological material for sensing the property of the biological material and the electronic or photonic circuitry (114; 214; 314; 414; 514) comprising the at least one sensor transducer element (116; 216; 316; 416; 516) being protected from making contact with the biological material. a biocompatible enclosure (102; 202; 302; 402; 502) defining at least one compartment (104, 106; 204, 206; 304, 306; 404; 504), the biocompatible enclosure (102; 202; 302; 402; 502) comprising a barrier (108; 208; 308; 408; 508) having a first surface and a second surface opposite to the first surface, wherein the barrier (108; 208; 308; 408; 508) is formed from biocompatible and electrically insulating material; at least one sensor receptor element (110; 210; 310; 410; 510) arranged at the first surface of the barrier (108; 208; 308; 408; 508); an electronic or photonic circuitry (114; 214; 314; 414; 514) comprising at least one sensor transducer element (116; 216; 316; 416; 516) for reading out signals from the at least one sensor receptor element (110; 210; 310; 410; 510), wherein the electronic or photonic circuitry (114; 214; 314; 414; 514) is arranged at the second surface of the barrier (108; 208; 308; 408; 508) and wherein the at least one sensor receptor element (110; 210; 310; 410; 510) and the at least one sensor transducer element (116; 216; 316; 416; 516) are configured to communicate through the barrier (108; 208; 308; 408; 508); and wherein the at least one compartment (104, 106; 204, 206; 304, 306; 404; 504) is configured to control transport of the biological material into the compartment (104; 204; 304; 404; 504) and wherein the at least one sensor receptor element (110; 210; 310; 410; 510) is arranged within the compartment (104; 204; 304; 404; 504); wherein the sensor device (100; 200; 300; 400; 500) is configured to be arranged with the at least one sensor receptor element (110; 210; 310; 410; 510) making contact with the biological material for sensing the property of the biological material and the electronic or photonic circuitry (114; 214; 314; 414; 514) comprising the at least one sensor transducer element (116; 216; 316; 416; 516) being protected from making contact with the biological material.