Table of Contents
Specs
- Serial interface (for bluetooth adapter) + another serial interface for debugging
- 2 hi-res PWM channels
- 2 interrupts to read the rotary encoder
- Another interrupt for the encoder push button
Microcontroller
Because 1) it’s cheap and 2) easily available and 3) satisfies all our needs (altough the hi-res PWM one only limited) and 4) i’m already a bit familiar with it, we’ll choose the ATMega328 as our processor.
The two external interrupts available on the 328 will take care of the rotary encoder. A pin change interrupt will monitor the push button.
The harware serial interface will be used for debugging, another soft serial interface will be used to communicate with the bluetooth module.
Timer2 and two 14-bit counters are available for our two-channel PWM.
Pin mapping
Pin Name | Pin # | Function |
---|---|---|
PB1 | 13 | LED cold |
PB2 | 14 | LED warm |
PD0 | 30 | BT Rx |
PD1 | 31 | BT Tx |
PD2 | 32 | Encoder - |
PD3 | 1 | Encoder + |
PD4 | 2 | Encoder push |
Design
When you open the design in Upverter (‘Open Editor’ button), you can:
- See the schematic
- See the layout
- Fork and edit everything
- Download Gerber files, BOM, etc.
Here’s an export from 12.06.2018 hosted on the fabacademy servers: