The virtual world example uses a TCS3200 color sensor and a HC-SR04 ultrasonic distance meter. When a colored paper is placed in front of the color sensor, the rgb (red, green, blue) components of the paper color are acquired. Then the HC-SR04 is used to measure the distance between the paper and the setup.
The photo shows the HC-SR04 distance meter on the left and the TCS3200 color sensor with its illumination LEDs on the right. The TCS3200 is mounted on top of the CPU board.
The color and distance information is used to create a virtual world, showing the sensors and the paper with its correct color. When the paper is moved away from the setup, this is reflected in the virtual world. When a paper with a different color is inserted, this also changes the color of the virtual paper in the virtual world.
A TCS3200 color sensor is used to determine the paper color. You find a description of it on the TCS3200 page. A driver for the color sensor as well as a few test programs are available.
The HC-SR04 distance measurement is described on the HC-SR04 page.
vpython allows to easily create 3d images with basic geometrical objects like
I | Attachment | History | Action | Size | Date | Who | Comment |
---|---|---|---|---|---|---|---|
![]() |
hc_sr04.png | r1 | manage | 546.4 K | 2022-05-30 - 18:56 | UliRaich | |
![]() |
virtualWorld.png | r1 | manage | 17.2 K | 2022-05-30 - 19:50 | UliRaich |