A diamond voltage imaging microscope

Technologies that capture the complex electrical dynamics occurring in biological systems, across fluid membranes and at solid–liquid interfaces are important for furthering fundamental understanding and innovation in diverse fields from neuroscience to energy storage. However, the capabilities of existing voltage imaging techniques utilizing microelectrode arrays, scanning probes or optical fluorescence methods are limited by resolution, scan speed and photostability, respectively. Here we report an optoelectronic voltage imaging system that overcomes these limitations by using nitrogen-vacancy defects as charge-sensitive fluorescent reporters embedded within a transparent semiconducting diamond device. Electrochemical tuning of the diamond surface termination enables photostable optical voltage imaging with a quantitative linear response at biologically relevant voltages and timescales. This technology represents a major step towards label-free, large-scale and long-term voltage recording of physical and biological systems with sub-micrometre spatial resolution. Nitrogen-vacancy centres in surface-engineered diamond are demonstrated to operate as charge-sensitive fluorescent reporters, enabling an optical scheme for voltage recording in physical and biological systems.

T he development of fluorescent molecular sensors for imaging voltage changes in biological systems has revolutionized neuroscience, providing a tool to capture neuronal activity over large areas with sub-neuron resolution both in vitro and in vivo [1][2][3] . However, the poor photostability of molecular voltage sensors limits recording times to a few minutes [1][2][3][4] , posing problems for longitudinal studies of network evolution and disease processes. These limitations mean that lower-resolution techniques such as multielectrode arrays (MEAs) remain predominant tools in neuroscientific research 5,6 , disease modelling, drug discovery and safety pharmacology. By embedding fluorescent, charge-sensitive defects within a transparent semiconducting substrate, solution voltage imaging can, in principle, be realized by the optical detection of local changes in the near-surface semiconductor space-charge layer. Changes to this space-charge layer are known to modulate the fluorescence of defects by altering the number of electrons bound to each, otherwise known as the charge state of the defect [7][8][9] . Such a hybrid optoelectronic approach has been proposed 10 and would occupy a voltage imaging regime unexplored to date, combining the spatial resolution of optical techniques with the long-term stability and minimal invasiveness of MEAs. The nitrogen-vacancy (NV) defect in diamond-a fluorescent atom-scale point defectis bright 11 , photostable 12 and possesses three optically distinguishable charge states known to be responsive to voltage changes in solution 10,13,14 , making it an ideal candidate system for developing this approach. As a substrate, a diamond is biocompatible 15,16 and has well-developed nanofabrication pathways [17][18][19] , meaning the proposed technique could potentially be applied to both intracellular 20,21 and extracellular 16,22 recording. In addition, the chemical inertness of diamond 23 suggests that this approach to voltage imaging could enable time-resolved electrochemical microscopy, complementing the scanning probe techniques currently employed in the characterization of energy storage materials in a wide range of liquid electrolytes 24,25 .
In this work, we realize optoelectronic voltage imaging with ensembles of NV centres by engineering the near-surface electrostatic environment of diamond for responsiveness to external potentials. We first establish precise electrochemical control of the diamond surface termination, which we use to tune the ensemble charge state population to an optimal composition for voltage sensing consisting exclusively of the fluorescent neutral (NV 0 ) and non-fluorescent positive (NV + ) states. This approach minimizes background fluorescence, avoids spectral overlap between NV 0 and negative (NV -) state that would otherwise act to impede sensitivity 13,26 , and eliminates any requirement for d.c. biasing 10 . We then demonstrate the capabilities of our diamond voltage imaging microscope (DVIM) by performing the real-time imaging of capacitive charge injection by a microelectrode in solution. Finally, we show that this sensing mechanism can be replicated and enhanced in an array of diamond nanopillar optrodes, each possessing sub-millisecond fluorescence response times and two orders of magnitude greater voltage sensitivity than previously demonstrated using NV centres 10,13,14 .

