composants:rpi_proxi_sensor

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
composants:rpi_proxi_sensor [2020/06/22 16:01] – [General] mhcomposants:rpi_proxi_sensor [2020/06/23 20:32] (current) – [Steps] mh
Line 7: Line 7:
 ==== Components ==== ==== Components ====
  
-  *Sharp 2Y0A21F Infrared sensor +  *[[composants:2Y0A21|Sharp 2Y0A21F Infrared sensor]] 
-  *MCP3008 ADC+  *[[composants:mcp3008|MCP3008 ADC]] 
 +  *Raspberry Pi - any model
   *Breadboard, jumpers, etc.   *Breadboard, jumpers, etc.
  
Line 15: Line 16:
 {{composants:sharp_mcp_wiring.png?400}} {{composants:sharp_mcp_wiring.png?400}}
  
 +<WRAP 50%>
 +|^  RPi Pin #^   ^Role  ^  MCP3008 Pin #^  ^Role  |
 +|  1|    |3.3V|  16|  |VDD  |
 +|  1|    |3.3V  |  15|  |VREF  |
 +|  6|    |GND  |  14|  |AGND  |
 +|  19|    |GPIO 10 (MOSI)  |  11|  |DIN  |
 +|  21|    |GPIO 9 (MISO)  |  12|  |DOUT  |
 +|  23|    |GPIO 11 (SLCK)  |  13|  |CLK  |
 +|  24|    |GPIO 8 (CE0)  |  10|  |CS/SHDN  |
 +|  6|    |GND  |  9|  |DGND  |
 +</WRAP>
  
 +There are two different wirings, this one is for hardware SPI. Another one is used for software SPI
 +
 +{{composants:mcp3008pin.jpg?250}}
 +
 +===== Steps =====
 +
 +  *Installed raspbian
 +  *Activated SPI in raspi-config
 +  *wired a MCP3008 and a sharp IR module to the GPIO pins
 +  *followed tuto on python but did not get data from module (read 0.00)
 +  *rewired to software SPI (needs documenting)
 +  *installed rust in tty with lightdm stopped
 +<code bash>
 +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
 +</code>
 +  *reboot to activate rust
 +  *
 ===== Ressources ===== ===== Ressources =====
  
   *[[https://tutorials-raspberrypi.com/infrared-distance-measurement-with-the-raspberry-pi-sharp-gp2y0a02yk0f/|Blog post Tutorial]]   *[[https://tutorials-raspberrypi.com/infrared-distance-measurement-with-the-raspberry-pi-sharp-gp2y0a02yk0f/|Blog post Tutorial]]
  • composants/rpi_proxi_sensor.1592834498.txt.gz
  • Last modified: 2020/06/22 16:01
  • by mh