-
PCB
03/31/2015 at 09:50 • 0 commentsI used the gEDA project tools for the schematics capture and PCB layout. The tutorials in the project wiki were very important to get me from total newbie level to a point where I could produce a working layout.
Here is the final result (top view):
I tried to keep the layout as simple as possible. First, I aimed for a single layer, since I thought a two-layer PCB was (and still is) beyond my skills. The dimensions are 3 inches by 4 inches, which fit in the wooden pencil holder I had bought for the project. There are three rows of LEDs more or less evenly spaced. The middle row has the LEDs connected to the pins and the resistors to the ground, and the other rows have the resistors connected to the pins and the LEDs to the ground. The middle and bottom rows (the minutes and the seconds) have the LEDs horizontally alined, while the LEDs an the top row (the hours) are alined with the spaces of the other rows. The layout implies that hours and minutes use alternate pins in PORTB and PORTC of the ATmega and seconds have a reverse bit order in PORTD. This makes the software a little bit more complex but keeps the layout straightforward.
To make the PCB I followed most of the excellent instructions at Blondihacks, including using the homemade etching solution of vinegar, hydrogen peroxide and salt. Here is the PCB being exposed:
Using this setup I found out that a little less than 2 minutes of light is enough. The bulb here is a 25w. My results, however, weren't as neat as Blondihacks'. Somehow the etching solution attacked the photo-resist and I got a few defects. I don't know the reason though. Maybe I over-exposed the PCB?
Here is what I got:
Despite the defects the board was usable. I had to solder a couple of jumpers in some traces, though.
Here is the PCB with the components and powered:
Next post: software!
-
Circuit
03/17/2015 at 17:27 • 0 commentsI've added circuit schematics and PCB layout files to the GitHub repository. Circuit is almost as simple as it could get. LEDs are connected to ATmega pins, with current limiting resistors. The encoder and the push-button are also connected directly to the µC pins, with pull-up resistors. All the LEDs, the push-button and the two encoder channels are each connected to its own dedicated pin. A 16MHz crystal, three capacitors, a programming header and another pull-up resistor complete the circuit.
I used gEDA for schematic capture and the PCB layout. I'm a beginner with those and it took some time to learn it. But it was worth it.
MURB's precision as a clock depends on the crystal. One MURB I built advances about 4 seconds per day. This is a frequency error of about 50ppm. Maybe a different crystal would have better precision.
This is the LED part of the circuit. At first, I selected the resistors to have a current of 20mA through the LED when on, the nominal current according to the datasheet. But these LEDs are bright! I'm using the L-7104QBC from Kingbright. At 20mA I could only dim it with a very small duty cycle in the PWM. So I went on and reduced the current. The final resistor value used was 5.6kOhm. I didn't measure the current, but it is below 1mA, probably below 0.4mA.Another thing to note on the circuit above is the position of the resistors. Usually it doesn't matter much because they are in series with the LEDs. But since I'm using the schematic to create the PCB, I had to alternate the order LED-resistor in some pins to simplify the layout.
-
GitHub
03/11/2015 at 16:54 • 0 commentsI just created a github repository and added the source code. It doesn't have many comments yet. I intend to describe it in detail via posts here.
I also plan to upload pcb file and schematics.
-
User interface
03/11/2015 at 13:42 • 0 commentsI wanted an easy to use interface for MURB. I've always hated having to go around all the 60 minutes because I've missed the right time by one and the clock's interface didn't let me go back. I decided to go for a rotary encoder. I had an old mouse lying around so I "recycled" its wheel encoder into the project.
My first approach was to treat the transitions via interrupts. However, I never got it to work. Perhaps the old encoder was bouncing too much (lame excuse) or I couldn't find all the bugs in my code (more likely). Finally I gave up and went with a pooling strategy. MURB is not a high performance position control project after all. The result is that MURB miss a step or jump two at once from time to time but this is nothing too annoying.
Still, I hasn't too happy about not getting the interrupts right. I should probably have tried one of the solutions here.
The rest of the interface is composed of a single push-button, with debounce done in software. The button is also pooled.
-
First steps: breadboard development
03/10/2015 at 17:48 • 0 commentsThis project idea started a long time ago for me. Back then, I tried to make it work with a simple PIC, a homemade parallel programmer and assembler. That didn't go very far. Some years later I hear about the Arduino and the project became much easier to do.
So I ordered a Uno and started learning. My first plan was to use the Uno directly in the MURB. It has enough gpio pins. I needed 17 LEDs, 6 bits for the minutes, 6 for the seconds and 5 for the hours. With a Uno I wouldn't need multiplexing. But then it occured to me what a waste would it be to block my nice little arduino permanently in MURB. It would be better to use just an ATmega328 instead of the whole uno, but I was afraid of how difficult it would be. For instance, I didn't even have an AVR programmer.
It turned out, however, that using an atmega standalone is really simple and well documented. You can use the arduino to program the standalone atmega. The process is well described here.
I got myself a couple of ATmega328, along with some other components, and stated developing directly on the breadboard using the Uno as a programmer.
Here is a late version of the circuit on a breadboard.