Results
Fabrication and operating principles. Our devices consist of high-density (HD) (of the order of 10 16 -10 17 cm -3 ) ultrashallow (≈7 nm) NV ensembles formed by ion implantation into ultrapure single-crystal diamond wafers (Methods). The diamonds are hydrogen terminated by indirect exposure to hydrogen plasma ( Supplementary Fig. 1), which prevents the hydrogen passivation of shallow NV centres 27,28 and renders the diamond surface electrically conductive in atmosphere via the formation of a two-dimensional hole gas 29,30 . The devices are mounted within custom-built fluid wells (Fig. 1a), which feature a planar platinum (Pt) electrode used to apply solution potentials for characterization while fluorescence excitation and collection are simultaneously performed from below. As indicated by the grey region in Fig. 1b, hydrogenation of the diamond surface results in the loss of virtually all detectable fluorescence, indicating the full conversion of NV ensemble to the dark NV + state. The charge state of an NV centre is determined by the position of the Fermi level, E F , relative to the adiabatic charge state transition energies (Fig. 1c). The layer of negatively charged adsorbates that forms on the hydrogenated surface creates a strong electrostatic field that shifts these transition energies upwards relative to E F (ref. 31 ), a phenomenon known as near-surface band bending (NSBB) 30 . The combination of an ultrashallow NV ensemble and the low bulk defect concentration of the diamond material used enables surface transfer doping to cause appreciable changes in E F , forcing it below the NV 0/+ transition (Fig. 1d). Even slightly deeper NV ensembles with the same areal density show some population of NV 0 following hydrogenation ( Supplementary Fig. 1), which explains why dense ensembles of NV + were previously thought to be intractable 13 .
Optimizing the performance of the voltage sensor requires a population of fluorescent NV centres whose change in fluorescence in response to an external solution voltage is maximally visible against their own shot noise. We realize precise control over the NV 0 population by pulsed electrochemical oxidation of the diamond surface in phosphate-buffered saline (PBS) interleaved with in situ measurements of voltage sensitivity. Each oxidative voltage pulse (Fig. 1e) strips a small fraction of hydrogen atoms from the diamond surface, likely replacing them with hydroxyl groups 32 . This reduces the equilibrium density of negative surface adsorbates and therefore the NSBB. As band bending is incrementally reduced, the population of the bright NV 0 state increases ( Supplementary Fig. 1) as its adiabatic charge state transition energy passes through the Fermi level at shallower depths 33 , which alters the fluorescence response of the device to an applied voltage while concurrently increasing the emitted photon shot noise. After each oxidative pulse, the voltage sensitivity η is measured and quantified according to the following (Supplementary Note 1): where the fluorescence contrast is estimated with the relation ΔI/I 0 = βΔV, ΔI is the measured change in the fluorescence count rate, I 0 is the fluorescence at 0 V and ΔV is the change in solution potential. As shown in Fig. 1f, the initial surface oxidation pulses concurrently increase the fluorescence contrast and NV 0 population until the voltage response plateaus in an optimal sensitivity region. At this point, the surface is partially oxidized (Fig. 1g, left) with E F intersecting the NV 0/+ transition within the shallow implanted region (Fig. 1g, right). The partially oxidized diamond surface retains sufficient conductivity to allow for solvated charges to build up within an electrolytic double layer 34 on the application of a solution voltage. As experimentally shown in Fig. 1h, positive solution voltages reduce the upwards band bending, increasing the NV 0 population and fluorescence intensity, whereas negative solution voltages have the opposite effect. Integrating the raw spectra reveals a fluorescence response that is well approximated by a linear function across a range of gate voltages of around ±50 mV ( Supplementary Fig. 1). For samples oxidized well beyond their maximum sensitivity, we begin to observe NV -/0 interconversion ( Supplementary Fig. 1). However, the sensitivity of such a configuration is limited by low contrast resulting from the spectral overlap between NVand NV 0 emissions.

Imaging microelectrode charge injection in solution.
To verify the localized solution voltage imaging capabilities of the DVIM, we used it to image the spatiotemporal voltage transient resulting from the application of a voltage step to a proximal microelectrode 35 . Figure 2a illustrates the experimental setup: an insulated Pt/Ir microelectrode with an exposed tip diameter of ≈8 µm ( Supplementary Fig. 2)    Fig. 1 shows the raw spectra) showing the near-complete loss of NV emission following hydrogenation and conversion of the ensemble to the dark NV + state. c, Relevant NV charge state transition energies relative to the diamond valence band. d, Schematic of NSbb and NV charge state population density (solid fill) for hydrogen-terminated diamond. e, electrochemical oxidation pulse used to strip a controlled amount of hydrogen termination. f, Voltage sensitivity evolution of a sacrificial diamond sample with electrochemical oxidation of the hydrogenated surface. g,h, electronic configuration (g) and solution gate-voltage dependence (h) of the fluorescence emission of a sensor near optimum sensitivity. A 580 nm long-pass filter was used to remove the first-order Raman line from these spectra.
was positioned as close to the diamond surface as possible without contact in a dilute buffered saline solution (Methods). Before the measurement of microelectrode signals, the voltage response of the imaged chip area was calibrated using d.c. voltages applied via the large Pt ring electrode (Methods). Figure 2b demonstrates the DVIM response within a dynamic range of ±70 mV, from which linear fits of the responses at each pixel can be used to construct a calibration map (Fig. 2c). A signal generator was used to apply 100 mV between the microelectrode and diamond surface while NV fluorescence was recorded using an inverted wide-field fluorescence microscope and a scientific complementary metal-oxide-semiconductor camera. This voltage is low enough to ensure the two surfaces behave as ideally polarizable electrodes (negligible Faradaic current flows between the two) 32 . The applied voltage signal and corresponding full-frame fluorescence are shown in Fig. 2d.
At time t > 0, positive charge begins to accumulate on the diamond surface directly underneath the microelectrode tip, resulting in increased fluorescence. The maximum at t = 30 ms occurs when the rate at which charge accumulates at the diamond surface is balanced by the rate at which it is laterally transported out of the field of view by diffusive processes. For t > 30 ms, ions continue spreading radially outwards until they are evenly distributed across the diamond surface. Select frames showing the localized buildup and subsequent spreading of charge from under the electrode tip are shown in Fig. 2e. These images were captured at 167 frames per second with an effective pixel mapping of approximately 5.5 µm and were converted from raw fluorescence images to voltage images using a calibration map (Fig. 2c). Figure 2f shows the radial averages (centred on the microelectrode tip location) of the voltage measured by the DVIM for a selection of times following the voltage step as well as the baseline measurement (red squares, bottom) preceding the step. We found that an equivalent RC circuit model yields very good agreement with our measurements, providing verification that the DVIM accurately reports the underlying solution charge dynamics. Our model (Supplementary Methods 1) contains three parameters: bulk solution resistivity κ S , diamond surface capacitance C D and specific surface resistance κ D accounting for the tangential flow of charge along the diamond surface. These parameters were varied to fit the simulated time dynamics sensitivity, we implement a straightforward approach for increasing light collection by patterning the DVIM surfaces with arrays of nanopillars to act as fluorescence waveguides 19 . Figure 3a shows a scanning electron microscopy image of a diamond sensor surface with an array of 700 nm-diameter pillars produced by reactive ion etching (Methods). As evidenced by Fig. 3b, these diamond 'optrodes' provide a tenfold increase in photon collection efficiency from our shallow NV 0 ensembles. Variations in fluorescence intensity from the optrodes shown in the image result from variations in wide-field laser excitation, as confirmed by the uniform brightness of the optrodes when observed with scanning confocal microscopy ( Supplementary Fig. 3). Figure 3c demonstrates the photostability of the optrodes, with no degradation of the fluorescence signal amplitude detected over 40 s of continuous recording as a 20 mV square wave was applied to the sample in PBS using the Pt ring electrode. We also note that no degradation of sensing performance was observed over the period during which the measurements of this device were performed (more than four months; Supplementary  Fig. 4). We confirmed that the linearity of the sensor response was preserved following nanofabrication both at the single-optrode level and over the aggregate field of view ( Supplementary Fig. 3). We observed an increase in the overall fluorescence contrast of the optrodes (Fig. 3d) compared with the flat surface. This effect was confirmed by measuring the voltage responses of circular test structures spanning two orders of magnitude in diameter that we fabricated on the same diamond sample (Supplementary Fig. 3). As we employed an oil-immersion objective lens for sensitivity characterizations, we primarily attribute this phenomenon to a reduction in the relative contribution of static background fluorescence originating from the immersion oil itself (Supplementary Fig. 1) to the fluorescence signals.
To evaluate the temporal response of the DVIM, an avalanche photodiode (APD) was used to capture the fluorescence dynamics from the illuminated area on the application of 3 ms square-wave voltage pulses with varying amplitudes from the large Pt counterelectrode. Unlike the microelectrode measurements described above, here we used a highly conductive buffered saline solution to minimize the RC time constant of the overall circuit. Figure 3e shows the extracted rise-and fall-time constants, whereas the inset shows a representative fluorescence response time trace. These responses are well fit by exponential functions and yield time constants consistent with capacitive charging of the diamond surface rather than NV charge state transition rates, which are expected to be <1 µs (ref. 26 ). As this charging time is limited by the diamond surface resistivity, it could be reduced in future devices by fabricating surface electrical contacts closer to the sensing region. The measured fluorescence response time of <300 µs corresponds to the maximum operating frequency of around 3 kHz. This knowledge allows us to reliably measure the noise spectral density of the DVIM as our camera is operated at its highest possible frame rate (over 128 × 128 pixels) of 1.6 kHz. Figure 3f displays the noise spectral density of a single optrode and a 9.25 µm × 9.25 µm area (Fig. 3d, white square). Above ≈10 Hz, the measured noise floors show no apparent dependence on frequency and are consistent with the photon shot-noise limits predicted by equation (1), which are denoted by dashed lines. DVIM sensitivity. From the measured noise power spectra, we obtain a sensitivity of 55 µV Hz -1/2 per optrode or 77 µV µm Hz -1/2 , accounting for the interpillar pitch of 1.4 µm. This value, more than six times the sensitivity of the unpatterned area of the same sample, could be further improved to 42 µV µm Hz -1/2 by reducing the pitch to 900 nm and utilizing hexagonal close-packed arrays in future devices. Diamond nanopillar structures are particularly attractive for electrophysiological applications due to their ability to facilitate close contact with cultured neurons 16 . With this use case in mind, Fig. 4a compares our measured optrode sensitivities with established technologies for the voltage imaging of neuronal cultures in vitro. Neuro-electrophysiological recordings can be broadly classified into three distinct modalities depending on the nature of the sensor-neuron interface. Planar sensors can be used to measure extracellular voltage signals with minimal perturbation to the cells in question. However, they provide poor confinement of transmembrane currents, which results in low signal powers that can only be detected by the most sensitive techniques, indicated by those occupying the region below the violet line in Fig. 4a. When protruding features can be engulfed by cultured cells, resulting in a well-sealed fluid cleft between the sensor and membrane, a class of higher-power 'quasi-intracellular' signals can be accessed 37 . Bringing the sensor into direct contact with the cytoplasm allows for the detection of intracellular APs. These exhibit the highest signal powers 20,21,38 and thus impose the least demanding requirements on sensitivity, as indicated by the region beneath the magenta line in Fig. 4a. The sensitivity of DVIM technology (Fig. 4a, red and blue squares) lies below the threshold for intracellular neuronal recording at the single-optrode resolution, but is not presently sufficient for (real-time) high-resolution quasi-intracellular (Supplementary Table 2) or extracellular measurements. To gauge the prospects for voltage sensing using the charge state modulation of diamond colour centres, we estimated a technologically feasible upper limit on the sensitivity of a single-diamond optrode using NV 0/+ sensing (Fig. 4a, green square) based on the implementation of established material and apparatus optimizations (Supplementary Note 3). The limit of sensitivity using charge state interconversion between NV 0 and NV + of around 375 nV Hz -1/2 for a single optrode ( Supplementary Fig. 5) is comparable to state-of-the-art HD MEAs, but offers more than one order of magnitude greater spatial resolution. In addition, the optical readout mechanism is not subject to the same restrictions on the total number of active recording channels as MEAs 39 , potentially allowing higher volumes of information to be extracted from dense neuronal cultures. To model local bioelectrical charge injection and verify our calculated sensitivities, we developed a protocol to generate voltage signals at the diamond surface with timescales and amplitudes commensurate with neuronal activity. This was achieved in three steps. First, a micromanipulator was used to manoeuvre a Pt/iridium (Ir) microelectrode to within 2 µm of the sensor surface. Second, the solution conductivity was adjusted from pure deionized water by adding PBS until the signals applied by the microelectrode elicited a sub-millisecond fluorescence response. Finally, to compensate for the shunting of injected charge to the solution ground and spatial fall-off of the signal produced by the microelectrode 40 , the amplitude of the applied voltage signal was increased until potential changes equivalent to the measured intracellular 21 action potential events were detected. Figure 4b shows the detection of 30 mV, 1 ms square-wave voltage pulses applied at a 10 Hz repetition rate (400 mV applied to the microelectrode) over a 4 × 4 optrode array. This restricted area (5.6 µm × 5.6 µm) allowed for a camera recording rate of 2 kHz, sufficient to observe sub-millisecond fluorescence response times (Supplementary Fig. 6). We also note that the applied signal was resolvable at the single-optrode level ( Supplementary  Fig. 6). To demonstrate that sub-millivolt detection is presently only limited by the photon shot noise, we gated our measurements to the applied signals and averaged the results over several trials, a practice for which a precedent exists for high-resolution mapping of extracellular signal propagation 40,41 . Figure 4c shows the resulting detected voltage traces integrated over a flat region (1.7 µm × 1.7 µm), indicating a peak voltage of less than 800 µV at the sensor surface (5 mV applied to the microelectrode). The region of interest can also be broken into sixteen 425 nm sub-regions, thereby demonstrating voltage recording with sub-micrometre resolution. This represents a 20 times improvement over current HD MEA systems and is around twice the diffraction limit of our microscopy apparatus (≈215 nm). The averaged result of 2,000 trials is shown in Fig. 4c for clarity, but we note that the signal was resolvable after around 200 trials ( Supplementary Fig. 6).

