Recent Updates

I have been off doing other things.
Some of my work has been with clients, some has been in some classes in Business Administration that I have taken to run my company better.

The latest effort is back to the Um Counter project.
One thing I have looked at is the cost of doing the project with discrete components as shown or using a microcontroller.
It turns out that using a microcontroller is about 40% less expensive and allows me to add a lot of features.

The down side is I have to flail at things that I have no control over, such as the Arduino software. The biggest problem is that the documentation I have seen for using an SPI bus calls out an spi.h file that doesn’t seem to exist.
But that is okay, I just wrote my own from scratch.

Unfortunately I am getting ahead of myself.
Why would I need to use a 74HC595 serial to parallel shift register?
There are two different microcontrollers used on Arduino boards. (Actually there are three but the ATmega 168 and ATmega 328 are very similar.)
The micro on the Arduino Mega boards is the ATmega 2560.
At first I planned to just use the ATmega2560 because an interim prototype had been built as a shield for an Arduino Mega.
At Digikey, the ATmega2560 is $17.97 in quantities I can use.
The ATmega328 is $3.93 in the same quantities, 4.5 times less expensive.
All I need is additional outputs to run the display, so what else works?
It turns out that the 74HC595 sells for $0.73 which means I could use two of these and still spend less than half of what the ATmega2560 costs.
So if you need more outputs at a low cost the ’595 does just what I need.

So how do I develop code without having the finished boards?
Use prototype boards!
This will allow me to develop the code to drive the 74HC595 as a function (subroutine for folks with a ForTran background.)
This is the circuit:







To make a long story short here are the code sections:
The Header

/*************************************************************/
/* Sketch to set up a function to send data out an SPI */
/* to a 74HC595 Serial to Parallel Register Chip */
/* BConley Circuitsville Engineering 15 Jan 2012 1617PST */
/* Does NOT Make use of Included Arduino SPI functions */
/* Uses an Arduino Nano 3.0 w/ ATmega 328 */
/* On q proto board */
/*************************************************************/
/* Inputs: */
/* SDATIN on Board, Arduino Nano pin 15, D12, MISO, PB4*/
/* SENS_P5V on Board, Arduino Pin 19, A0 (analog) */
/* SENS_D_P5V on board, Arduino Pin 20, A1 (analog) */
/* Outputs: */
/* SDATOUT on board, Arduino Nano Pin 14, D11, MOSI, PB3*/
/* SCLK on board, Arduino Nano Pin 16, D13, SCK, PB5 */
/* XTRIO_CLR on board, Arduino Nano pin 14, D10, PB2 */
/* OUTCLK on board, Arduino Nano Pin 11, D8, PB0 */
/* Other IO: */
/* Green LED, Arduino Nano Pin 6, D3, PD3 */
/* Red LED, Arduino Nano Pin 7, D4, PD4 */
/*************************************************************/
/* 74HC595 considerations: */
/* MSB is first out, first in */
/* */
/* NOT Use SPI.setBitOrder(MSBFIRST) */
/* Output HIGH turns LED OFF */
/* 74HC595 Has TWO (2) Clocks !!! */
/* Both clock data on the rising clock edge */
/* SCLK clocks data into the register */
/* OUTCLK clocks data into the output register so it is seen*/
/*************************************************************/
/* Pre Set up (Declarations and such) */
/* NOTE: SPI Library does NOT work, so do something else */
/*************************************************************/
/*FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF*/
/* 74HC595 Function code section Declares & Defines */
/* Required FUNCTION Stuff-copy & paste into calling routine */
/*FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF*/
//int xtraIO_Clr = 10; Not used in this application
int clockPin = 13; /* Define register clock as Arduino D13*/
int dataPin = 11; /* Define serial data out as Arduino D11*/
int outClkPin = 10; /* Define output reg. clock as Arduino D10*/
int sDatInPin = 15; /* Define ser. Data input as Arduino D15*/
/*FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF*/
/* End Rqrd FUNCTION Stuff-copy & paste into calling routine */
/*FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF*/

What goes into the SETUP() Function

/*FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF*/
/* 74HC595 Code for the SETUP function */
/* Required FUNCTION Stuff-copy & paste into calling routine */
/*FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF*/
// pinMode (xtraIO_Clr,OUTPUT);
pinMode (clockPin,OUTPUT);
pinMode (outClkPin,OUTPUT);
pinMode (dataPin,OUTPUT);
pinMode (sDatInPin,INPUT);
digitalWrite(outClkPin,LOW);
digitalWrite(clockPin,LOW);

// digitalWrite(xtraIO_Clr,LOW); /* this Clears the HC595 */
// digitalWrite(xtraIO_Clr,HIGH);
digitalWrite(outClkPin,HIGH); /* loads the cleared reg into output */
digitalWrite(outClkPin,LOW);
digitalWrite(redOut,HIGH);
digitalWrite(grnOut,HIGH);
/*FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF*/
/* End Rqrd FUNCTION Stuff-copy & paste into calling routine */
/*FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF*/



The Function Code

/*FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF*/
/* Required FUNCTION Stuff-copy & paste into calling routine */
/*FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF*/
/*************************************************************/
/* sendHC595 function */
/* function to send a byte to an 74HC595 serial to parallel*/
/*************************************************************/
void sendHC595(unsigned char Data){
unsigned char SendCnt, BitCnt;
unsigned char DatClk = 0;
// shiftOut(dataPin, clockPin, MSBFIRST, Count);
SendCnt = Data; /* Copy Count into SendCnt*/
while(DatClk0){
digitalWrite(dataPin,HIGH); // If Bit is High, Put out 1
}
else{
digitalWrite(dataPin,LOW); // If Bit is LOW, Put out 0
}
SendCnt = SendCnt << 1; //Shift left one place
delay(100);
digitalWrite(clockPin,HIGH);
delay(100);
DatClk++;
} /* End clocking out, DatClk loop */
DatClk=0;
digitalWrite(outClkPin,HIGH); /* This sequence loads the data out */
delay(100);
digitalWrite(outClkPin,LOW); /* End data out squence */
} /* End sendHC595 function */
/*FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF*/
/* End Rqrd FUNCTION Stuff-copy & paste into calling routine */
/*FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF*/



That wasn’t too hard, was it?

Posted in Engineering, Money, Technology | Leave a comment

Choices, the Design Continues

The title of this post is what happens at this stage of the design. The development path can go one of two ways or get split between two people. One path is to generate a board layout from the schematic. I will talk about that later, if I can. The other is to generate a Bill of Material from the schematic and begin figuring out what this will cost. Actually I had already checked that the parts were available, not discontinued or on back order and not outrageously priced. I also had to download the datasheets to check that I had the right part for the footprint on the board about to be laid out.

The Bill of Material or BoM generation is automated in EAGLE. During the schematic capture phase of the project I will often run a BoM organized by values to find any parts that should have the same information but don’t. For example if I gave a resistor the value of 10.0k instead of 10.0K. (Yes capital letters mean the part gets put into a different list. The other reason to run a BoM, to find typographic or other errors in the schematic.) Here is an example:








Notice that there are two lines with 10.0K resistors, something that needs to get fixed. But it is also an example of what a values organized BoM looks like. Often I will save this file with the ending of “Check BoM” since I will also use it later to verify that I have the correct number of each part.

The other organization of the Bill of Material is by Part. Here is an example:













This Bill will get imported into a spread sheet program and given the title of Raw BoM. It is a relatively laborious process because there is no easy way to automate the import. So it is mostly done by hand. Later this document will be used to help create the hand assembly instructions, mostly as a check off list that all the parts have been accounted for in the hand assembly. The other thing I do with this particular spread sheet page is collect the library information.










Library information is critical because of a trap within the EAGLE software. If you load a new version of EAGLE into the same directory as your existing version it removes all the custom libraries and over writes all of the EAGLE provided libraries with new copies. So if you want to be able to updated this version of your board I will need to make an archive of all the files used including the library files. I create the archive after the boards are ordered anyway. Yes, I was burned by this once. So now I am careful.

The “Side” column gets filled in after the layout has finished. One of the reasons I care what side a part is on tells me how many copies of that side of the board I need to make for my hand assembly instructions. The other reason is that several automated assembly houses charge each time you use a particular part on a side. Thus if you use a part both on the top and on the bottom of the board you get charged twice. I like to prevent that cost when I can.

The next step in the Bill of Material analysis leads to what I call the “Info BoM”. In this listing or bill I am not concerned by each individual part but more for each part type, how many of each type there are and how I order them. How many of each part, or Quantity, comes from tallying up all the instances of a particular part on the Raw BoM and then checking that count with the Check BoM. If there is a discrepancy it is probably a typo on the schematic that needs to be fixed. There have been times when generating an accurate quantity has taken two or more iterations.

Once the quantity is correct then I look at the other specifications of the parts. What tolerance do I need? What other information is critical? In the example below the capacitors have a choice of 25 Volt or 50 Volt. The choice may be from information in the circuit or it might be that I can simply not get that part with that parameter in a reasonable time. (There is an example of that coming.) So here are the early columns of the Info BoM:









Moving right along the row the next type of information is the source of the part or the Vendor. Also what number the vendor uses for the part that I want. In the case of this capacitor the Venkel company (www.venkel.com) comes up most often. In decoding the part number I see that one of the 50 Volt versions of this capacitor is an X5R dielectric and the other is a X7R dielectric. I won’t discuss the trade offs between the two here, but sometimes it is important. (A beginning discussion can be found at www.circuitsvilleeng.com/sabertc.htm





Moving further right shows some of the reasons why the 25V capacitor was selected instead of the 50V. These columns show what the individual cost of the component is, the Unit Cost, and how many I have to purchase to get that price. In this example the part cost is $0.01 or one penny each but only if I buy a reel of 4000. This means an upfront investment of $40 for these parts. That price is relatively low, for example I had to purchase for a customer 390 of a part for $2.59, or over a thousand dollars of up front cost even before any were sold.





The next two columns are ones that I find most useful for a project. The first is what these parts cost on this board, or the individual part cost times the quantity on the board assembly. The costs in this column are totaled at the bottom of the list and used in the next column. The column heading is “Percentage of Total” and is the cost of this part type is as percentage of the total assembly cost. This column is useful because it tells me where reducing part cost would have the most impact on assembly cost. For example using one less capacitor saves me only a penny and less than 1%. But a buzzer at $3.49 each is 13.9% of the total, so if I could find a cheaper buzzer I could save some significant money on the assembly. This savings could be used to reduce the cost of building the product and thus either reduce the price so as to sell more units or simply to increase the profit margin.

The final two columns answer the question I posed earlier in this discussion. The question was why use the 25 Volt capacitor instead of the 50 Volt version. The Lead Time is how much time the vendor needs to build the parts before they can be shipped to me. For the 50 Volt capacitors the lead time was 10 weeks. (Yes, almost 3 months.) The 25 Volt capacitors could ship the next business day, so after checking the electrical requirements waiting 10 weeks was not necessary.

The final column is an inventory I keep on parts for each client. Not only do I have to find all the information about these parts but when the order comes to make an assembly I need the parts, either to build a small quantity by hand or take to an assembly house to run a large batch. If I don’t have enough parts I better get the order out in time to keep the schedule moving.

That was the basics of Bills of Material, how I use them. Next I get to try to explain board layout.

Posted in Engineering, Mathematics, Money, Technology | Tagged , , , , , | Leave a comment

The Design Continues,

last of the hard stuff & loose ends…

In general, counting chips only require a pulse on the clock line.  More specifically a rising or falling edge of a pulse but that might be a little too much detail.  To be simple and direct, the trigger is what generates this pulse. But the buzzer is different because it does not care about the pulse edge but the length of the pulse itself.

The alarm is difficult because what is desired is not a buzz or a beep as long as the switch is closed but a short beep just long enough to be heard by the speaker but no more. But the question is how long should the buzz be? This is harder than it might seem. I don’t know what the studies of human perception have shown about what the minimum duration of a sound is to be heard. And how does that differ from person to person? Can I make the sound so that the speaker hears it and knows it happened but so that the audience does not notice? (And I did try to find information via a Google Search, too much and too technical.)

The buzzer itself is something I have used my self several times over the last 20 years. It comes from Radio Shack, of all places, and is real easy. Apply power and it screams. Turn off power and it shuts up. Works over a voltage range of 5 to 12 so is good most anywhere.

The best think I can try as a discrete chip is a “Monostable Multivibrator”. The particular chip is a 74121 which is supposed to be triggered by the rising edge of a pulse then stay high for a length of time that is set by two other components, a resistor and a capacitor. But what values of those should I use? As a first start I chose a 1.0uF capacitor and a 10.0k Ohm resistor. That should give me a pulse of six or seven milliseconds or 0.006 to 0.007 seconds. Yes, I could see that on the oscilloscope, but could I hear it?


Alarm circuit based on 74121













So this is an experiment. Can I hear a 7 millisecond sound? Or will I have to try several different values of capacitor and resistor to get what I want? That will remain to be seen.

One thing I did get from talking to potential customers about this idea. Some people want the beep, some don’t. So I added a switch to the circuit to stop the triggering pulse to the beep.

At this point I have the schematic captured. Although there is something to note, namely the miscellaneous stuff. These are two types. First are holes for legs or “stand-offs” for the board. These keep the electrical parts from touching and shorting out with the metal box that this board will, most likely, be packaged in. Four of them, one for each corner of the board.

The other type of thing is a “fiducial”. These are little markers so that the automated assembly equipment can map what it has been told about the board to an actual piece of fiberglass. On the schematic neither the stand offs nor the fiducials are an active part but they will be needed on the board layout so they must be included here. Fiducials are three per side, assuming that there will be parts on the front and the back of the board. Having parts on the back of the board does increase assembly cost but often it is either good to do electrically or is the only way to get all the parts into the amount of board allowed. (Like 5 pounds of parts on a 2 pound board perhaps?) And at this point I can’t make the decision yet to NOT to put parts on the back side. On the other hand this is a prototype that I will hand assemble, should I care?
That will depend on the next step…


Miscellaneous Parts

Miscellaneous Parts Necessary for the Layout and Final assembly










Next time: There is a fork in the road for the design path, which way will I go?
Also, is this useful to you?

Posted in Engineering, Mathematics, Technology | Tagged , , , | Leave a comment

A pause for some Fun stuff…

I did this a couple of years ago. As an engineer, I deal with tolerance. Not the racial, ethnic,or gender kind but parts tolerance. Meaning how far off can the value of a part be from what I designed and still have the thing work? This is something an engineer has to do for every design.

A news story that got my attention was that some legislative body had decreed that the mathematical constant Pi would, hence forth, have the value of 3.000.

How nice of them.

But as an engineer, I wondered how far off your results would be if you used 3.000 for Pi. And since it was easy to do in a spread sheet, why not see how each significant digit changed that error?

From a commercially available spread sheet program, whose manufacturer will not be named, I used the Pi() function (cell contents are “=Pi()”) which gave me an approximation of Pi to 15 significant digits as a reference value. The column “How Close?” is simply the estimated value divided by the reference value. The “Error” is the difference between How Close and unity.

The Table:


Table of Approximations to Pi and the resulting error.










The results are interesting. Using just 3.000 means that you are within 5 five percent from the actual value. Often this is well within what is considered “engineering accuracy”. Better yet, adding only two significant digits to the approximation of Pi gets your error to down to the range of hundreths of percent. But as you go further the adding of each significant digit improves your estimate only slightly.


Were the legislatures right? That might depend on if you are buying something or selling something.


As for me, I will do my own calculations thank you very kindly.

Posted in Engineering, Mathematics | Tagged , , | Leave a comment

The Design Continues, The hard stuff, part 1

I thought I would do all the hard stuff in one post.  Silly me.
Plus I had to hack into the HTML code because the defaults from WordPress dot com don’t format text with graphics very well.
(Didn’t know I could do that, did ya’? ;-) )

In the previous posts I talked about the counters and how their output got to be displayed.  Now I need something to count and how to count it.

In general, counting chips only require a pulse on the clock line.  More specifically a rising or falling edge of a pulse but that might be a little too much detail.  To be simple and direct, the trigger is what generates this pulse.

The trigger is difficult because switches inevitably bounce or chatter, a single button push or switch closure could create multiple counts. Switch bounce is an artifact of using a mechanical device that contains its own energy storage elements, even if they are simply parasites on the device. A good discussion of this problem is found in an application note by Maxim, Application Note 287. (see www.maxim-ic.com/app-notes/index.mvp/id/287)
[Had I know about the Maxim MAX6816 before the design started I might have tired them. They appear to be carried by most distributors and cost about $3.50 each.] Compounding the bounce issue is the switch I want to use.

In previous designs I used a switch which had both a normally closed and a normally open connection. One side is always high and the other low because both have pull up resistors. This forms a “complimentary pair” of signals the work well with the RS latch used to block out the bouncing. The “Normally Closed” or NC contact is usually pulled down to ground. The “Normally Open” or NC contact is pulled high. During a change, contacts will be open causing both outputs to be high. In the RS latch discussion below you will understand why that is good.

Circuit for a Normally Open and Normally Closed Switch






























But the switch I plan to use has only a Normally Open contact, so I will have to somehow generate a complimentary signal to feed the latch correctly.

Simple, Normally Open Switch Circuit


















































The RS or Reset-Set latch is one of several methods of debouncing switch signals.  It is a method I have used successfully before.  Most often these types of latches are made of Nand or Nor gates, such as this circuit of Nand gates:

Set Reset Latch Circuit Constructed of two Nand Gates













The truth table for the Nand or Not And gate is shown here for convenience:

Logic Truth Table for NAND gate












A quick explanation:

An AND logical function has a High output (Logic 1, 5V, etc) only when BOTH inputs are High.

For a NAND, take an AND logic function and invert the output.  Thus when both inputs are high the output is low.  (when any input is low the output is high)

The gate truth table is used to generate the RS latch truth table:

Set Reset Latch Truth Table for Nand Implementation













The latching action of the circuit holds the previous state independent of the input to the latch. Thus keeping the switch bounces at the switch.

The latch itself is pretty straight forward, but how do I generate this complementary set of signals? My choice was to use a comparator, an LM393. By using a reference voltage and opposite polarity inputs generating a complementary signal should be easy. So the circuit now looks like this:

Simple Switch with Comparators








{Essentially Comparators make a decision, if the input is greater than the REFerence the comparator turns on which generates a logic Low signal.  Otherwise the output is a logic high.}

But this is something that I am not sure of, so I choose to simulate this section. I have a copy of Linear Technology’s Switcher CAD, which is a SPICE based simulator and should give me some insights into how this circuit should behave.


Simple Comparator Simulation circuit








Input Voltage V2 simulates the voltage at the top of the switch

Looking at the simulation results, all looks as expected.

Simulation Results for Simple Comparator Circuit



But I zoom into a transition point to see what is going on and there could be trouble.

Close Up of Simple Comparator Circuit Simulation Results

































There is a point were both outputs are low. Yes it is only a few nanoseconds, but let’s see if there is a better alternative. One thing to try is to create a high and low reference voltage. I do this by adding a smaller value resistor in the middle of the reference divider, as shown:

Comparator Circuit with Reference Hysteresis








This gives me better results:

Simulation Results for Comparators with Reference Hysteresis








Now there is no time when both signals are low. In fact there is a nice overlap of high signals. Only 2-3 micro seconds, but still adequate.

Simulation Results, Comparator with Hysteresis, Close Up


































So the final Trigger circuit looks like this:

Final Version of Trigger Circuit





















I have added small sketches of what the signal should look like at significant moments of use. This will, hopefully, help me debug the circuit later.

(Also be aware that I did try other values for R104, the Hysteresis resistor.  The 499 Ohm value seemed to work best.)

This took longer than I had planned, so I will have to talk about the alarm next time.

It seems that WordPress can not adequately deal with formatting text with figures.  I finally had to go into the HTML code and add things and remove things to get what I wanted. And keep the whole thing from looking awful. Quite tedious.

And anything that I pasted in from something like word gets strange formatting that I had to remove.

So what kind of work will the next post take to do?.

Posted in Technology | Tagged , , , | Leave a comment

Sorry for the delay

I wanted to get the post out today.

Unfortunately WordPress had other ideas.

WordPress is not capable of having a blog post with both text and figures.  That explains a lot about why there are so few real technical blogs here.

It also can’t deal with changing fonts or font sizes.

I will have to see if I continue with WordPress or find a blog site that can deal with what I write.

I also need to figure out if there is a way I can tweek the HTML code to get the formating I need.

I never thought I would come to hacking to get something done.

Posted in Technology | 2 Comments

Continuing the Design

The Design, Part 1

The Easy Stuff

The “Easy Stuff” is the Power Block, the Counter, the Display, and the Reset.

The Power Block is simply a regulator and capacitors. The power decoupling capacitors for each IC are also included in this section.

The regulator, a 78M05 is a lower power version of the venerable 7800 regulator that has been in use since the mid 1970′s. It is simple to use, inexpensive, and reliable. It also has internal protection circuits to limit damage from overheating or a fault current. This regulator gets a 1.0 UF capacitor on the input and output.

All other integrated circuits get a 1.0 UF capacitor across the power pins. This decoupling capacitor needs to be placed as close as possible to the power and ground pins of each chip for maximum effectiveness.

The last part of the power section is the indicator LED. If you read my story in EDN’s “Tales from the Cube” you can understand why.  Link: http://www.edn.com/article/509479-Go_on_green.php

Um Counter Power Regulator Section

The counters are the second section designed. Each 74HC192 counter chip has four inputs for preloading. These are tied low, so if a load happens it is the same as a reset or clear. The Load Control input, the pin which controls the load is tied high to prevent loading. Likewise, the Terminal Down Count is tied high, insuring that this counter will only count on way.

For the first stage, the ones count, has the “Up” pin (“Terminal Count UP”) connected to the trigger section. Each press of the trigger button advances the count by one. On the output side the Terminal Count Up (CO) and Terminal Count Down (BO) are connected to the Count UP and Count Down pins of the next stage, the tens count. The output count, Pins Q0 through Q3 are the binary count, actually Binary Coded Decimal. These output pins directly feed into the display section.

In this case I have used the counters to count events. Another use of these is in a frequency division. For example taking a 16 bit counter clocked by a 10 Hz source gives you 5 Hz on the MSB pin, 2.5 Hz on the next significant bit pin, and 0.625 Hz on the LSB pin. One problem with doing this, especially if you are trying to use this to create music, is that all of the signals are Phase Coherent. A designer of electric organs once explained to me how bad this sounded, although I haven’t experienced it myself.

Counter Section

The next section of the Easy Stuff is the Display.

This section makes use of the Seven Segment LED driver chip, the 74LS47. This chip converts the binary input to the signals needed to turn on each LED of the Seven Segment Display. Logically this is referred to as binary to seven segment conversion. In addition to the logic in this IC are current drivers that act as switches to control the flow of current. These switches close to ground to turn on a segment of the display.

The Seven Segment LED displays are directly connected to the 5 Volt supply. To limit the current through each segment a series resistor is connected between the segment pin and the 74LS47. This allows the LED segment to last instead of failing in a bright flash. The only additional connection on the display LED is to tie the decimal point pin high to keep it from turning on.

Also note that, contrary to most numerical displays, the ones digit is to the left of the tens digit.  This is the joy of a schematic, here I can simply place and connect the parts to have the most logical connections.  I do have to keep track of what I am doing though, so the signal names make sense such as “OnesMSB” and “TensLSB”.  (LSB stands for Least Significant Bit, MSB for Most Significant Bit)  In the layout I will have to conform to the expected format of tens digit on the left and ones digit on the right.

Two Digit, Seven Segment LED Display

One thing that I want to try on this project is using smaller component sizes. Usually I use 0805 size or 1206 size, but now I want to move smaller. For resistors, this will be an 0603 size, meaning that is 0.060 inches long and 0.030 inches wide.   These are readily available but will they stand the power? The worst case for that would be the display.

The circuit for the display is simple. A 499 Ohm resistor connected between the cathode of the LED display segment and the switch to ground inside the 7447 IC. Assuming that the voltage across the closed switch is zero the worst case current would be the voltage across the resistor divided by the resistance. The voltage across the resistor is the 5 V supply less the forward voltage of the LED, Vf. For this LED the “typical” forward voltage is 2V. That leaves 3V across the resistor, giving a current of 6mA and a power of 18.04 milli Watts. For the resistors I have chosen, the maximum power is 63mW, so this is a ratio of 28.6% of rated which is well within the acceptable range of 80%. At maximum forward voltage, 2.6 V in this case, the voltage across the resistor is less meaning the current is less and the power is less. Taking into account the voltage across the switch inside the 7447 (0.3V to 0.4V) reduces the current and power even further.

To take this design adequacy check to its logical conclusion, I also need to verify that the current on each LED segment is less than the maximum forward current for the seven segment LED display and less than the maximum current that can be sunk by the switch inside the 74LS47. The 6mA current expected is much less than the 25mA maximum for the LED ( a Lite On Electronics LTS-546AHR) and is also one quarter of the 24mA maximum for the 74LS47 integrated circuit.

The other thing to note is that I use resistance values from the E-96 list. (see www.logwell.com/tech/components/resistor_values.html for further information) These are one percent tolerance parts. Most times I don’t need that much accuracy, but in a large design it is best to use the same type of resistor.   For example if you need a one percent 10.0k Ohm resistor it is best to make all the 10.0k Ohm resistors on the design one percent tolerance. That way you have only one part type, so less chance you will put the wrong tolerance resistor into this spot. Plus, given the cost of 0603 size in reels of 5000 is about $9.00 per reel or $0.0018 per part (0.18 cents per part or five for a penny in US Dollars), you won’t get much savings by having two different versions of the same resistor. Finally, most automated assembly houses charge for each reel used thus having two different reels of the same resistor value doubles the assembly expense for that part.

The last section of the Easy Stuff is the Reset.

The Reset in this case simply sets the count back to zero. For the 74HC192 the CLEAR pin is held low during counting. To reset the count to zero simply bring the CLEAR pin of both chips up to 5 Volts for a short time. Doing this manually, with the push of a button is most often a long enough time to clear the count. Instead of just connecting this to ground, the CLEAR pin is connected through a 10.0 kilo Ohm resistor. In digital design parlance, this is known as a “weak pull down”. Putting a switch to 5 Volts at the clear pin allows the pin to be pulled high for a short time without causing a short across the power supply that would cause other problems.

If you were concerned about the current flow, you could add a resistor between the switch and 5 Volts. A value of 100 Ohms would not significantly reduce the closed voltage and would prevent any accidental current spikes. In this design I judged that extra resistor to be an unnecessary expense, because of the use of more board space, another part on the bill of material, along with potential assembly errors.

Reset for the Counters

This is the easy part of the design. Next are the two difficult parts of this design, the Trigger and the Alarm.


Posted in Technology | Tagged , , , , , | Leave a comment

Welcome to Circuitsville Engineering’s blog.

As a start for this I have a design in development what I can talk about.  It gives you, the reader, an idea of the kinds of services that Circuitsville can provide.  The scary part is that it also gives you a view into the design process and into my mind.

I wanted to add to my website (www.circuitsvilleeng.com) the steps that I take along the path of a design.

Unfortunately most clients want their designs kept confidential, so I respect their wishes and looked for another idea.

Someone at my Toastmasters group, Creekside Toastmasters in Beaverton Oregon, suggested something to make a noise when the speaker uses the word um, uh, but, or any of the many other words that just take up space and cover for silence when you think.  As a Toastmaster extraneous words such as these, or phrases like “ya’ know” or “like, man” are avoided and we work constantly to improve.  In the meeting it is the responsibility of the Grammarian to report how you did at the end of the meeting. But some people  prefer the immediate feed back of a click, a buzz, or a beep as a reminer of something they need to improve on.

So this will be a project called the Um Counter.

A quick comment about hardware version numbers:

In many organizations as a product idea goes through development it is important to keep track of just which version you have in front of you.   (This keeps you from fixing problems that have already been fixed. ) Typically prototypes begin with a capital A then a number for the version, for example A0 is the first prototype.  A1 is the second, A2 the third, etc.  Sometimes the version has a major change or experimental idea along the way so the version number might become A1b.

Once the decision is made to convert the prototype to a product the version moves to B, probably B0 for the first production version.

(If you are familiar with software, they do something similar.  There are other versioning systems out there, this is the one I use.)

But you will see how that actually happens as the project grows.

Counters are easy, there are several examples of TTL or CMOS synchronous or asynchronous counters. Relatively inexpensive and quick to impliment. I have used the 74xx193 before, a binary counter, but this should be easily a 74xx192 which is a BCD or Binary Coded Decimal.    But to get ideas and talk to potential clients I figured I would do a block diagram.

Note: The EAGLE schematic capture software that I use is not set up to do hierarchical design.

Even with that it is relatively simple to create a block diagram in EAGLE.

This is what I got:

Block Diagram of the Um Counter
Block Diagram of the Um Counter

  1. There needed to be a switch to turn off the beep, buzz or other alarm sound used
  2. Counting from zero to 99 would probably be adequate.  (Thus limit to two digits worth of counters and displays.)
  3. For development, power could come from a “wall wart” type of AC adaptor (for an explanation see http://en.wikipedia.org/wiki/AC_adapter)  Future versions would be battery driven, as soon as a battery type and capacity are determined.

From this I could start a design and once I had a prototype take it out to have people try out.  This way I could get feed back for potential improvements.



Posted in Technology | Tagged , , , , , , , | Leave a comment

Hello world!

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!

Posted in Uncategorized | Leave a comment