Mundarija:

DIY velosiped takometri: 5 qadam (rasmlar bilan)
DIY velosiped takometri: 5 qadam (rasmlar bilan)

Video: DIY velosiped takometri: 5 qadam (rasmlar bilan)

Video: DIY velosiped takometri: 5 qadam (rasmlar bilan)
Video: 5 AJOYIB LIFE HACKLARI №2 2024, Noyabr
Anonim
Image
Image
DIY velosiped takometri
DIY velosiped takometri

Men sizga velosiped tezligini o'lchash asbobini ko'rsataman. Bu sizning tezligingizni, o'rtacha tezligingizni, haroratni, sayohat vaqtini va umumiy masofani ko'rsatadi. Siz uni tugma yordamida o'zgartirishingiz mumkin. Bundan tashqari, tezlik takometrda ko'rsatiladi. Men uni qurdim, chunki men yangi narsalarni qurishni yaxshi ko'raman, men Internetda bunaqa narsani topmadim, shuning uchun men sizga qanday yaxshi tezlik o'lchagich qurishni ko'rsatmoqchiman, chunki velosipedim men xohlagan darajada salqin emas:). Shunday qilib, boshlaylik.

1 -qadam: qismlar:

Qismlar
Qismlar

Bu sizga kerak bo'ladigan qismlar ro'yxati. Ular menga taxminan 40 dollar turadi:

  • Arduino
  • Qamish kaliti bo'lgan velosiped
  • LCD displey 16x2
  • Servo
  • Non paneli
  • DS18B20 termometr
  • Rezistor 1,2k, 4,7k
  • O'tish
  • Tugma
  • Potentsiometr 10 kΩ
  • 9V batareya
  • Kabellar
  • Quti
  • Asboblar (matkap, lehim, pichoq, lenta)

2 -qadam: ulanish

Ulanish
Ulanish
Ulanish
Ulanish
Ulanish
Ulanish
Ulanish
Ulanish

Men Fritzingdan rasm qo'shdim va uni qanday ulash haqida og'zaki tavsif. Rasmda barcha qizil simlar 5V ga, barcha ko'k kabellar GND ga ulangan.

LCD displey:

VSS GND Arduino

VDP 5V Arduino

VO chiqish potentsiometr (VCC potentsiometr -> 5V Arduino, GND potentsiometr -> Arduino GND).

RS pin 12 Arduino

RW GND Arduino

E pin 11 Arduino

D4 pin 5 Arduino

D5 pin 4 Arduino

D6 pin 3 Arduino

D7 pin 2 Arduino

5V kuchlanishli Arduino

K GND Arduino

Servo:

VCC 5V Arduino

ommaviy GND Arduino

Ma'lumot pin 6 Arduino

Termometr:

VCC 5V Arduino

ommaviy GND Arduino

Ma'lumot pin 1 Arduino

ma'lumotlar va quvvat 4,7 kΩ rezistor orqali ulanadi

G'ildirakdagi sensor:

bir uchi -> 5V Arduino

ikkinchi uchi -> A0 Arduino va qarshilik 1, 2 kΩ

Rezistorning ikkinchi uchi Arduinoda erga ulanadi

Tugma:

bir uchi 5V Arduino

Ikkinchi uchi A1 Arduino

3 -qadam: Kodni yuklash:

Quyida men izohlarda kodni qo'shdim, tushuntirish bor.

Yuklab olish kutubxonalariga havolalar:

www.pjrc.com/teensy/arduino_libraries/OneWire.zip

github.com/milesburton/Arduino-Temperature-Control-Library

Agar sizda g'ildirak diametri boshqacha bo'lsa, uni o'zgartirish kerak. Siz uni quyidagi formula bilan hisoblashingiz mumkin:

sxema = π*d*2, 54 (d = g'ildirakning diametri, natijani metrda olish uchun uni 2,54 ga ko'paytirdim).