Discussion
We have demonstrated an optical voltage imaging sensor with a quantitative linear response utilizing the transitions of diamond NV centres between their neutral and positive charge states. Our method is made possible through tailored control over the NV ensemble charge state populations via electrochemical tuning of the diamond surface termination. This technology circumvents the need for on-chip readout circuitry, enabling resolutions more than twenty times higher than complementary metal-oxide-semiconductor HD MEAs as parallel readout is enabled from, in principle, as many channels as there are pixels available on modern scientific cameras (>1 million). Diamond voltage imaging microscopy can be immediately utilized in fundamental studies where the complex electrokinetic dynamics of diffuse liquids 42 preclude or complicate the use of single-point probe measurements [43][44][45] , and may enable time-resolved imaging studies of battery systems 24,25 . Practical application of this technique to electrophysiology will likely require  adhesion-promoting coatings to improve cell survival rates 46 and enhance signal strength via biological seal resistance 22 . The cationic nature of these coatings could conceivably cause changes to near-surface NV responses 47 ; however, our testing has shown no deleterious effects (Supplementary Note 4). Long-term photostability, rapid response of NV emissions and the transparency of diamond make DVIMs an attractive platform for the future studies of neuronal network formation and function, where the transparent substrate can be leveraged to enable multimodal voltage imaging with, for instance, transcriptional 48,49 , structural 50 or metabolomic 51 tags, as well as all-optical closed-loop systems utilizing optogenetic stimulation 52,53 .
Recent advances in large-area single-crystal diamond wafer synthesis 54 and in neuronal culturing on diamond surfaces and nanopillars 16 provide optimism that DVIMs can be realized as a competitive in vitro electrophysiological platform. On the near-term horizon, nanowire optrodes (<200 nm in diameter) may provide intracellular access 21,38 , whereas newly developed diamond dry-etching techniques 55,56 can be used to fabricate arrays of mushroom-like optrodes 37 for quasi-intracellular recordings. Looking ahead, although substantial (yet realistic) improvements in diamond materials engineering would be required (Supplementary Note 3  and Supplementary Table 4), we predict that voltage imaging using charge state transitions of fluorescent colour centres will enable label-free extracellular imaging of neuronal network dynamics with deep sub-cellular resolution.

