pibot:lesson2
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
pibot:lesson2 [2021/06/19 14:53] – Added more tips jstruebel | pibot:lesson2 [2022/10/20 19:53] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Objective ====== | ||
+ | |||
+ | This lesson will show you how to make the PiBot follow a line on the ground. First it will show you how to add the Infrared (IR) sensors to the PiBot. Then it will show you how to program the PiBot to follow a line. Finally it will describe how the electronics let the PiBot " | ||
+ | |||
+ | ====== Parts Required ====== | ||
+ | |||
+ | The parts below are required to complete this lesson. Note that all parts except the foam board and optional hardware are included in the [[https:// | ||
+ | |||
+ | - Assembled PiBot from [[: | ||
+ | - OSOYOO Sensor 5-Channel IR Tracker Board | ||
+ | - 7-pin 25cm Female to Female Jumper Wires | ||
+ | - 3cm Wide Black Tape | ||
+ | - 3/16 inch thick White Foam Board or Corrugated Plastic Yard Signs | ||
+ | - Hardware | ||
+ | - M2.5x5mm Plastic Screws | ||
+ | - M2.5x5mm+6mm Hex Plastic Pillars | ||
+ | - M2.5 Hex Plastic Nuts | ||
+ | - Optional Hardware | ||
+ | - M2.5x5mm Hex Cap Screws | ||
+ | - M2.5x5mm+6mm Hex Brass Pillars | ||
+ | - M2.5 Hex Nuts | ||
+ | |||
+ | ====== Hardware Assembly ====== | ||
+ | |||
+ | <WRAP round important> | ||
+ | |||
+ | <WRAP round tip>When installing items with multiple screws or nuts, leave them loose until all are installed and then tighten to ensure that you can get them all inserted</ | ||
+ | |||
+ | - Install the IR tracker board on the bottom chassis with 2pcs M2.5x5mm screws, M2.5x5mm+6mm pillars, and M2.5 nuts from the hardware kit as shown below\\ \\ <WRAP round tip> | ||
+ | - Connect the IR tracker board to the PCA9685 compatible board and Raspberry Pi board as shown below\\ \\ <WRAP round tip> | ||
+ | ^ IR Tracker Board ^ PCA9685 Module | ||
+ | | @-lightgrey: | ||
+ | | @-brown: | ||
+ | | @-blue: | ||
+ | | @-green: | ||
+ | | @-yellow: | ||
+ | | @-red: | ||
+ | | @-black: | ||
+ | </ | ||
+ | - Lay out a path on the foam board with the black tape\\ \\ <WRAP round tip>Use small lengths of the clear packing tape to join multiple pieces of the foam board together to make a larger area for your maze. Place the tape on the top of the foam board for one joint and on the bottom of the foam board for the next joint so that you can fold it up like a Z and store it flat.</ | ||
+ | - Turn the PiBot on and place it so that some of the IR sensors are over the black tape and some are over the white foam board as shown below\\ \\ <WRAP box>{{ : | ||
+ | - Use a screwdriver to adjust the blue potentiometer on the IR tracker board until the LEDs above the white foam board are off while the LEDs above the black tape are on as shown below\\ \\ <WRAP box>{{ : | ||
+ | |||
+ | ====== Software ====== | ||
+ | |||
+ | Select the appropriate link below for instructions to setup the software on the PiBot and an exploration of how it works. | ||
+ | |||
+ | * [[: | ||
+ | * [[: | ||
+ | |||
+ | ====== Electrical Description ====== | ||
+ | |||
+ | The OSOYOO IR Tracker board has 5 IR sensors on on the bottom that sense the surface under the PiBot. Each sensor has a light that shines down toward the surface and a detector that senses the reflected light. The light from the sensor is Infrared (IR) which is a color that humans cannot see. | ||
+ | |||
+ | The sensor outputs a voltage that varies based on how much light is reflected back to it. When a lot of light is reflected back then the voltage is lower. Since the black tape absorbs most of the light but the white foam board reflects some of the light, the voltage from the sensor is lower for the white foam board than it is for the black tape. | ||
+ | |||
+ | The voltage from each sensor is fed into a Schmitt trigger inverter chip. When the Schmitt trigger inverter chip senses its input voltage below a threshold, it outputs a high voltage. Similarly when the Schmitt trigger inverter chip senses its input voltage above the threshold it outputs a low voltage. The threshold is usualy around half of the supply voltage of the chip. The blue potentiometer allows the voltages from the IR sensors to be adjusted so that they are above and below the threshold of the inverter chip. | ||
+ | |||
+ | The output of the Schmitt trigger inverter chip is connected to the Raspberry Pi GPIO inputs so that the software can tell when each sensor is over the black tape or the white foam board. | ||
+ | |||
+ | [[: | ||
+ | |||