Tags:
create new tag
view all tags

Combining the Real World with the Virtual World

Before we have seen how to read out the color sensor and and how to determine the distance between the colored paper and the ultra-sonic distance sensor. We also saw how to create a virtual world with VPython. All that is left now is combing both parts.

Here is a photo of the hardware setup

In front you see the HC-SR04 ultra-sonic distance sensor (the one with the two cylinders sticking out) and the color sensor (the one with the black guard ring and the 4 LEDs). Behind the distance sensor you see an rgb LED on the left and a level converter on the right, converting the 5V TTL output signals from the distance and the color sensors to 3.3 V needed by the Raspberry Pi.

Here are the connections:

The HC-SR04 distance sensor:

Vcc 5V  
Trig gpio 23  
Echo gpio 24 via the level converter
Gnd Gnd  

The rgb LED

+ 3.3V
red gpio 17
green gpio 22
blue gpio 18
The TCS34200 color sensor

Gnd Gnd  
Out gpio 19 via the level converter
S2 gpio 13  
S4 gpio 26  
Vcc 5V  
Gnd nc  
LED gpio 21  
S0 gpio 26  
S1 gpio 12  
Vcc nc  
-- Uli Raich - 2018-03-07

Comments


Topic attachments
ISorted ascending Attachment History Action Size Date Who Comment
PNGpng fullSetup.png r1 manage 1315.7 K 2018-03-07 - 10:34 UliRaich  
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2018-04-24 - UliRaich
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback