Treat Flux like your intern. Tell it what you'd like to build and it'll get to work. You can also ask it questions, brainstorm ideas, and teach it your preferences. Learn More
Para conectar un sensor que tenga una entrada analógica y dos salidas digitales con el MCP3008, aquí tienes una guía más completa.
Supongamos que el sensor tiene las siguientes características:
Entrada Analógica (IN)
Dos Salidas Digitales (OUT1, OUT2)
Alimentación (VCC)
Tierra (GND)
Podríamos conectar la salida analógica del sensor a una de las entradas analógicas del MCP3008 y las salidas digitales a pines GPIO del Raspberry Pi. Vamos a suponer que el sensor requiere 5V para funcionar.
ConexionesMCP3008
VDD (Pin 16) a 3.3V
VREF (Pin 15) a 3.3V
AGND (Pin 14) a GND
CLK (Pin 13) al Pin 23 (GPIO11/SCLK)
DOUT (Pin 12) al Pin 21 (GPIO9/MISO)
DIN (Pin 11) al Pin 19 (GPIO10/MOSI)
CS/SHDN (Pin 10) al Pin 24 (GPIO8/CE0)
DGND (Pin 9) a GND
CH0 (Pin 1) a la salida del sensor
Sensor
VCC a 5V
GND a Tierra
IN al canal CH0 del MCP3008 (Pin 1)
OUT1 a un GPIO del Raspberry Pi, ejemplo (GPIO17, Pin 11)
OUT2 a otro GPIO del Raspberry Pi, ejemplo (GPIO27, Pin 13)
Voy a crear una imagen que represente las conexiones mencionadas.
Conexiones:
MCP3008:16 (VDD) a 3.3V.
MCP3008:15 (VREF) a 3.3V.
MCP3008:14 (AGND) a GND.
MCP3008:13 (CLK) al Raspberry Pi:Pin 23 (GPIO11/SCLK).
MCP3008:12 (DOUT) al Raspberry Pi:Pin 21 (GPIO9/MISO).
MCP3008:11 (DIN) al Raspberry Pi:Pin 19 (GPIO10/MOSI).
MCP3008:10 (CS/SHDN) al Raspberry Pi:Pin 24 (GPIO8/CE0).
MCP3008:9 (DGND) a GND.
MCP3008:1 (CH0) a la salida del sensor (IN).
Sensor:VCC a 5V.
Sensor:GND a GND.
Sensor:OUT1 al Raspberry Pi:Pin 11 (GPIO17).
Sensor:OUT2 al Raspberry Pi:Pin 13 (GPIO27).
Voy a proceder a crear la imagen de estas conexiones.
albertitodj
albertitodj
copilot
albertitodj
copilot
- VDD (Pin 16) a 3.3V
- VREF (Pin 15) a 3.3V
- AGND (Pin 14) a GND
- CLK (Pin 13) al Pin 23 (GPIO11/SCLK)
- DOUT (Pin 12) al Pin 21 (GPIO9/MISO)
- DIN (Pin 11) al Pin 19 (GPIO10/MOSI)
- CS/SHDN (Pin 10) al Pin 24 (GPIO8/CE0)
- DGND (Pin 9) a GND
- CH0 (Pin 1) a la salida del sensor
Sensor