/*

######################################################################################### Mualliflik huquqi Nikodem Bartnik 2014 yil iyun ############################################# ###### */// kutubxonalar #qo'shish #qo'shish #qo'shish #qo'shish #ta'riflash ONE_WIRE_BUS 1 OneWire oneWire (ONE_WIRE_BUS); Dallas harorat sensori (& oneWire); // LCD displey pinlari LiquidCrystal lcd (12, 11, 5, 4, 3, 2); // servo nomi Servo myservo; // o'zgaruvchilarning ta'rifi ancha oldin, uch vaqt, vaqt, impulslar; suzuvchi tezlik o'lchagichi, dist, asped; int servo; int ekran = 1; // Agar sizda boshqa g'ildirak sxemasi bo'lsa, uni o'zgartiring float pallasi = 2.0; ikki tomonlama harorat; void setup () {lcd.begin (16, 2);

pinMode (A0, INPUT); pinMode (A1, Kirish); // servo ta'rifi va takometrni 0 ga o'rnatish myservo.attach (6); myservo.write (180); lcd.print ("Velosiped takometri"); kechikish (1000); lcd.setCursor (5, 1); lcd.print ("V 1.0"); kechikish (4000); lcd.clear (); kechikish (500); lcd.setCursor (0, 0); lcd.print ("Dist:"); } void loop () {// agar g'ildirak aylansa if (analogRead (A0)> = 300) {// burilishlar soni ++ impulslari ++; // burilish vaqtini hisoblash = (millis ()-oldingi); // tezlik o'lchagichini hisoblash = (davr /vaqt)*3600.0; oldingi = millis (); Takometr (); kechikish (100); } Lcd (); } // takometrda ko'rsatiladigan tezlik void Tachometer () {// xarita tezligi 0-180 ni servo tezlik o'lchagichiga = int (tezlik o'lchagich); servo = xarita (tezlik o'lchagichi, 0, 72, 180, 0); // servo myservo.write ni sozlash (servo); } void Lcd () {// tugmasi bosilganda, agar (analogRead (A1)> = 1010) {lcd.clear (); ekran ++; agar (ekran == 5) {ekran = 1; }} if (ekran == 1) {// tezlikni ko'rsatadi lcd.setCursor (0, 1); lcd.print ("Tezlik:"); lcd.setCursor (7, 1); lcd.print (tezlik o'lchagich); lcd.print ("km/soat"); } if (ekran == 2) {// harorat haroratini ko'rsatadi = sensors.getTempCByIndex (0); sensorlar.requestTemperatures (); lcd.setCursor (0, 1); lcd.print ("Harorat:"); lcd.setCursor (7, 1); lcd.print (harorat); lcd.print ("C"); } if (ekran == 3) {// averagr tezligini ko'rsatadi aspeed = dist/(millis ()/1000.0)*3600.0; lcd.setCursor (0, 1); lcd.print ("A. tezlik:"); lcd.setCursor (8, 1); lcd.print (asped); lcd.print ("km/soat"); } if (screen == 4) {// diplays trip time triptime = millis ()/60000; lcd.setCursor (0, 1); lcd.print ("Vaqt:"); lcd.setCursor (7, 1); lcd.print (uch marta); } lcd.setCursor (0, 0); lcd.print ("Dist:"); // masofani hisoblash dist = impulslar*sxemasi/1000.00; // masofani ko'rsatadi lcd.setCursor (6, 0); lcd.print (dist); lcd.print ("km"); }

4 -qadam: Paket

Paket
Paket
Paket
Paket
Paket
Paket

Qopqoq sifatida men 1 dollarga sotib olgan plastik qutidan foydalandim. Pichoq va matkap yordamida teshiklarni kesib tashladim. Servo va LCD displeyni men lenta bilan yopishtirdim, uchini kartondan yasadim va uni bo'yoq bilan bo'yadim. Men Corel Draw X5 -da qalqon qildim va uni chop etdim,-p.webp

5 -qadam: ishga tushiring

Yugur!
Yugur!
Yugur!
Yugur!
Yugur!
Yugur!
Yugur!
Yugur!

Endi u tayyor. Buning uchun uni yoqish va haydash kifoya. Tezlik o'lchagichingiz bilan xursand bo'ling. Agar sizga bu loyiha yoqsa, menga ovoz bering.

Tavsiya: