tag:blogger.com,1999:blog-49332290844368491672024-03-13T15:05:53.615-07:00Ramblings of an E-GeekRandom thoughts as a Geekdad makes his way through the wonderful world of learning electronics.Kenhttp://www.blogger.com/profile/02720825801825816765noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-4933229084436849167.post-3629065187719686292011-03-11T16:57:00.000-08:002011-03-11T17:17:17.094-08:00Update: Switch Mode Power SupplyWell, I'm back after a fairly long time away from my blog and, unfortunately, away from my projects as well.<br />
<br />
Since I last posted, I've have a few developments on the SMPS front, including another excellent source for simple switch mode power supplies at very cheap cost. If you remember my last post about SMPS, I created a power supply for my baseball scoreboard project out of a car charger for a long defunct cell phone of mine. A little tweaking to change the output voltage to suit my needs and, presto! A "reasonably efficient" SMPS. Here's a link to that post:<br />
<br />
<a href="http://egeekrambling.blogspot.com/2010/08/building-blocks-switch-mode-power.html">Building Blocks: Switch Mode Power Supply</a><br />
<br />
I've had some developments in this arena and I thought I would share it with my fans.<br />
<br />
First, back in August of 2010,<a href="http://hackaday.com/2010/08/29/make-switched-mode-power-supplies-do-your-bidding/"> I was featured on Hack-a-Day</a>, which was really cool. Mike was a very nice guy and it was really nice to get a little exposure. For the article, I drew a quick schematic of the power supply, so that might be handy for those that are interested. Also, I was able to grab my loupe and identify the chip that was being used. It's an MC34063 switching regulator; apparently quite cheap and quite common to find in a very low end, low cost SMPS.<br />
<br />
Shortly after this feature, Dave, from the <a href="http://www.eevblog.com/">EEV Blog</a> (one of the few blogs I view religiously, btw) did a video on this exact same voltage regulator and how to run all the calculations. While I'd like to say that I inspired Dave to do this video, I can't really say that he'd be at all interested in my ramblings, but it was extremely timely and several orders of magnitude more informative than my simple hack, so, good on ya, Dave!<br />
<br />
Now, being an unprofessional hack rather than a professional designer, I thought I could do better. I mean, that SMPS is all through hole parts! Well, quite a while ago I stumbled upon this quirky, but very inspiring Chinese website called <a href="http://www.dealextreme.com/">Deal Extreme</a>. Some people love them, some people hate them, but no one disputes that they sell really cheap stuff. Combine that with free shipping on everything and you've got a hacker's paradise (assuming you don't sweat the lack of quality of many of their parts). Digging through their sub$2 parts, <a href="http://www.dealextreme.com/p/car-cigarette-powered-1000ma-usb-adapter-charger-black-dc-12v-40470">I found this gem</a> for $2, which reminded me of my SMPS project.<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://lh6.googleusercontent.com/-07n5k-sUbcg/TXrArA8XntI/AAAAAAAAADM/LmTuMgI3Zag/s1600/sku_40470_1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://lh6.googleusercontent.com/-07n5k-sUbcg/TXrArA8XntI/AAAAAAAAADM/LmTuMgI3Zag/s320/sku_40470_1.jpg" width="320" /></a></div><br />
A couple months later, I finally got my shipment of three of these guys (they were on backorder for a bit). When I popped open one of them, I found a nice, neat, and extremely small (1"x0.5") SMD based SMPS using the MC34063 regulator. The resistors appear to be 0603 size, but I was able to change out the resistor divider (similar to my first post about SMPS) with an 0805 size. So, for $2 I was able to reduce the size of my previous SMPS by 4 or 5 fold. Excellent!!<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://lh5.googleusercontent.com/-7j8bn-uCSeE/TXrEaaGVyUI/AAAAAAAAADU/lkT8kmKfpfQ/s1600/photo+2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://lh5.googleusercontent.com/-7j8bn-uCSeE/TXrEaaGVyUI/AAAAAAAAADU/lkT8kmKfpfQ/s320/photo+2.JPG" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://lh4.googleusercontent.com/-VBRu9_gp6lI/TXrEXxyuksI/AAAAAAAAADQ/XQYXa-YW9WQ/s1600/photo+1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://lh4.googleusercontent.com/-VBRu9_gp6lI/TXrEXxyuksI/AAAAAAAAADQ/XQYXa-YW9WQ/s320/photo+1.JPG" width="320" /></a></div><br />
Don't mind the wires, those are the ones I tacked on for easy access to the supply voltage and output voltage.<br />
<br />
What I also found was a little disturbing. I have yet to find a fuse in this product, so buyer beware. I would never use this in any of my vehicles (the most expensive things I own second only to my house, which would also be in danger). I know my 12V sockets on my car are also fused, but still... Perhaps it's the principle of the matter.<br />
<br />
That being said, I would totally use this to power my creations, so that's what I'm going to do.Kenhttp://www.blogger.com/profile/02720825801825816765noreply@blogger.com2tag:blogger.com,1999:blog-4933229084436849167.post-80705413565178258652010-08-27T23:09:00.000-07:002010-08-27T23:09:30.630-07:00Building Blocks: The UARTI know these posts aren’t in any kind of logical order, but I figure I should post about what I feel inspired to post about and, eventually, it’ll all be there. So, today I’m going to talk about the UART code I use on the atMega328p to communicate with the WiFly GSX. It is a bit more complex than the very basic tutorials out there, but I suspect it’s not up to professional grade either. I use an interrupt driven transmit/receive with 256byte buffer for each.<br />
<br />
The inspiration for this bit of code came from a couple sources. There is a great and simple UART tutorial on Sparkfun that got me started when all other tutorials failed me. Additionally, reading the AVR Freaks forums, I educated myself on more advanced UART techniques including a suggestion by Dean, I believe, to use ring buffers to store data and handle transmitting/receiving the data in interrupt routines.<br />
<br />
In my library, I have the following data structures:<br />
<div><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> volatile char in[256];<br />
volatile char out[256];<br />
volatile uint8_t inptr;<br />
volatile uint8_t outptr;<br />
uint8_t curoutptr;<br />
uint8_t curinptr;</span><br />
<br />
and the following routines:<br />
<br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> uart_init();<br />
uart_tx(char c);<br />
uart_send_string(const char* s);<br />
uart_check();<br />
ISR (USART_RX_vect);<br />
ISR (USART_UDRE_vect);</span><br />
<br />
In the next few paragraphs, I’ll show you how these are used, but first, let’s take a quick look at the data structures.<br />
<br />
<a name='more'></a><br />
<br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> volatile char in[256];</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> volatile char out[256];</span><br />
<br />
These are what I call my ring buffers. They are called that because they wrap around to the beginning when they exceed 256 characters. Why? Because I am using an 8-bit integer for the index of the buffer. The AVR is an 8-bit micro, so the integers are only 8 bits long, allowing a maximum value of 255. If you add 1 to an 8-bit integer variable that contains the value of 255, the result is a value of 0. Very cool! It makes for a very convenient way of handling buffers for all kinds of things. As with everything there are trade offs. Two 256 byte buffers may be overkill for most UART applications. Some AVR micros don’t have or can’t spare the 512 bytes of memory needed for this. I used this library on a Tiny and had to drop the buffer size down to 16 bytes each. It wasn’t too difficult, but it’s just some extra coding.<br />
<br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> volatile uint8_t inptr;</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> volatile uint8_t outptr;</span><br />
<br />
These are the pointers into the index of each of the buffers that lets me know where to put new data. It also lets me figure out what data has not yet been sent.<br />
<br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> uint8_t curoutptr;</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> uint8_t curinptr;</span><br />
<br />
These are also pointers. These point to the last character that was sent/received. Using this pointer and the previous pointers, I can check to see if I need to send any data to the UART, or process any received data.<br />
<br />
Now, on to the routines.<br />
<br />
<b><span class="Apple-style-span" style="font-size: x-large;">uart_init()</span></b><br />
<br />
Let’s start with the uart_init() routine. As you probably suspect, it is the routine you call at the beginning of your main program to initialize the UART so that you can use it. Once this init routine is complete, you will be able to the other routines to send data out the UART. Let’s take a look at the code:<br />
<br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> void uart_init (void)</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> {</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br />
</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> DDRD &= ~(1«DDD0);</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> DDRD |= (1«DDD1);</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> PORTD |= (1«PORTD0);</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br />
</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> UCSR0B |= (1 « RXEN0) | (1 « TXEN0);</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> UCSR0C |= (1 « UCSZ00) | (1 « UCSZ01);</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> UCSR0C &= ~(1«UPM01);</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> UCSR0C &= ~(1«UPM00);</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br />
</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> UBRR0H = (unsigned char)(BAUD_PRESCALE » 8);</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> UBRR0L = (unsigned char)BAUD_PRESCALE;</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> UCSR0B |= (1 « RXCIE0) | (1«UDRIE0);</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br />
</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> inptr = 0;</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> outptr = 0;</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> curoutptr = 0;</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> curinptr = 0;</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br />
</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> uart_tx(‘o’);</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> uart_tx(‘k’);</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> uart_tx(‘\r’);</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> uart_tx(‘\n’);</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br />
</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> }</span><br />
<br />
The code is split into five sections. The first section is where the pins on the micro are initialized to “known” values. I suppose that these pins have default values and that I am possibly wasting my time setting some of these values, but I feel that it’s best to KNOW that they are set correctly, rather than rely on supposed manufacturer default. The first three lines accomplish the following: set pin D0 (RX) to input, set pin D1 (TX) to output, enable pullup resistor on D0. The last statement is very important. I’ve not remembered to do this and it makes UART transmissions virtually impossible.<br />
<br />
The second section sets up the parameters for the UART hardware itself. The first line simply turns on the UART TX/RX circuitry in the micro. The second line instructs the UART to use 8-bit characters. The third and fourth lines set the UART hardware to use no parity. This is a prime example of when defaults are not what they say they are. For some reason, the micro prefers to boot with odd parity. That is not what the datasheet from Atmel says. I wasted a week of effort just on this one issue. Word to the wise, if a bit needs to be set to zero, then set it to zero. Don’t assume that it will be zero by default.<br />
<br />
The third section sets the BAUD rate in the UART hardware. The BAUD rate is either calculated by the following formula:<br />
<br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">#define USART_BAUDRATE 9600</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">#define BAUD_PRESCALE (((F_CPU/(USART_BAUDRATE*16UL)))-1)</span><br />
<br />
or you can simply set it manually to a specific value. There are suggested values in the Atmel datasheets. There is a lot to consider when setting the baudrate on an Atmel micro and I won’t really go into it, but I’ve typically just gone with 9600 baud at a micro clock rate of 8MHz. It’s worth spending the time to read and understand this if you want to be successful at using the UART for your projects. I suggest going over to AVR Freaks and doing some reading on the subject in their forums.<br />
<br />
The fourth section just initializes the ring buffer pointers to zero. Standard stuff.<br />
<br />
The last section sends an “ok” to the UART letting me know that the UART was successfully initialized. Clearly this is optional, but I prefer to have a little bit of interactivity here and there so that I know my micro is behaving.<br />
<br />
<b><span class="Apple-style-span" style="font-size: x-large;">uart_tx(char c)</span></b><br />
<br />
This routine is very simple. It inserts characters into the transmit ring buffer and increments the buffer pointer.<br />
<br />
<br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> void uart_tx(char c) {</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> out[outptr]=c;</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> outptr++;</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> UCSR0B |= (1«UDRIE0);</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> }</span><br />
<br />
What it also does is enable the UART’s data register empty interrupt. This setting causes the this interrupt to fire so that you know when to put more data out of your buffer into the UART. As you will see later, the interrupt either sends data or turns off the interrupt (so that it doesn’t just continue to interrupt with no data to send…that’s bad), so this routine must turn on the interrupt again when there is data to send. I think this is a confusing way to do it, but it is what it is.<br />
<br />
<span class="Apple-style-span" style="font-size: x-large;"><b>uart_send_string(const char* s)</b></span><br />
<br />
This routine is a simple wrapper around the uart_tx() routine. As you can see in the uart_init() routine, it’s not exactly “code efficient” to send a string to the UART one character at a time. In this routine, we are taking the string and simply iterating through the it and dumping the characters into the uart_tx() routine.<br />
<br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> void uart_send_string(const char* s) {</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> while (*s)</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> uart_tx(*s++);</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> }</span><br />
<br />
The observant will notice that there is no error checking here. The ring buffers are only 256 characters long. If you pass a 260 character string to this routine, the buffer will overlap and, at best, you will only get the last four characters sent to the UART. This is because the routine packs the buffer so quickly that the UART can’t keep up. This is an area of improvement for my code, but I haven’t done anything yet. I think that a simple check of the buffer pointers will allow you to insert a small delay if you detect an potential overlap condition, allowing the UART to catch up.<br />
<br />
<span class="Apple-style-span" style="font-size: x-large;"><b>uart_check()</b></span><br />
<br />
This routine checks the receive buffer for characters and processes them. I will publish a skeleton of my actual code because there is quite a few lines of code here. This is where I implement the interactive part of the scoreboard (i.e. the H, h, I, i, G, g, b, s, o, d commands and others)<br />
<br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> void uart_check()</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> {</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> while (curinptr != inptr) {</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> switch (in[curinptr]) {</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> case ‘.’:</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> default:</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> }</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> }</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> }</span><br />
<br />
This routine is called from the tight loop in the main routine. It checks the input buffer for new data and then parses the new data character by character using a simple switch structure. It’s tight, fast, and restrictive enough to encourage me to KISS (keep it simple stupid).<br />
<br />
<br />
<b><span class="Apple-style-span" style="font-size: x-large;">ISR (USART_RX_vect)</span></b><br />
<br />
This is an interrupt vector for when data has been received on the micro’s receive buffer. It is important to service this routine and get out as quickly as possible. There are only two lines and they simply add the data to the receive ring buffer and then increment the buffer pointer.<br />
<br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> ISR (USART_RX_vect)</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> {</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> in[inptr] = UDR0; // Fetch the recieved byte value into the variable “ByteReceived”</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> inptr++;</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> }</span><br />
<br />
<br />
<b><span class="Apple-style-span" style="font-size: x-large;">ISR (USART_UDRE_vect)</span></b><br />
<br />
This interrupt handles sending the data from the transmit ring buffer to the micro’s UART. Again, it is always a good idea to take care of business and get out of your interrupt routines, so the code is intentionally short and to the point.<br />
<br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> ISR (USART_UDRE_vect)</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> {</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> if (curoutptr != outptr) {</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> UDR0 = out[curoutptr];</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> curoutptr++;</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> } else {</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> UCSR0B &= ~(1«UDRIE0);</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> }</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> }</span><br />
<br />
The first half of the IF statement checks to see if the current output pointer is not the same as the ring buffer pointer. If they are not, that means that there is data in the buffer that has not been sent. Put a byte on the output register and increment the current output pointer. If the current output pointer and the transmit ring buffer pointer are the same, that means there’s nothing to do, so you simply disable the interrupt. Remember, back in the uart_tx() routine, you enable the interrupt again when there is data to send.<br />
<br />
Okay, I’m on a roll with the long blog posts. Hopefully it was coherent enough to help you out. As always, please feel free to comment and I will try to respond.</div>Kenhttp://www.blogger.com/profile/02720825801825816765noreply@blogger.com2tag:blogger.com,1999:blog-4933229084436849167.post-8761286812962964002010-08-27T22:56:00.000-07:002010-08-27T22:59:34.155-07:00Building Blocks: The MicrocontrollerAs part of the building blocks series, I thought I would share a modular microcontroller design that I came up with over two years ago and that I am using for the scoreboard project. The Arduino craze not yet peaked and I was not fully aware of what it was, however, I did see some value in what they were doing and couldn’t help but allow the Arduino influence my design. Basically I took the shield concept, added a passthrough bus, and threw out the rest. Arduino is beneficial to those that don’t have a Programmer or who are not familiar with C/C++ or assembly. I had both, so I saw Arduino as having way too much circuitry for my tastes. So, what did I do? I built my own. (This is a common theme with me, in case you haven’t noticed.)<br />
<br />
What follows is an admittedly lengthy excerpt of a contribution that I made on the <a href="http://www.societyofrobots.com/">Society of Robots</a> website back in 2008, where I first cut my teeth in all things electronics and mechanics. It’s interesting for me to go back and read my thoughts back then.<br />
<br />
<b>A Modular PCB Layout</b><br />
<br />
<b><i><u>Introduction:</u></i></b><br />
This project started as a result of my frustration and consternation with etching my own PCBs. Now, if I could draw out a board to perfection in Eagle on the first try, I probably wouldn’t have thought of doing this. However, my Eagle skills are somewhat lacking, as are my soldering skills. I needed a simple way for me to avoid having to build and debug large and complex boards for each project on my list. In addition to reducing the risk of me screwing up a large board, I found that it creates a bit of a “plug and play” environment where I can add and remove modules as needed for my various projects. Changing from a robot controller with motor driver and sensors to a temperature sensor with LCD display is as simple as swapping out the modules you need and reflashing the AVR. (I know, I don’t have an LCD module yet, but I will!)<br />
<br />
As I took a look at some of the projects I wanted to create, I realized that there was a common basis for these projects; what I will call the AVR baseboard. There was always a socketed AVR (atMega168 for me), a reset button w/ resistor, and a decoupling capacitor. I wondered if I could build a VERY simple AVR baseboard and then just create modules for the functionality I wanted to add to it. Hey! While I’m at it, I could make them all stack together in a nice neat stacking bus arrangement. At first, I thought it was going to be a bit ambitious for someone of my skill level. Well, I did it, it seems to work pretty well, and I want to share it so that I can inspire others and also (selfishly) get some good feedback from the community on improvements, errors, etc. Here’s how it goes.<br />
<br />
<b><i><u>Form Factor:</u></i></b><br />
<br />
First, I decided on a physical form factor. If I was going to connect multiple modules together, it would be nice if they were all of a “standard” size. I picked a 2” by 3” PCB dimension for the AVR baseboard and for a large module. I picked two other sizes for smaller modules, 2”x1.5” and 1”x1.5”. (see the first attached graphic “Module Sizes.png”)<br />
<br />
This effectively gives me a full size, half size, and quarter sized modules. It also breaks the AVR baseboard into what I like to call “quadrants”. I’ve labeled the quadrants A, B, C and D. Each of the modules that I’ve built are built specifically for one or more quadrants. You’ll see why when I go into detail on the ISP and Serial modules.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/_YHAL31XXN6k/THii8oEyDVI/AAAAAAAAABg/5IkdmUt0d0w/s1600/z.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="316" src="http://3.bp.blogspot.com/_YHAL31XXN6k/THii8oEyDVI/AAAAAAAAABg/5IkdmUt0d0w/s400/z.png" width="400" /></a></div><br />
<br />
<a name='more'></a><br />
<br />
<b><i><u>Connectors:</u></i></b><br />
<br />
The board to board connectors for this idea turned out to be the hardest part for me to figure out. I was essentially copying the stackthrough bus on the PC/104, but I didn’t need 104 pins. Not even close. So, for a while I was cobbling it together with a male header soldered from the bottom of the board, and a female header receptacle soldered onto the male pins that were sticking out through the top of the board. It was very problematic for my soldering skill level, but I managed to get it to work fine after much trial and error.<br />
<br />
<i>Note: I designed the connectors based on the pinout of the ATmega168P because this was my target MCU. This strategy could be extended to other, more or less powerful MCUs.</i><br />
<br />
The pinout of the ATmega168P lends itself quite nicely to my “quadrant” strategy. Looking at the pinouts, the pins are split into two rows 1-14 and 15-28, simply because it’s a DIP package. Additionally, each row is further divided in half, roughly, by the GND, VCC, AVCC, AREF pins. This gives you four clusters of pins in each quadrant. Pins 1-6, 9-14, 15-19, and 23-28. There’s, at most, six signal pins in each quadrant.<br />
<br />
Power is something I thought long and hard about. I’d like for each module, regardless of size, to have access to regulated power, unregulated power, and ground. This will allow for the ultimate flexibility. That adds another three pins to the connector for each quadrant. So, that adds up to 9 pins for each quadrant.<br />
<br />
The connectors I created, and then ultimately found a supplier for, create a stackthrough bus between the PCBs in the stack. All pins are passed through the connector to the board above it, in addition to being connected to a trace on the PCB if needed. This allows modules to share pins, if necessary. I haven’t actually needed to share pins yet (except for the I2C bus), so I’m not even sure it’s possible/recommended, but I can see where it might be necessary in some cases. There’s no magic going on here, so don’t start thinking you can just plug a module anywhere and it will work. This is simply a method for organizing and connectorizing.<br />
<br />
Here’s the AVR baseboard with the connectors attached. Note that since the baseboard is designed to be on the bottom of the stack, I don’t use the stacking connectors on this board.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://2.bp.blogspot.com/_YHAL31XXN6k/THijPdWWHqI/AAAAAAAAABo/5XKsE62JtpY/s1600/z.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="316" src="http://2.bp.blogspot.com/_YHAL31XXN6k/THijPdWWHqI/AAAAAAAAABo/5XKsE62JtpY/s400/z.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">ATmega Baseboard with four 1x9 female header receptacles</td></tr>
</tbody></table><br />
I was able to find some female header receptacles with longer solder tails. The solder tails are actually shaped like regular header pins, so they’re specifically made for this purpose. I sourced them from Samtec and just got my samples in a couple days ago, so you won’t see them on my pictures. I think they’ll work great. The part number is ESQ-109-14-G-S and they’re $1.40 each in quantities less than 555. Over that, I think they drop to about $1.19. You can order the tin version rather than the gold versions using part number ESQ-109-14-T-S and they’re $1.02/$0.87.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://2.bp.blogspot.com/_YHAL31XXN6k/THijn5H8bKI/AAAAAAAAABw/lHUReDzeFYQ/s1600/z.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="316" src="http://2.bp.blogspot.com/_YHAL31XXN6k/THijn5H8bKI/AAAAAAAAABw/lHUReDzeFYQ/s400/z.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">One Quadrant Module with Stackthrough Connector</td></tr>
</tbody></table><br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/_YHAL31XXN6k/THij0BOkqhI/AAAAAAAAAB4/vw5pBG7fkFU/s1600/z.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="316" src="http://3.bp.blogspot.com/_YHAL31XXN6k/THij0BOkqhI/AAAAAAAAAB4/vw5pBG7fkFU/s400/z.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Two Quadrant Module with Stackthrough Connector</td></tr>
</tbody></table><br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/_YHAL31XXN6k/THikD45l-YI/AAAAAAAAACA/dz3d_1R3JfU/s1600/z.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="316" src="http://3.bp.blogspot.com/_YHAL31XXN6k/THikD45l-YI/AAAAAAAAACA/dz3d_1R3JfU/s400/z.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Module Stacking Example</td></tr>
</tbody></table><br />
<i>Note: I realize that there may be some over-current concerns on the connectors, specifically with using the unregulated power for driving motors. I will try to address these in version 2 of the PCB designs by creating some sort of external power bus for the unregulated power. Perhaps another module! :D</i><br />
<br />
<br />
<b><i><u>The ATmega168P Baseboard:</u></i></b><br />
<br />
The ATmega168P baseboard is very simple. The goal is to break out the pins to the four connectors while only adding additional components if absolutely necessary or highly convenient. You will note that I took this to the extreme in that there is no power supply on this board. I did this intentionally, because I have a few projects that I will likely end up using 3.3V for, so why not make the regulated power supply just another module? I couldn’t think of a reason not to, so I did it.<br />
<br />
The only parts on this board are: a 28-pin socket, a momentary switch for the reset button, and a pull-up resistor for the reset pin. Later, I added a decoupling capacitor for the ADC Voltage Reference pin. I laid the traces for an external resonator, but that is completely optional. Using the clock internal to the ATmega168P works just fine, but I did want the option of boosting the processing power if necessary.<br />
<br />
You might notice that I labelled the quadrants A, B, C, and D. This is simply a marking system that will help me remember on which quadrants I can connect my modules. Each module I made has a similar marking. This just keeps things straight when I take a week or two off and then come back to it.<br />
<br />
I didn’t build this board with a top layer. The board layout uses the top layer to help me figure out where to put my wire jumpers. In the future, I’ll probably try to see if I can do a double layer board. It’s not really a priority for me right now though. If you want to use my files for a double sided board, make sure you increase the width of the top layer traces.<br />
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/_YHAL31XXN6k/THikU6iDXmI/AAAAAAAAACI/8eHJBn8nYIM/s1600/z.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="372" src="http://1.bp.blogspot.com/_YHAL31XXN6k/THikU6iDXmI/AAAAAAAAACI/8eHJBn8nYIM/s400/z.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">ATmega168P Baseboard Schematic</td></tr>
</tbody></table><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://4.bp.blogspot.com/_YHAL31XXN6k/THikkMrt-1I/AAAAAAAAACQ/WluWtjaeAWw/s1600/z.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="640" src="http://4.bp.blogspot.com/_YHAL31XXN6k/THikkMrt-1I/AAAAAAAAACQ/WluWtjaeAWw/s640/z.png" width="452" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">ATmega168P Baseboard Layout</td></tr>
</tbody></table><br />
I decided to place the unregulated power, regulated power, and ground rails on the connector pins closest to the ends of the PCB. The problem with this is that for the single quadrant modules, the power pins only match up for two of the four possible quadrants, so they can only be used for those two quadrants. For the other quadrants, the pins are reversed from what they need to be. I didn’t notice this at first, but honestly I don’t have a whole lot of single quadrant modules that can go in any of the four quadrants. Most of them have to be in a specific quadrant anyway, so no big deal.<br />
<br />
I’ve got another way of doing this in mind which may be more flexible, but this is how I’ve chosen to do it for now.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/_YHAL31XXN6k/THik1RZlbGI/AAAAAAAAACY/b7TTGbmXzbA/s1600/z.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="300" src="http://1.bp.blogspot.com/_YHAL31XXN6k/THik1RZlbGI/AAAAAAAAACY/b7TTGbmXzbA/s400/z.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Finished ATmega168 Baseboard</td></tr>
</tbody></table><br />
I think I’ll stop for now. There is quite a bit more, but this post is getting way too long as it is. I have several “modules” that I’ve developed for this board, including an ISP module, a Serial module, a Power module, a Motor controller module, and an Analog sensor input module.Kenhttp://www.blogger.com/profile/02720825801825816765noreply@blogger.com1tag:blogger.com,1999:blog-4933229084436849167.post-44718808571079628752010-08-27T22:12:00.000-07:002010-08-27T22:45:28.617-07:00Building Blocks: OverviewAlright, I’ve hinted and even mentioned what all the components are in the scoreboard, but not really in much detail. To supplement my building blocks series of posts, I thought I would put together a simple diagram of how all the different building blocks are connected and with some basic stats for each.<br />
<div style="color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px; outline-color: initial; outline-style: none; outline-width: 0px;"></div><br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/_YHAL31XXN6k/THiibTs4YeI/AAAAAAAAABY/bwDdNxUXWSk/s1600/blocks.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="http://4.bp.blogspot.com/_YHAL31XXN6k/THiibTs4YeI/AAAAAAAAABY/bwDdNxUXWSk/s640/blocks.png" width="452" /></a></div><br />
<br />
As you can see, there is quite a bit of power distribution throughout the design. This was one of my main focus points because I wanted to make sure the power was distributed in a safe and maintainable manner. The last thing I want is an epic failure during the middle of a game (i.e. flames…).<br />
<br />
Let’s see…I’ve done building blocks post on the digits and the SMPS. I think next I’ll discuss some of the code I used on the atMega328p and then perhaps a blog on the battery, battery safety, and power distribution.Kenhttp://www.blogger.com/profile/02720825801825816765noreply@blogger.com0tag:blogger.com,1999:blog-4933229084436849167.post-51865533886330028452010-08-27T22:09:00.000-07:002010-08-27T22:10:10.709-07:00I'm Finished! (sort of)<object width="425" height="344" align="center"><param name="movie" value="http://www.youtube.com/v/Ccw5WhbPVZ4?fs=1&hl=en_US&rel=0&color1=0x3a3a3a&color2=0x999999"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Ccw5WhbPVZ4?fs=1&hl=en_US&rel=0&color1=0x3a3a3a&color2=0x999999" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object><br />
<br />
Finished the scoreboard!! I had a week of vacation, so I made a big push to finish. Now I might have time to document the rest of the building blocks.Kenhttp://www.blogger.com/profile/02720825801825816765noreply@blogger.com2tag:blogger.com,1999:blog-4933229084436849167.post-69987404748740313902010-08-27T22:05:00.000-07:002010-08-30T20:40:11.733-07:00Building Blocks: Switch Mode Power Supply<div class="separator" style="clear: both; text-align: center;"></div><span class="Apple-style-span" style="color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: medium;"><span class="Apple-style-span" style="font-size: 14px; line-height: 19px;"><br />
</span></span><br />
I know what you’re thinking…”Wow! This guy must be really smart because he designed a switch mode power supply for his project.” Well, I hate to disappoint, but I’m not really that smart at electronics (that’s why I’m doing this project…to learn!)<br />
<br />
The truth is, I was looking at building my own SMPS, but it looked like a chore even considering there are some really easy to use chips like the LM2575. Picky PCB layout problems and the fact that I don’t own an inductor of any kind, really made me think twice about trying. Oh, I designed a SMPS in Eagle, but I have yet to try it because I came up with a…how should I put this…dumb simple, solution. That is, simple enough I can do it and it just works. No fussing around with it.<br />
<br />
First, I knew that I needed something to convert from my 11.1V (call it 12V) LiPo battery down to a useful 3.3V. Looking at typical linear voltage regulators, I could see that I would be burning up lots of my battery as heat. In fact, a 12V to 3.3V linear regulator is only about 28% efficient. That’s a deal breaker. This scoreboard needs to be as efficient as possible in the power department because it could be used for hours at a time. Incidentally, during development I was using a 5V LDO regulator and just converting from 12V to 5V caused the regulator to heat up to where it will burn you if you touch it. I don’t want that in my scoreboard box. The LEDs are going to be warm enough. My other option was to look at a SMPS.<br />
<br />
Looking up SMPS online, I found that they tend to be about 80 to 90% efficient in the voltage and current ranges that I am expecting. That’s a HUGE improvement. This is when I made the decision to do a SMPS or bust. Little did I know that I actually had a SMPS lurking in my desk drawer that would do the job perfectly. While I was pondering SMPS datasheets, I noticed a car charger from a long defunct cell phone laying on my desk. “Hey!” I said to myself, “that thing converts from 12V car voltage to 5V USB!” My search for a SMPS was over.<br />
<br />
Gutting the charger, I found a small circuit with a couple resistors, a diode, an 8 pin unmarked dip, and (the tell tale sign of a SMPS), an inductor. But this SMPS outputs 5V, not 3.3V, which is what I need. Having done a bit of research already, I knew that the voltage on a variable SMPS chip is set with a potential divider. So I set out to recreate the schematic of this simple board. Soon, I had identified the two resistors that create the voltage divider, figured out which one I needed to replace, calculated the new resistor value, and replaced the resistor with an appropriate value for 3.3V output.<br />
<br />
Honestly, I didn’t think it could be this simple, but apparently it was. When I powered on the circuit, it measured exactly 3.295V. Sweet!! I had concerns that perhaps this SMPS couldn’t handle the current required for running all my electronics, but now that I have it hooked up I can see that it’s not going to be an issue. In a steady state, my electronics (minus the digits which run on 12V anyway) take anywhere from 30 to 50mA with peaks up to 200mA. The SMPS can handle that, no problem, if it ever charged a phone.<br />
<br />
Here’s a pic of my repurposed SMPS.<br />
<div><br />
</div><div><span class="Apple-style-span" style="color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px;"></span><br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/_YHAL31XXN6k/THiiASOq4TI/AAAAAAAAABQ/JRt6DHO4KUY/s1600/smps.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="http://2.bp.blogspot.com/_YHAL31XXN6k/THiiASOq4TI/AAAAAAAAABQ/JRt6DHO4KUY/s640/smps.jpg" width="480" /></a></div><br />
<br />
For those of you that are impeccably observant, you may have noticed that there are two resistors connected together. That’s just me not being able to find a 1000 ohm resistor, so I made one with two 500 ohm resistors. Yeah, okay, it’s not that clean, but it works and I’m all about things that just work.<br />
<br />
That’s all for now!<br />
<br />
<b>Edit:</b><br />
<br />
I've had a couple comments from folks clarifying the efficiency assumptions that I made in this post. This inspired me to measure the actual efficiency of the supply in question. Here are my results:<br />
<br />
I attached a 9v source to the input and a purely resistive load of 58 Ohms on the output.<br />
<br />
Vin = 9v<br />
Vout = 3.3v<br />
Iin(no load) = 3.6 mA<br />
Iin = 30 mA<br />
Iout = 55 mA<br />
<br />
Time to whip out Ohm's Law. As you can see, the supply consumes 3.6 mA current with no load connected. Overall, the supply is<br />
<br />
(55 * 3.3)/(30 * 9), or around 67% efficient. Not too bad, considering.<br />
<br />
On a positive note, the current that the supply consumes remains constant, so the higher the current, the higher the efficiency (to a point). At higher current, I suppose this supply could easily reach 75% efficiency.<br />
<br />
Thanks for all the comments and keep 'em coming!!<br />
<br />
</div>Kenhttp://www.blogger.com/profile/02720825801825816765noreply@blogger.com6tag:blogger.com,1999:blog-4933229084436849167.post-13884604280478753422010-08-27T22:00:00.000-07:002010-08-27T22:13:10.885-07:00Building Blocks: Anatomy of a DigitHaving already quite a bit of experience with microcontrollers, I decided to tackle the score digits first. I figured that if I could build these, the rest (except for maybe the wireless) would be pretty straight forward. Also, the digit design would be applicable for score digits, the inning digits, and also the balls/strikes/outs display.<br />
<br />
My design criteria were as follows:<br />
<ol><li>The digits must be easily visible from a distance</li>
<li>The digits must be visible in sunlight.</li>
<li>I must have dimming control of the digits for night viewing.</li>
<li>I need to control all of this from a single microcontroller (atMega168 or similar)</li>
</ol><br />
After much research, I found these wonderful chips from TI (TLC5916) and STMicro (STP08CP05). Both are effectively identical. They each have their own value added features (none of which I use), but the basics are the same. They are a 8-bit, constant current, LED driver with cascadable latch registers. Additionally, they work on 3.3V power, which is something I didn’t consider before I started, but is convenient since I’m going to likely have to run the whole thing on 3.3V because of the wireless module I’ve chosen.<br />
<br />
These chips are quite simple. There is an SPI input and an SPI output on the chips. From your microcontroller, you start by sending a byte on the SPI peripheral. This shifts bits across the SPI bus and into the shift register on the TLC5916. Then, if you take the Latch Enable pin low, up to 8 LED driver channels will be lit based on the position of the 1 bits in the byte you sent. Cool!<br />
<br />
If you send more than one byte, as the second byte is shifted into the first chip, the first byte gets shifted out of the chip to the input of the next chip. This allows me to send an entire string of bytes that represent the values I want to display on the scoreboard. Once I’ve shifted all the bytes, then I take the Latch Enable pin low and the LED driver channels light up all at once. Double cool!<br />
<br />
In order for this to work, you have to design your board so that you can easily cascade them. Some pins, SPI in for example, terminate on the chip. Others terminate on the TLC5916, but also are passed on to the next; Latch Enable, for example. Also, the SPI out pins have to be connected to the next as well.<br />
<br />
The LED segments are 10mm red ultrabright LEDs, four in series, and powered by a 11.1 LiPo 4000mAh battery (let’s call it 12V for now). I’ve decided to use a bus bar power design for simplicity. All 12V power and ground are derived from these bus bars and are connected to each digit with a 5mm dual screw terminal connector. The electronics are powered by 3.3V coming in on the cascade connectors.<br />
<br />
A picture is worth a thousand words (or more), so I’ve added a view of what the Score Digit schematic and layout look like. The schematic is pretty straight forward. I simply copied the sample schematic out of the data sheet and then added in my own values and LED design. Then I added in a SPI/Power/Latch bus design that would enable me to easily cascade the digit modules.<br />
<div><br />
</div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><br />
</div><a href="http://1.bp.blogspot.com/_YHAL31XXN6k/THiYRH_C8II/AAAAAAAAABA/fcPmYnQZ-GU/s1600/tumblr_l1sy11u6rQ1qbq9yy.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="298" src="http://1.bp.blogspot.com/_YHAL31XXN6k/THiYRH_C8II/AAAAAAAAABA/fcPmYnQZ-GU/s400/tumblr_l1sy11u6rQ1qbq9yy.png" width="400" /></a><br />
<br />
The layout of the PCB is, even now, in a state of flux. Each time I make one of these, I find something I can improve. Mounting holes, copper fill to help with heat dissipation, layout so I can optionally use SMD resistors and capacitors, adjustments to tracks to allow for easier home etching and drilling, thermals on pads, then no thermals on pads (ended up being a bad idea). Here’s the latest version of the layout, and I may yet change it because I have two more of these to make. There is a variant of this module that I will be using for the inning and ball/strike/out display. Essentially it will be the same. I will post this once I’ve made it.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/_YHAL31XXN6k/THiYTtN2-NI/AAAAAAAAABI/hFMWHpEKQMk/s1600/tumblr_l1sy1kVS1T1qbq9yy.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="http://3.bp.blogspot.com/_YHAL31XXN6k/THiYTtN2-NI/AAAAAAAAABI/hFMWHpEKQMk/s400/tumblr_l1sy1kVS1T1qbq9yy.png" width="267" /></a></div><br />
<div><br />
</div><div>I hope you've enjoyed this segment. More later!<br />
<div class="separator" style="clear: both; text-align: left;"><br />
</div><div><br />
</div></div>Kenhttp://www.blogger.com/profile/02720825801825816765noreply@blogger.com2tag:blogger.com,1999:blog-4933229084436849167.post-72350062749456117082010-08-27T21:56:00.000-07:002010-08-27T22:12:53.660-07:00Building Blocks: IntroductionIt’s pretty funny how my neighbors view my different projects. They’re always asking, “so…why don’t you just buy one of those on the internet?”, to which I reply, “none of those on the internet do exactly what I want them to do.”<br />
<br />
This project is no different. I wanted an open scoreboard hardware platform that I can control from common wireless devices (mobile phones, netbooks, etc.) I also wanted a scoreboard that didn’t cost me $1000 and that I could actually repair myself. Well, I haven’t exceeded the $1000 mark, but it hasn’t been a cheap project either. Subsequent versions (i.e. those made by fans of the blog) should be significantly cheaper without all the trial and error (and error, and error, etc.)<br />
<br />
When I began to plan this project, in earnest, I quickly decided that the best way to pull this off would be to cut the project down into building blocks. Mass produced products benefit from a single monolithic PCB that does everything. For me, that simply isn’t the case. This thing needs to be modular so that I can build the smaller building blocks, test them, and then move on to others. I’m going to detail each building block in a series of posts along with the files I used to create them.<br />
<br />
The building blocks I am working on now are score digits, inning digits, balls/strikes/outs, microcontroller, and finally the wireless interface.Kenhttp://www.blogger.com/profile/02720825801825816765noreply@blogger.com0tag:blogger.com,1999:blog-4933229084436849167.post-58094861817593484712010-08-27T21:41:00.000-07:002010-08-27T21:45:32.206-07:00I don’t need no stinking drill press!<div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/_YHAL31XXN6k/THiTV-dwCmI/AAAAAAAAAAo/umnACjdJKpU/s1600/tumblr_l0p4l3g4jL1qbb813o1_1280.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="http://2.bp.blogspot.com/_YHAL31XXN6k/THiTV-dwCmI/AAAAAAAAAAo/umnACjdJKpU/s320/tumblr_l0p4l3g4jL1qbb813o1_1280.jpg" width="320" /></a></div><br />
<br />
That’s right. I drill my holes by hand. Yes, I even own a rather large drill press, but I find it easier to achieve the precision I’m looking for with a simple hand drill.<br />
<br />
This is one of the 7 segment display boards for the scoreboard. I did the layout in Eagle and then used the toner transfer method to put it on some 4”x6” copper clad I bought on Ebay. I use a solution of diluted HCl and H2O2 as etchant. It works great and is a bit greener than the Ferric Chloride method. Do a search at Instructables. There’s a couple instructables on this method of etching.Kenhttp://www.blogger.com/profile/02720825801825816765noreply@blogger.com0tag:blogger.com,1999:blog-4933229084436849167.post-54733583138477540362010-08-27T21:36:00.003-07:002010-08-27T21:45:44.803-07:00<object height="344" width="425"><param name="movie" value="http://www.youtube.com/v/P0Y4lHB3g_I?fs=1&hl=en_US&rel=0&color1=0x3a3a3a&color2=0x999999"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/P0Y4lHB3g_I?fs=1&hl=en_US&rel=0&color1=0x3a3a3a&color2=0x999999" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object><br />
<br />
<br />
<br />
Here’s a preview of where I am at right now with the scoreboard. Unfortunately I did not think of blogging my progress until now, so I’ve made some significant progress already. I will try to go back and document most things I have done so far. Stay tuned for that.Kenhttp://www.blogger.com/profile/02720825801825816765noreply@blogger.com0tag:blogger.com,1999:blog-4933229084436849167.post-30275484425671312222010-08-27T21:14:00.000-07:002010-08-27T21:14:26.954-07:00Let's Get Started, Shall We?A few years ago, I realized that there were many things I've always wanted to do and learn, but never took the time. Some of these things come from as far back as when I was a kid, but I never had the time or the opportunity to pursue them.<br />
<br />
So...I took up Snowboarding. Now, a 38 year old on a snowboard for the first time is a comical thing to see. After a few years and a couple mishaps where I smashed my knee real good and almost knocked myself out even though I was wearing a helmet (thankfully), I decided that I scratched that itch enough and should move on.<br />
<br />
So...I decided to build a robot. Oh yeah, it was going to do everything and I knew exactly what I wanted to do. I realized that I knew bupkis about anything to do with electronics and mechanical engineering. I did know that I have some significant skills as a programmer, so I hoped that would help compensate for my other deficiencies.<br />
<br />
In programming, things are on and off, true or false; values are known and don't deviate. I came to find out that it is not the same in the real world of electronics and mechanics. No amount of programming prowess was going to compensate for my electronics and mechanical newb-ness. I was going to have to learn how to reign in an analog world into a digital format that I can work with.<br />
<br />
So...I decided to learn electronics. Digital electronics, at first, because it fits best into my digital view of the world. I went through the whole breadboard , then toner transfer, etching, and building my own circuits. I've learned a lot in this journey.<br />
<br />
So...I decided to scrap the robot project. Why? Well, to be blunt, most robots I saw during my journey in electronics fell short of the expectations I would have for myself. Some stood out, but it was clear that there was a significant amount of electronics, mechanics, and programming skill behind them that I felt I simply didn't have at this point. What to do then?<br />
<br />
Well, I figured I should hone my electronics skills by building a project of significant complexity in electronics. Next I should hone my mechanics skills by building a project of significant complexity in mechanics. For my first project, I decided that I should build an electronic scoreboard for my daughter's softball team. The beauty of this project is that it involves almost no mechanics whatsoever. That way my lack of experience with mechanics won't stall the project.<br />
<br />
This is where I am today. Building the scoreboard. And this blog is my attempt at documenting my successes and my failures. Along the way, I expect to be able to post valuable information for others to use, and hopefully I can also see some feedback from the community for improvements to my project.<br />
<br />
I have many other interests and projects going on, so you may see much more than just the scoreboard on here. Feel free to enjoy my other ramblings as well.<br />
<br />
Thanks for reading!<br />
<br />
Ken.Kenhttp://www.blogger.com/profile/02720825801825816765noreply@blogger.com0