Just to let you know what lies ahead....
If you want to go from making a hand-built breadboard or prototype to actual PCB's, you have a lot of hours and anywhere from several hundred to a few thousand dollars cost in front of you, depending on how much you are willing to do yourself.
Schematic capture and PCB layout
First of all you need to capture your design using some sort of schematic capture program, and then design a PCB. One of the more popular programs is EAGLE, which I use. They have a EAGLE Light version ($49), but it can only be used for schematics with one sheet (any size), two signal layers, and 100x80mm (approx 4"x3") routing area. For any serious work, you need at least the EAGLE Standard version, which costs $747. There are probably other less costly (even free) alternatives. There are lots of others that cost thousands or tens of thousands of dollars. In any case you will have to spend considerable time learning how to use the program.
Or you can pay someone like me to do it for you ($$/hour).
PCB Fabrication
Getting boards made is the next step by a PCB fabricator. The problem here is the NRE (non-recurring engineering) costs. Some board houses treat this as a separate figure, and others built it into their per-board quote. In any case, it is almost never economical to have just a few boards made. You might spend $100 for two boards, and $500 for 25. You need to have really large quantities to get down to just a few dollars per board.
The gotcha is, if you make 25 boards, populate just a couple of them for testing and find they don't work (and there is not an easy fix -- e.g. because you laid out a connector backwards), you might end up throwing away the other 23 blank boards away and you would have been better off just getting two. I have stacks of blank PCB's as evidence of this phenomena.
PCB Assembly
Unless you are willing to build the boards by hand, you will need to have them assembled. Surface mount packages are difficult to deal with. If the board has BGA or QFN packages, you probably won't be able to build them yourself unless you have your own reflow oven.
Getting your first two boards built by an assembly house might cost $500. Whereas getting 25 built might cost $1200. (Once again, the problem here is the NRE costs.) Getting down to just a few dollars per board requires (again) large quantities.
And someone else has already discussed the problem of getting parts.
Make sure you use parts that are readily available -- if both DigiKey and Mouser have hundreds of the part available you should be okay. If instead, they have it in their catalog, but it is currently out-of-stock, try to find something else. If you need some special parts that aren't carried by DigiKey or Mouser, make sure you have a reliable source before incorporating it in your product. (Note: the more unusual parts you use, the more likely you will have to add the part manually to your PCB parts library.)
Custom Cases
Do you want to put your board into a case? If you need to have a custom case designed, that will be a couple thou for the designer using a program like SolidWorks (I don't do that, but can recommend someone who can). If you are going to make just a few cases to begin with, you will probably need to go with rapid prototyping, such as Selective Laser Sintering (SLS). Figure at least $100 per case in small quantities. To get down to a few dollars per case cost, you need to have a custom mold made. NRE time again! Plan on spending $10,000 or more for the mold.
And I won't even start on EMC or EMI testing, since I don't know if it applies to your product.
As you can see from all of this, until you get into production, the cost of the electronic parts is usually not the biggest item on a per board basis. Doing your own assembly for small volumes will save you a lot of money. So it is important to design with that in mind -- no impossible to solder-by-hand parts.
To get really low prices for high-volume, generally you need to go offshore -- China etc. But I would avoid doing so in the beginning.
In my industrial experience, the way things generally go in terms of a design cycle follow this sort of flow (condensed version):
- Market research/contact with a customer (identification of the what the basics of the product should be)
- Establishment of a specification (or "spec" as it's often abbreviated)
- A formal quotation and business agreement between the parties (or between engineering and marketing for a 'standard' product)
- Initial design / calculation / simulation / debugging
- Design validation testing, or DVT (you making sure the product meets the spec)
- Bugfix implementation / regression test
- Independent DVT (someone else making sure the product meets the spec)
- Safety and regulatory approvals
- Design for manufacturability review (DFM)
- Production release / marketing release
If you have a project that you've developed, and you feel you're ready to market it, you may want to consider some or all of the following points:
- Write a spec if one doesn't exist. Characterize the typical performance of the product and put this in the spec, as well as any absolute maximums or minimums in terms of 'externals' (volts / amps / degrees) that should be avoided.
- Make sure that your product meets your spec. Do a formal DVT and make a report of the results. Also, test a quantity of boards against the spec and use statistical analysis (Cp/Cpk) to prove that over tolerances and normal variation, you product can do what you say it can do.
- Come up with a reduced number of tests to perform per-unit as a manufacturing reliability test. Bad builds, bad parts, new operators, bad equipment can all lead to problems.
- Make sure that your PCB has in-circuit test pads on as many nets as possible to facilitate in-circuit test (ICT) or manufacturing defect analysis (MDA) - finding problems earlier rather than later is always beneficial.
- If this product is intended to be high reliability, you may want to perform a life test. Run a quantity of units perpetually until something fails. There are industry standards on life testing (acceleration factors, lot size, etc.) which fall beyond the scope of casual advice.
- Consider HALT (highly-accelerated reliability testing) as well - testing the product under thermal and mechanical vibration stress can show weaknesses in the design as well as its construction.
Many of these sorts of tests are big bucks. (Tens of thousands of dollars per test). The cheapest things you can do are those that you can do yourself - the spec, the DVT test and statistical analysis, test pads on the PCB, for instance.
You may wish to consult with an experienced manufacturing engineer to figure out what you really need to do, given your budget and the expected revenue of the product.
Good luck!
Best Answer
Pass the signal through an envelope detector, and differentiate the envelope, either electronically, or in software. The four periods should show as a positive level (Attack), a negative (Decay), (near) zero (Sustain), and again negative (Release).
Telling how much a solution will cost is not possible unless you tell us what you want to do with the result. Do you want to log the 4 time values? Display them? In those cases you'll need a microcontroller anyway, and then you can do the differentiation in software, that would save you a few cents. The envelope detector is a (precision) diode, a capacitor, and a resistor.
AFAIK that's the most application-specific you can go for these low quantities. The microcontroller will cost you anything between a few tens of cents and a few dollar. If you need a display the sky is the limit.
edit
Since you only want to log the data connect an EEPROM to the microcontroller (maybe it has storage available on-chip) and provide a serial interface to a PC.