- Internet of Things Programming with JavaScript
- Rubén Oliva Ramos
- 149字
- 2021-04-02 20:31:20
Connecting analog inputs using an MCP3008 ADC Converter
If we want to connect analog sensors to the Raspberry Pi, we need to use an Analog-to-Digital Converter (ADC). The board doesn't have analog inputs; we use the MCP3008 to connect analog sensors. This is a 10-bit ADC and has eight channels. This means that you can connect up to eight sensors that can be read from the Raspberry Pi Zero. We don't need special components to connect them. They can be connected with SPI to the Raspberry Pi's GPIOs.
The first step is to enable SPI communication:
- Access the Raspberry Pi terminal and type the following command:
sudo raspi-config
- Select Advanced Options, as shown in the following screenshot:
- Enable SPI communication by selecting the SPI option:
- Select <Yes> to enable the SPI interface:
- The final screen looks like the following screenshot when we enable the SPI interface. Select <Ok>:
推薦閱讀
- 從零開始學Hadoop大數據分析(視頻教學版)
- 云計算環境下的信息資源集成與服務
- Mastering Ninject for Dependency Injection
- Spark大數據分析實戰
- Modern Programming: Object Oriented Programming and Best Practices
- 深入淺出數字孿生
- MySQL 8.x從入門到精通(視頻教學版)
- Spark大數據編程實用教程
- 數據庫技術實用教程
- 高維數據分析預處理技術
- 圖數據實戰:用圖思維和圖技術解決復雜問題
- Power BI智能數據分析與可視化從入門到精通
- 活用數據:驅動業務的數據分析實戰
- 大數據技術原理與應用:概念、存儲、處理、分析與應用
- 改變未來的九大算法