To the question of modules
Recently I accidentally went to the Amperka website (in the style of “we went to look for spare parts for an excavator and, of course, we ended up on a porn site”) and remembered how I once carried out an unpleasant analysis of their display module. I decided to see how things are with this module at the moment and amazed to find that they are now offering a completely different device (internally different, the exact same outside, although not quite), which has no complaints about functioning. I don’t know what caused the processing; I flatter myself with the hope that these were my comments.
I would be proud of myself and go to other sites, but my eyes settled on the scheme of the new module and the idea arose that this device could be instructive in terms of development. Indeed, those who want to get acquainted with some simple considerations on this subject can click a button.
So, we begin the analysis. On the module amperka.ru/product/troyka-quad-display(link to the circuit) shift registers are installed, the information in which is written in a sequential code (data plus a strobe, it is possible through a bit-band, it is possible through an interface) and is fixed at the outputs by a third signal, everything is clear. But there are two more microcircuits on the module, on which a clock generator and a decoder for two outputs are implemented (this can be called an inverter). Most likely, the module was initially planned on single seven-segment indicators of the KCSA04 type, as evidenced by the inscription on the diagram, but then it was redone for a quad indicator with dual controls. Indeed, the outputs of the shift registers are multiplexed in pairs by controlling the output buffer of the chip. At the same time, one of the conclusions of the decoder excites the anode of the indicator corresponding to the included register - a dynamic indication with two phases.
Consider the question of why this was done. To begin with, we ask ourselves how much the shift register chip 4095 costs. It seems to be an obvious answer - we go to the seller’s website (let it be Platan, I have many memories associated with it, I went there on the fourth or fifth floor of the building through the avenue from the metro , this is how long ago it was), we type the name of the component in the search and we see the answer - 11 rubles (hereinafter I will omit the designation of the monetary unit) in wholesale (we are not going to make one fee). Let us leave aside the opportunity to search from other suppliers and believe that 11 is the price of the chip?
The previous answer is true only in the very unlikely event that we purchase mcx in bulk for subsequent resale at retail. If we are going to use mxx for the production of printed circuit boards, then we must consider the cost of ownership, which in this particular case leads to the need to take into account the cost of a fragment of the printed circuit board for placing the mxx and the cost of installing it on the board.
There is no ambiguity with the first indicator - often (as in this case) the dimensions and geometry of the board are determined by the surrounding circumstances and are not directly related to the circuit implementation. Nevertheless, in the general case, such a connection may take place and you should not forget completely about this component.
Now the second part of the costs - a quick search gives 0.5 for the SMD soldering and 1 for the output. I still remember the times when the cost of soldering was 0.3, but then the dollar was completely different.
In general, it would seem, how can a foreign exchange rate affect prices within the Russian Federation, but the correlation can be established and it is unambiguous. Some observers even go further and make bold conclusions about the relationship between domestic prices and world prices for certain types of energy, but we must indignantly reject these vile insinuations, because a true patriot should understand that the level of well-being of Russians depends solely on the wisdom and insight of the country's leadership expressed in "the constant care of the party and government, led by the personally dear Leonid Ilyich ..." - I accidentally turned on the TV yesterday.
But back to our calculations and try to verify the detected indicators. If the soldering of a two-lead SMD component costs 1, and the number of mounted components is 3 per minute (we do not have an automatic line or even a semi-automatic), then with the number of working days in the average month 21 * 8 = 168 hours * 60 = 10080 minutes * 3 = 30,240 components * 1 = 30,240 rubles. For this amount of work will be performed by our conditional installer. Of these, he will receive 30,240 / 1.2 = 25,200 / 1.4 = 18,000 / 1.13 = 15,930 rubles a month, in my opinion, quite a bit. And this is an estimate from above, because we did not take into account the fixed costs of organizing production, the cost of consumables, equipment and the “surplus value appropriated by the capitalist due to private ownership of the means of production” (something like this today directly comes to mind). On the other hand, three components per minute - I just took it for definiteness, if the intensity is higher, then the final figure changes accordingly. Nevertheless, I would not want to earn a living by installing printed circuit boards.
At these prices, the cost of installing four indicators of the KCSA04 type will be 8 (in fact, they are only called seven-segment) + 1 = 9 -> 14 * 4 = 64 * 0.5 (SMD) = 32. At the same time, a really installed indicator of type CA04-41 will require 8 + 2 = 10-> 10 * 2 = 20 * 1 (output) = 20, which is better than 32. And if we go to an indicator of type CA56-12, then we get 8 + 4 = 12-> 12 * 1 = 12, which leads to a saving of 20 rubles with improved quality (a trifle, but nice). It's funny that the difference in the cost of the last two indicators is exactly 8 rubles, so taking into account the soldering, their cost is compared (coincidence ... I do not think so). Yes, in this case we will have to set the decoder to 4 and add two transistors to the excitation circuit, but even such a change in the circuit may be acceptable, although there is a much better option.
Let's pay attention to the alignment resistors in the chains of segments. At first glance, their number can also be reduced from 4 * 8 = 32 to 2 * 8 = 16 by connecting the outputs of the registers in pairs and putting resistors after the union point. Why do this - if saving 16 while maintaining quality is not of interest to you, then you should not engage in the production of electronics. But you should pay attention to the last condition, and in this particular case, not everything is so simple. If we connect the outputs of the msx directly, then at the time of switching through currents are possible, which is not welcome, so for now we will refrain from reducing the number of resistors.
The value of the resistors of 0.510 kΩ should be considered acceptable, although it should be noted the possibility of a significant deviation of luminosity with this switching circuit. Indeed, a direct drop on the LED at a current of 20 mA will be from 2.0 to 2.5 V (in the table they give values from 2.1 to 2.4 and here is a note about the accuracy of 0.1 - but I did not know that this is possible) and the current at a voltage of 1.5 V will be no more than 0.1mA.
PNP: actually, the last figure is very controversial, since it’s taken from the graph, but we don’t have any other data, from the word at all, except for the statement about the reverse current at a voltage of -5 volts, but this is not at all. You can, of course, take the universal value of 0 mA at a voltage of 0 V, and we will definitely not be mistaken, but the calculation error will increase, so it is better to take more accurate values that look plausible.
The data presented are clearly not enough to accurately plot the I – V characteristic of the graphic LED segment, not counting), but it is quite possible to construct an area for finding possible characteristics under certain plausible assumptions, in particular, about not decreasing the differential resistance with increasing voltage on the device. Having accepted some simplifications, we get that the spread of currents through the segments can be at a supply voltage of 3.3 V from (3.3-2.5) /0.5=1.4 mA to (3.3-2.0) /0.5=2.6 mA or almost two times. For a 5V supply voltage, the picture improves - the current varies from 5mA to 6mA, which will not surprise those of my readers who read my post about choosing the parameters of the LED power supply circuit. When assessing the difference in luminosity, one should also take into account the possible asymmetry in the generator of exciting signals, which can be estimated at a maximum of 30 percent.
PNP: in general, it’s not very clear why all this fuss is relative to the equality of the current through the segments, if at the very beginning of the date the indicator indicates a possible spread of luminous intensity 4+ times (from 3000 to 13000 microchannels at 10 mA), which exceeds all possible current variations, probably, it’s just a habit to try to do well.
We continue the conversation about possible circuitry options. If we switch to a multiplexed indicator with 4 excitation inputs, we can consider the rejection of the registers and the generator and replace all this with an inexpensive MK (candidates for this role are STM8, MSP430 or Padauk). The main requirements for the controller: 1) the number of general purpose terminals 8 + 4 + 3 = 15, 2) the zero current is at least 6 mA, 3) the current on msx is at least 48 mA, 4) a timer is desirable, 5) SPI is desirable, 6 ) external interruption is desirable. All three candidates satisfy these requirements.
Next, we will be guided by the data from the Platan site, you can take the company you are familiar with, we are not interested in absolute values (here it is impossible to compete with China), but relative. So, we change 4 registers of 11 to MK for 48 and get 4 * 11 = 44 <48 and there is no benefit. But if we take into account the cost of installation and the picture changes 4 * (11 + 8) = 76> 1 * (48 + 10) = 58 (-18). And then we take into account that we removed 2 cases of the double TSh 2 * (5 + 3) = 16 (-16) and the number of resistors was reduced from 32 to 8 (-24), so taking into account the savings on the soldering of the indicator, we have 20 + 18 + 16 + 24 = 78. Two additional transistors 2 * (3 + 2) = 10 will have to be subtracted from the resulting savings, but you can add the generator strapping 2 * (0 + 1) = 2 to it, getting 78-10 + 2 = 70, more than 10% of the selling price.
But we should take into account the need to fill the program in MK before soldering and do not forget that this program still needs to be developed. The first part can be estimated at 2 minutes of the installer’s work, which in our figures gives 6. Well, the development of the program will take less than (but no more) two hours of the programmer, which can be estimated at 60 * 1.13 * 1.42 * 1.2 / 168 * 2 = 1400, will be beaten on the first 20 copies of the device. By careful development, you can still make the board one-sided, and this is a reduction in price from 36 to 18 with our sizes.
In conclusion, let’s try “on fingers” to estimate the cost of such a module in a small series:
Board (285/8) 36, indicator (165 + 12) 177, MK (48 + 10) 58, resistors (8 * 1) 8, transistors 4 * (7 + 2) 036, connectors 4 * (0.5 + 1.5) 8, capacitors 2 * (1 + 1) 2. The total cost of the module is 325. Add the overhead costs, the manufacturer’s profit, and the selling price of 690 seem excessive. At least one copy for yourself you will definitely not make cheaper, although it will not work out more expensive, so this post is not abusive and not advertising, but rather neutral.
I would be proud of myself and go to other sites, but my eyes settled on the scheme of the new module and the idea arose that this device could be instructive in terms of development. Indeed, those who want to get acquainted with some simple considerations on this subject can click a button.
We consider the initial scheme
So, we begin the analysis. On the module amperka.ru/product/troyka-quad-display(link to the circuit) shift registers are installed, the information in which is written in a sequential code (data plus a strobe, it is possible through a bit-band, it is possible through an interface) and is fixed at the outputs by a third signal, everything is clear. But there are two more microcircuits on the module, on which a clock generator and a decoder for two outputs are implemented (this can be called an inverter). Most likely, the module was initially planned on single seven-segment indicators of the KCSA04 type, as evidenced by the inscription on the diagram, but then it was redone for a quad indicator with dual controls. Indeed, the outputs of the shift registers are multiplexed in pairs by controlling the output buffer of the chip. At the same time, one of the conclusions of the decoder excites the anode of the indicator corresponding to the included register - a dynamic indication with two phases.
Why so?
Consider the question of why this was done. To begin with, we ask ourselves how much the shift register chip 4095 costs. It seems to be an obvious answer - we go to the seller’s website (let it be Platan, I have many memories associated with it, I went there on the fourth or fifth floor of the building through the avenue from the metro , this is how long ago it was), we type the name of the component in the search and we see the answer - 11 rubles (hereinafter I will omit the designation of the monetary unit) in wholesale (we are not going to make one fee). Let us leave aside the opportunity to search from other suppliers and believe that 11 is the price of the chip?
Feature cost chips
The previous answer is true only in the very unlikely event that we purchase mcx in bulk for subsequent resale at retail. If we are going to use mxx for the production of printed circuit boards, then we must consider the cost of ownership, which in this particular case leads to the need to take into account the cost of a fragment of the printed circuit board for placing the mxx and the cost of installing it on the board.
There is no ambiguity with the first indicator - often (as in this case) the dimensions and geometry of the board are determined by the surrounding circumstances and are not directly related to the circuit implementation. Nevertheless, in the general case, such a connection may take place and you should not forget completely about this component.
Now the second part of the costs - a quick search gives 0.5 for the SMD soldering and 1 for the output. I still remember the times when the cost of soldering was 0.3, but then the dollar was completely different.
Sarcasm in the margins of the post:
In general, it would seem, how can a foreign exchange rate affect prices within the Russian Federation, but the correlation can be established and it is unambiguous. Some observers even go further and make bold conclusions about the relationship between domestic prices and world prices for certain types of energy, but we must indignantly reject these vile insinuations, because a true patriot should understand that the level of well-being of Russians depends solely on the wisdom and insight of the country's leadership expressed in "the constant care of the party and government, led by the personally dear Leonid Ilyich ..." - I accidentally turned on the TV yesterday.
Let's digress and estimate: 50 kopecks - is it a lot or a little?
But back to our calculations and try to verify the detected indicators. If the soldering of a two-lead SMD component costs 1, and the number of mounted components is 3 per minute (we do not have an automatic line or even a semi-automatic), then with the number of working days in the average month 21 * 8 = 168 hours * 60 = 10080 minutes * 3 = 30,240 components * 1 = 30,240 rubles. For this amount of work will be performed by our conditional installer. Of these, he will receive 30,240 / 1.2 = 25,200 / 1.4 = 18,000 / 1.13 = 15,930 rubles a month, in my opinion, quite a bit. And this is an estimate from above, because we did not take into account the fixed costs of organizing production, the cost of consumables, equipment and the “surplus value appropriated by the capitalist due to private ownership of the means of production” (something like this today directly comes to mind). On the other hand, three components per minute - I just took it for definiteness, if the intensity is higher, then the final figure changes accordingly. Nevertheless, I would not want to earn a living by installing printed circuit boards.
We consider further.
At these prices, the cost of installing four indicators of the KCSA04 type will be 8 (in fact, they are only called seven-segment) + 1 = 9 -> 14 * 4 = 64 * 0.5 (SMD) = 32. At the same time, a really installed indicator of type CA04-41 will require 8 + 2 = 10-> 10 * 2 = 20 * 1 (output) = 20, which is better than 32. And if we go to an indicator of type CA56-12, then we get 8 + 4 = 12-> 12 * 1 = 12, which leads to a saving of 20 rubles with improved quality (a trifle, but nice). It's funny that the difference in the cost of the last two indicators is exactly 8 rubles, so taking into account the soldering, their cost is compared (coincidence ... I do not think so). Yes, in this case we will have to set the decoder to 4 and add two transistors to the excitation circuit, but even such a change in the circuit may be acceptable, although there is a much better option.
Let's pay attention to the alignment resistors in the chains of segments. At first glance, their number can also be reduced from 4 * 8 = 32 to 2 * 8 = 16 by connecting the outputs of the registers in pairs and putting resistors after the union point. Why do this - if saving 16 while maintaining quality is not of interest to you, then you should not engage in the production of electronics. But you should pay attention to the last condition, and in this particular case, not everything is so simple. If we connect the outputs of the msx directly, then at the time of switching through currents are possible, which is not welcome, so for now we will refrain from reducing the number of resistors.
A bit about resistors
The value of the resistors of 0.510 kΩ should be considered acceptable, although it should be noted the possibility of a significant deviation of luminosity with this switching circuit. Indeed, a direct drop on the LED at a current of 20 mA will be from 2.0 to 2.5 V (in the table they give values from 2.1 to 2.4 and here is a note about the accuracy of 0.1 - but I did not know that this is possible) and the current at a voltage of 1.5 V will be no more than 0.1mA.
PNP: actually, the last figure is very controversial, since it’s taken from the graph, but we don’t have any other data, from the word at all, except for the statement about the reverse current at a voltage of -5 volts, but this is not at all. You can, of course, take the universal value of 0 mA at a voltage of 0 V, and we will definitely not be mistaken, but the calculation error will increase, so it is better to take more accurate values that look plausible.
The data presented are clearly not enough to accurately plot the I – V characteristic of the graphic LED segment, not counting), but it is quite possible to construct an area for finding possible characteristics under certain plausible assumptions, in particular, about not decreasing the differential resistance with increasing voltage on the device. Having accepted some simplifications, we get that the spread of currents through the segments can be at a supply voltage of 3.3 V from (3.3-2.5) /0.5=1.4 mA to (3.3-2.0) /0.5=2.6 mA or almost two times. For a 5V supply voltage, the picture improves - the current varies from 5mA to 6mA, which will not surprise those of my readers who read my post about choosing the parameters of the LED power supply circuit. When assessing the difference in luminosity, one should also take into account the possible asymmetry in the generator of exciting signals, which can be estimated at a maximum of 30 percent.
PNP: in general, it’s not very clear why all this fuss is relative to the equality of the current through the segments, if at the very beginning of the date the indicator indicates a possible spread of luminous intensity 4+ times (from 3000 to 13000 microchannels at 10 mA), which exceeds all possible current variations, probably, it’s just a habit to try to do well.
We put MK and consider
We continue the conversation about possible circuitry options. If we switch to a multiplexed indicator with 4 excitation inputs, we can consider the rejection of the registers and the generator and replace all this with an inexpensive MK (candidates for this role are STM8, MSP430 or Padauk). The main requirements for the controller: 1) the number of general purpose terminals 8 + 4 + 3 = 15, 2) the zero current is at least 6 mA, 3) the current on msx is at least 48 mA, 4) a timer is desirable, 5) SPI is desirable, 6 ) external interruption is desirable. All three candidates satisfy these requirements.
Next, we will be guided by the data from the Platan site, you can take the company you are familiar with, we are not interested in absolute values (here it is impossible to compete with China), but relative. So, we change 4 registers of 11 to MK for 48 and get 4 * 11 = 44 <48 and there is no benefit. But if we take into account the cost of installation and the picture changes 4 * (11 + 8) = 76> 1 * (48 + 10) = 58 (-18). And then we take into account that we removed 2 cases of the double TSh 2 * (5 + 3) = 16 (-16) and the number of resistors was reduced from 32 to 8 (-24), so taking into account the savings on the soldering of the indicator, we have 20 + 18 + 16 + 24 = 78. Two additional transistors 2 * (3 + 2) = 10 will have to be subtracted from the resulting savings, but you can add the generator strapping 2 * (0 + 1) = 2 to it, getting 78-10 + 2 = 70, more than 10% of the selling price.
But we should take into account the need to fill the program in MK before soldering and do not forget that this program still needs to be developed. The first part can be estimated at 2 minutes of the installer’s work, which in our figures gives 6. Well, the development of the program will take less than (but no more) two hours of the programmer, which can be estimated at 60 * 1.13 * 1.42 * 1.2 / 168 * 2 = 1400, will be beaten on the first 20 copies of the device. By careful development, you can still make the board one-sided, and this is a reduction in price from 36 to 18 with our sizes.
Conclusions: normal flight
In conclusion, let’s try “on fingers” to estimate the cost of such a module in a small series:
Board (285/8) 36, indicator (165 + 12) 177, MK (48 + 10) 58, resistors (8 * 1) 8, transistors 4 * (7 + 2) 036, connectors 4 * (0.5 + 1.5) 8, capacitors 2 * (1 + 1) 2. The total cost of the module is 325. Add the overhead costs, the manufacturer’s profit, and the selling price of 690 seem excessive. At least one copy for yourself you will definitely not make cheaper, although it will not work out more expensive, so this post is not abusive and not advertising, but rather neutral.