online content
Any methods, additional references, Nature Research reporting summaries, source data, extended data, supplementary information, acknowledgements, peer review information; details of author contributions and competing interests; and statements of data and code availability are available at https://doi.org/10.1038/ s41566-022-01064-1.

Methods
Sensor fabrication. HD near-surface NV ensembles were created via 2 keV implants of 14 N ions at a dose of 10 13 cm -2 and an incidence angle of 7° (InnovIon) into commercial chemical-vapour-deposited electronic-grade <100> diamond wafers (Element Six), which were then annealed in a vacuum (≈10 -5 torr) at 950 °C for 4 h. The samples were initially oxygen terminated by boiling in a hot mixture of sulphuric acid and sodium nitrate for 30 min. Ti/Pt 15/50 nm electrical contacts were patterned on the diamond surface via photolithography using the TI 35E photoresist in image-reversal mode. Nanopillar arrays were fabricated via oxygen-plasma reactive ion etching: patterns were exposed in a layer of PMMA A8 (Kayaku Advanced Materials) using electron-beam lithography, and etch masks composed of a 10/125 nm Cr/Au bilayer were deposited by electron-beam evaporation and lift-off. Reactive ion etching was performed using an Oxford Instruments PLASMALAB 100 ICP380 system. A two-step oxygen-plasma etching process was used, the first step being performed at 10 mtorr, 50 s.c.c.m. gas flow rate and 600 W of ICP power with 30 W radio-frequency power for 10 min. In the second step, which was run for 30 min, the flow rate was increased to 60 s.c.c.m. and the radio-frequency power was reduced to 10 W. The samples were hydrogen terminated by indirect exposure to hydrogen plasma in a microwave plasma-enhanced chemical-vapour-deposition diamond growth reactor (Seki), where indirect exposure was achieved by shielding the samples from the plasma ball with a perforated molybdenum shell ( Supplementary Fig. 1).

Sensitization and characterization.
Custom-built fluid wells were fabricated by patterning glass coverslips with a thickness of 50 µm with a Pt ring counterelectrode and a Pt stripline for contacting the diamond samples. The coverslips were attached to custom printed circuit boards with circular cutouts using commercial two-part epoxy resin. Silicone fluid wells were made by pouring two-part silicone rubber into custom moulds. The bases of the moulds were flat enough that the resulting silicone wells would spontaneously form a watertight seal on contact with the glass coverslips. The samples were mounted to the coverslips with a thin layer of optically transparent, non-fluorescent silicone rubber (SYLGARD 184, Dow Corning) and electrical contact between the samples and Pt stripline was made using conductive silver epoxy (CircuitWorks). The cured silver epoxy was then encapsulated with silicone to prevent Faradaic short-circuiting of the applied voltage signals through the solution.
All the voltage signals used in this work were applied using a Rigol DG4162 function/arbitrary waveform generator. The diamond devices were sensitized in PBS solution (137.0 mM NaCl, 10.0 mM phosphate, 2.7 mM KCl, pH 7.4; osmolarity, 280-310 mOsm kg -1 ; Gibco Thermo Fisher) by the repeated application of oxidative voltage pulses (Fig. 1e) applied between a Pt counterelectrode and the diamond until the device sensitivity plateaued. The sensitivity was calculated from the measured fluorescence responses to 50 mV peak-to-peak square-wave voltage pulses applied through the counterelectrode using equation (1). For microelectrode experiments, commercial deionized water (Honeywell) was mixed with a small amount of PBS to create a dilute conductive solution in which the measurements were performed. The microelectrode (rounded tip Pt/Ir electrode from Microprobes for Life Science) was positioned just above the diamond surface using a manual micromanipulator by first bringing the tip into contact with the surface as determined by a local change in diamond fluorescence at the tip location due to contact potential difference. The tip was then lifted off the surface until the local fluorescence change vanished and was allowed to settle for 20 min before measurement to ensure that no movement of the electrode occurred during recording. Through bright-field imaging of the microelectrode (Fig. 2a), we confirmed that the tip was situated within half the focal depth of our microscope objective from the surface (approximately 5 µm).

