Ich weiß - ich sagen immer: "Warum bauen was du fertig kaufen kann?"
Und dann bauen ich mir ein Messwagen für H0. Nicht ein hochtechnisiertes wagen wie ESU, wer nicht geeinigt ist für analoge Anlage (unsere größte Anlage sind analog) und nicht ein wagen wer ist größer als umgrenzung des lichtes räume (Flesichmann fahrrad-computer-wagen).
Ich hab mehrere Projekte gesehen mit selbst-gebaute Messwagen, wo große Platine und viel Elektronik ist. "Warum so avanciert?" hab ich gedacht, und da hab ich meiner eigenen Messwagen gebaut.
Hier kannst du fast alle Einzelteile sehen:
Ein Arduino nano, ein DC/DC Wandler (wer wandelt der Batteriespannung bis 5 Volt), ein 2x16 LCD, ein Batteriehalter (von ein altes PC maus), zwei Widerstände, ein Poti, ein ic-fassung und ein Rasterplatine.
Hier ein Link bis der Schaltplan in PDF
Und ein "close-up" von der auftaster.
Mein Programm sind meistens Diebstahl von einer Zahler, wer zahlt drücken von ein Taster. Ich hab ein bisschen mehr angelegt, aber nicht viel.
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include <LiquidCrystal.h>
LiquidCrystal lcd(7,8,9,10,11,12);
const byte buttonPin = 5; // set input pin
unsigned long counter = 0; // set your counter to zero to begin with
unsigned long dispcounter = 0; // set your dispcounter to zero to begin with
int wheeld = 1100; // set wheel diameter in 0,01 mm
int ppr = 2; // pulses per wheel revolution
byte buttonState; // the current reading from the input pin
byte lastButtonState = HIGH; // the previous reading from the input pin
unsigned long lastDebounceTime = 0; // parameter for debounce filter
unsigned long debounceDelay = 0; // parameter for debounce filter
void setup()
{
pinMode(buttonPin, INPUT_PULLUP); // enable pullup for input
lcd.begin(16, 2); // setup to 16x2 lcd display
lcd.setCursor(0, 0); // display text at startup
lcd.print("Moppes Messwagen"); // display text at startup
lcd.setCursor(1, 1); // display text at startup
lcd.print("L = "); // display text at startup
lcd.print(dispcounter); // display text at startup
lcd.print(" mm"); // display text at startup
}
void loop() {
// read the state of the input into a local variable:
byte reading = digitalRead(buttonPin);
// check to see if input has changes
// (i.e. the input went from HIGH to LOW), and you've waited
// long enough since the last input to ignore any noise:
// If the input changed, due to noise:
if (reading != lastButtonState) {
// reset the debouncing timer
lastDebounceTime = millis();
}
if ((millis() - lastDebounceTime) >= debounceDelay) {
// whatever the reading is at, it's been there for longer
// than the debounce delay, so take it as the actual current state:
// if the button state has changed:
if (reading != buttonState) {
buttonState = reading;
if (buttonState == LOW) {
counter ++; // count up
// "wheeld*3.1416/ppr" calculates wheel circumference between pulses
dispcounter=counter*wheeld*3.1416/ppr; // multiply by wheel circumference between pulses
dispcounter=dispcounter/100; // divide by 100 to get mm
lcd.setCursor(1, 1);
lcd.print("L = ");
lcd.print(dispcounter);
lcd.print(" mm");
}
}
}
lastButtonState = reading;
}
Hier die Rückseite der wagen:
Klaus