Answers.Body: <p>This part has been <a href="https://rebrickable.com/parts/37308/sensor-color-spike/15/" rel="nofollow noreferrer">included in a number of sets</a> since its first use in 2020, including SPIKE sets from LEGO Education as well as the Robot Inventor set. It's purpose is to detect reflected light color, reflected light intensity, or ambient light intensity. Because it can detect reflected light, it can be used as a short-range distance sensor.</p>
  <p>We can slide the white and black portions of this element apart to reveal a single PCB inside. Here's the bottom view of the PCB:</p>
  <p><a href="https://i.sstatic.net/kDWvi.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/kDWvi.jpg" alt="PCB bottom" /></a></p>
  <p>The primary microcontroller on board appears to be an <a href="https://www.st.com/en/microcontrollers-microprocessors/stm8s105k6.html" rel="nofollow noreferrer">STM8S105K6</a>. This is an 8-bit MCU with 32 Kbytes Flash, a 16 MHz CPU, and integrated EEPROM for program storage.</p>
  <p>The other smaller components provide support for the main chip and RGB sensor as well as drivers for the LEDs on the board.</p>
  <p>On the top side of the PCB we have the remaining electronic components:</p>
  <p><a href="https://i.sstatic.net/bXaas.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/bXaas.jpg" alt="PCB Top View" /></a></p>
  <p>On the top side, we have 3 surface mount LEDs to provide illumination and a central RGB sensor. I believe that this sensor is a <a href="https://cdn-shop.adafruit.com/datasheets/TCS34725.pdf" rel="nofollow noreferrer">TCS3472</a> or something very similar based on its pinout, function, and shape. This part is able to detect light intensity and hue, but it has extremely limited resolution. Here's a diagram of the photodiode array:</p>
  <p><a href="https://i.sstatic.net/heDwM.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/heDwM.png" alt="Photodiode array diagram" /></a></p>
  <p>This might look like a very low-resolution camera sensor, but the individual photodiodes are averaged internally. Here's what the datasheet says:</p>
  <blockquote>
  <p>The TCS3472 light-to-digital converter contains a 3 × 4 photodiode array, four analog-to-digital converters (ADC) that integrate the photodiode current, data registers, a state machine, and an I 2C interface. The 3 × 4 photodiode array is composed of red-filtered, Green-filtered, blue-filtered, and clear (unfiltered) photodiodes. In addition, the photodiodes are coated with an IR-blocking filter. The four integrating ADCs simultaneously
  convert the amplified photodiode currents to a 16-bit digital value. Upon completion of a conversion cycle, the results are transferred to the data registers, which are double-buffered to ensure the integrity of the data. All of the internal timing, as well as the low-power wait state, is controlled by the state machine.</p>
  </blockquote>
  <p>While this averaging setup may improve sensitivity and accuracy, it does not allow the individual photodiodes in the 3x4 array to be accessed. This sensor is certainly not a camera in any meaningful way. It does not appear to be possible to use this sensor to detect even crude shapes, only color and intensity of light.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-04-22T16:36:09.597Z
Answers.Text: LEGO Education also has a technical specification document on this sensor (although it isn't very technical). https://education.lego.com/en-us/product-resources/spike-prime/downloads/technical-specifications/
Answers.UserDisplayName: David Lechner
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-04-20T00:29:13.037Z
Answers.LastActivityDate: 2024-04-20T16:55:26.217Z
Answers.LastEditDate: 2024-04-20T16:55:26.217Z
Answers.UserDisplayName: jncraton
Body: <p>What components are inside the <a href="https://rebrickable.com/parts/37308/sensor-color-spike/15/" rel="nofollow noreferrer">color sensor (37308)</a>?</p>
  <p><a href="https://i.sstatic.net/pEGWi.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/pEGWi.png" alt="Element photo" /></a></p>
  <p>Can this part be used as a camera, or is it simply a light sensor?</p>
  
Tags: <powered-up><spike-prime><sensor-colour><robot-inventor>
Title: Does the color sensor use a camera?
UserDisplayName: jncraton
ThreadText: # Does the color sensor use a camera?
  
  (Asked by: username_0 on 2024-04-20)
  
  What components are inside the [color sensor (37308)](https://rebrickable.com/parts/37308/sensor-color-spike/15/)?
  
  [![Element photo](https://i.sstatic.net/pEGWi.png)](https://i.sstatic.net/pEGWi.png)
  
  Can this part be used as a camera, or is it simply a light sensor?
  
  **Tags:** powered-up, spike-prime, sensor-colour, robot-inventor
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2024-04-20. Score: 3
  
  This part has been [included in a number of sets](https://rebrickable.com/parts/37308/sensor-color-spike/15/) since its first use in 2020, including SPIKE sets from LEGO Education as well as the Robot Inventor set. It's purpose is to detect reflected light color, reflected light intensity, or ambient light intensity. Because it can detect reflected light, it can be used as a short-range distance sensor.
  
  We can slide the white and black portions of this element apart to reveal a single PCB inside. Here's the bottom view of the PCB:
  
  [![PCB bottom](https://i.sstatic.net/kDWvi.jpg)](https://i.sstatic.net/kDWvi.jpg)
  
  The primary microcontroller on board appears to be an [STM8S105K6](https://www.st.com/en/microcontrollers-microprocessors/stm8s105k6.html). This is an 8-bit MCU with 32 Kbytes Flash, a 16 MHz CPU, and integrated EEPROM for program storage.
  
  The other smaller components provide support for the main chip and RGB sensor as well as drivers for the LEDs on the board.
  
  On the top side of the PCB we have the remaining electronic components:
  
  [![PCB Top View](https://i.sstatic.net/bXaas.jpg)](https://i.sstatic.net/bXaas.jpg)
  
  On the top side, we have 3 surface mount LEDs to provide illumination and a central RGB sensor. I believe that this sensor is a [TCS3472](https://cdn-shop.adafruit.com/datasheets/TCS34725.pdf) or something very similar based on its pinout, function, and shape. This part is able to detect light intensity and hue, but it has extremely limited resolution. Here's a diagram of the photodiode array:
  
  [![Photodiode array diagram](https://i.sstatic.net/heDwM.png)](https://i.sstatic.net/heDwM.png)
  
  This might look like a very low-resolution camera sensor, but the individual photodiodes are averaged internally. Here's what the datasheet says:
  
  > The TCS3472 light-to-digital converter contains a 3 × 4 photodiode array, four analog-to-digital converters (ADC) that integrate the photodiode current, data registers, a state machine, and an I 2C interface. The 3 × 4 photodiode array is composed of red-filtered, Green-filtered, blue-filtered, and clear (unfiltered) photodiodes. In addition, the photodiodes are coated with an IR-blocking filter. The four integrating ADCs simultaneously
  > convert the amplified photodiode currents to a 16-bit digital value. Upon completion of a conversion cycle, the results are transferred to the data registers, which are double-buffered to ensure the integrity of the data. All of the internal timing, as well as the low-power wait state, is controlled by the state machine.
  
  While this averaging setup may improve sensitivity and accuracy, it does not allow the individual photodiodes in the 3x4 array to be accessed. This sensor is certainly not a camera in any meaningful way. It does not appear to be possible to use this sensor to detect even crude shapes, only color and intensity of light.
  
  > **Comments:**
  > **username_1**: LEGO Education also has a technical specification document on this sensor (although it isn't very technical). https://education.lego.com/en-us/product-resources/spike-prime/downloads/technical-specifications/  
  
  ---
  
  