I have spend a lot of time drawing this circuit and I hope that it is clear to understand.
The electronics basically consist of two boards.
- Mainboard: the mainboard contains the powersupply, Microcontroller, clock, memory, and motordrivers.
- Interface board: This board contains the LCD-screen and 2 buttons.
Both boards are connected to each other with a 10wire flatcable.
The powersupply should be pretty forward: it is a standard 5V supply used on many projects. The only thing I added are a 'power-on led' and a connection for a 9V battery. The 2 diodes should prevent the 9V battery to 'charge' when the 12V is on and vice versa.
When we look at the microcontroller, you can see that Port D is entirely used for the lcd and the 2 buttons (INT0 and INT1).
Port B is used for ISP programming (PB3 to PB5 + PC6 for reset) and to sent the pulses for the steppermotors to the drivers (PB0 to PB2).
The communication with the clock and EEPROM goes via an I2
C protocol and uses PC4 and PC5.
PC0 is used for the buzzer and PC1 to PC3 go to the 74HCT238. The 74HCT238 is a 3 to 8 decoder/converter and decodes a 3 pin binary input to a decimal output. I use it to save pins on my microcontroller. The output of this IC turns the logic voltage of the drivers on and sets the enable pins to 1. One driver for each day of the week.
As said before the clock and the EEPROM use the same 2 wires to communicate with the microcontroller via an I2
C protocol. It is a pretty easy and straightforward way to communicate (especially if you use bascomAVR like I do) and it allows you to communicate with 127slave devices via 2 wires. Just don't forget to add the 2 pull-up resistors (in this case 4,7K).
Port D on the main board, is connected to a 10 pin female header so that it can be connected directly to the interface board by a flatcable. The power for the interface board also comes via the cable from the main board.
The 10K resistor and the 10K potentiometer are used to set the brightness of the lcd. The power and datalines are directly connected from the header.
The two buttons connect to ground. Note that the pull-up resistors (1.5K) are on the mainboard.
Keep in mind that other lcd's can have a different pinning so check your datasheet for the correct pinning.
I added a 47Ohm resistor to the backgroundlight just to make it a bit less bright. It is however not a necessary component to make the machine work.