Hi guys and gals! Welcome to the DIY Clock Kit tutorial! This tutorial is broken down into many steps, and you can take as long as you like to complete them. In the end, you will have a complete DIY clock, with many ways to customize it! Well, lets jump to it without further ado.
Step 1; LearningLearning! Before you can build this project, you have to learn about the parts that make it work.
crystals and:
and
RGB LEDs
microcontrollers or microcontrollers
reference designators and some more
There will be a QUIZ after completing this reading, so don't even think about skipping it ;).
Also...
There are many different types of information used in C++.
Some types are:
- String (this type usually holds characters; for example, "hello")
- float (this type usually holds values with decimals; for example, 12.25)
- int (this type usually holds integers; for example, 152)
So a value (piece of information) could be a `String`, `float`, or a `int`. There are many others also, but these are the basics.
Step 2; PartsGather your parts. As you can see, you have quite a list of parts to gather, but don't worry. You have a bag all put together for you! Inside, you will find all the parts needed, and they're all labeled so DON'T MIX THEM UP!!!!!! You will also get a PCB (Printed Circuit Board) that is for soldering the parts onto. Now that you have learned about the parts see if you can notice which ones do what.
Step 3; Building the ClockPlacing your parts. I know what you're thinking (or not thinking at all:) ). This is much easier than it looks. On your PCB board, there is reference designators (if you don't know what that is, maybe you should go back and read what you skipped). Each reference designator is also numbered, so it tells you which part and what number of that part. Choose you parts one by one and place them on the board with the correct correlating reference designators. In the parts list at the top of this page, it tells you what reference designator goes to what part. DO NOT place parts onto the wrong places on the board!!!!! This will render your clock trash and cost you some money. Make very certain what part goes where before placing. Start with one part. Find its place on the PCB, place it, then, holding the part, flip the board over so you see the bottom with the part's legs sticking out. Solder these to the pads, and cut the extra off. Go through each piece until the PCB is completed! I would suggest starting with capacitors or something like that and going through all the capacitors before moving onto the next type of component.
Step 4; ProgrammingProgramming! The fun part :). After everything is soldered on correctly, we are ready to program! First, you need to prepare your computer. Download the Arduino IDE and install it. Next, click here to download the code. Once downloaded, open it up and take a look.
Inside you will find a folder called Clock. This folder needs to be dragged into the Arduino, libraries folder. Once that is done, you can open the IDE and go to File, Examples, Clock and click on the example you would like to open!
In your kit, you should have found an ATMEGA16 (the long black thing with lots of legs; the ant; the microcontroller from your reading above). Your electronics expert will have a programmer, so ask to borrow it to program your microcontroller. It should look something like this:
When using this programmer, you have two ways to program your clock. You can program it in the large IC socket on the end of the programmer, or you may use the RX / TX pins and jumper wires to attach to the Clock's RX / TX pins.
Programming via Onboard Socket
When using the onboard socket to program, you must slide both switches on the RED DIP switch to on. Then, when you upload your code, press the SHIFT key while hitting the upload button.
Programming via RX / TX Pins
When using the pins, you will need two female - female Dupont wires. You may ask your electronics expert for these. The pin header on the Clock goes +5V, GND, RX, TX, RST in that order from left to right. The RST button is placed directly behind the pin header.
When you upload your code, make sure to press the tactile button once when the IDE says "Uploading".
Uploading the Code
Once your code is prepared, goto tools,boards,MightyCore in the menu bar and select "ATMEGA16". Goto programmer, and select "Arduino as ISP". Leave all the other settings how they are. Insert your ATMEGA16 into the correct slot and plugin the programmer to your computer via either a USB A to B, or micro USB cable. Back in the tools menu, select port and change it to the USB port that shows up (usually /dev/cu.usbserial-1420). Click the upload button on the code (pay attention to the previous sections), and you will see the programmer's LEDs flashing as the code is being written to your microcontroller. Once your sketch says "Completed Uploading", unplug the programmer, and remove your microcontroller / remove the jumper wires. You have just successfully flashed your first microcontroller! Give yourself a pat on the back (if you can reach ;) ).
Finishing up. Insert your programmed microcontroller into your DIY soldered PCB. Plug it into the wall via its USB port, and your code will start running! Change your code as much as you like or not at all. You can try out different codes to see what you like best. Have fun!
PS. I hereby void all permits for broken ATMEGA16s.
Comments