- 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>:
推薦閱讀
- SQL Server 2016 數據庫教程(第4版)
- Python絕技:運用Python成為頂級數據工程師
- 輕松學大數據挖掘:算法、場景與數據產品
- 區塊鏈:看得見的信任
- Python數據分析:基于Plotly的動態可視化繪圖
- 大話Oracle Grid:云時代的RAC
- Remote Usability Testing
- Instant Autodesk AutoCAD 2014 Customization with .NET
- Power BI智能數據分析與可視化從入門到精通
- Spark分布式處理實戰
- MySQL DBA修煉之道
- 商業智能工具應用與數據可視化
- 算力經濟:從超級計算到云計算
- Scratch 2.0 Game Development HOTSHOT
- 碼上行動:利用Python與ChatGPT高效搞定Excel數據分析