Cov txheej txheem:

DIY Bike Tachometer: 5 Kauj Ruam (nrog Duab)
DIY Bike Tachometer: 5 Kauj Ruam (nrog Duab)

Video: DIY Bike Tachometer: 5 Kauj Ruam (nrog Duab)

Video: DIY Bike Tachometer: 5 Kauj Ruam (nrog Duab)
Video: 10 самых АТМОСФЕРНЫХ мест Дагестана. БОЛЬШОЙ ВЫПУСК #Дагестан #ПутешествиеПоДагестану 2024, Hlis ntuj nqeg
Anonim
Image
Image
DIY Tsheb kauj vab Tachometer
DIY Tsheb kauj vab Tachometer

Kuv yuav qhia koj yuav tsim lub ntsuas tsheb kauj vab li cas. Nws qhia koj qhov nrawm, qhov nruab nrab nrawm, ntsuas kub, sijhawm mus ncig thiab qhov nrug deb li cas. Koj tuaj yeem hloov nws siv lub pob. Ib qho ntxiv, qhov nrawm tau qhia ntawm lub tachometer. Kuv ua nws vim kuv nyiam tsim cov khoom tshiab, Kuv tsis tau pom ib yam dab tsi zoo li no hauv is taws nem yog li kuv xav qhia koj yuav ua li cas thiaj tsim lub ntsuas hluav taws xob zoo li ib qho ntawm kuv lub tsheb kauj vab tsis zoo li kuv xav:). Yog li cia peb pib.

Kauj Ruam 1: Qhov:

Qhov
Qhov

Nov yog cov npe uas koj yuav xav tau. Lawv raug kuv li $ 40:

  • Arduino
  • Tsheb kauj vab nrog reed hloov
  • LCD zaub 16x2
  • Servo
  • Cov qhob cij
  • Tus pas ntsuas kub DS18B20
  • Resistor 1.2k Ω, 4.7k Ω
  • Hloov
  • Khawm
  • Potentiometer 10 kΩ
  • 9V roj teeb
  • Cov kab
  • Lub thawv
  • Cov cuab yeej (laum, soldering, riam, kab xev)

Kauj ruam 2: Kev sib txuas

Kev sib txuas
Kev sib txuas
Kev sib txuas
Kev sib txuas
Kev sib txuas
Kev sib txuas
Kev sib txuas
Kev sib txuas

Kuv ntxiv ib daim duab los ntawm Fritzing thiab hais lus piav qhia yuav ua li cas txuas nws. Hauv daim duab txhua lub xov tooj liab tau txuas nrog 5V, txhua lub xov tooj liab txuas nrog GND.

LCD zaub:

VSS GND Arduino

VDP 5V Arduino

VO tso zis potentiometer (potentiometer VCC -> 5V Arduino, potentiometer GND -> Arduino GND).

RS pin 12 Arduino

RW GND Arduino

E pin 11 Arduino

D4 tus pin 5 Arduino

D5 tus pin 4 Arduino

D6 tus pin 3 Arduino

D7 tus pin 2 Arduino

A 5V Arduino

K GND Arduino

Kev pab:

VCC 5V Arduino

pawg GND Arduino

Cov ntaub ntawv tus pin 6 Arduino

Tus pas ntsuas kub:

VCC 5V Arduino

pawg GND Arduino

Cov ntaub ntawv tus pin 1 Arduino

cov ntaub ntawv thiab lub zog txuas nrog ntawm 4.7 kΩresistor

Sensor ntawm lub log:

ib kawg -> 5V Arduino

thib ob kawg -> A0 Arduino thiab tus tiv thaiv 1, 2 kΩ

Lwm qhov kawg ntawm tus tiv thaiv rau hauv av hauv Arduino

Khawm:

ib kawg 5V Arduino

thib ob kawg A1 Arduino

Kauj ruam 3: Upload Code:

Hauv qab no kuv ntxiv cov cai hauv cov lus muaj kev piav qhia.

txuas mus rau rub cov tsev qiv ntawv:

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

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

Yog tias koj muaj lub log log sib txawv koj yuav tsum hloov nws. Koj tuaj yeem suav nws nrog cov mis no:

Circuit = π*d*2, 54 (d = txoj kab uas hla ntawm koj lub log, Kuv muab nws sib npaug 2.54 kom tau txais txiaj ntsig hauv meters).

/*

####################################### Copyright los ntawm Nikodem Bartnik lub rau hli ntuj 2014 ########################################### ###### */// librarys #include #include #include #include #define ONE_WIRE_BUS 1 OneWire oneWire (ONE_WIRE_BUS); DallasTemperature sensors (& oneWire); // LCD zaub pins LiquidCrystal lcd (12, 11, 5, 4, 3, 2); // servo lub npe Servo myservo; // txhais ntawm qhov hloov pauv ntev dhau los, triptime, sijhawm, kev xav; float speedometer, deb, aspeed; koj servo; int npo = 1; // Yog tias koj muaj lwm lub voj voog ntawm lub log koj xav tau hloov nws ntab Circuit = 2.0; kub ob npaug; teeb tsa tsis muaj dab tsi () {lcd.begin (16, 2);

pinMode (A0, INPUT); pinMode (A1, INPUT); // servo txhais thiab teeb lub tachometer rau 0 myservo.attach (6); myservo.write (180); lcd.print ("Tsheb tuam tachometer"); ncua (1000); lcd.setCursor (5, 1); lcd.print ("V 1.0"); ncua (4000); lcd.clear (); ncua (500); lcd.setCursor (0, 0); lcd.print ("Dist:"); } void loop () {// yog lub log tig yog (analogRead (A0)> = 300) {// tus naj npawb ntawm lem ++ impulses ++; // suav lub sij hawm tig = (millis ()-yav dhau los); // suav ceev speedometer = (Circuit /sijhawm)*3600.0; yav dhau los = millis (); Tachometer (); ncua (100); } Lcd (); } // tso tawm nrawm ntawm tachometer tsis muaj dab tsi Tachometer () {// daim ntawv qhia nrawm 0-180 rau servo speedometer = int (speedometer); servo = daim ntawv qhia (ntsuas qhov nrawm, 0, 72, 180, 0); // teeb tsa servo myservo.write (servo); } tsis muaj dab tsi Lcd () {// thaum khawm tau nyem yog (analogRead (A1)> = 1010) {lcd.clear (); screen ++; yog (screen == 5) {screen = 1; }} yog (screen == 1) {// qhia nrawm lcd.setCursor (0, 1); lcd.print ("Ceev:"); lcd.setCursor (7, 1); lcd.print (ntsuas lub ntsuas cua); lcd.print ("km/h"); } yog (screen == 2) {// qhia txog qhov ntsuas kub = sensors.getTempCByIndex (0); sensors.requestTemperatures (); lcd.setCursor (0, 1); lcd.print ("Temp:"); lcd.setCursor (7, 1); lcd.print (kub); lcd.print ("C"); } yog (screen == 3) {// qhia qhov nruab nrab qhov nrawm aspeed = dist/(millis ()/1000.0)*3600.0; lcd.setCursor (0, 1); lcd.print ("A.speed:"); lcd.setCursor (8, 1); lcd.print (aspeed); lcd.print ("km/h"); } yog (screen == 4) {// daim ntawv kawm tiav lub sijhawm mus ncig triptime = millis ()/60000; lcd.setCursor (0, 1); lcd.print ("Sijhawm:"); lcd.setCursor (7, 1); lcd.print (triptime); } lcd.setCursor (0, 0); lcd.print ("Dist:"); // xam qhov deb deb = impulses*Circuit/1000.00; // dislays nrug lcd.setCursor (6, 0); lcd.print (deb); lcd.print ("km"); }

Kauj ruam 4: Pob

Pob
Pob
Pob
Pob
Pob
Pob

Raws li lub npog kuv siv lub thawv yas kuv yuav rau $ 1. Kuv txiav qhov siv rab riam thiab laum. Servo thiab LCD zaub Kuv glued nrog kab xev, ntsis kuv ua nrog thawv ntawv thiab pleev xim rau xim. Kuv tau tiv thaiv hauv Corel Draw X5 thiab kuv tau luam nws, Kuv ntxiv daim duab PNG, thiab Corel Draw cov ntaub ntawv (yog tias koj xav tau, koj tuaj yeem kho nws). Kuv kaw lub thawv rau lub kauj tsheb ntawm kuv lub tsheb kauj vab thiab kuv tau txuas cov hlua txuas mus rau lub pas nrig.

Kauj ruam 5: Khiav Nws

Khiav Nws!
Khiav Nws!
Khiav Nws!
Khiav Nws!
Khiav Nws!
Khiav Nws!
Khiav Nws!
Khiav Nws!

Tam sim no nws yog npaj txhij. Txhua yam koj yuav tsum tau ua yog tig nws thiab caij. Muaj kev lom zem nrog koj tus speedometer. Yog tias koj nyiam txoj haujlwm no, thov pov npav rau kuv.

Pom zoo: