<acronym id="s8ci2"><small id="s8ci2"></small></acronym>
<rt id="s8ci2"></rt><rt id="s8ci2"><optgroup id="s8ci2"></optgroup></rt>
<acronym id="s8ci2"></acronym>
<acronym id="s8ci2"><center id="s8ci2"></center></acronym>

電子發燒友App

硬聲App

0
  • 聊天消息
  • 系統消息
  • 評論與回復
登錄后你可以
  • 下載海量資料
  • 學習在線課程
  • 觀看技術視頻
  • 寫文章/發帖/加入社區
創作中心

完善資料讓更多小伙伴認識你,還能領取20積分哦,立即完善>

3天內不再提示
電子發燒友網>電子資料下載>電子資料>智能垃圾管理開源硬件

智能垃圾管理開源硬件

2023-02-01 | zip | 0.02 MB | 次下載 | 免費

資料介紹

描述

現在是時候寫下智慧城市的定義了。與其祖先一樣,智慧城市現在具備成為現實的所有因素。從農業革命和后來的工業革命中發展起來的城市受到類似因素的驅動——人口增長和技術進步促進并推動了生活條件的改變。現代城市也有這些相同的因素,但規模要大得多;如前所述,全球人口呈指數級增長,我們需要應對的方法。

人口對資源的壓力是使我們當前的城市模型更加智能化的一個主要因素。而且,這樣做的技術最終以超連接、改進和更便宜的傳感器、人工智能和數據分析的形式出現。這里的線索就在數據中;數據是現代智慧城市的新能源。數據,或者更確切地說,對這些數據的分析和應用,將成為智慧城市發展的支點。因此,智慧城市應該結合多種技術來改善城市的重要方面和任務,例如監測水和空氣、廢物管理、停車、照明和車輛。

在這個項目中,我們專注于借助智能垃圾箱和 IOTA tangle 改善一個地區(包括許多智能城市)的智能垃圾管理,以加快智能垃圾管理的進程,減少擁堵、污染,并幫助改善能源優化。

廢物管理的主要問題之一是未優化的垃圾收集卡車路線。未優化的卡車路線會導致使用過多的燃料并在人口稠密的城市造成擁堵。此外,有些垃圾箱可能會因此而被裝滿而其他垃圾箱則可能因此而裝滿。所以我們真正要解決的是垃圾收集車路線的優化,以避免擁堵和過度使用燃料。

這就是該項目的運作方式。我們在垃圾箱中連接填充液位傳感器,持續監測垃圾箱內的填充液位。在每天早上的固定時間(比如早上 7 點),數據會上傳到 tangle。垃圾車司機能夠使用合適的設備從節點檢索數據,并且他可以優化卡車路線。

硬件組件

iota_6j37c6c23f_XtUnIfLkVn.jpg?auto=compress%2Cformat&w=740&h=555&fit=max
硬件設置
?

1.紅外接近傳感器

可以使用下圖解釋紅外傳感器作為物體檢測傳感器的原理。紅外傳感器由紅外 LED 和紅外光電二極管組成;它們一起被稱為光電耦合器或光電耦合器。

當 IR 發射器發射輻射時,它會到達物體,并且一些輻射會反射回 IR 接收器。根據 IR 接收器的接收強度,定義傳感器的輸出。

ir-sensor-working_x5xOvm0HXa.png?auto=compress%2Cformat&w=740&h=555&fit=max
紅外傳感器工作
?

IR 接近傳感器用作液位傳感器。接近傳感器放置在垃圾箱頂部附近的垃圾箱內。

iota2_h997fuo3ck_RlvD8tLLOi.jpg?auto=compress%2Cformat&w=740&h=555&fit=max
帶液位傳感器的垃圾桶
?

一旦垃圾箱裝滿,傳感器返回 1,否則返回 0。(超聲波傳感器可以代替使用并且被廣泛使用。為簡單起見,我們使用 IR 接近傳感器。)

2.樹莓派

樹莓派是用于將數據發布到 tangle 的板。對于每個垃圾箱,我們都將 Raspberry Pi zero 與紅外接近傳感器連接起來。傳感器監控填充水平,Raspberry Pi 會在每天早上的預定時間將數據歸零發布到 tangle。

layout_bb_Qd8u7V3VnU.jpg?auto=compress%2Cformat&w=740&h=555&fit=max
用樹莓派 3 填充杠桿傳感器
?

軟件組件

1.蟒蛇

Python 是一種解釋型、高級、通用的編程語言。我們使用 python 構建整個項目。

2. PyOTA:IOTA Python API 庫

這是 IOTA 核心的官方 Python 庫。它實現了官方 API以及新提出的功能(例如簽名、捆綁、實用程序和轉換)。

3.漂亮的桌子

PrettyTable 是一個簡單的 Python 庫,旨在使在視覺上吸引人的 ASCII 表格中快速輕松地表示表格數據。

程序

1. 安裝樹莓派

通過安裝 Raspbian OS 或任何其他合適的操作系統來設置 Raspberry Pi。如果需要,請遵循教程。

2. 安裝所需軟件

如果之前未安裝,請下載并安裝Python 3.5或更高版本。然后安裝其他庫,如PyOTAPrettyTable。

如果安裝了 pip,請在終端中輸入以下命令來安裝庫。

pip install pyota

pip install PrettyTable

3.創建IOTA地址

我們可以使用 IOTA 手機錢包創建一個 IOTA 錢包地址。使用 IOTA 錢包生成新地址或在https://thetangle.org上搜索現有地址時,您會找到一個二維碼。

whatsapp_image_2019-04-23_at_12_25_02_pm_fOKMuoATkP.jpeg?auto=compress%2Cformat&w=740&h=555&fit=max
設置 IOTA 錢包地址
?

4.代碼

我們有兩個用于該項目的 python 代碼。一個在與傳感器連接的 Raspberry Pi 零上運行。這段 python 代碼不斷地從傳感器讀取數據,并將箱子編號和箱子的狀態發送給 tangle。

sensorread.py

#Developed by CodersCafe
from datetime import datetime
import time
import schedule
import RPi.GPIO as GPIO
  
#Setup sensor as input
sensor1 = 16
sensor2  = 12
  
GPIO.setmode(GPIO.BOARD)
GPIO.setup(sensor1,GPIO.IN)
GPIO.setup(sensor2,GPIO.IN)
# Import the PyOTA library
import iota
# Import json
import json
# Define IOTA address where all transactions  are stored, replace with your own address.
# IOTA addresses can be created with the IOTA Wallet
Addr = b"RLLQQVU9ZPWF9EPOVTJ9AXVJOBQWJWDPGGMALZQANY9GWR99XPITQJQBVLYCX9XLGIGLB9TBUNDTDWYBZACGWGQSLZ"

# Create IOTA object, specify full node to be used when sending transactions.  
api = iota.Iota("https://nodes.thetangle.org:443")
  
# Define static variable
city = "Smart City"
  
#Define the post function
def datapost():
   FinalBundle = api.send_transfer(depth=3, transfers=[pta], min_weight_magnitude=14)['bundle']
   FinalBundle = api.send_transfer(depth=3, transfers=[ptb], min_weight_magnitude=14)['bundle']
   print("Success")
  
#Schedule data  posting at 7 am
schedule.every().day.at("07:00").do(datapost)
  
#Main loop
try:
   while True:
       # Show welcome message
       print("\n Welcome to Smart City")
       print("Press Ctrl+C to exit the system")
       # Get bin number
       bin_number1 = sensor1
       print ("bin number = ",bin_number1)
       bin_number2 = sensor2
       print ("bin number = ",bin_number2)
       # Get status from bins
       id1 = GPIO.input(sensor1)
       if id1==1:
           status="Full"
       else:
           status="Not Full"
       id2 = GPIO.input(sensor2)
       if id1==1:
           status="Full"
       else:
           status="Not Full"        
       # Create json data to be uploaded to the tangle
       data1 = {'city': city, 'bin_number': bin_number1,'Status': status}
       data2 = {'city': city, 'bin_number': bin_number2,'Status': status}
       # Define new IOTA transaction
       pta = iota.ProposedTransaction(address = iota.Address(Addr),
                                     message = iota.TryteString.from_unicode(json.dumps(data1)),
                                     tag     = iota.Tag(b'SMARTCITY'),
                                     value   = 0)
       ptb = iota.ProposedTransaction(address = iota.Address(Addr),
                                     message = iota.TryteString.from_unicode(json.dumps(data2)),
                                     tag     = iota.Tag(b'SMARTCITY'),
                                     value   = 0)
       schedule.run_pending()
       time.sleep(50) 
# Clean up function when user press Ctrl+C (exit)
except KeyboardInterrupt:
   GPIO.cleanup()

另一個 python 代碼由垃圾車司機或任何其他授權人員使用。此代碼從 tangle 中讀取數據并以綜合方式顯示 bin 的數據。

displaydata.py

#Developed by CodersCafe
# Imports from the PyOTA library
from iota import Iota
from iota import Address
from iota import Transaction
from iota import TryteString

# Import json library
import json

# Import datetime libary
import datetime

# Import from PrettyTable
from prettytable import PrettyTable

# Define IOTA address where all transactions are stored, replace with your own address.
address = [Address(b'RLLQQVU9ZPWF9EPOVTJ9AXVJOBQWJWDPGGMALZQANY9GWR99XPITQJQBVLYCX9XLGIGLB9TBUNDTDWYBZACGWGQSLZ')]

# Define full node to be used when retrieving cleaning records
iotaNode = "https://nodes.thetangle.org:443"

# Create an IOTA object
api = Iota(iotaNode)

# Create PrettyTable object
x = PrettyTable()

# Specify column headers for the table
x.field_names = [ "city", "bin_number","Status", "last_time"]

# Find all transacions for selected IOTA address
result = api.find_transactions(addresses=address)

# Create a list of transaction hashes
myhashes = result['hashes']

# Print wait message
print("Please wait while retrieving data from the tangle...")

# Loop trough all transaction hashes
for txn_hash in myhashes:
   # Convert to bytes
   txn_hash_as_bytes = bytes(txn_hash)
   # Get the raw transaction data (trytes) of transaction
   gt_result = api.get_trytes([txn_hash_as_bytes])
   # Convert to string
   trytes = str(gt_result['trytes'][0])
   # Get transaction object
   txn = Transaction.from_tryte_string(trytes)
   # Get transaction timestamp
   timestamp = txn.timestamp
   # Convert timestamp to datetime
   last_time = datetime.datetime.fromtimestamp(timestamp).strftime('%Y-%m-%d %H:%M:%S')
   # Get transaction message as string
   txn_data = str(txn.signature_message_fragment.decode())
   # Convert to json
   json_data = json.loads(txn_data)
   # Check if json data has the expected json tag's
   if all(key in json.dumps(json_data) for key in ["city","bin_number","Status"]):
       # Add table row with json values
       x.add_row([json_data['city'], json_data['bin_number'], json_data['Status'], last_time])

# Sort table by cleaned datetime
x.sortby = "last_time"

# Print table to terminal
print(x)

5.工作

將 IR 傳感器連接到 Raspberry Pi 零,并將液位傳感器放入垃圾箱內。然后在樹莓派零中運行代碼sensorread.py,讓它永遠工作,它會在每天早上的固定時間無縫返回填充水平狀態。

然后在 Android 設備或計算機(或其他 Raspberry Pi)中運行代碼 displaydata.py。它將顯示帶有箱號及其填充水平狀態的數據。通過查看數據,駕駛員可以優化卡車路線。

?

?


下載該資料的人也在下載 下載該資料的人還在閱讀
更多 >

評論

查看更多

下載排行

本周

  1. 1山景DSP芯片AP8248A2數據手冊
  2. 1.06 MB  |  532次下載  |  免費
  3. 2RK3399完整板原理圖(支持平板,盒子VR)
  4. 3.28 MB  |  339次下載  |  免費
  5. 3TC358743XBG評估板參考手冊
  6. 1.36 MB  |  330次下載  |  免費
  7. 4DFM軟件使用教程
  8. 0.84 MB  |  295次下載  |  免費
  9. 5元宇宙深度解析—未來的未來-風口還是泡沫
  10. 6.40 MB  |  227次下載  |  免費
  11. 6迪文DGUS開發指南
  12. 31.67 MB  |  194次下載  |  免費
  13. 7元宇宙底層硬件系列報告
  14. 13.42 MB  |  182次下載  |  免費
  15. 8FP5207XR-G1中文應用手冊
  16. 1.09 MB  |  178次下載  |  免費

本月

  1. 1OrCAD10.5下載OrCAD10.5中文版軟件
  2. 0.00 MB  |  234315次下載  |  免費
  3. 2555集成電路應用800例(新編版)
  4. 0.00 MB  |  33566次下載  |  免費
  5. 3接口電路圖大全
  6. 未知  |  30323次下載  |  免費
  7. 4開關電源設計實例指南
  8. 未知  |  21549次下載  |  免費
  9. 5電氣工程師手冊免費下載(新編第二版pdf電子書)
  10. 0.00 MB  |  15349次下載  |  免費
  11. 6數字電路基礎pdf(下載)
  12. 未知  |  13750次下載  |  免費
  13. 7電子制作實例集錦 下載
  14. 未知  |  8113次下載  |  免費
  15. 8《LED驅動電路設計》 溫德爾著
  16. 0.00 MB  |  6656次下載  |  免費

總榜

  1. 1matlab軟件下載入口
  2. 未知  |  935054次下載  |  免費
  3. 2protel99se軟件下載(可英文版轉中文版)
  4. 78.1 MB  |  537798次下載  |  免費
  5. 3MATLAB 7.1 下載 (含軟件介紹)
  6. 未知  |  420027次下載  |  免費
  7. 4OrCAD10.5下載OrCAD10.5中文版軟件
  8. 0.00 MB  |  234315次下載  |  免費
  9. 5Altium DXP2002下載入口
  10. 未知  |  233046次下載  |  免費
  11. 6電路仿真軟件multisim 10.0免費下載
  12. 340992  |  191187次下載  |  免費
  13. 7十天學會AVR單片機與C語言視頻教程 下載
  14. 158M  |  183279次下載  |  免費
  15. 8proe5.0野火版下載(中文版免費下載)
  16. 未知  |  138040次下載  |  免費
亚洲欧美日韩精品久久_久久精品AⅤ无码中文_日本中文字幕有码在线播放_亚洲视频高清不卡在线观看
<acronym id="s8ci2"><small id="s8ci2"></small></acronym>
<rt id="s8ci2"></rt><rt id="s8ci2"><optgroup id="s8ci2"></optgroup></rt>
<acronym id="s8ci2"></acronym>
<acronym id="s8ci2"><center id="s8ci2"></center></acronym>