Fluorescence measurements.
Fluorescence was excited with a 200 mW, 532 nm laser (Coherent Verdi) and collected through either a coverslip-corrected air objective with ×20 magnification (numerical aperture, 0.8; roughly 0.3 kW cm -2 ) for microelectrode imaging measurements or an oil-immersion objective with ×40 magnification (numerical aperture, 1.4; roughly 0.6 kW cm -2 ) for optrode array measurements, chip sensitization and per-area sensitivity measurements. For per-area sensitivity measurements, only a small area at the centre of the excitation laser spot where diamond fluorescence was the brightest was considered for both optrode array (Fig. 3d, highlighted region) and flat surface (Fig. 3d, inset). The collected light was split with a 560 nm dichroic mirror and filtered with either a 580 nm long-pass filter (camera measurements and spectra in Fig. 1h) or a 545 nm long-pass filter (spectra in Fig. 1b). Spectroscopy was performed with a fibre-coupled spectrometer (Ocean Insight Flame), whereas fluorescence video was recorded using a scientific complementary metal-oxide-semiconductor camera (ANDOR Neo) that was thermoelectrically cooled to -40 °C. APD measurements were performed with a fibre-coupled single-photon-counting unit (Excelitas Technologies). Spectrometer and camera readings were corrected by the subtraction of background/dark counts measured without laser illumination. Diamond fluorescence spectra (Fig. 1b) have had the diamond Raman scattering and non-diamond background fluorescence removed for clarity; the original spectra are shown in Supplementary Fig. 1.
Raw fluorescence images F(t) with a solution gate voltage applied were converted to fluorescence contrast f c images via where ΔF = 〈F(t) -F 0 〉 and F 0 is the baseline fluorescence measured with the sensor and any external electrodes grounded.
Voltage response characterization. Calibration of the DVIM voltage response was performed with voltages applied between the large Pt counterelectrode (Fig.  1a) and the sensor. For microelectrode measurements, calibration was performed in the same dilute solution as the recordings, although similar responses to calibrations in PBS were observed. The voltage was stepped 15 times in increments of 10 mV, from 0 V to -70 mV, then to 70 mV and back to 0 V, with a step period of ≈25 s. The sensor fluorescence was recorded over a 768 × 768 pixel region at ten frames per second. Pixels in the calibration video were binned to match the binning of pixels in the processed recording data (32 × 32 pixels for the data displayed in Fig. 2). For each pixel, the average fluorescence for the last 15 s of each voltage step was fit as a linear function of the applied voltage using least-squares regression (polyfit from the NumPy library running in Python 3) to extract gradients m and offsets b of the linear functions as well as the co-variance matrix for the fit Γ. Per-pixel fluorescence contrasts f c and uncertainties ẟf c were then calculated as Calibration was performed in PBS for optrode array measurements. Here 2 Hz square waves with one half-period at 0 V and the other half-period at ±2 mV, ±5 mV and from ±10 to ±50 mV (steps of 10 mV) were applied for 10 s. Fluorescence was recorded over 1,024 × 1,024 pixel regions at almost ten frames per second. The pixels belonging to each optrode were binned using a circular Hough transform algorithm 46 before further processing. The fluorescence histogram of each optrode was fit with the sum of two Gaussian lineshapes, namely, g(x,x1,x2, σ1, σ2, A1, A2), where x, σ and A denote the mean, standard deviation and integrated area of each Gaussian, respectively, obtained using the nonlinear least-squares curve-fitting function available from the scipy.optimize library. The per-optrode fluorescence contrasts and their uncertainty were then computed via The fluorescence contrast responsivities were then calculated by fitting straight-line functions with a zero intercept to f c as a function of the excursion voltage from 0 V ( Supplementary Fig. 3).
Radial averages (Fig. 2f) were weighted with the estimated standard deviation (quadrature sum of percentage contrast error ẟf c and estimated per-pixel noise). The radius assigned to a pixel was calculated as the integer floor of the true radius at the innermost corner of each pixel (with respect to the pixel chosen as the centre point). The error bars shown are 95% confidence intervals determined from the Student's t-test using a weighted radial standard deviation.
Fitting of APD measurements. Measurements of the DVIM response time in PBS performed with an APD used aggregate fluorescence collected from an ≈200 µm circular illuminated region of the sample. Due to the finite conductivity of the hydrogen-terminated diamond surface, we expect the fluorescence response of the DVIM (which results from the re-equilibration of the two-dimensional hole gas density in response to a change in density of the solvated charges at the diamond surface) to exhibit an RC-like time constant. However, the varying proximity of each point in the illuminated area to the Ti/Pt electrical contact on the sample surface means that we also expect a small amount of variation in the equilibration time constant between each point. To capture this effect on the aggregate fluorescence measured with the APD, we fit the measured response curves with stretched exponential functions that can account for a distribution of response times within the illuminated area 57 . These functions S(t) take the following form: