Instead of the mill we will use the buildin LED from the arduino or a LED.
- (todo) fritzing picture
Arduino
D12 -> Taster Signal
D11 -> Rotary Encoder CLK
D10 -> Rotary Encoder DT
D09 -> Rotary Encoder SW
D08 -> Relais Signal
GND -> Taster GND, Rotary Encoder GND, Display GND, Relais
3V3 -> Taster positiv, Rotary Encoder positiv, Display VCC, Relais
A5 -> Display SCL
A4 -> Display SDA
Taster
Signal -> Arduino D12
GND -> Arduino GND
Positv -> Arduino 3V3
Rotary encoder
CLK -> Arduino D11
DT -> Arduino D10
SW -> Arduino D09
Positiv -> Arduino 3V3
GND -> Arduino GND
Display
GND -> Arduino GND
VCC -> Arduino 3V3
SCL -> Arduino A5
SDA -> Arduino A4
Relais
Signal -> Arduino D8
Positiv -> Arduino 3V3
Negativ -> Arduino GND
- the project must be inside an IDE (like described in the WebEditor)
- set up the components on the breadboard
- Arduino
- Taster
- display
- rotary encoder
- the relais
- (todo) maybe the On/Off switch needs to be placed here as well
- the following lines can be changed to mock the mill. Instead of the mill we will use our LED. So that if the millButton will be pushed, the LED will be turned on until the grind process is done.
- in UI.h the line 110
- from:
static const unsigned char RELAY_PIN = 7;
- to:
static const unsigned char RELAY_PIN = LED_BUILTIN;
- in RUN.cpp line 39
- from:
void Run::startMill() { digitalWrite(UI::RELAY_PIN, LOW); }
- to:
void Run::startMill() { digitalWrite(UI::RELAY_PIN, HIGH); }
- in RUN.cpp line 41
- from:
void Run::stopMill() { digitalWrite(UI::RELAY_PIN, HIGH); }
- to:
void Run::stopMill() { digitalWrite(UI::RELAY_PIN, LOW); }
- in UI.h the line 110
- deploy everything on the arduino
- now you can get some experience with the display and the buttons
- the first running demo looks like this
- Next we will insert the relais into the breadbord. Therefore you will need to change some lines again:
- in UI.h replace the line 110
- from:
static const unsigned char RELAY_PIN = LED_BUILTIN;
- to:
static const unsigned char RELAY_PIN = 8; static const unsigned char RELAY_PIN_LED = LED_BUILTIN;
- in RUN.cpp replace line 39 to 42 (todo needs to checked again)
void Run::startMill() { digitalWrite(UI::RELAY_PIN, LOW); digitalWrite(UI::RELAY_PIN_LED, HIGH); } void Run::stopMill() { digitalWrite(UI::RELAY_PIN, HIGH); digitalWrite(UI::RELAY_PIN_LED, LOW); }
- in UI.h replace the line 110
- with the relais it looks like this
- the last step would be to hock up something on the relais. E.g. a lamp or something with an external powersupply. So that we can test if the relais and the programm works as designed.