text
stringlengths 83
79.5k
|
|---|
H: Help to design an amplifier
I need help designing an amplifier that is capable of providing 1 W to an 8 Ohm speaker. I have 3.3 V, 5 V or 18 V supply available to power it.
I also have only one power supply available that has no negative output.
The signal is coming from an AVR as a 3.3 V PWM signal. I have following components available:
NPN, PNP transistors,
N-channel MOSFETs,
TL494 Pulse-Width-Modulation Control Circuit,
JRC4558, LM358 op amps,
NJM13700 TRANSCONDUCTANCE AMPLIFIER
and other standard equipment
The last three ICs I got from an old 500W amplifier (thats why I posted them in here if they are useful).
I already experimented with push-pull, common emitter but just couldn't get it to work (not enough power and distortions).
EDIT:
I request this question to be reopened.
I am editing this question with hopes to get help from you guys, I will try to stick to the rules.
Thanks to Olin Lathrop I designed a bridged class D amplifier, but its not working as it should. First off, here is the schematic:
simulate this circuit – Schematic created using CircuitLab
NOT, AND, NAND gates are all made from NAND logic gates.
NOT1 inverts the PWM signal to drive the other half of H-bridge, combined with AND3, and D6 (which is output pin on MCU), they drive the other half of the H-bridge only when D6 is high, preventing it to be on, when PWM output is low.
NAND1 prevents both halves of the H-bridge to be on at the same time (at least thats what I though it would do).
NAND1, AND1 drives one half of the H-bridge, when the PWM signal is high.
NAND1, AND2 drives second half of the H-bridge, when the PWM signal is low.
The purpose of these logic gates is also, to convert 3.3 V PWM signal to 5 V.
PROBLEM:
If I connect only one half of the H-bridge I get expected distorted sound output. Now, when I connect the second half, it makes a really bad noise and PWM signal stops.
What I think happens:
When I did some measurements with osciloscope I expected that when I would add(+) both waveforms, from AND1 and AND2, I would get a flat +5 V line, but in reality there are some spikes reaching to 0 V and 10 V on both rising and falling edges of the waveforms. So I suspect that, due to this, both of the halves of the H-bridge are on for a small amount of time, to short circuit whole thing to ground.
I am not an expert on this matter, so I would really appreciate any help from you.
AI: The first thing to do is to look at what output voltage you need.
Watts = Volts2/Ω
From this you can determine that you need 2.83 V RMS, which is 4 V peak, which is 8 V peak to peak. This clearly eliminates the 3.3 V supply as being able to power the final stage. The 5 V supply could be used if you implement a bridge drive circuit, which ideally can drive to ±5 V. You need ±4 V, so 5 V supply is about the minimum, and gives you 1 V overhead the pass elements are allowed to eat up. Since a saturated BJT is usually just a few 100 mV, and a fully on FET can easily be found at this voltage that is just a few mΩ when on, this is at least doable.
The 18 V supply is large enough to power a single-ended driver, with the other side of the speaker connected to ground thru a suitably large capacitor. However, that will be quite inefficient and will require some thought about how to get rid of the heat unless you use a class D final stage.
The rest is really up to you. This isn't a gimme da codz kind of site, and your question is otherwise too broad, and may even get closed on that ground.
As for your parts list, I'm ignoring that completely. Parts to make a variety of small audio power amplifiers like this are cheaply and readily available at the other end of the internet, so nowadays designing to some limited and usually inapplicable set of parts you happen to have on hand is silly.
|
H: Extending LED length
Completely new to electronics, I've just begun to play with an Arduino. I was wondering, if I wanted to make an LED sculpture, what is the correct way to extend the legs of each LED so that they stand about 3 inchs long and are bendable? Is there a particular type of shielded wire that has enough strength to support an LED's weight?
AI: You probably want solid insulated hookup wire that is about 0.5mm or 0.6mm in diameter.
That's about AWG 22 or AWG 24 (larger AWG numbers are for thinner wire).
As an alternative you could use bare wire and use sleeving on the wire but solid hookup wire is often cheaper and easier to get than bare wire suitable for soldering. If you get two colours (such as red and black) you can keep the polarity straight.
It would also be a good idea to get some heat shrink tubing and put it over the LED leads where they are spliced to the wire, but be careful not to overheat the LED when you are shrinking the tubing with a hot air gun.
|
H: Arithmetic Overflow ATmega328
I have written the following function to calculate the current timestamp (since 00h Jan 1 1900). The output I get is:
Current Time & Date : 20:5:32 25/7/2014<\r>
2014 7 25 20 5 32<\r>
retval 1 3597523200<\r>
retval 2 3597523200<\r>
retval 3 3613161600<\r>
retval 4 3615235200<\r>
retval 5 3615241664<\r>
retval 6 3615241964<\r>
retval 7 3615241996<\r>
retval 8 3615241996<\r>
Current time timestamp 3615241996
Basically I am printing the retval (function return value) at every step to check and verify the calculations.
The calculation match up till retval 4 (when current day hours are converted to seconds). I think it might be due to arithmetic overflow but not sure.
The issue seems to be happening in this line:
retval += (d.hr * 60 * 60); printf("retval 5 %"PRIu32"\r", retval);
retval is uint32_t and d.hr is uint16_t
uint32_t DS1307_GET_CURRENT_TIMESTAMP()
{
uint32_t retval = SECONDS_SINCE_1900_TO_2014;
ds1307 d;
DS1307_GET_DATETIME(&d);
printf("%u %u %u %u %u %u\r", d.yy,d.mm,d.dd,d.hr, d.min, d.sec);
printf("retval 1 %"PRIu32"\r", retval);
//process complete years since 2014 to current year
uint8_t i=0;
for(i=0; i<(d.yy - 2014); i++)
{
if(DS1307_IS_LEAP_YEAR(2014+i)==0) retval += 31622400;
else retval += 31536000;
}
printf("retval 2 %"PRIu32"\r", retval);
//process complete months from beginning of current year to current date/time
for(i=1; i<d.mm; i++)
{
if((i==1) || (i==3) || (i==5) || (i==7) || (i==8) || (i==10) || (i==12))
{
//31 days
retval += (31 * 86400);
}
else if ((i==4) || (i==6) || (i==9) || (i==11))
{
//30 days
retval += (30 * 86400);
}
else
{
//i==2==february. check if leap year
if(DS1307_IS_LEAP_YEAR(d.yy)==0) retval += (29 * 86400);
else retval += (28 * 86400);
}
}
printf("retval 3 %"PRIu32"\r", retval);
//process complete days from beginning of month till current date
retval += ((d.dd-1) * 86400);
printf("retval 4 %"PRIu32"\r", retval);
//process hours, min and seconds - CALCULATION DEVIATES HERE.
retval += (d.hr * 60 * 60); printf("retval 5 %"PRIu32"\r", retval);
retval += (d.min * 60); printf("retval 6 %"PRIu32"\r", retval);
retval += d.sec; printf("retval 7 %"PRIu32"\r", retval);
printf("retval 8 %"PRIu32"\r", retval);
return retval;
}
AI: 20 * 60 * 60 = 72000
You need to perform the multiplication in 32 bits in order to avoid an overflow.
retval += (d.hr * 60UL * 60);
|
H: Which is good method for step down 50Hz, 230V AC
Which is low cost and safe for step down 50Hz 230V AC into 12V?
Transformer or reactance or Regulator IC ?
simulate this circuit – Schematic created using CircuitLab
AI: Which is low cost and safe for step down 50Hz 230V AC into 12V?
The key word in the question above is "safe" and this means using a method that inherently provides isolation. If you want to transfer some reasonable amount of power (rather than using an optical method that can transfer maybe 1 milli watt), you are forced down the road of using a transformer. This is how I read "safe" in this context.
In this context I assume that safe means isolation so that anyone touching the reduced-voltage output is not going to receive an electric shock.
Other safe methods involve providing sufficient insulation around everything that connects to the circuit - under these circumstances you don't need to use a transformer BUT be prepared, when building the thing to get your fingers scorched by electricity. A non-transformer method to reduce voltage can provide a fair amount of power (such as when using a switching buck regulator type of circuit) but it is still connected to live mains and can electrocute if not handled properly.
If using a transformer means more cost then this price is worth paying for reasons of safety and prevention of litigation.
|
H: How to measure power of my device?
My device is working with ten 1 watt LEDs. How can I measure the power consumption of my devices?
AI: Power (P) is voltage (E) times current (I):
$$ P = IE $$
This works for any individual part, or an entire circuit.
If you wanted to measure the power used by your entire circuit, measure the current your power supply is supplying, and the voltage at its output, and multiply them.
If you also want to include losses in the power supply, then measure the input voltage and current.
If you want to measure the power of an individual LED, measure the voltage across it and the current through it.
|
H: Relation between drift velocity & conductivity of a doped semiconductor
Here is the problem, and I am stuck.
When an electric field with strength \$1 \times 10^3 \text{V/cm}\$ is
applied to a p-type uncompensated Si sample at room temperature, the
electron drift velocity, \$v_d\$ is \$ 1 \times 10^6 \text{cm/s}\$.
Calculate the conductivity of this sample. (\$ q = 1.6 \times 10^{-19} \text{C}\$, \$ m_0 = 9.11 \times 10^{-31} \text{kg}\$, \$ m_{n,\text{Si}}^{*} = 0.26 m_0\$, \$n_{i, \text{Si}} = 1.5 \times 10^{10} \text{cm}^{-3}\$. The graph was from Solid State Electronic Devices, 6th Ed., by B. G. Streetman & S. K. Banerjee.)
I used the following equations : \$\sigma = q n \mu_n\$, \$\mu_n = - \dfrac{\langle v_x \rangle}{\mathcal{E}_x}\$.
I can find \$ \mu_n = \dfrac{1 \times 10^6 \text{cm/s}}{1 \times 10^3 \text{V/cm}} = 1 \times 10^3 \text{cm}^2/\text{V s} \$.
Using the graph, \$ n \approx 1 \times 10^{17} \text{cm}^{-3} \$.
Therefore, \$\sigma = q n \mu_n\ = 1.6 \times 10^{-19} \text{C} \times 1 \times 10^{17} \text{cm}^{-3} \times 1 \times 10^3 \text{cm}^2/\text{V s} \\ = 16 \text{C} / \text{cm V s} \\ = 16 \text{A s} / \text{cm A } \Omega \text{ s} \\ = 16 \text{cm}^{-1}\Omega^{-1}.\$
However, I don't know where the condition "p-type" should be used.
It is also strange that \$ n \gg n_i \$ even though it is p-type.
I thought the impurity concentration from \$ \mu_n \$ leads to the \$n\$ since it is not \$\mu_p\$, but is it wrong?
Or is my answer correct?
How to solve this problem correctly?
AI: Taking a stab at ths- and it's been a while- I'm thinking that your supposed to divine the dopant concentration from the minority carrier mobility, then use \$\mu_p\$ at that concentration for the majority carrier mobility \$\mu_p\$, so around \$3\times 10^2\$, so you'd get a considerably smaller conductivity number.
|
H: How can I know how much power can I generate?
Let's say we have a wind power of 6,831 megawatts. How can know how much power (i.e, megawatts/hour ) it can generate per year?
AI: If you always had 6831 megawatts, then this is how you would calculate how many megawatt-hours in a year:
6831 megawatts * 8765.81 hours = 59880546 megawatt hours
All you have to do is take the power multiplied by the time (the hours in a year in this case), and you get a number.
However, it's impossible to get exactly how much power you'll get in a year since wind power isn't constant. If it was a generator powered by natural gas, then that would be much more stable. You still couldn't get an exact number, but it'd be pretty close.
You seem to be looking at this the wrong way, thinking about this much harder than you have to. It seems as you're thinking that it will deplete a megawatt from the generator until it's replenished. That's not true. Let's look at what a megawatt equals.
A megawatt is a measurement of power. It's much bigger than a watt, but we'll look at the watt first to simplify things. The equation for wattage: wattage = voltage * amps. You can then know that a light bulb that's 120 watts takes one amp, because common household AC voltage is 120V (in the US).
Well, what's a volt/amp? Voltage is similar to water pressure in a pipe, where amperage is how fast the water is flowing through the pipe.
Well, how does the killowatt hour relate to this? As far as I can tell, the killowatt hour is only used on your electric bill. Since you don't use the same amount of power 24/7, there needed to be a way to accurately bill you. (watt-hour = watts * time used for, or watt-hour = amps used * 120V * time used for)
Examples of the killowatt hour:
My fridge ran for five hours today, using 1A. Equation: 120V * 1A * 5HR = 0.6 killowatt hours
I had to charge my electric car today to go out to the store because my milk spoiled because I only had my fridge plugged in for five hours! It used 75A at 240V. It ran for three hours. Equation: 240V * 75A * 3HR = 54 killowatt hours
Note: 1000 killowatt hours is one megawatt hour.
|
H: Connecting separately powered devices via serial
I have a small issue connecting an FTDI USB to 5V Serial adapter to an externally powered PIC microcontroller. They are connected via serial connection. The USB connection powered the FTDI and a battery powers the PIC.
Serial
Laptop --- FTDI ======== PIC ----- 3.7V battery
Currently I have 4k7 resistors in the serial lines. 5V high on the FTDI's TX will be clamped to whatever the PIC is (3v - 4.2v) via the input protection diodes, and 3V from the PIC's TX is higher than the FTDI's input threshold. This seems ok, limiting the protection diode current to 500uA.
My main concern is unplugging the cable from the laptop. Then the FTDI device is powered off and the PIC, via its TX line, will try and power it. Even at 10K, that's 500uA. I've no idea if that's a bad idea or not.
I've a feeling this isn't the best way of going about this given that either circuit could be powered off and damaged by the other. Would it be better to convert each RX side into a pseudo "open drain"?
+----- Vdd
100k
+-------|<----+------RX
AI: I think I can answer this one myself. My main issue was knowing whether or not 500uA flowing into the FTDI chip will damage it but I think the best idea is to avoid having to ask that question.
If I use a voltage divider from the main USB line to an analog comparator or a2d or even a high value pullup to a logic input on the PIC micro, then I can detect if USB power is present or not. If not I can tristate the serial port.
Other than that, googling reveals that using the diode and pull up to RX works just fine to prevent current flowing the wrong way...
|
H: Question on 3DS power adapters, minor voltage difference
I am going to be traveling overseas and bringing my Nintendo 3DS which the adapter outputs DC 4.6V 900mA.
I found an unofficial USB cable to charge it and I was curious if the minor variance in the voltage would cause any issue. Say if I use an iPad 5.2V charger or the iPhone 5V one, being I have them and they support 240V input.
Thank you!
AI: The real question is where you are going. I'll start with a simple answer on the voltages then come back to this.
When designing a circuit, the inputs to the processor must allow the voltage. In addition, the circuit is designed to take a certain amount of power from the power circuit. The rest of the circuit for a consumer product is generally designed to be durable and contains things such as clamping diodes to prevent current surges and over-voltages.
The simple answer to this is therefore we can not know exactly unless we have the specs for the parts or a general datasheet was released, which I did not look for. It is safe to assume Nintendo has some really good circuit designers however, and the device therefore probably has at least a 10% tolerance from what you usually charge at. I wouldn't worry so much about stuff like this, as you can tell pretty fast by whether the power regulation circuit on the device side is heating up. Worry more about the country standard.
Your true concern is that when traveling overseas, the AC mains voltage changes. Here in the US it is 110, and likewise, our products are made to deal with that. In Japan it is 100, so if a product is designed for Japanese market (note that the DS has an American compatible version which is different than the Japanese one), then it will have problems over here. If you took an American product there, then it won't charge as fast. Then we have the European standard at 220V. If you plug in your device over there without a power converter, say goodbye to your device. Be weary of this and if you have to buy an adapter anyway (which I suggest), then you may want to just wait until you are there and get a brand spanking new charger.
Cheers
|
H: The same flag for an interrupt
I think I'm mixed up a bit in NVIC of stm32 MCUs. I took a look in the SPI.h of the STM32F10x standard peripheral library. I don't know that why while there is SPI_I2S_IT_RXNE for checking the status of recieved buffer we have SPI_I2S_FLAG_RXNE flag for this porpuse?
look:
AI: The SPI_I2S_FLAG* flags are used in polling mode, while SPI_I2S_IT* flags are for interrupt mode.
See here for more details: http://web.eece.maine.edu/~hummels/classes/ece486/docs/libperiph_doc/group__SPI__Group5.html
|
H: How to select most efficient motor for generator?
First post. Please forgive me if this is a stupid question. This post can be broken down into two questions.
I am building a bicycle generator, but am new to the field of EE. I am trying to select the most efficient means of generating electricity, but have only been able to find suggestions in terms of selection (as opposed to a numbers-based approach). The goal for this phase of the project is to output the highest wattage possible (ultimately in the form of DC power).
1) What numbers and criteria should I use for deciding whether to use a motor or alternator for this project? I understand that alternators generate AC, and (many) motors generate DC.
2) Once I have decided on which approach to use, how I can select the most efficient component?
When searching online for the answer to this question, I came across some helpful links (examples here and here), but I did not see any quantitative methods for finding the most efficient solution.
Thanks.
EDIT:
I am building a generator designed to output 3-phase power for industrial applications. I am not sure whether to create AC (and use a variable frequency drive to convert it to 3-phase power) or use DC, and then convert it to 3-phase power. The idea is a ride a stationary bike (probably just a bike on a stand) to turn the generator shaft.
AI: Added at top as updated question modifies best response:
I am building a generator designed to output 3-phase power for industrial applications. ... The idea (best-case scenario) is to have multiple people riding bikes, and then convert the power into 3-phase electricity. ...
I am not sure whether to create AC (and use a variable frequency drive to convert it to 3-phase power) or use DC, and then convert it to 3-phase power. The idea is [to use] stationary bike[s] (probably just a bike on a stand) to turn the generator shaft.
My prior general comments below still apply but my specific answer is:
There are a number of ways to do this and none is 'best' as all are compromises, and the final configuration depends on what assumptions are made.
However, if you wanted the industrial norm of constant voltage constant frequency AC then you almost certainly need to store energy from the bikes and produce the AC from the energy store. As advised below, the most likely bike power producer would be a permanent magnet alternator producing multiple phase AC (usually 3 phase). Voltage and frequency and power level are immensely user dependant and the best method is likely to be to convert this output to DC, store it in a battery and then produce fixed voltage fixed frequency AC using a DC to AC converter - an off the shelf product.
A good way to handle the bike AC is to arrange for the alternator AC Voltage to be higher than the battery DC voltage at all useful power output and speed ranges, convert the AC to DC and then "buck convert"(= voltage down convert) the DC to battery level voltage. A charger-controller would handle the input from all bikes and manage battery charging. Depending on design requirements users may be requested to pedal at constant power or constant voltage (both of which can be enforced by a controller with feedback to the user) or be free to provide input as desired.
It would be possible to transfer energy directly from bike rectified DC via down converters to the DC to AC converter input directly without battery storage - and this is essentially what happens to most of the energy when bike user input is <= load, but completely batteryless operation would be difficult as the battery provides a stabilising influence and, in a properly designed system, an energy source that has no drop puts to below load requirements.
In a past lifetime I designed controllers for alternators used as loads for exercise machines so have a good feel for what is required to achieve this task. Realistic load levels for typical fit but non athlete users are.
50 Watts for say one hour with reasonable ease.
100 Watts for one hour for a very solid work out.
200 Watts - getting extremely strenuous.
500 Watts - I could do about 10 seconds :-).
I can answer specific questions if you have any.
Is this a real-world idea or an investigation of a concept or ...?
All considered, schemes like this would not prove economic relative to grid powered electricity at current grid prices.
"Generators" output DC directly by converting the alternating voltages within the machine to DC. This is typically done using a commutator and brushes - effectively a manual "synchronous rectifier". This arrangement has some drag, complex mechanical requirements, lower lifetimes and losses in the carbon to metal contact of the commutator.
"Alternators" output AC = "alternating current" (and voltage) which is converted or "rectified" to DC outside the machine proper. Electronic conversion methods and components allow this conversion to be highly efficient.
Alternators come in two main "flavours" -
Those which create the AC in the rotor and transfer it to the non rotating frame of reference (the one you are standing on) with slip rings, while the fixed stator is used to create the field that the rotor turns in to produce the AC voltages.
Those where the AC is made in the stationary stator windings with the rotating part (rotor) providing a rotating field that interacts with the stationary output windings to provide the AC.
There are two main subsets of these stationary output winding machines.
Wound rotor - the rotating magnetic field is produced by rotating windings which are fed DC field power via slip rings. Automotive alternators usually work like this. Advantages are that magnetics provided by wound copper coils are relatively cheap and the field magnitude can be controlled by varying the DC power which is fed to the winding. Disadvantages are mechanical complexity from slip ring feed and wound rotors.
Permanent magnet rotor. Permanent magnets are sound to produce an alternating output voltage in the stator windings. Advantages are no need for DC feed to the rotor, relative ease of rotor construction, modern high strength rare earth magnets allow very energy dense alternators to be produced. Disadvantages are the inability to control the field strength.
There are variants such as AC induction motors used as generators but these are usually best used for specialist applications and can be difficult to control.
For your application where you require efficient energy conversion and probably low cost, low complexity and ease of "doing it" the best solutions are either a dedicated alternator OR a brushless DC motor (BLDCM) - sized to be of the wattage range desired in each case. Electrically these are essentially the same but one was produced with alternator roles in mind whereas the other (the BLDCM) was designed for motor use but will work very well as an alternator. Small dedicated alternators are rare but BLDCMs of the size range of interest are used 'everywhere'. These are typically found in computer printers, powered toys (especially flying ones), disk & DVD drives and much other equipment that uses small motors.
BLDCMs can be converted for alternator use or it may be practical to build your own alternator based on the same principles.
As above, when used as alternators, BLDCM's have permanent magnet rotors and generate AC in the stator with no mechanical connections (such as brushes or slip rings) from rotor to stator. The generated AC is converted to DC - usually with diodes. This is the overwhelmingly most common and sensible method to use in a very wide range of power levels and applications. There are exceptions but this is usually the best approach.
To decide how to proceed from here you need to know
What order of power you require.
Where and how you would like to mechanically power your device and why.
eg on a bicycle you may wish to use wheel rim , hub, pedal crank or chain drive. Or ...
A concise but complete description of the application will help.
Ask more questions ...
Tell us about power levels,application, more ,... .
|
H: Does any thermal fuse with the same cut off temperature work?
Would any thermal fuse cutoff for 216°C work as a replacement for the fuse in the picture below?
AI: Any similar 216°C thermal fuse with a 10A or better current rating and an appropriate voltage rating should be fine.
For example, a CANTHERM SDF DF216S, which is approved for use at 250V 10A or 15A depending on the safety agency.
If it's held in a clip or something like that, make sure the diameter is close enough that it will behave similarly thermally.
|
H: no-load voltage on ac-dc adapter
I recently acquired a toy that uses this transformer:
but since I live in a 220V area, I cannot use it directly.
I have this generic AC-DC adapter:
which in theory is all I need because it has a 4.5V output and enough amperage.
However, I'm a bit concerned since when measuring the voltage of the ac-dc adapter when it's set to 4.5V output, I get ~10.5V. I know that the voltage measured in a no-load scenario is supposed to be higher than when it actually has load, but it seems a little bit too much.
When set to 9V, it outputs ~16.6V
Is it safe to use this ac-dc adapter with this toy? Or it might be broken and supply more volts than it indicates?
AI: This is one of the hazards of trying to use a greatly overrated (3:1) unregulated supply. That's actually the first time I've seen a no-load voltage specified on the label, very handy. Yes, it could potentially damage the toy.
You could try the adapter on the 3V setting and see if the product works, but it might be a bit on the low side.
Another possibility is to add a dummy load to the universal adapter (something like 10-15 ohms 5-10W), but it might get very hot. Or you could poke around and find a ~300mA 4.5V adapter that can accept your mains voltage.
|
H: How do you cover up exposed high voltage pcb traces?
This is my PCB:
The thick lines should be able to pass a high voltage (230VAC) signal through it. The board will be kept inside a enclosed box.
In my case, the signal on the board is only one polarity so unless someone is purposefully trying to kill themselves, I think it's relatively safe. However, my question still stands - what are some ways to cover up exposed signals?
These traces are on the bottom layer, and it is not possible to sandwich them in between.
AI: You may want to consider finding a relay that has better construction such that the AC load switch lead does not go over in between the coil leads. This will lead to better isolation from low voltage control side to the AC side.
If you have arranged all the connections on the bottom side of the board and then mounted the board in the enclosure with the bottom of the board facing to the base of the enclosure then this leaves things about as safe as you can get without excessive other measures. With this configuration I think you are good to go after providing appropriate safety labeling on the outside.
The AC connection looks like you are planning a screw terminal quick connect type of affair. Does this mean that users are going to be opening the box to attach the AC wires?
There could be safety concerns with this because there is no good way to regulate how the attachment is done and how the wire in-feed is protected (i.e. how is strain relief and wire abrasion protection provided).
### Update after Comments Discussion ###
I have previously designed and deployed a similar AC load switching type device. I happened to use an SSR (solid state relay) in place of the relay but that need not be done. To greatly simplify the AC power wiring for the user I supplied the enclosure of my product with an AC input plug and an AC output plug. For the AC input the following IEC type connector was used:
For the switched AC load side the following IEC C13 type connector was used:
This scheme lets the power be supplied to the switching box with any one of a number of readily available AC power cords that have an appropriate country specific plug on one end and the IEC style end that plugs into the input side of the switching box.
The output side connector can be supported by readily available load side plugs that have IEC C13 and C14 type plugs at each end such as this cable:
This scheme also has several additional advantages:
The safety ground can be connected inside the enclosure.
The safety ground can be connected all the way out to the switched
load device.
The enclosure could contain an additional internal load on the AC
input to power internal electronics from a small PC mounted power
supply.
The product design that I developed and deployed actually had two switching circuits that supported two AC input plugs and two AC output plugs. The switching circuits were also wired through thermal circuit breakers rated at 15A. The internal microprocessor electronics was powered from the first AC input. Here is a picture of the rear panel of the unit.
|
H: Fourier Transform in real life
what is the frequency spectrum mean in real life ? , if we said x(t) , we mean that each time we have an output which is represented by x(t) , also it can represent decaying ,growing of an object , it can represent the power of an object accroding to it's time . but how can i understand the X(f) , if we say that X(f) represent a power according to it's frequency , it's not make sense , because frequency is not an abstract thing that can we deal in real life , like time , we can not "feel" it , to give better understand for my question , let's say that x(f) is zero at f=5 , how this reflect in the time domaine ? , I know that my question is a kind of 'philosphy' rather than 'electrical' :)
AI: Your title indicated you were interested in the use of FT's in real-life. One application where I have made use of FTs is the decoding of touch-tone signals, like those generated on a telephone keypad. Each "touch-tone" is a superposition of two tones, selected from a set of four columns (1209 Hz, 1336 Hz, 1477 Hz, 1633 Hz) and four rows (697 Hz, 770 Hz, 852 Hz, 941 Hz). (Wait, you say your telephone only has 3 columns of buttons? There is actually a provision for four more buttons along the right side labelled A, B, C and D, which was used in the military.)
This picture shows what the combination of 941 Hz and 1336 Hz looks like on an oscilloscope:
One can see there is a regular pattern here, but no way to separate out the two tones.
If however you run this signal into a spectrum analyzer, which performs a FFT (Fast Fourier Transform), you get this:
The two peaks correspond to the frequencies 950 Hz and 1330 Hz. Not exactly the ones listed earlier, but this probably represents slightly-off oscillators in the telephone keypad. The frequencies chosen for the eight tones were designed so the two frequencies in each pair would be far enough apart to allow for some leeway.
Back before microcontrollers were invented (and even after, when they were not fast enough to handle this sort of thing), decoding of touch-tones was done in hardware using a set of analog filters, one for each of the eight frequencies. Here is a Western Electric touch-tone decoder, circa 1965. The analog filter circuitry is contained on the plug-in cards to the right (with the orange markings).
This circuitry was later reduced to an IC, first the LM567 (one chip per column) and then the HT9170 which used highly accurate switched capacitor filters to decode all 16 combinations of tones.
With microcontrollers, and particularly DSPs (Digital Signal Processors), things have become much easier. Initially DSPs were separate chips, and had to be combined with a microprocessor to form a complete system. Now they can be combined into one chip.
I used a Microchip dsPIC33FJ256GP710 (which, as the name implies contains a DSP in addition to a general purpose microcontroller based on the PIC24, and costs around $6). I also used a free DTMF decoder library (most of it written in assembly language) that performs the FFT, and generates two outputs corresponding to the peaks in the earlier picture. So I was able to decode DTMF tones coming into the microcontroller's ADC without adding any addition hardware. Meanwhile the microcontroller was free to perform all of the other functions of the device I was building.
|
H: How ADSL Demodulates (restores the order) the signal for dummies
I am not an electric engineer so sorry for questions that might miss some fundamentals.
I am trying to understand the ADSL modem. The ADSL modem sends the data over different frequencies in parallel. However I have learned that faster frequencies means higher data rate. So I assume the data is transferred over the "bins" with different speed.
Which algorithm exactly is deployed to ensure that data is restored in the correct order? The link with simple explanation will be fine.
UPD: As smart people mentioned, I didn't meant actual speed of signal but bitrate per channel.
AI: No, the speed (distance covered per unit of time) is always the same. A higher (not 'faster') frequency channel can accommodate more data per unit of time.
Think of it as sending a sequence of small letters and a sequence of fat books by mail. They will both travel at the same speed (let's say 100 kilometers in one day), but the 'book stream' conveys much more information per day.
|
H: Hooking up a 3 wire load cell and measuring the output on an ADC
I am trying to get 4, 3 wire load cells connected together in the form of a wheatsone bridge correctly to measure weight. I have the following schematic used from this http://www.nerdkits.com/forum/thread/900/:
I am giving e+ 3V and e- to ground. I am measuring the difference between the S+ and S- terminal. When I put pressure on each of the load cells I see a deflection which goes postive for 2 cells and the voltage goes decreases(but not below 0 (stops at 0) ) when I put pressure on 2 other cells. When I place the load, the weight is uniformly distributed across all 4 cells and as a result the voltage is constant. But I know that this works because I tested it out before opening it up. What am I doing wrong and how exactly do I read these inputs from s+ and s- using an ad620 or LM307?
AI: When I put pressure on each of the load cells I see a deflection which
goes positive for 2 cells and the voltage goes decreases(but not below
0 (stops at 0) ) when I put pressure on 2 other cells.
If you have scenarios where a weight over two of the load-cells increases voltage but the same weight over the other two decreases the voltage then you need to swap the two end wires of the two load cells that send the voltage negative.
how exactly do I read these inputs from s+ and s- using an ad620 or
LM307?
Use this circuit but you might need a negative voltage supply to make sure the AD620 input voltage common-mode range is not infringed - read the data sheet.
|
H: How to use LM56 to switch on/off a 2kW heater
I have an oil heater at 220V/2000W so lets say 10A. I was thinking of creating a circuit to switch the oil heater on/off with a LM56 (http://www.ti.com/product/lm56). Is it possible using a relay or optocuplor? I don't have experience with high-power devices.
Thanks!
AI: Yes, you could do that. I suggest you leave all the present thermostat and safety devices in place and only interrupt the power to the heater (just turn the thermostat to a somewhat higher temperature than you would like to maintain.
You could drive a mechanical relay with the output of the LM36, preferably using a transistor such as a 2N4401 or MOSFET to drive the coil. The usual circuit is something like this (good for a T90 type 12V relay).
simulate this circuit – Schematic created using CircuitLab
The idea is to avoid switching the relay directly with the LM56 to keep the power dissipation low since the LM56 is actually your temperature sensor. You could also simplify this greatly by switching an SSR directly with the LM56, but the SSR would require a large heat sink for 10A. You could use a 12V regulated wall wart to power this.
Take all necessary care with the mains connections and have someone knowledgeable have a look at it before applying power if you're not very familiar working with mains electrics.
A typical 30A relay will last a few hundred thousand operations at 10A, so you might want to calculate the life and decide how much hysteresis you can tolerate in the room temperature. Something like 1-1.5°C is probably okay.
|
H: How to check the source of reset in ATMEGA644p
I am trying to find the source of reset for ATMEGA644p, but I couldn't find the way to do it!
MCUCSR gives error in atmel studio as not declared and the datasheet also doesn't have it.
AI: According to the ATMEGA644p datasheet section 9.3.1 page 57 , there is the MCU Status Register MCUSR that provides information on which reset source caused an MCU reset.
|
H: Resistor Magnitudes in Voltage Dividers
I recently made a voltage divider that uses a 10 ohm (top) and ~90 ohm (bottom) to divide a source voltage of 5v to 4.5v. The resistor values I used was somewhat arbitrary, in that I just picked a random top resistor value based on the resistors I had and calculated the bottom one.
My question: is there any advantage to use higher value resistor pairs over lower value resistors? Would a 100 top and 900 bottom have been better, for example? Or will the circuit work the same regardless of the resistance as long as the ratio remains constant?
AI: Theoretically, any correct ratio works but of importance is not loading the 5V source too much that it sags a little i.e. don't choose resistor values that are so low that what you measure changes due to the introduction of the two resistors.
Next is consideration of what is measuring the output from the potential divider - you don't want the resistors to be so high in value that the impedance of the instrument or circuit changes the ratio. For instance an oscilloscope might have an input resistance of 1Mohm - using a 100k top resistor and a 900k bottom resistor will not be good. Try to aim for 0.1% (just a figure that is reasonable to me) so that the bottom resistor would be about 900 ohms and the top resistor 100 ohms.
Some DVMs are 10Mohm input resistance so a divider formed from 1k and 9k would be OK.
|
H: How to install an embedded GPS patch antenna
How should I install an embedded GPS antenna?
Here is the antenna in question:
the antenna http://www.robotshop.com/media/catalog/product/cache/7/image/800x800/9df78eab33525d08d6e5fb8d27136e95/s/e/seeedstudio-embedded-gps-antenna-for-gps-bee.jpg
http://www.robotshop.com/ca/en/seeedstudio-embedded-gps-antenna-for-gps-bee.html
It has a 9 cm cable.
My project box (which contains a gsm shield, microcontroller, custom proto circuit board, motor h-bridge, lipo battery, and charging circuit) is an outdoor grey PVC junction box (like the kind used on hot tubs). It is just big enough to fit all the components inside.
It looks kinda like this, but more of a cube:
(source: cesco.com)
Right now I just have the antenna loosely held in place by the mess of wires, and it is taking about 40 seconds from cold start to establish a fix, which is usually about 30-100 m off.
So, do I need to somehow mount the antenna to the wall of the project box, facing up? If so, do I just drill out a small hole in the side of the box and epoxy the antenna to the wall such that nub on top is 'looking' through the hole?
AI: I would secure it flat to the roof of the box. From this application note which is from a typical patch antenna:
Taoglas internal GPS active patch antennas like all GPS antennas should be
ideally placed with a line of sight to the sky. The antenna should be placed
on the top of the device below the plastic housing, without metal close to it.
The antenna cable should not be more than 200mm so as to minimize
attenuation to the receiver. The cable should not be bent more than 30
degrees and should be routed away from noisy components such as ICs.
Taping or gluing it to the top of your box, oriented flat to the sky, should give you the best results. Keep the antenna cable away from other wires if possible.
|
H: Logic design k-map question
Hi everyone I'm trying to minimize this boolean function F(A, B, C, D) = ∑m(7, 8, 9, 12, 13)
don't care terms(2, 3, 6, 10, 11, 14). My main question is about the row of don't care terms in the bottom row, do I include this as a group of 4 when minimizing? I assumed I should and got this product-of-sums AB'C + AC' + ACD' + A'C + B'C. I'm also, not that great at simplifying so do AC' and A'C cancell to get AB'C + ACD' + B'C? Any and all help is appreciated especially if you could give an explanation on how you simplified, thanks.
AI: The point of minimizing a boolean function is that you want to output the same 0s and 1s with the smallest number of terms. A don't care can be either a 0 or a 1 - whichever makes the function simpler.
In your case, there's no reason to treat the entire CD' block of don't cares as 1s: if it doesn't make your SOP function simpler, don't add it.
I think the simplest SOP expression is AC' + A'C. Here's a picture of those two terms.
|
H: Reading switches without a common ground from Arduino
I'm trying to interface a steering wheel control interface with an Arduino.
The interface connector has 6 pins, A to F.
These pins are interconnected with 8 push buttons, SW1 to SW8:
simulate this circuit – Schematic created using CircuitLab
These buttons don't have a common ground, so I can't connect them directly to the Arduino.
How can I interface these with the Arduino, in order to know which button is pressed?
What came to my mind is creating a network of resistors, injecting +5V somewhere, and reading an analog value that would be dependent on which button is pressed, but I'm not sure how to do that, or even if it is the best solution.
AI: Hoping that only one button will be pressed at a time, I have a software solution based on polling :
Let A is connected to Pin1, B is connected to Pin2 and so on..
First configure Pin1 as output port and all others as inputs. And out
a logic '1' at Pin1. Read the values at Pin2 to Pin6.
if Pin2 = '1' then SW1 is pressed.
if Pin4 = '1' and then SW5 is pressed.
Now repeat the above steps with Pin2 as output port and others as input ports (Change the conditions accordingly).
EDIT: As Spehro Pefhany commented, this will work for upto two switches pressed simultaneously.
|
H: Powering 12v led strip from 16v dc
I want to power up about 2 meters of led strip from a 16.5v dc battery (4s lipo).
I know there are dc-dc converters, but I rather avoid using them due to weight (rc plane)
The lights will not be used very often, probably they will stay on for about 30 minutes.
I have read somewhere that I could plug few diodes in series with the strip, could this be a good idea? Are there any precautions to put in place (do diodes overheat)?
I am basically looking for a solution that works, not for the best practice, performance or top reliability...
Thank you!
AI: Common led strips take about ~18mA at 12V per segment (typically 3 LED). They are used in Automotive 12V rails, which is 12V nominal, but can go to 14V regularly, with larger spikes.
If you look at a segment, you will notice it has three LEDs and one resistor. Based on the color of the led and ohms law, you can figure out it's current at any given voltage.
$$I = \frac{V_s - V_f}{R}$$
Assuming a white or blue led with ~3.2V forward voltage drop, which is typically paired with a 120Ω resistor:
$$\approx 18mA = \frac{12V - (\approx 3.2V \times 3)}{120Ω}$$
At 14V, you get:
$$\approx 36mA = \frac{14V - (\approx 3.2V \times 3)}{120Ω}$$
This isn't exact. The higher the source voltage and current goes, and the LEDs forward voltage drop does change a bit. At ~36mA the LEDs are being over driven, shortening their life some, so you won't get 1000~5000 hours that they should give at 20mA. But its normal to overdrive them. And they will be brighter to boot, so you might even need less LED segments.
But now lets change the source voltage to 16V:
$$\approx 53mA = \frac{16V - (\approx 3.2V \times 3)}{120Ω}$$
53mA continuous is almost 300% of the typical recommended current of 20mA. But at 53mA, the forward voltage drop goes up as well, making the math tricky. The life of the leds will be much shorter, and they will warm up considerably.
Solution: As others have mentioned, you can use Silicon Diodes to drop the source voltage. You can use from 3 to 9 (Dropping 2.1V to 6.3V), depending on how bright you want the leds, how much current the strip should pull, your batteries voltage range (A 4S Lipo is 14V Nominal, 16.5V at max safe charge, 11.5V at lowest safe discharged voltage).
Best thing to do, is take one or two segments of the led strip and TEST THEM. Connect one directly at the charged 16V and see how long it lasts or how hot they run. Look at the resistor and do the math. Then start adding Silicon Diodes and see the difference.
|
H: Driving EL wire with Supertex HV850 family drivers
I was considering driving EL wire with Supertex'es ICs or some equivalent ICs from another manufacturer. The ICs are designed to drive EL panels not EL wire. Would this still work?
Supertex'es ICs are rated for "lamp sizes" up to 42 square inch. My wire is 2.3 mm in diameter and 20 meters long. I'm going to assume 2.3 mm is the diameter including the outer protective sleeve and the actual diameter is probably somewhere around 2 mm. Looking up the formula for a cylinder's surface area I determined that my EL wire has surface area of about 2513 cm² (about 390 square inch). That's way too much for those ICs.
According to this calculation I could drive up to 2 meters of EL wire with these ICs. But is this calculation applicable to EL wire at all?
AI: The area is not really what loads the driver- what matters is the total capacitance (and the voltage, and frequency). The wires have a spiral wire on the outside which doesn't have as much capacitance per unit area as a flat panel.
The HV816 claims to be able to drive 150nF, which they say is about 42in^2 of EL backlight.
From this link, they claim the capacitance of their EL wire is about 1nF/foot, so 20m should be about 66nF, in which case the Supertex HV816 should be able to handle the capacitive load, and if the voltage and frequency are right, it should be okay. Check the specs on the EL wire you are using (or measure it).
|
H: Non-glass heating element for an etching tank
I have been using below glass heating element (the part name is ET20) on my etching tank.
The problem is that the glass is too gentle that breaks very easy for many reasons, I already needed to replace a few of them.
I wonder if you could suggest me any non-glass heating element for an etching tank that is not fragile and durable to use?
AI: Titanium is used commercially. Since they're sold for aquariums they might be economical enough and work for you (if the other materials and the Ti are compatible with your etchant).
|
H: G.711 for dummies
I am in midst of some online telephony course, and there are questions regarding which I have no one to ask but this community.
G.711 volume encoding. I have some difficulty to understand how exactly G.711 encodes the absolute volume, if at all. The standard does seem to address it in mapping the code to actual input voltage. But does the actual voltage range choice as input for encoder - changes anything in mathematics of G.711 or is it only so G.711 encoders be compatible one with another. Because seems like G.711 deals with encoding any arbitrary 256 steps range.
Given the following sentence "Power of 3.17 dBm is 2.0749 mW in 600 Ohms (Ω) of telephone impedance". Why do we have to reference impedance, isn't 3.17 dBm translated directly to 2.0749 mW?
AI: It doesn't encode absolute volume. 0dBm (1mW) is chosen as the nominal 'full volume' power level because it is a standard for analogue telephone lines, and the +3.17dBm maximum provides an overload margin. If the telephone equipment uses a different standard (eg. -10dBm) then the signal will be encoded relative to that level, but can still be reproduced at 0dBm (or any other 'volume') if required.
The encoder itself is basically just an A/D converter, and the input voltage it requires depends on the particular circuit used (convertor type, reference voltage etc.). The incoming audio signal would typically be terminated with a 600 Ohm resistor, then the voltage across it amplified to match the input range of the ADC.
It's redundant, but for good reason. We are not machines, and redundancy helps us to understand concepts and memorize facts.
|
H: Size of SMD pads for components with high tolerances
I'm building an Eagle component for an LSM115J.
The connectors on this part have fairly large tolerances (1.85-2.21mm width, 0.76-1.52mm length). There is no recommended land pattern.
Should I go for the largest size (so the part will never need to be partially soldered on top of the stop mask), the smallest size (so the part has a well-defined placement) or something in the middle?
AI: That package is an SMB. Here is Diodes Inc. suggested footprint for their SMB (almost the same):
The IPC footprint expert would give you a somewhat different footprint (more prone to shorting in the center IMO).
|
H: Why do some diodes have a glass package?
Put simply, why do some diodes such as most Zeners and Schottky diodes have a glass package as opposed to the more traditional plastic package?
Is it ease of manufacturing, thermal properties, or some other electrical phenomenon?
AI: Early semiconductor diodes were mostly glass packaged which provided the advantage that they were hermetic and did not depend on passivation of the chip to survive heat and humidity. The glass package also allows a very high operating temperature. Early devices such as the 1N34A (germanium) and the 1N914 as well as the 1N7xx Zener series became very popular and inexpensive.
Plastic-packaged devices were developed to reduce costs where high performance was not so important.
For example, the glass 1N4148 has a maximum junction temperature of 200 °C compared to only 150 °C for the plastic-packaged 1N4001.
Ceramic packaged diodes have also been produced.
|
H: What is the difference between TFT LCD interfaces?
I am looking at driving a small TFT and have found that the driver chip supports various interface methods, however I can't see why I would choose one over another.
The options are:
i80
SPI
VSYNC
RGB
Can anyone describe the pros and cons of the different interfaces?
In my specific case I want to drive an ILI9320 with a PIC32 via the Parallel Master Port.
AI: The "i80" parallel interface is simple and fast, and can be driven by external memory interfaces on some microcontrollers. However, it's a wide parallel bus, and requires a lot of pins to drive.
SPI requires very few pins to drive, and is available as a hardware peripheral on many microcontrollers. It's slower than the parallel interface, though.
The VSYNC and RGB interfaces are mainly useful for displaying streaming video from live sources (e.g, in a camera). They aren't useful outside special situations.
Given that you're using a PIC32 with what sounds like a big parallel port, the i80 interface is probably ideal.
|
H: K-map Minimization
I'm having trouble minimizing this k-map for ∑m(0,5,9,12,15) and converting the SOP into a design using only NAND's and NOR's. I think the SOP should be (ABD')+(A'B'D')+(AC)+(A'BC'D)+(AB'D), but I'm confused because there is a single 1 that I can't group. Sorry for the poor formatting and thanks in advance for any answers, explanations are always a plus for me.
AI: The SOP you have got is correct.
F = (ABD')+(A'B'D')+(AC)+(A'BC'D)+(AB'D)
You can not reduce this further. Now implementing using NAND is simple.
F = [F']' = [(ABD')' . (A'B'D')'. (AC)' . (A'BC'D)' . (AB'D)']'
F can be implemented as the output of a NAND gate whose inputs are the five terms as shown above. It is clear from the expression that each of these five terms can be implemented using NAND gates.
Similarly, writing POS will give easy NOR only implementation.
|
H: Antenna Diversity: two Yagi antennas to the Rx and Rx/Tx u.fl-male points on the wifi-NIC?
I looked at the BCM4312 file - available as as doc or a pdf - and it says:
BCM4312 has 2 radio chains, one is a dedicated Rx chain, the other is shared by TX and > RX chain using an RF switch
Support Antenna Diversity
RF Output Power
802.11b: 16.5 dBm ± 1.5 dBm
802.11g: 15.5 dBm ±1.5 dBm
Can I hook up two Yagi antennas to each u.fl connector (it has 2 u.fl male connectors) and will "diversity" work? How exactly does all this work?
Wiki says:
Spatial diversity employs multiple antennas, usually with the same
characteristics, that are physically separated from one another.
Depending upon the expected incidence of the incoming signal,
sometimes a space on the order of a wavelength is sufficient. Other
times much larger distances are needed
Transmit/Receive diversity uses two separate, collocated antennas for
transmit and receive functions. Such a configuration eliminates the
need for a duplexer and can protect sensitive receiver components from
the high power used in transmit.
All of the above techniques require some sort of post processing to recover the
desired message
- Switching – In a switching receiver, the signal from only one antenna is fed to the receiver for as long as the quality of that signal remains above some prescribed threshold. If and when the signal degrades, another antenna is switched in. Switching is the easiest and least power consuming of the antenna diversity processing techniques but periods of fading and desynchronization may occur while the quality of one antenna degrades and another antenna link is established.
AI: From the datasheet it always transmits over one of the antenna connectors and a software algorithm is used to determine the best one at the time to use for receiving:
BCM4312 has 2 radio chains, one is a dedicated Rx chain, the other is shared by TX and RX chain using an RF switch. For RX, It supports antenna diversity and provides four options. A software diversity algorithm is used to determine which option is used.
It doesn't mention what the four options are but in general the idea of using diversity mode is when you think the reception from one antenna is likely to be better than the other, it won't increase range otherwise because only one is actually being used at a time. For further reading here's an article Multipath and Diversity from Cisco that goes into quite a bit of detail on the use cases.
So it's certainly possible to connect a Yagi to each antenna connector and it shouldn't cause any problems as long as you don't use it to try and expand coverage to a wider area. But if it's in a location where multipathing isn't likely to be issue like say outdoors and line-of-sight it won't gain you anything either. In that case you'd be better to spend the extra money on a better antenna and low-loss coax and connectors.
From a practical point of view determining the best setup is mainly a matter of testing various configurations and doing a site survey to make sure all the areas you're interested in have good coverage. The last time I did something similar it was an embedded system that had logging and GPS anyway, but there are a number of phone apps around that may prove useful if the clients will be moving around. For point-to-point you could just measure throughput and reliability over a period of time to make sure it meets your needs.
|
H: Independent watchdog (IWDG) or Window watchdog (WWDG)?
I'm still searching to find an answer for this question:
Since the STM32 MCUs already have a perfect watchdog (I mean the Window watchdog (WWDG)), why is there also a simple watchdog (Independent watchdog (IWDG)) ?
I found this page that has said:
ST Microelectronics has a line of Cortex-M3 devices. The M3 has become extremely popular for lower-end embedded devices, and ST's STM32F is representative of these parts (though the WDT is an ST add-on, and does not necessarily mirror other vendors' implementations). The STM32F has two different protection mechanisms. An "Independent Watchdog" is a pretty vanilla design that has little going for it other than ease of use. But their Window Watchdog offers more robust protection. When a countdown timer expires, a reset is generated, which can be impeded by reloading the timer. Nothing special there. But if the reload happens too quickly, the system will also reset. In this case "too quickly" is determined by a value one programs into a control register.
Another cool feature: it can generate an interrupt just before
resetting. Write a bit of code to snag the interrupt and you can take
some action to, for instance, put the system in a safe state or to
snapshot data for debugging purposes. ST suggests using the ISR to
reload the watchdog -- that is, kick the dog so a reset does not
occur. Don't take their advice. If the program crashes the interrupt
handlers may very well continue to function normally. And using an ISR
to reload the WDT invalidates the entire reason for a window watchdog.
and this:
STMicroelectronics' new series of STM32F4 Cortex™-M4 CPUs has two
independent watchdogs. One runs from its own internal RC oscillator.
That means that all kinds of things can collapse in the CPU and the
WDT will still fire. There is also a “window watchdog” (WWDT) which
requires the code to tickle it frequently, but not too often. This is
a very effective way to insure crashed code that randomly writes to
the protection mechanism does not cause a WDT tickle, and the WWDT can
generate an interrupt shortly before reset is asserted.
Now let's take a look at the reference manual:
The STM32F10xxx have two embedded watchdog peripherals which offer a
combination of high safety level, timing accuracy and flexibility of
use. Both watchdog peripherals (Independent and Window) serve to
detect and resolve malfunctions due to software failure, and to
trigger system reset or an interrupt (window watchdog only) when the
counter reaches a given timeout value. The independent watchdog (IWDG)
is clocked by its own dedicated low-speed clock (LSI) and thus stays
active even if the main clock fails. The window watchdog (WWDG) clock
is prescaled from the APB1 clock and has a configurable time-window
that can be programmed to detect abnormally late or early application
behavior. The IWDG is best suited to applications which require the
watchdog to run as a totally independent process outside the main
application, but have lower timing accuracy constraints. The WWDG is
best suited to applications which require the watchdog to react within
an accurate timing window.
The window watchdog is used to detect the occurrence of a software
fault, usually generated by external interference or by unforeseen
logical conditions, which causes the application program to abandon
its normal sequence. The watchdog circuit generates an MCU reset on
expiry of a programmed time period, unless the program refreshes the
contents of the downcounter before the T6 bit becomes cleared. An MCU
reset is also generated if the 7-bit downcounter value (in the control
register) is refreshed before the downcounter has reached the window
register value. This implies that the counter must be refreshed in a
limited window.
As you can see, none of them have explained Why there are two watchdogs. if I ask, "What are the differences between the two watchdogs?", then you will count all of the features that you can see in the above excerpts, and compare them both, coming to the obvious conclusion that the Window watchdog (WWDG) is the winner! So, then, Why there are two watchdogs?
I want to know... When should I use the IWDG? ...And when should I use the WWDG?
Finally, why do they call the second watchdog a "Window watchdog"?
AI: Regular watchdog timers must be reset at some time before they time out. If you have a 100ms WDT you can reset it every 99.9ms or every 10us and it will never time out.
Window watchdog timers have a time window within which they must be reset. If you reset it too early or too late (from the previous reset) it will cause the processor to reset.
The purpose, if it is not obvious, is to help ensure that the code resetting the WDT is the intended code, operating in the intended fashion. Some kind of unforeseen condition that generates high-frequency WDT resets won't prevent the system from being reset.
Running a WDT from the system clock could be a bit of an issue- if the clock fails and if there is not an independent clock monitor circuit, bad things can happen. The independent clock for the WDT means that if the thing for some reason started running at 1/10 speed, the WDT would reset (but the window WDT would not).
Use both if you can.
As the page says, resetting the WDT with an ISR is generally bad juju (but may be acceptable if the ISR verifies the reset of the firmware is functioning before resetting the timer).
|
H: Two amplifiers in single speaker with different frequency power
I have two amplifiers using LM386. One of them I plan to use for normal amplifier and the second one I want it to be a low pass amplifier/bass amplifier and both of them will be connected to same speaker. My question is: is it possible to run two amplifiers in the same speaker with different frequency (there is no high tone in second amp) and how should I wired them, bridge or parallel?
AI: No. Connecting the output of two amplifiers to the same speaker in parallel is not a good idea.
Slight variances in amplified signal at specified periods of time produce a voltage (difference of potential). In this situation you'll have something similar to shortcircuit.
Of course, you could add some series resistors, but this would modify speaker impedance and reduce output power, which isn't too much when using LM386.
You could wire them as a bridge configuration. Something like this:
Source: seekic.com
As you can see, it has only one input. So, you should use a simple preamplifier to mix the different frequency input signals.
|
H: Minimum cover for this K-MAP to find minimum SOP; which is better, and why?
I used this K-MAP to find the minimum sum-of-products expression for this collection of minterms.
I see that minterm-one could also have been "covered" by grouping it with minterm-five.
I opted to "cover" minterm 1 with the largest possible group: (0,1,2,3), which is the green circle on my K-MAP.
Since both combinations of groups result in a minimum SOP of 5 terms, which would be considered "better" in terms of hardware/gate implementation?
Am I correct to assume that the my larger group is better, as it eliminates one more literal?
Or am I wrong, and would group (1,5) be better than group (0,1,2,3) for finding a minimum SOP?
AI: For hardware implementations, your version with the larger groupings is better. Even though you'll still have five terms, your terms will be more easily implemented since they won't depend on rarely used specific cases.
Think of it like this, if you have a simple AND gate, a larger group reduces the amount of inputs the AND gate will take since its output will be predictable regardless of what any other possible inputs would be. A smaller group makes your AND gate take in more inputs and thus is more complex. You may need more NOT gates before inputting the signal to the AND gate.
Let me know if that is a little confusing.
|
H: CD4029 does not initialize at 0
I am attempting to build a very simple 4 bit counting machine using a CD4029 ic and a 555 timer. I have built my circuit on a breadboard and everything seems to be working perfectly, however on the power up of the circuit the outputs id the CD4029 seem to be set to random values and not to 0000 as I had expected. I need my counter to start at 0 for the project I am working on. How would I manage to achieve this.
AI: Set Jam Inputs J1-J4 to 0V (pulldown) then give a short positive going pulse on Preset Enable. That should set the all the outputs to low. Once Preset Enable goes back to 0, pulses on the clock input will cause the counter to count up or down (depending on how you've set UP/DOWN.)
A simple, easy, and not terribly reliable way to do this would be to connect a 100nF capacitor from VDD to Preset Enable, and a 100k Resistor from Preset Enable to ground. Powering on the circuit will cause Preset Enable to go high through the capacitor. This is then discharged through the 100K to ground, bringing Preset Enable back to ground.
|
H: Regarding Microchip XC8 compiler's registers and bits definitions
I'm going to take a random 8-bit Microchip microcontroller: PIC16F887.
Let's have a look at how the XC8 compiler (and the HI-TECH PICC, for that matter) is defining a register (SFR) and its coresponding bits in the header file of the device (/opt/microchip/xc8/v1.31/include/pic16f887.h):
extern volatile unsigned char PORTB @ 0x006;
So PORTB SFR is defined as an 8-bit volatile variable with the absolute address 0x006, as per the datasheet.
I'm having problems understanding the definition of a single bit (bit 1, for example) corresponding to PORTB:
extern volatile __bit RB1 @ (((unsigned) &PORTB)*8) + 1;
Why do they multiply the PORTB address by 8?
EDIT:
I also looked for an explanation in the compiler's manual and found pretty much the same answers that Spehro gave me. I should have consulted the manual before asking here:
When defining absolute bit variables (see Section 5.4.2.1 “Bit Data
Types and Variables”), the address specified must be a bit address.
A bit address is obtained by mul- tiplying the desired byte address by
8, then adding the bit offset within that bit.
So, for example, to
place a bit variable called mode at bit position #2 at byte address
0x50, use the following: bit mode @ 0x282; If you wish to place a bit
variable over an existing object (typically this will be an SFR
variable or another absolute variable) then you can use the symbol of
that object, as in the following example which places flag at bit
position #3 in the char variable MOT_STATUS:
bit flag @ ((unsigned) &MOT_STATUS)*8 + 3;
AI: Bit addressing uses the lower 3 bits of the address to point to the bit within a byte.
So the bit is number (RB1 & 0x07) or 1 in your example, the byte address is (RB1 >> 3), or 0x06 in your example.
|
H: What are the advantages of a shunt resistor vs. a hall effect sensor?
I'm constructing a boost converter, and I need to measure both the input current and the output current. Currents range anywhere from 25A to 200A, depending on the model. My controller is referenced to the negative rail of the converter. I've been focusing on hall effect sensors, but it occurs to me that I could use shunt resistors in the negative leg instead. What are the advantages and disadvantages of each approach?
AI: I am not an expert in the field but I can try to help jotting down some quick ideas.
Hall effect sensor
pros:
galvanic insulation between the measurement circuit and the circuit to be measured
they can be placed anywhere on the current path (voltage is not a problem), thus easyness of installation and eventually servicing
they nearly do not affect the measured current so they are great if this is a concern
cons:
cost: a high current, precise sensor can cost tens of bucks
bandwidth: the sensor and the sensed wire are coupled through a transformer, and of course it has its own frequecny response. A piece of copper (aka shunt resistor) is less affected by this problem.
magnetic fields: an external fixed magnetic field can cause an offset in the measurement that must be somehow taken into account
Shunt resistor
pros:
small and cheap, I bet that with a good pcb manufacturer you can make your shunt resistor on the pcb paying only for the increased size, but keep in mind that the copper resistivity depends on temperature, moreover the pcb outer layers thickness is not precise while inner layers are somewhat better.
You can get cheap SMD shunt resistors down to 1m\$\Omega\$ from ohmite
cons:
they can dissipate quite an amount of power, and a tradeoff exists between precision and dissipated power. They can get quite hot too.
they do affect the measured circuit, namely there's a voltage drop across them and that might not be acceptable for very low voltage, high current applications. You can't measure the current consumed by an array of cores that are powered with 1.8V with a shunt that drops some 100mV
That is just what comes to me from the top of my mind, I'd be very happy to integrate/correct this list reflecting any reasonable comment from below.
|
H: Low pass filter value for DAC
I was wondering, how to calculate the values needed for LC/RC filter when using it for digital to analog conversion?
Also, how does the square waves frequency affect DAC ?
For example: lets say I have 10 kHz 5V square wave output to the LPF. From it, I would like to get an analog value, with cut off frequency at 20kHz.
How would I calculate component values needed?
AI: If you are not very close to the sampling frequency you can assume that the output amplitude from the DAC pretty much represents the input amplitude - this means that the low pass filter you wish to design (if a 1st order) would be based on a resistor feeding a capacitor to ground and the filtered output taken from the capacitor. The 3dB point of the filter is: -
\$f_C = \dfrac{1}{2\pi RC}\$ so...
Plug 20,000 Hz into the formula and maybe 1000 ohms and see what value capacitor you get. For higher order filters I'd use a 2nd order sallen-key calculator like from here - it's a good site and I trust it for coming up with the goods.
You do need to be aware of the problems if the highest frequency you want to produce is greater than a fifth of the sampling frequency - this will cause an amplitude error and you may want to "straighten" this out with a little bit of high pass filtering to. Here is an explanation and below is the formula that you need to worry about when compensating: -
It describes how the amplitude tails off as the input frequency gets closer to the sampling frequency.
|
H: How to choose what a power supply to drive 2 x 10watt RGB LEDS?
I'm trying to figure out how to determine what power supply I should be using for different types of LEDs for this and future projects.
I have 2 x RGB LEDS:
Forward Current: 350mA
Forward Voltage:
RED: 6V - 6.6V
BLUE: 9.6V - 10.2V
GREEN: 9.6V - 10.2V
I want to run these in parallel with a power supply and was thinking something along the lines of using an LED Strip power supply as my main power source that is 12V - 2Amp - 25 watt.
I'm going to use an arduino and attempt to dim them using PWM with a transistor.
What's the best way to gauge a power supply unit for high powered LEDS including putting them in parallel?
My understanding is that if I'm drawing 20 watts of power, ideally a power supply should be able to output slightly more than you're drawing. The same goes for the amperage?
Is using this LED Strip power supply a bad idea?
AI: I think you should go up to the next largest power supply size or use the LEDs at less than full current. For example, if you used them at 275mA, the total draw would be 1.65A.
The current is the important factor since you're going to be wasting significant power in the series resistors. You should use six series resistors, one for each LED string. If the forward voltage of the red LEDs is 6.3V you can use (12-6.3)/0.275 = 22 ohms at 2W (0.275a * (12-6.3) = 1.7W) (two of those) and the other values would be calculated in the same way.
As Funkyguy says, it's not a good idea to run the power supply or the LEDs at full rated power (often there is an explicit derating chart for temperature or whatever, but you may not get that with no-name Chinese supplies, and you may not have a full datasheet for the LEDs).
|
H: why making processors is Monopolized on 3 companies
why only there are only 3 companies allowed to make processor "intel - AMD -apple" why others can't make one ..
i know that making processor is difficult and needs a huge techno , but what about google or samsung aren't they have the qualified techno ? so why they use others' processors
AI: Firstly, there are plenty of other Processor manufacturers, ARM noted above are probably bigger than the ones you named by processors shipped, but others, such as VIA who also make processors for the same X86 and X86-64 instruction sets used in Intel and AMD 32 and 64-bit processors.
Processor companies require architecture volume to persuade third parties to support a platform.
Imagine if a new chip manufacturer with their own architecture and instruction set, came to market: 1st they'd either need to make their own System-on-Chip or motherboard, 2nd they'd need to code all of the basic software, peripherals and in the first instance either code or port an operating system to their brand new hardware to convince others of its potential.
In short, unless someone could demonstrate exceptional power usage, or alternatively a significant increase in the performance/cost ratio, they would struggle to convince partners in hardware, software and peripherals to support their new platform.
|
H: Understanding resistance in open and short circuits
I am continuing to try to learn a little about Electronics and I came across the following problem for which I am not sure I completely understand the calculations. In other parts of the book, they showed the calculations, but for this question they did not.
Image source: pp. 69, Practical Electronics for Inventors (3rd Edition), Scherz and Monk, Tab Books, 2013
For the circuit 2.61a, my calculations were:
$$
I = \frac{12V}{\left( \frac{1}{\frac{1}{10} + \frac{1}{10} + \frac{1}{10}}\Omega + 0.2\Omega \right)} = 3.396
$$
For circuit 2.61b I used:
$$
I = \frac{12V}{\left( \frac{1}{\frac{1}{10} + \frac{1}{10} }\Omega + 0.2\Omega \right)} = 2.3
$$
But I can't figure out how the book arrived at 6A for circuit 2.61c. What effect does the short circuit across the third resistor have on the parallel resistance? Does it completely eliminate any resistance so that the equation becomes:
$$
I = \frac{12V}{2.0\Omega} = 6.0
$$
And what is the significance of \$\infty\$ on the third resistor in 2.61b?
AI: The first two calculations look good. The first one is a little ambiguous on the problem's behalf because the current is more than 3A, but not a short circuit so we don't explicitly know the series resistance of the battery. I also agree with your answer for the last one but let's understand why.
Let's do the calculation exactly the same though for c. We now have a zero ohm resistor. And since we know a short circuit condition is present we know the equivalent series resistor will be 2Ω.
$$
I = \frac{12V}{\left( \frac{1}{\frac{1}{10} + \frac{1}{10} + \frac{1}{0}}\Omega + 2.0\Omega \right)}
$$
Simplifies to:
$$
I = \frac{12V}{\left( \frac{1}{\infty}\Omega + 2.0\Omega \right)}
$$
Finally we can see the the equation does simplify to
$$
I = \frac{12V}{2.0\Omega} = 6A
$$
Appending to answer your last question which I missed. Even if you don't explicitly know what the purpose of the infinity resistor is doing in the circuit solve it the same way:
$$
I = \frac{12V}{\left( \frac{1}{\frac{1}{10} + \frac{1}{10} + \frac{1}{\infty}}\Omega + 2.0\Omega \right)} = \frac{12V}{\left( \frac{1}{\frac{1}{10} + \frac{1}{10} + 0}\Omega + 2.0\Omega \right)}
$$
Which is what you had.
**Side note, current is usually denoted with an 'I' not an 'A'.
|
H: Unplugging a router from the wall socket
When the internet appears to have crashed, the service provider invariably gives this advice as a first line remedy: unplug the router from the wall socket, then wait 5 minutes, then plug it back in. Many times this remedy works.
Question: Why does the router care if it's been unplugged from the wall versus simply turning it off? And more interestingly, what happens during the 5 minute interval that the router is unplugged; if it has no electricity, is it not merely in a deadened state?
AI: What you are waiting can be two things. One is for the ISP to "release" your dynamic IP address, and after 'x' minutes, when powered back on, the MRC (Modem/router combo) will be re-assigned an IP address to its MAC address.
The other reason is to allow a internal capacitor to discharge completely to allow the volatile memory that contains the cache to be cleared. Clearing this cache can often "resolve" the issue.
|
H: DSP - practical even or odd functions
Signals can be classified as even, odd, or a neither - in which case they can be broken up into their even and odd components. Theoretically its all very nice to be able to say that yes that function is symmetric about the origin, but practically is this ever actually achievable?
My confusion basically is how can a practical signal exist before t = 0 or x[0] and thus allow for classification? In my naive thinking it would seem that you can never have a purely even or odd signal in practice.
EDIT: To clarify, this is about an INPUT
AI: Given a real signal, the choice of exactly which instant constitutes t = 0 is essentially arbitrary. So, for instance, if a signal occurs from 9:00:00 AM day before yesterday, to 9:00:02 AM the same day, you can set t = 0 at 9:00:01 and know what the signal was for t < 0 as well as you do for t > 0.
|
H: Radio Receiver IC
I am a Junior EE student that is interested in putting together a small radio receiver project for fun and to get some general practice with design. I have found these receiver chips from Silicon Labs Si4732/34/35. I would like to hook up the final design with a small LCD screen to show the frequency and then be able to listen with a standard pair of headphones through a 3.5mm headphone jack. My question is does anyone have experience with these chips or are there other chips out there that will better suit my needs? My second question is am I attempting to embark upon a project that is too ambitious for one person? Thank you for the help and advice. This is also my first post so if I have violated any rules around here please let me know.
AI: If you are happy with that series of wireless chips from Silicon Labs then you should check out their reference design kits which may be more suitable for getting started with development than simply ordering the standalone.
With design kits, you usually have options of adding LCD screens and other connectors much more easily and they usually come with some IDE for developing software right off the bat, and even some sample code.
|
H: What kind of PC board coating is this?
I recently came into possession of two large (approx. 3x4 ft) copper-clad fiberglass boards from a junk sale. These boards are consistent with typical printed circuit board material (thickness, flexibility, internal appearance, etc.), save for a blue coating on both sides. Here are two small pieces I cut off for testing:
Here I've sanded off some of the coating to reveal the copper underneath (the cuts are from me testing my PCB mill):
The copper is conductive (unsurprisingly), and the coating is not.
Any ideas on what the coating might be? The boards are probably around 5-10 years old, and were covered in a thin plastic sheeting when I obtained them.
Specifically, I'd be interested in knowing (a) how to remove the coating without damaging the copper (solvents? acids? photoexposure?) and (b) if I could use the coating in some way to help make printed circuit boards (as a resist material? ablate with a laser cutter?).
AI: The boards appear to be photoresist boards, i.e. bare PCBs factory coated with photoresist material, then protected by a thin sheet of plastic. Here is an example of such PCBs.
Over time, even if such boards are stored in a relatively dark place, the photoresist gets exposed and becomes unusable. It just needs to be scrubbed off for the bare PCB to be used like any other copper PCB.
|
H: C Documentation for AVR Atmel Studio
I am new to AVR programming and have tried couple of tests on assembly language and were successful.
However, I would like to try out programming in C with Atmel Studio.
Could somebody tell me where I can find the complete documentation of what is available for C language in Atmel Studio?
AI: Atmel Studio 6 provides the Atmel Software Framework which is a massive, if bloated, set of libraries for all the various hardware configurations that Atmel offers. Atmel has done a pretty good job of using doxygen in these libraries so you can find a pretty thorough set of documentation here.
The ASF is fairly well integrated into the IDE with some C example projects which should work out of the box (assuming you are using a dev kit or otherwise supported hardware).
The avr-Libc documentation is also a great source of information about this particular flavor of C. The rest is mostly gcc C syntax.
Lastly, while EE.SE is a great site, for AVR specific things you also might want to try asking a question over at AVR Freaks. I think the ASF documentation is relatively self-explanatory, but for things like project setup and tool-chain problems, that site is probably your best bet.
|
H: Why do op-amps keep amplifying?
I was reading an old copy of Horowitz and Hill's The Art of Electronics and I am trying to wrap my head around operational amplifiers in negative feedback circuits.
As the book explains, as the op-amp sees a positive voltage at its inverting input relative to its non-inverting input, it drives its output strongly negative, which effectively sets up a voltage divider along the resistor between the signal source and the op-amp's inverting input, and the feedback resistor running between the op-amp's output to the inverting input. The gain will be such that the voltage at the inverting input is the same as at the non-inverting input, which is typically ground. Hence the inverting input in a negative feedback circuit is sometimes called a virtual ground.
Now if this is the case, and the inverting and non-inverting inputs are brought to the same potential, won't the op-amp stop amplifying? I mean, there's now no voltage difference, so there's nothing to amplify.
I suspect that this is actually occurring, but as the op-amp stops amplifying, the output voltage moves up toward zero, which raises the voltage at its inverting input, which triggers amplification again until the virtual ground is re-established and the cycle repeats.
Wait, did I just say the cycle repeats? This implies is that the output voltage is actually oscillating at (probably) a very low amplitude and very high frequency, which for all intents and purposes for common circuits is stable. Is my understanding correct?
I bet if I used a capacitor to introduce a delay in the reaction of the op-amp, I could get oscillation at a lower frequency.
AI: At first, the principle of "virtual ground" can be applied during DESIGN of opamp-based amplifiers. This simplifies calculations - and the error is in most cases acceptable. Error? Yes - because there is always a differential voltage between both opamp inputs, which is exactly Vdiff=Vout/Aol. (Aol=open-loop gain of the opamp). Because of the large values for Aol (1E4...1E6 for lower frequencies) this diff. voltage Vdiff is in the µV range.
However, because this is not true for larger frequencies, the closed-loop gain will deviate from the calculated value for rising frequencies.
Regarding your last sentence: Yes - introducing additional delay in the feedback path will cause additional phase shift - and this can lead to instability/oscillations.
EDIT: "...until the virtual ground is re-established and the cycle repeats."
I suppose, with the above cited sentence you are asking for something like a "sequence" which leads to the steady-state conditions after applying an input signal, correct? This is, indeed, a question which deserves some explanations.
Example: Inverting opamp-based amplifier with a gain of "-2". Input: +1V step (t=0).
At the very beginning (t>0), the feedback is not yet active and the output will jump to the maximum negative voltage (supply rail). Now the feedback network causes the inverting terminal to become negative - and the output starts to go to positive voltages. However, this will not continue again and again because the opamp has internal delay elements (causing bandwidth limitations and phase shift). That means: The output does not "jump" to other values but it takes some time to reach the upper rail. But, in reality, the output will NOT reach the upper rail because on the way to the maximum positive output the output voltage crosses some finite negative values - and for an output value of app. Vout=-1.999V there will be an equilibrium between input and output. Explanation:
Vout=-1.999V and Vin=+1V cause a very small voltage between both resistors (at the inv. input terminal) which - when multiplied with Aol - is exactly the assumed output voltage (in the example: Vout=-1.999V.) This equilibrium state is stable.
|
H: Arduino I2C level conversion
I'm working with Arduino Uno (Rev 3) to interface a DRV2605 haptic driver to control several ERM/LRA motors using I2C.
As I look at examples on the web, I see everyone uses a I2C level conversor to drop the voltage from 5v to 3.3V, despite according to the driver datasheet and the I2C protocol description it is possible to use 5V directly. I understand that the only requirement is that both devices work at the same voltage level.
Is there any reason (apart from power efficiency) to use 3.3V over 5V?
AI: If you use the i2c pins of the arduino only to pull the signal to ground and to go Hi-Z and leave the bus pull-up for 3.3v it should work, because the logic levels are usually reasonably compatible.
People might use logic converters out of habit - if a chip takes 3.3V and is SPI and you dump arduino's 5V in it's input, you might fry it, but since I2C devices only pull the bus to ground or go Hi-Z, it should be ok.
|
H: How to debug large I2C bus?
I have a circuit board with lots of soldered SMD chips. There are a few I2C components connected to the same bus and the bus is also connected to a "bus switch" isolation switch. Unfortunately the bus is behaving weirdly. It seems to have large capacitance, and my microcontroller seems unable to drive the clock signal low.
If this were on a breadboard I could simply remove components until it worked, and if it was a collection of components connected in series I could look at the signals between components to find where they go weird.
But unfortunately I can't modify the circuit (without a lot of effort anyway), and the components are all connected to the same bus.
Does anyone know of any clever ways of debugging this situation? Or would you resort to removing SMD components?
(By the way, this is one of the things I always hated about electronics - the implicit relationships between everything make it really hard to debug!)
AI: The technique for testing will depend upon whether this is new first article design being debugged for the first time or if it is one board of a known working design that is acting up.
For purposes here I'll assume this is the first case where you've just made this board and are now trying to get it to work.
One technique is to use a sharp cutter like an xacto knife to cut the bus traces at some point in the connection chain. This is a quick way to isolate if the problem is presented by a certain group of the chips or not. After the problem is debugged you can scrape off the solder mask on the cut traces and solder it back together with a short piece of fine wire. This technique is faster than removing individual components and approximates an binary search to the problem if multiple cuts end up needing to be made.
Note that if using the cut trace idea you may need to temporarily patch in a pull-up resistor for the I2C bus if the onboard pullup is on the cut away side of the bus.
Another technique is to use an oscilloscope to look at what the signal looks like when it is being driven by one component or another. For example if the MCU is trying to drive the SCL line you may be able to see some wiggle to the signal. That can lead to giving clues to what may be wrong. For example if it can pull down from 3.3V to 1.2V but no lower the problem could be a too low of pullup resistor value or a short of the SCL line to some other net that wants to be at a high level.
|
H: GPS parity decoding, how to get D29 and D30 of previous bits?
According to ICD GPS 200C, to decode the bits of a word you need to have the bits 29 and 30 of the previous word, this means that to get the bits 29 and 30 of the previous word you should know the bits 29 and 30 of the word before and so on. Now my question is that how do I start decoding? If I start receiving the bits, I don't know about the bits of the previous word because I didn't receive them, so how do I decode this first word I receive ?
AI: You need to take in the first word of the subframe and ignore every thing in it except D29 and D30 which you carry forward to the next word.
It will probably be necessary to comprehend the higher level framing protocol that defines frames and subframes. No doubt at some part of the protocol framing boundary the previous D29 and D30 are assumed to be '0' or '1' for the first word of the frame.
|
H: Getting the right frequency from an oscillator circuit
I have constructed an oscillator circuit using the resistor and capacitor values shown in the diagram above (from the Proteus ISIS simulator).
I run the circuit and use a switch to trigger the oscillator. I get the following waveform.
Using cursors in the oscilloscope I observed the time for each cycle of the waveform was around 7.6 microseconds which was considerably lower than the required frequency.
Could someone tell me why I'm not obtaining the required frequency? I understand that that it will never be exact, but this is a pretty large difference. Also, is there any way to obtain a more sinusoidal output?
AI: As you can see, the signal is not a real sinus. I suppose the reason is a bad slew rate.
Therefore, in addition to increasing both of the resistor values (kohm values and nF capacitors are always good) you should select an opamp which has a sufficient slew rate.
For example, many opamps have a maximum large frequency bandwidth of app. 10 kHz only with a maximum slew rate of SR=0.5V/µs only (for example, the classical reference type 741).
I recommend for your application at least a value of SR=(2..5)V/µs.
As another hint: Make the gain somewhat larger than "3" (3.1...3.2) and use two antiparallel diodes across R3 for amplitude control. Then, you will get an acceptable signal quality.
|
H: USB lights up simple circuit but not coin-cell
I have 13 adafruit LED sequins in parallel hooked up to a CR2032 coin cell. This cell is also hooked up to an adafruit Gemma board (Arduino-like board using an Attiny85). Pads D0 & D1 on the Gemma each connect to a single LED sequin. D0 & D1 can do PWM, so the Gemma's program simply fades these two LEDs on and off. This is all connected using conductive steel thread.
When I use the coin cell, the 13 LEDs all light up like I would expect, but the Gemma stays dark (it has a green LED to indicate when it's powered up). When I power the Gemma via USB, it works as expected: the two LEDs connected to the PWM pads fade on and off, while the rest of the LEDs stay on.
What is the problem with my coin cell power source? Not enough voltage? Not enough current? Could I fix it by putting two of these cells together?
Note that the LED sequins each have their own 220 ohm resistor, and when "powered from 3.3V they draw about 5mA". The Gemma "draws only 9 mA while running" and has an "On-board 3.3V power regulator with 150mA output capability"
AI: Coin cell batteries generally have a voltage of 3V. Your Gemma takes in 5V. Even though your LEDs are powering on, your Gemma doesn't have enough voltage to actually run.
The voltage regulator doesn't take whatever input you give it and make the proper output, it needs either a lower OR a higher voltage. In this case, and this is the most often case, you'll need a higher voltage than what your voltage regulator will output
I would caution you regarding putting 2 CR2032 cells together because this will result in 6V. If the Gemma has a regulator, then that will be safe but your leds might not have the proper resistor for a 6V source.
|
H: Powering SIM 900 gsm
I bought a sim900 (the chip itself, not a module) and have gotten stuck trying to figure out how to power it. I hope to power it using a pin from my RBBB arduino clone, which outputs 5 volts and though sources differ, either 250mA or 300mA. It uses a L4931 power regulator, if that makes a difference.
So far, the most helpful website has been this one which has schematics for an usb powered 500mA power circuit.
I don't understand what is happening on this diagram. For one thing, the part I was most worried about, the capacitor, seems not to be listed. The description of the diagram states that "A low ESR tantalum capacitor is usually used. The value for the capacitor should be more than 470uF."
It also says that "When there was no on/off pin in the LDO or DC-DC IC, the customer can follow nether reference schematic to control the VBAT on/off." which seems to imply this doesn't actually show all of what goes into the VBAT and there's more to the circuit outside the VBAT_IN.
I'm also confused as to what the MCU_CTRL is. The pinout here: simcom(dot)us/act_admin/supportfile/SIM900_HD_V1.01%28091226%29.pdf#page=16 of the sim900 shows no such pin.
There is also a different diagram from this site that looks completely different.
If somebody could explain which diagram is right to use, and what the parts do in that diagram, that would be fantastic!
[Edit: after looking at the parts more closely, it seems that figure 5 is a better fit, despite figure 3 specifically mentioning usb power. I am still confused on that one what the purpose is of the capacitors leading to ground, and the inductors. Also, if this is a LDO, then the diagram on the 1st website a litter higher up might be a good fit. That site mentioned that it needed a 2 amp power in to the regulator. Is that what the capacitors are for?]
AI: I don't understand what is happening on this diagram.
Referring to the diagram in OP.
This MOSFET-TRANSISTOR duo is used to enable and disable the power supply of the module, when MCU_CTRL is high Q101 is enable, which in turn enables the Q102 by pulling the GATE of the PMOS Q102 to GND, and enable the power for module on VBAT pin. When MCU_CTRL is low, in similar fashion it disable the power in VBAT pin.
For one thing, the part I was most worried about, the capacitor, seems not to be listed. The description of the diagram states that "A low ESR tantalum capacitor is usually used. The value for the capacitor should be more than 470uF."
The datasheet of SIM900 suggest low ESR 100uF capacitor(tantalum will be good) with a small 0.1uF or 1uF ceramic in parallel placed close to the SIM900, on page 20 of datasheet.
It also says that "When there was no on/off pin in the LDO or DC-DC IC, the customer can follow nether reference schematic to control the VBAT on/off." which seems to imply this doesn't actually show all of what goes into the VBAT and there's more to the circuit outside the VBAT_IN.
This particular section in the datasheet gives you an option to enable/disable the power supply of SIM900 using the MOSFET-TRANSISTOR duo if in case there is no ON/OFF pin present on the DC-DC converter or LDO. So either optios you can use to enable/disable the power supply of SIM900. But the datasheet of SIM900 shows it has got PWRKEY which is default pulled-up to enable or disable the power supply. Ref: Datasheet page 17.
I'm also confused as to what the MCU_CTRL is
The MCU_CTRL is external pin coming out from the master controller/processor, not coming from SIM900 to enable/disable the power supply.
In the starting of the OP, it disusses about powering the SIM900 using RBBB arduino which can supply a maximum of 250mA to 300mA which is using L4931 LDO.
But I am afraid it is not the correct approach to power SIM900, since the datasheet clearly expects to power SIM900 using LDO or DC-DC Converter which is capable of 2A current, with a minimum voltage of 3.4V. Ref: Datasheet page 20
|
H: What happens if SINR is < 1?
What happens if the SINR of a signal is less than 1 in a (wireless) network? Is that practical at all to have a SINR < 1? Using the Shannon capacity formula, it seems that we must be able to have SINR < 1, but we get a rate < 1 bits/sec/Hz.
AI: Yes, it is practical.
For example, if you have an ASK signal with modulation depth 60%:
>> am = [ (ones(1,100) * 0.2) (ones(1,200) * 0.8) (ones(1,200) * 0.2) (ones(1,100) * 0.8)];
Using a low-pass filter
>> d = fdesign.lowpass(0.01, 0.02, 0.01, 100);
>> hd = design(d)
hd =
FilterStructure: 'Direct-Form FIR'
Arithmetic: 'double'
Numerator: [1x946 double]
PersistentMemory: false
you can reduce the output signal bandwidth in order to be nice to the neighbors:
>> amlp = filter2(hd.Numerator, sig);
The recipient gets a noisy signal
>> amno = amlp + 2*rand(1,600) - 0.5;
and also uses a lowpass filter to reconstruct it:
>> amre = filter2(hd.Numerator, amno) - mean(amno) + 0.5;
This signal is sufficiently similar to the original signal that you can decide between 0 and 1 bits, but you need a rather narrow filter here in order to remove the noise -- in my case, 1% of the sampling rate (that is the .01 above). Note that we're only interested in the signal at the points 50, 150, 250, ..., 550, i.e. the middle of each symbol.
In order to be able to reconstruct that signal, I had to use rather long symbols (100 samples). That is, with 100 Hz sampling rate, which would allow me to express frequencies up to 50 Hz, I can only transfer 1 bit per second.
|
H: DC shunt generators problem
One of the questions in my book goes like this...
'A shunt generator delivers 450 Amps at 230 volts...'. The resistance of the shunt field, armature and brush contacts are given.
I get that the 450 Amps is the current passing through the load. But how can the voltage(230 volts) be constant? Though we can make the current in a dc generator nearly constant and unidirectional, but the value of the voltage always remains alternating, isn't it?
AI: Almost in every generator the quantity that's regulated at the output is always voltage, so if you change the load, the current will change but the voltage remains same(or it's supposed to remain same, ideally), and when you say it's a DC generator the the output voltage is Direct, not Alternating.
If you're confused as to how a rotating machine produce a unidirectional and almost constant voltage, it's because of the shape of the poles, they are arranged so that the field on the armature windings remains almost constant-in magnitude and direction as well- but there's one more problem, when armature winding goes from beneath of one pole to another, the voltage suddenly changes direction at the terminals of the armature(magnitude still remains same), but that's one of the reason why commutators are used, to prevent the polarity reversal- and also to deliver power out of the rotating structure.
|
H: Meaning of temperature coefficient for resistors
Is temperature coefficient of a resistor about the temperature of the resistor or ambient temperature or are they the same thing? What I mean to ask is that: Lets say I have a resistor and I have no data sheet about it and I want to find the temperature coefficient. Can I use the ambient temperature in calculations? Is the resistor temperature same as the ambient temperature after a while or is that always much higher?
AI: The temperature coefficient specification ostensibly provides a limit for the change in the resistance of a resistor from its nominal value at temperature \$T_0\$ to another temperature T. In fact it's usually defined using a box method at temperature extremes and does not really guarantee the slope of the temperature-resistance curve as you might assume.
Ideally, a maximum temperature coefficient of, say, 10ppm/°C would mean that if our 1.00K resistor measures 1.0015K at 25°C and the temperature changes to 35°C then the value should somewhere between:
\$1.0015K + 1.0015K (35°C - 25°C) 10^6 \cdot 10ppm/°C \$
and
\$1.0015K - 1.0015K (35°C - 25°C) 10^6 \cdot 10ppm/°C\$
Or 1001.5\$\Omega\$ +/- 0.1005\$\Omega\$
It doesn't matter why the temperature changes- ambient, self heating, nearby components, or some combination.
If you are trying to measure the actual temperature coefficient of a resistor, you can measure the resistance at two widely separated temperatures, using low enough current that self-heating is minimal (note that it cancels out to a first order if you allow it to settle out- also pulsed current can be used and the measurement made before the temperature changes much) and calculate the tempco as:
Temperature coefficient = \$\frac{R_X - R_0}{R_0(T_X-T_0)}\cdot 10^6 ppm/°C\$
If the tempco is large you might want to use the average resistance rather than \$R_0\$, but it shouldn't matter much in most cases.
Edit: Regarding the situation you mention - 0.2% change for a change in power dissipation of about 100mW.. you need a better resistor and probably a larger one that won't heat as much for a given dissipation.
Consider a 1206 249 ohm Susumu resistor. P/N: RG3216P-2490-B-T1. Tempco is +/-25ppm/°C, it will increase by 15-30°C at 20mA depending on layout (see the link). That should represent a change in resistance of about 375-750ppm or maybe 3-5x better than you are measuring. If you need even higher accuracy, you could use a bigger resistor, several smaller ones distributed with copper around, or use a smaller value resistor and amplify the signal so it doesn't get as hot.
You could also use a Z-foil style resistor such as Y1630250R000T9R that has only 0.2ppm/K tempco, but they are pretty expensive (>$10 each).
|
H: Accuracy in translating voltages to currents for shunt resistors
I apply a constant 4ma current I to a resistor R and I measure a voltage V across.
so the resistor \$ R = \dfrac{V}{I}\$.
But when I apply \$ I_2=20ma\$ to the same resistor R and I obtain the voltage \$V_2\$ then the resistor \$R= \dfrac{V_2}{I_2}\$ I expect the same.
but in first case for 4ma, I obtain 248.2 ohm and in 20ma case I obtain 248.7 ohm.
I can only measure the voltages with a daq box. If I have a device with a current loop output how can I then translate the voltages to currents, since I find different resistances for different currents? is there a way to obtain accuracy error? is there a standard for that?
AI: Perhaps check the temperature coefficient of the resistor. With 20mA, the power dissipation in the resistor is 25x larger than with 4mA (power dissipation is proportional to I2). The resistor heats up as you increase your current. As it heats up, its resistance changes. Incorporating the temperature coefficient would improve your accuracy. Another option is to use a much smaller resistor so that the temperature change over the current range is small.
|
H: STM32F103 Systick Interrupt stopped working when debugging in ram - (Coocox IDE)
I tried debugging my code in ram in order to increase the flash's life (only rated at 10k writes minimum)
Anyways, I have tied the boot0 and boot1 pins to 3.3v and set the compiler to debug from ram like so:
When I debug my code this way, my SysTick_Handler doesn't run. If I debug from flash everything works just fine.
I can't figure out what is going on, and how can I get my SysTick interrupt to work in ram debug mode ?
P.S: I tried asking this in the coocox forum, but haven't got any help there.
AI: You need to relocate the vector table — right now, the processor is probably still using the copy of the vector table in FLASH, which will point into an old version of your code in FLASH. (Or, if you've erased FLASH since you started developing in SRAM, the vector table in use will be blank.)
If you're using the STM32 Standard Peripheral Library (SPL), you can define the VECT_TAB_SRAM macro to have it set the appropriate flags to use a vector table in SRAM. If you're going the bare-metal route, you need to set the TBLOFF field of VTOR to point to the base of SRAM (0x02000000 on STM32F1).
|
H: VHDL 'buffer' vs. 'out'
I was wondering about the 'buffer' i/o option for entities in the VHDL language. I have found that my code is much cleaner if I use the 'buffer' option instead of 'out' in any circumstance where I want to act on the outgoing signal somewhere within the entity. I find that I can think of very few reasons to use 'out' ever and I'm tempted to just always use 'buffer' in every case. So, my question is, under what circumstances should I set my outputs as 'out' (even when that means I have to add an extra signal declaration and assignment) and when is it ok to use 'buffer'?
AI: One case, that probably doesn't apply, is if you're using a standard older than VHDL-2002. Before than, buffer could not connect directly to out. So in a hierarchical design, the signal path would need to be declared as a buffer on all levels. Also, when adhering to these older standards, some tools have problems synthesizing buffers correctly. They may or may not warn you about this.
These should no longer be an issue if you're using a newer standard. From the VHDL-2002 Standard:
a) For a formal port of mode in, the associated actual must be a
port of mode in, inout, or buffer.
b) For a formal port of mode out, the associated actual must be a
port of mode out, inout, or buffer.
c) For a formal port of mode inout, the associated actual must be
a port of mode inout, or buffer.
d) For a formal port of mode buffer, the associated actual must be
a port of mode out, inout, or buffer.
e) For a formal port of mode linkage, the associated actual may be
a port of any mode.
I also often see advice stating that a buffer should never be tri-stated. If you need the ability to tri-state a bus, then you would need to use out. I could find no direct reference to how buffers handled tri-stating in the standard. But it is probably good advice to follow. Again, your tools may or may not complain if you attempt to synthesis a tri-stated buffer.
|
H: making Tphl and Tplh equal
Let's say we have the following netlist
* Standard cell circuit
.global VDD VSS
.prot
.lib '.\reference_models.lib' TT
.unprot
***********************************************************
.SUBCKT ZP_NAND2 QN A B
M1I1 N1N9 B VSS VSS N W=WN L=LN
M1I2 QN A N1N9 VSS N W=WN L=LN
M1I3 QN A VDD VDD P W=WP L=LP
M1I4 QN B VDD VDD P W=WP L=LP
.ENDS
.SUBCKT ZP_INV QN A
M1I1 QN A VDD VDD P W=WP L=LP
M1I2 QN A VSS VSS N W=WN L=LN
.ENDS
.SUBCKT AN2D1 Z A1 A2
X1I8 N1N1 A1 A2 ZP_NAND2 wp=1.62um lp=0.35um wn=1.07um ln=0.09um
X1I9 Z N1N1 ZP_INV wp=2.70um lp=0.35um wn=1.35um ln=0.09um
c1 Z VSS 0.018pf
c2 A1 VSS 0.009pf
c3 A2 VSS 0.009pf
.ENDS
**************************************************************
X1 Z A1 A2 AN2D1
*************************
.param vdd = 1.8
.param vss =0
Vvdd VDD 0 VDD
Vvss VSS 0 VSS
Vin1 A1 0 pulse (vss vdd 2ns 200ps 200ps 3.8ns 8ns)
Vin2 A2 0 pulse (vdd vss 4ns 200ps 200ps 2ns 8ns)
.TRAN 1p 20n
.measure tran pow_avg_X1 avg p(X1)
*.measure tran pow_avg_mn avg p(X1.mn)
*.measure tran pow_avg_mp avg p(X1.mp)
*.measure tran total_power param='(pow_avg_mn+pow_avg_mp)'
.measure tran I_integ integ I(Vvdd)
.measure tran P_Iinteg param='I_integ*vdd/20n'
****************************************************
.meas tran TPHL trig v(A2) val='0.9' TD=0
+ fall=1 targ v(z) val='0.9' fall=1
.meas tran TPLH trig v(z) val='0.9' TD=0
+ rise=1 targ v(A1) val='0.9' rise=1
********************************************************
.end
When we run it in hspice, we get the following result for Tplh and Tphl
tphl= 1.1032E-10
tplh= -6.6974E-11
How do we make them equal(not necessarily 100% equal,, but lets give them a maximum difference of only 3%)? The only thing that we can vary is the transistor's width (we need to make the 'L' fixed to 90 nm). Aside from randomly guessing the value of 'W' to make them equal, are there any methodologies out there to follow?
Thanks
AI: There is no need for guessing, but you will need to look at the transistors data-sheet for \$I_DS,Sat \$ per width, and you should understand what happens when you stack transistors.
Alternatively, you can set the \$ \dfrac{G_m}{C} \$ for the NMOS and the PMOS to be the same.
I will note several odd things with your netlist:
you have all the same size NMOS's and all the same size PMOS's in your NAND which.
your width ratios are odd too, PMOS/NMOS ratios are more typically 2.2X you have 2.0 X
all you PMOS are very long 4X longer than the NMOS.
|
H: LEDs flash at the same time and not one at a time
As you can see on the illustration below, I have a voltage supply (a keyboard made of two piezo elements) with two terminals. Each one drives one LED, but since I've added a buzzer in parallel with both LED, my circuit drives the LEDs at the same time
Do you have any idea on how I could make flash one LED at a time using just one buzzer?
Thanks in advance ;)
AI: Add a diode in each lead from the buzzer to the collector of the transistor (in that direction).
Current can flow through a diode in one dircetion only (the 'arrrow' direction) so it can flow from Vcc through the buzzer and a diode to one of the transistors and to ground, but not from one LED to the other transistor, because one of the diodes would block it.
An 1n4148 will do up to ~ 100 mA, otherwise pick an 1N4004. (or any other 1n400*)
PS your opamps feed the base of the transistors directly. Unless it is a current-output opamp (in which case the circuit would not work as expected) this is not a good idea. Put resistors in series with each base, 10k will probably do.
|
H: Help interpreting TIP127 datasheet
I'm trying to build a constant current 2A amplifier using a TIP 127. To be honest, I have a lack of transistor knowledge.
I decided to analyze a few existent circuits with a TIP127 and the datasheet.
One of circuits mentions a voltage drop of 1.2 v between Emitter–Base, Is this a common sense value (2 transistors x 0.6 v drop) or this is an exact value variable per transistor? I'm looking in the datasheet and I cannot find the Emitter Base voltage drop.
A resistor between a Vin and the emitter with a specific voltage applied in the base will regulated the current passed to the collector? Is my interpretation correct or there is another away of explaining? I'll provide more details on point 3.
For a 2 Amp constant current on the collector:
VIn = 12
R1=0.3 ohm
VBase = 10.2 v
EB voltage drop (point 1) is 1.2 v
I R1 = (12-10.2-1.2)/0.3 = 2A
Is this correct?
I'm not feeling confident due to lack of knowledge interpreting the datasheet.
Can someone provide a theoretical/educational explanation?
AI: I think (tentatively) that this is what you mean - but you need to play around with the schematic editor and make your own version.
simulate this circuit – Schematic created using CircuitLab
This is intended to work by assuming a 1.2 volt base-emitter drop, leaving 0.6 volts across the .3 ohm resistor, fixing the emitter current at 2 amps.
This is a decent start, but you need to keep a few things in mind
1) The data sheet really won't tell you about how the circuit will work. Note that, from figure 1, you can assume a current gain at 2 amps of about 3000. From figure 2, you can see that Vbe at 2 amps is about 1.7 volts, which would seem to mess up your calculations. But notice that this is a saturation voltage, and the note at upper right says that the transistor is being run at a gain of 250, not 3000. To understand this, you need to go study what "saturation" in a transistor means.
2) Let's assume that the Vbe actually is 1.2 volts. 1.2 to 1.4 is actually the number you can expect, so be prepared to change V2 to get the current you want. The circuit will work, right? Well, sort of. Let's say you have a 1 ohm load. Then the voltage drop across the transistor will be 12 - (2 x .3) - (2 x 1.0), or 9.4 volts. The power dissipated in the transistor will be 2 x 9.4 = 18.6 watts. Unless you do a very good job of heat sinking your transistor, it will get hot and may self-destruct. But let's say you do provide an adequate heat sink, and it just gets hot. As the temperature rises, Vbe will decrease (you need to calculate how much), and the voltage across R1 will increase. This will increase the current through the transistor. It will also decrease (somewhat) the voltage across the transistor as the voltage across the two resistors, but this will not compensate entirely for the increased current. As the current increases the power dissipated in the transistor will increase. In the worst case, you will get what is called thermal runaway, as the increasing temperature causes increasing current which causes increasing temperature, etc. and it all ends in the release of the magic smoke.
3) Trying to set the current by setting the difference in two voltages is, in general, a bad idea. The problem is that you are at the mercy of both voltages. In your circuit, think about what happens if V1 starts rising, or simply if it varies due to other (not shown on the schematic) loads.
|
H: Charging 10 1.2V nicd batteries
I have 10 x 1.2V Sanyo NiCd batteries. They are connected in series. I would like to charge them. The thing is, I don't have a charger. I looked up chargers and they are all quite expensive(I live in India). I would like to know what voltage AC to DC adapter should I get to charge them.
What are the risks involved in doing so?
Could you also suggest me some cheap ways of getting the batteries charged?
AI: The fully charged voltage on 10 NiCd batteries is about 1.4V * 10 = 14V. So the first thing you will need is a voltage source higher than that. To keep it safe you really need 1.5 * 10 = 15V minimum.
NiCd batteries are charged with a constant current. You don't say what the rating on your batteries are, but let us assume they are 500mAhr. Trickle charging them is C/10 or 50mA. That's nice and safe and will fully charge your batteries in 15hrs (you add 50% to the time because charging is not 100% efficient)
simulate this circuit – Schematic created using CircuitLab
To keep things cheap you can use a resistor to supply this current and calculate the resistor value as:
$$R = \frac{V_{source} - V_{batpack}}{I}$$
Let's say you find an 18V source. Then 18 - 14 = 4V. And you want to charge at 50mA so your resistor value is 80 ohms. 100 is the closest you will get which will charge at: 4/100 = 40mA.
Edit:
I should add that the current will vary as the batteries charge. So a discharged battery at 1.1V will charge at (18 - 11) / 100 = 70mA. This current will fall to 40mA as the battery comes up to full charge.
With a C/10 charge rate, 14 hours is safe even if they are partially charged to begin with. You are "trickle charging" at a "charging rate" and the batteries are designed to full cope with this rate. Any faster than this you will have to verify they are charged - the battery pack voltage will be above the nominal 1.25V * 10 = 12.5V when you disconnect the charger and check with a meter. At 1.45V/cell (or anything above 14V for your pack), they are fully charged. Expensive chargers do all this for you.
You can trickle charge at a "top up" rate by adjusting to C/20. So for 500mA batteries, trickle charge at 500/20 = 25mA. You can do this indefinately without damage. Although to charge at this rate from discharged will take, well, days!
|
H: Theory question about "j" imaginary unit (AC circuit analysis)
I have just started to learn about AC network analysis and have some questions about "j" (or "i" on my calculator), the imaginary unit. My book doesn't go into a great deal about this, and jumps right into formulas and substitutions (more practical approach, not theoretical). So, what exactly does J represent?
I see that if I draw a complex-plane (y-axis being imaginary, x-axis being real), and draw a unit circle on it, a 90° angle is \$\sqrt{-1}\$, which is "j". I see that I can use this substitution in phasor form when, say, solving for the voltage across a capacitor when the current through it is known:
$$V = \frac{I}{j \omega C}$$
Can someone help me understand this?
To be honest, this question is pretty vague because I'm not even sure how to ask about what J is; it's that foreign to me. I would like a common-sense explanation (big-picture) of it's meaning and purpose in AC circuit analysis. I'm not necessarily looking for a rigorous mathematical explanation (although any necessary mathematical explanation is welcome).
AI: If you put a minus sign in front of the number "5" it becomes "-5".
Try and look at this differently. Try thinking that it rotates the number "5" (tied to the origin by a piece of string of length 5) through 180 degrees to become "-5"
OK so far? Negative signs are the same as rotating thru 180 degrees...
Why not extend this further to produce something you can "stick" in front of a positive number that rotates it thru 90 degrees - in EE this is usually called "j" and it acts to rotate a value (about the origin) thru 90 degrees counter-clock wise i.e. if you did it twice (j*j) you'd get 180 degrees ("-").
From this gem of knowledge you can therefore say j*j = -1 therefore, j = \$\sqrt{-1}\$
Just as a minus sign can rotate any positive value thru 180 degrees it can rotate any vector or phasor thru 180 degrees. The same applies to the j operator - it rotates any vector or phasor thru 90 degrees counter clockwise.
EDIT - forgot part of question: -
substituting j into the impedance of a capacitor. Remember the basic formula for a capacitor is Q=CV and therefore differentiating the variables we get: -
\$ I = \dfrac{dQ}{dt} = C\dfrac{dV}{dt}\$
This tells us that for a sinewave applied voltage across a capacitor, the current will also be a sinewave but differentiated into a cosine like this: -
If you tried to calculate the impedance (V/I) of a capacitor from the V-I relationship you'd get into trouble because when I passes thru zero, V is NOT zero so you get infinities. If on the other hand you apply a "j" to bring current in phase with voltage the math works out fine - current and voltage are aligned and impedance based on instantaneous values of V/I makes sense.
I'm aware that you are just starting out so I've tried to keep this both accurate and simple (maybe too simple for some?).
If you look at the inductor, the "j" can be applied to the voltage to align it with the current hence "j" is in the numerator for inductive reactance and j is in the denominator for capacitive reactance. There are subtleties lying around here that hopefully will make sense as you learn more - it's actually no coincidence that "j" appears to "follow" omega when it comes to impedances - my explanation doesn't cover that and neither does your question!
|
H: Calculating the peak output voltage from RMS power of an audio amplifier
I want to calculate the peak voltage output of an audio amplifier when driving at its maximum rated power, a loudspeaker.
For example, an amplifier rated at 50 W RMS into 8 Ω, driving an 8 Ω loudspeaker.
This wikipedia article tries to explain what RMS power actually means, but it's not clear. And I'm wondering if it's actually wrong where it says:
[RMS Power] is proportional to the RMS voltage
This seems wrong, since I know that the equation for power/voltage/resistance is:
$$ P = \frac{V^2}{R} $$
So assuming that the amplifier does not distort, does not exceed 50 W RMS and so on, what is the peak AC voltage it would output?
AI: With some assumptions (pure sine wave, resistive load, etc.) you can simply apply your formula.
$$ 50 = \frac{V^2}{8} $$
leads to
$$ V = \sqrt{400} $$
hence \$V = 20\$. This is the DC voltage that puts 50 W in an 8 Ω load.
For an AC sine wave the peak (with respect to the average) is \$\sqrt{2}\$ times this value, or approximately 28 V. These peaks appear both in positive and negative direction, so the peak-to-peak voltage is twice this value, approximately 56 V.
This is the minimal DC supply a capacitor-coupled push-pull amplifier stage would need. A direct-coupled push-pull amplifier would need one positive and one negative 28 V supplies, a bridge amplifier would need one 28 V supply. (In each case, more is needed due to losses, margins, etc.)
|
H: How do I keep my constant current source constant?
So I am trying to created a current source that will be used to drain a battery at specific time intervals for a specified duration.
simulate this circuit – Schematic created using CircuitLab
Here is the circuit that I am attempting to use, pulses from the square wave source will trigger the transistor allowing the current to flow and thus draining the battery.
This needs to be implemented three times for my design but the first two (which are 10uA and 10mA sources) work fine and do not vary much with changes in the battery voltage, however I am struggling a bit with my final current source which needs to draw 100mA+ from the battery.
The issue is not with getting the correct current, but in fact getting the current to remain constant with changes in the battery voltage, that is the voltage at the collector of the transistor.
I was advised that I could possibly need a current buffer before the base pin of the transistor and I implemented this but it still does not yield a steady and constant current source!
This is the circuit for the 'current buffer', not really sure what it is but that is what I was told to do:
simulate this circuit
As you can see all it is a pnp ahead of the previously show circuit. Again my issue is not with this, I just need a method of keeping the current very constant, ie. No significant change until the battery voltage has dropped < 1V or something like that!
Any help would be greatly appreciated!
AI: Try this:
simulate this circuit – Schematic created using CircuitLab
This circuit is capable of ~1% accuracy with good layout. If the battery is removed, the op-amp will current limit into the base, which should not hurt it. If you don't like that, or if you use another op-amp that doesn't current limit as well, add a small base resistor such as 100 ohms.
|
H: How to keep rarely-used Li-Ion batteries functional?
I have many gadgets around the house that I don't use often, recently I notice that a battery failed on an Mp3 player not used for a year. The battery now has a life of 1 minute from the original 5-7 hours.
What would be the maximum amount of time to leave a Li-Ion uncharched that would not make the batteries unusable.
What other considerations should I take if I use rarely a device to be able to still use the battery, should I leave it fully charged, etc ?
AI: Optimum temperature: 15 degrees Celsius and even lower
Optimum state-of-charge: 40 %
Avoid temperatures above 30 degrees Celsius (both during usage and storage)
Note that after 300 to 500 charge/discharge cycles, the battery may never be able to charge at its full capacity.
Here is an useful table:
By Isidor Buchmann. How to Prolong Lithium-based Batteries
Sources: batteryuniversity.com: How to Store Batteries and How to Prolong Lithium-based Batteries
|
H: Will 74HC595 as LED sink damage LED when pin goes high?
If used as a LED sink, what happens if a 74HC595 pin goes high? Might the LED blow?
I expect that when a pin is low, current will sink and the LED will light.
What about the opposite condition? When a the pin goes high, might there be risk of blowing LED's due to reverse flow? Why or why not?
simulate this circuit – Schematic created using CircuitLab
AI: The answer lies in the reverse voltage rating of the LED chosen. Common through-hole LEDs typically are rated at 5 Volts reverse, some LEDs higher. This means that for up to 5 Volts applied in reverse bias, the LED will behave as a regular diode, blocking current flow. Beyond this voltage, reverse breakdown might occur, potentially destroying the LED if the voltage is high enough.
In the schematic shown, the PWM signal is 0 to 5 Volts. Thus, even when the PWM signal is low, and the latch output is high, the maximum reverse voltage the LED is exposed to is less than 5 Volts. So the LEDs will be fine.
|
H: Connecting power source to Arduino's 5V pin
I have an Arduino board connected to a Neopixel Ring. This Ring draws more than 0.5 Ampere, so it needs its own power supply (not drawing power via the Arduino board)
I found this schematic that connects a Neopixel and an Arduino to a single power adapter. To my surprise, the power adapter connects its power straight to the 5V pin of the Arduino board.
Arduino seems to advice against this, so my question is: is this the correct way to separately power a device AND an Arduino from one adapter?
AI: Yes, it is correct, as long as you leave Arduino unpowered via 9...12 V DC plug, because it will draw power from that 5V adapter.
And of course, be sure your adapter can handle the current for both Arduino and that Ring.
Another option would be to power Arduino as usually. Power the Ring through the 5V adapter. Then join the ground on all devices (Arduino, Ring, 5V supply).
|
H: In what situation should I keep the brown-out detection feature OFF on a microcontroller?
When the power supply on a microcontroller falls under a certain threshold, a brown-out conditions occurs and RAM may get corrupted. Provided that every power down sequence of the circuit can mean a potential brown-out condition, I always enable the brown-out detection reset mechanism when working with microcontrollers.
Are there are any situations in which it is not recommended to enable the brown-out reset feature?
AI: As noted, enabling the brown-out circuit will often increase current consumption. Further, because manufacturers generally want to ensure that the brown-out circuit will trip on any voltage that might be low enough to cause other parts of the chip to function, many parts will be able to operate at a lower voltage with brown-out disabled. For example, a controller might work most of the time down to 1.5 volts at room temperature but, under certain stressful conditions (such as elevated temperature) could malfunction at 1.99 volts. To ensure that the device would reset under any condition where a malfunction might occur, the brown out circuit might be designed to trip at 2.1 volts +/- 100mV.
If a device with such a controller were powered from two alkaline AA batteries, enabling the brownout circuit may cause the device to become unusable with a battery voltage of 1.1 volts per cell, and would likely cause it to cease operation by the time the voltage reached 1.05 volts per cell. Disabling the brownout circuit would likely extend operation down to at least 0.9 volts per cell, and possibly even 0.75 volts per cell. If no plausible malfunction that could occur at low voltage could cause any harm beyond increased drain on junk batteries, disabling the brownout circuit would be a simple way of improving battery life, even if it didn't reduce the current draw from usable batteries.
|
H: What are .C1 and .C2 Gerber files in Altium 14?
I am currently working on a project and I'm about to get the Gerber files checked by FreeDFM.com. My question is, in my Gerber files, there are a couple that have the extension .C1 and .C2. In FreeDFM.com they want me to specify what these are (Inner copper layers, top layers etc.), but I have no idea what they are.
Any help in determining what these are would be very much appreciated!
AI: Normally the mid-layers in Altium are .G1, .G2, etc. Top and bottom layers are .GTL and .GBL respectively.
Possibly you're mistaking the G for a C, or possibly the program could be configured to use those extensions (though I don't think the version of Altium we're using has that capability).
|
H: Energy dissipation in RC circuit given AC sinewave input
I'm implementing a low-pass RC circuit that as an input will have an AC sine wave voltage input. How can I calculate the average power dissipation in the resistor, given R, C, peak (or RMS) voltage applied, and frequency?
Edit: Please assume no current draw from the output of the RC circuit. (However would be interesting to see the formula given an impedance across the output)
AI: First you decide what the output load will be - if it's open circuit i.e. a simple RC low pass filter you need to calculate the current flow thru the series R and C using an AC version of ohms law: -
I = V/R becomes I = V/Z where Z, in your example is
\$R +\dfrac{1}{j\omega C}\$.
Once you have that current then the power dissipation in the resistor is current squared multiplied by resistance.
You could also calculate Z (without using complex numbers) using: -
\$Z_{IN} = \sqrt{R^2 + X_C^2}\$ where \$X_C\$ is capacitive reactance.
If there is an output load resistor (\$R_L\$) then input impedance changes to: -
\$Z_{IN} = R + \dfrac{\frac{R_L}{j\omega C}}{R_L + \dfrac{1}{j\omega C}}\$
or
\$Z_{IN} = R + \dfrac{R_L}{R_L + j\omega CR_L}\$
You can take this further to but it's become maths rather than EE now.
|
H: SRD-05VDC-SL-C 5V DC relay not working with XY-DJM-5V
I'm just a beginner and need some assistance. below is a diagram of a 4CH reciever which works fine with some leds and it reports 5V positive on Data0 when holding channel 0 on the transmitter. What's not working is when attempting to use a 5V DC relay as shown in diagram, the relay clicks and seems to work fine with a direct input.
I'm using USB Powered socket which is 5V DC 0.5A I believe. I'm really puzzled while its not working.
SUGGESTED
simulate this circuit – Schematic created using CircuitLab
AI: The relay draws more current than that module can supply. If you keep doing such tests you may damage the receiver!
If you read the SC2272-M4 datasheet, you'll see it can supply a maximum current of 3 mA. That relay needs 89 mA at a 55 ohms coil resistance. So the load current is 5 / 55 = 0.09 A = 90 mA. Now, the minimum hFE of the transistor should be (0.09 / 0.003) x 5 = 150. The resistor between receiver and transistor base should be 0.2 x 55 x 150 = 1650 ohms. Choose 1.8 k. Calculations made on http://pcbheaven.com/wikipages/Transistor_Circuits/
Due to the very low available current from receiver output pin, a high hFE transistor is required. 2N2222 should work (its maximum hFE is 300).
Use a (transistor) driver. Something like:
|
H: Neophyte question about AC vs. DC (especially for powering a home)
Here in the United States the electricity grid is AC. I have heard that AC allows transmission of power at greater distances with less loss. However, with the advent of solar panels, it would seem that one could generate DC power directly and power the home this way. There are no great distances involved.
Why is this not done? As far as I know, solar panels feed back into the main electricity grid. This means they convert dc to ac, presumably at some loss. Could you power your whole house using DC? Assuming you lived in a sunny area and had sufficient roof space, could you power everything (fridge air cond. etc), perhaps storing the power in batteries for use at night time? I assume you'd need all new appliances that work with DC?
It would seem a small price to pay to be energy independent. Could you reuse your existing house wires? I've never heard of this, so I assume there are major obstacles. Could someone give me the layman's explanation as to why it's a bad idea, or impossible, or just not done?
AI: It's not impossible, it's just more complicated and expensive. Everything in your house is designed to run from AC. Many smaller products do take DC in but they come with an AC adapter because that's the only available source of continuous, inexpensive power nearly everywhere. The voltage required can be different for each device. The closest thing to a standard for DC power is probably USB 5.0V, which only offers enough current for small gadgets and not anything larger.
The way a solar powered house works is roughly: solar panel to battery charger to battery, to DC-AC inverter to wall outlets, plus another power regulator & meter if feeding extra energy back to the grid, which isn't a requirement. One could power a house directly with unregulated DC from the battery if the appliances were designed to run from it, but most aren't. If the battery voltage had to be regulated before distribution to the house, all you'd really be doing is swapping the DC-AC inverter for a DC-DC regulator, basically a different box with similar cost.
Due to the small size of the market for DC appliances (at the moment), they'd be harder to find and possibly more expensive than AC units. If a time comes when nearly every house has solar on the roof, they might be just as easy to purchase and maintain.
As to reusing wiring, a wire is just a strip of copper and doesn't care whether you put AC or DC on it, IF you stay within its capabilities. If you had to put a lot more current through the wire due to lower voltage, you might need thicker wires, different safety features in the wiring boxes, higher rated fuses and so on. You'd want different plugs on the outlets so nobody made a mistake of plugging an AC device into an outlet providing DC.
Overall, it's cheaper and simpler to put a DC-AC inverter at the battery than it is to gut the entire electrical system of the house and rebuild it, plus buying all new appliances, plus still needing small DC-AC inverter in each room for the devices which can't be repurchased to run from DC - which at the moment is nearly every gadget. You might think of the AC inverter as providing "backward compatibility" with the previous hundred years of electrical devices.
|
H: Adafruit trinket power question
I am reading the Adafruit Trinket tutorial here. It states that BAT+ is used for battery INPUT:
If you want to power the trinket from a battery or power adapter or solar panel or any other kind of power source, connect the + (positive) pin here!
So I'm slightly confused by the Adafruit LED skateboard tutorial, which uses this pin for power OUTPUT.
My questions:
How can you use the power input pin for output?
Why don't the LEDs draw way too much amperage through the Trinket board?
AI: You are thinking of the power pin in a digital manner. The power pin is not set to be an input or an output. It is just the positive terminal of the power rail. If you want to power the trinket using a 5V power source, you'll put it in there since its the positive terminal. If you want to power another device that uses 5V and it just so happens that the 5V rail connects to the trinket as well, the device will still be powered.
The trinket isn't sourcing the power, the battery is, or in this case the power supply that the battery is connected to.
The LEDs aren't pulling their current from the trinket but rather the power supply. All the trinket is doing is sending the signal through the DIN pin.
|
H: What is the difference between registers, flip flops and latches?
I want the answer to the very basic level. I know what they mean individually, but what I am looking for is connection between them.
AI: Flip-flops are single bit devices with two stable states. The outputs are typically Q and \$\mathsf{\small \overline{\text{Q}}} \$. There are several kinds, here are probably the most common:
SR flops have two inputs, S (Set) and R (Reset). As they name implies, asserting either of these either sets or resets the flip-flop. After the input is de-asserted, the flip-flip retains it state. The inputs are usually negated, \$\mathsf{\small \overline{\text{S}}} \$ and \$\mathsf{\small \overline{\text{R}}} \$, i.e. 0 is the asserted state.
J-K flip-flops are similar to SR flip-flops, (with J being Set and K being Reset), but they have a third property -- if both J and K are set, then the flip-flop toggles.
D flips have a clock input, and when this clock rises (or falls, depending on the type), the D input is clocked into the flip-flop. Most D-flops also have the S and R inputs of a SR flip-flop.
Latches are the same as a flip-flop. Several latches can be combined in parallel to form a register. There will be inputs for each bit plus a clock. An 8-bit register used inside a microcontroller would hold a single byte. A 16-bit register would hold an address ranging from 0 to 65535 etc. Often a register will have a common reset lead.
Latches can also be combined in series to form a shift register, in this case there is a single input, and the output of one latch is fed into the input of the next on the rising or falling edge of a clock. The final output of the register can be used to feed into the input of another register. The shift register can also have individual inputs for each latch, so the register is both parallel and serial at the same time. This might be used for a register inside an ALU (arithmetic logic unit), that can do both arithmetic and logic operations, as well as shifting.
|
H: Why isn't homemade hardware a thing
What prevents someone with some funding from creating and selling their own hardware? Let's ignore the legal side of things and assume the only limit is technology.
Could someone create something akin to a 1995-2000 time period processor without specialized equipment? What about slightly earlier, like the "computer pioneers" did?
AI: If you're talking about fabricating your own IC like maybe an Intel '386 or '486 processor "without specialized equipment" you can forget it. However, the computer pioneers built the first computers with vacuum tubes, and there's nothing preventing you from buying a boatload of them and wiring them together to duplicate what they did. Or, you could get a bunch of TTL NAND gates and build a processor with them. If you just want to learn about digital logic you don't have to go that far, you could experiment with some simple circuits, then take a course in Verilog or VHDL. At that point you could implement a simple processor in an FPGA rather than wiring together a bunch of discrete gates.
|
H: Failsafe for home automation with Raspberry Pi
I have a Raspberry Pi driving a home automation system. I have connected a bunch of lights to the network. The GPIOs of the Pi connect to a relay board that switch the lights on and off. What I need is failsafe + alternative switches. These switches need to work even if the Pi fails, and they need to be usable when the system is operational (in 3 way switch, Pi switch XOR manual switch = bulb state fashion).
What is the best/standard solution for this? Three way switches would work, but then the Pi loses the state of the devices. I could get the state of the lamps by setting up a DC adapter in parallel to the bulb input, effectively measuring voltage which could feed back to the Pi telling me the true state of the bulb.
AI: You could use light sensors giving feedback to the rPi about its state. Or use some small value resistors (sense resistors) to tell the rPi if there is current flowing to the lamps. Hall effect sensors on a lead to the lamps could also detect current without the power loss that a sense resistor would incur. Each of these could determine state. In software, you could control the relays depending on the desired state versus the detected state.
The alternative power could be provided by a normally closed relay whos coil is powered from the rPi's power. If that was lost, the NC relays could introduce power to the lamps from an alternate feed(backup). When the pi came back online, it would then OPEN the NC relays now letting you KNOW the state of the bulbs is OFF and the rPi would continue on its original program. A single pole switch in line with the backup relay and the bulb would allow you to manually control power.
|
H: Creating with BGA
I have a project that I've begun to work on, it's sort of an embedded PC type project, with a iMx6 arm processor. However, since this is a (potentially) commercial venture, we can't use prebuilt boards like the Pi etc. I have a thorough understanding of creating PCBs, however I've never made one with SMT ICs, and now I need to make one with BGAs. I've been reading/researching , and it doesn't seem practical to do in a small company- we only have a soldering iron, hot air, and spools of solder. Is there a commercial alternative to making a prototype with these parts? We need to order a pcb, are there companies that can produce ONE OR TWO boards, as opposed to by the thousand? Or is there even a way to do it in house? I don't want to waste time and parts trying it to find that it's best to order, but I don't want to waste money either.
What types of prototyping services are available, and where could I find them (websites)?
What would the cost range be for a 10x10cm square with parts as expensive as a processor/ram?
AI: You've already accepted an answer, but I'll add this:
Keep in mind that all but the smallest (number of balls) and crudest (ball pitch) BGA layouts are going to require expensive multilayer boards- 6 or 8 layers, often not even the relatively inexpensive 4-layer type. Costly per board in small quantities and high up-front NRE costs that get charged every time you make a change. Slower, too, unless you pay astronomical rush charges.
They will also likely require microvias, which also increase the cost and limit which suppliers you can use. Companies that act as front ends for offshore factories will typically use a different factory for such multilayer boards.
The iMx6 processors use 21 x 21mm, 0.8 mm BGA, which is not the highest density, but will still likely require microvias, 6 or 8 layers and fine pitch.
Mounting a BGA chip is actually not that difficult if you don't require X-ray inspection- print with a stencil (rework stencils are available) and a pass through a reflow oven will do it. If the process is right they'll almost always be okay.
If you have sufficient budget for that kind of board technology, it is not a particular problem, but keep in mind that multiple spins of even a small board can eat up many weeks and thousands of dollars. Be sure to read the recommendations carefully on BGA layout before doing it (or deal with a layout person who has done this before) as mistakes are unusually costly if you're used to dealing with 1-2-4 layer boards.
|
H: High frequency, low noise clamp circuit
I have an analog circuit that outputs voltage between 0-5V. A simple representative circuit is given below.
The ADC can tolerate up to 4V and the interesting signal that I like to digitize is between 0-3.3V. In other words, it is ok to read all 1's at the ADC if the signal is more than 3.3V?
I am trying to find a circuit where it doesn't introduce:
Additional noise
Doesn't disturb my signal if it is not above 4V
fast enough to deal with my 1 MHz input signal (zeners are out at least I couldn't find one that is fast enough and small noise)
Any help would be appreciated.
AI: You specify that it "should not introduce additional noise", which rules out any possible components in the signal path, at least in a strict reading.
So, okay, we could put an LDO regulator on the op-amp power supply rail(s) and reduce its supply voltage so that it is not 'railed' at 3.3V but does saturate under all conditions at 4V. If the LDO has the same or less noise than your current supply, there will be no additional noise, and if the op-amp functions well enough with a few hundred mV of headroom, the 1MHz signal may emerge unscathed. If the particular op-amp you have in mind does not quite allow that, it's often acceptable to reduce the allowable input swing to (say) 3.0V and lose a fraction of a bit of resolution.
A clamp diode as @user50443 suggests is possible- that means you use something like a zener (say a TL431) to create a stiff supply that can sink current and that's a few hundred mV below your desired clamp voltage and use a diode (conventional switching diode or a small signal Schottky) to clamp the op-amp output through a relatively low-value resistor such as 50 or 75\$\Omega\$. Of course the forward voltage of a diode changes with temperature, so unless you compensate the supply you'll have some change in the clamp voltage, and Schottky diodes tend to be leaky so you'll have to do the sums as to allowable error. If you're only concerned about high frequency noise, the Schottky (eg. BAT54) +TL431 should be a good choice.
There also "clamp" amplifier chips that are designed to clamp the output at a certain level. I've never found them adequate in performance, but if memory serves they might be okay for this kind of application if precision is not a big deal.
Edit: Here is a simple clamp diode setup that will not affect signals below 3.3V significantly (you could notice a slight DC shift at high temperatures) and does not require a minimum load on your 3.3V supply. If you're sure the signal can never exceed 5V and you're sure that the load on your 3.3V supply will never be less than about 15mA (maybe you put a resistor on there) you can lose the TL431 and resistors and just connect the BAT54 to the 3.3V supply.
simulate this circuit – Schematic created using CircuitLab
|
H: Planar process vs. 3D chip
As far as I know, the planar process of making IC, especially CMOS IC, is already a 3D process because a layer is added on top of an existing layer to realize various things (cf. Wikipedia IC Layout). So, in my opinion, an IC is already 3D because there are multiple interconnected vertical layers. Why people coined the terms 3D IC then? What does the planar process IC lack in the three dimensionality that 3D IC fulfills?
AI: There's a single surface of semiconductor, so doesn't matter how many conductor layers you have, you need to go down to ground level at every conductor terminal. Note, not the conductors is the heart of circuit, but silicon devices on surface of a chip. You cannot stack transistors one above another with current technology. This very limits IC grow to third dimension. So it's still 2D.
To be 3D, IC technology needs method to make and interconnect devices in bulk of semiconductor or method to make lots of stacked semiconductor films.
|
H: Initial state of SN74AUP2G80 dual FF
My understanding is that a basic FF will in general power-up into a meta-stable state that then resolves to either H or L (more or less quickly).
My question is, does this apply to current real-world parts such as the dual D-FF 74AUP2G80, or do these parts contain some circuitry to force them into a predictable state on power-up?
AI: You should never assume any particular startup state for anything unless the datasheet provides specifics.
If startup state is important you need to include some sort of power up initialization sequence. There are SUPERVISOR integrated circuits that reliably produce a delayed reset pulse on power up that can serve this purpose, like tlv803m (link to pdf).
That said, often a clock tick or two without any special handling might serve to get you to a predicatable state without problems. You should think about how detrimental a few unpredictable states at startup would be to determine if you need to go out of your way here.
|
H: Patient protection resistors in the biopotential amplifiers
In biopotential amplifiers like ECG amplifier, I often see protection resistors (around 100kohm) between electrode and the input of instrumentation amplifier or ECG amplifiers like ADS1298. I understand that the resistor are supposed to limit the current flowing into the patient. But the input impedance of the amplifiers are already in Gohm range. How does adding the resistors make difference?
Here is an example:
AI: The input impedance is high only when the circuit is operating correctly. If a fault occurs inside the equipment, you can no longer say for sure that that assumption is still true. By explicitly placing resistors in series with the leads, you can enforce a lower bound on the input impedance, and you can easily analyze the limited set of faults that might bypass those resistors.
|
H: Reverse current with Peltier (TEC)
Trying to control a Peltier to cool and to heat.
Does the following code allow me to reverse the current to switch cooling/heating depending on whether I input "a" or "z"?
Source: http://garagelab.com/profiles/blogs/how-to-use-a-peltier-with-arduino
int peltier = 3; //The N-Channel MOSFET is on digital pin 3
int power = 0; //Power level fro 0 to 99%
int peltier_level = map(power, 0, 99, 0, 255); //This is a value from 0 to 255 that actually controls the MOSFET
void setup(){
Serial.begin(9600);
//pinMode(peltier, OUTPUT);
}
void loop(){
char option;
if(Serial.available() > 0)
{
option = Serial.read();
if(option == 'a')
power += 5;
else if(option == 'z')
power -= 5;
if(power > 99) power = 99;
if(power < 0) power = 0;
peltier_level = map(power, 0, 99, 0, 255);
}
Serial.print("Power=");
Serial.print(power);
Serial.print(" PLevel=");
Serial.println(peltier_level);
analogWrite(peltier, peltier_level); //Write this new value out to the port
}
AI: No, the circuit does not contain a full bridge.
Think of the TEC being L1 in the image. To make the TEC switch from one side cooling to that same side heating current needs to flow in the opposite direction through the TEC. One direction would be Q1 and Q4 ON and the other two transistors OFF. To switch current directions turn Q2 and Q3 ON and the other two OFF.
Since this circuit only contains one transistor the TEC cannot have its current direction reversed. It looks like your code will just shut off the current altogether.
|
H: Wien bridge using single potentiometer
I'm making a function generator which works in the audio range for a college project. I'm not allowed to use microcontrollers or any digital chips. So I'm using a Wien Bridge oscillator with a pot to generate variable sine wave. It is followed by a Schmitt trigger to generate square waves and finally an integrator to get triangle wave. I found this schematic on the web for the Wein bridge:
Could you replace the two variable 100k pots by a single pot? If not, is it possible to somehow mechanically (or electrically) gang the two different 100k pots? I'm trying to avoid using a single double-ganged-potentiometer to save cost.
I would like my final design to have only two pots. One for frequency and one for amplitude.
AI: Are you forced to use the WIEN oscillator (named after Max WIEN) topology ?
There are other oscillator types with single-element control - however with two operational amplifiers.
Here is a corresponding link:
http://m.eet.com/media/1143038/17995-82202di.pdf
I like to mention that for frequency tuning you only have to tune one single grounded resistor. More than that, the quality of the output signal (THD) - for most applications - will be sufficient, even without additional amplitude control mechanism.
EDIT: To all who also are interested in the update of the referenced paper:
Try this link (I hope it works) and search for "A novel harmonic Oscillator: GIC Resonator" :
https://www.researchgate.net/profile/Lutz_Von_Wangenheim/publications
|
H: Building a regulated power supply AC-to-DC
What components do I need to build a regulated power supply with an input voltage of 220V AC and outputs of 3V, 6V, 9V, 12V? Assuming max. current of 1A in each outputs.
AI: Option 1: A linear power supply:
transformer (at least 50 W output at 12 ... 15 V)
bridge rectifier
filter capacitor
fixed voltage regulators (78XX series)
some 0.1 ... 0.33 uF capacitors
optional: some rectifier diodes (to protect regulators in case reverse voltage is applied - if you charge batteries with the supply)
Option 2: A switched mode power supply. A 50 W transformer is quite big and heavy, and with the current configuration there will be a big energy loss as unwanted heat. A SMPS is the most effective solution, but you shouldn't build it yourself. There are online services that allow you to create almost any configuration and order the required parts.
|
H: Can the power source for a USB device be different from the data source?
I was wondering if the data source (USB Host) for a USB device has to also deliver the power 5V circuit e.g. data and power need to have a common ground.
Or can I connect the data lines to the data source and have a separate power supply for the 5V line?
AI: As Chris pointed out in the comments, you can have self-powered devices. However, even with self-powered devices you need to have a common ground to ensure that the signal levels on the data lines are within spec.
|
H: Taking power from two different feeds
Probably a silly question I know but I'm not all that good when it comes to wiring but at the same time don't want to blow myself, or my car up!
I have a set of sidelights/ daytime lights that take a feed from the cars loom and turn the lights on when I a) unlock the doors (they remain lit for a short period of time) b) turn the sidelights on.
What I would like is for them to turn on when I unlock the car, and then to remain on while the engine is running (which I have a relay to handle). My concern is that if I have an active feed from both my sidelights being on and the relay from the battery - will this overload the circuit and thus cause irreparable damage to my car or my lights? If it won't cause any damage - which would be the best way to achieve this?
Basic diagram of what I am getting at here (yes, no question would be complete without one) -
I look forward to your thoughts.
AI: It will be fine - you will just have two switches in parallel (one being your relay, the other being the existing circuitry).
|
H: Is it possible to make a complete analogy between electricity and something more graspable? (e.g. fluids)
A similar question has been asked here, but mine is more general.
Here is the background: it seems to me that electricity is not so intuitive as it may sound. For example, many (unskilled, as I am) people think an electric plug is like a (water) tap: it delivers what it can, and stop at a maximum flow. But it is not possible to stop the water from flowing, by putting too large a bucket under a tap, whereas if you plug a washing machine you could break the current!
Improving the understanding with analogy seems to be an efficient way to learn (not talking about scholar stuff) about electricity and "feel" it (not too intensely, though).
Water seems to be a good candidate for these analogies: current/water flow, electron/molecule, tension/height difference, resistance/decrease of the pipe section, capacitor/volume with membrane. I also heard about an analogy between electricity/water for transistor.
My question is: is it possible to define a global analogy, which would: (i) allow to better understand any electrical circuit [ideally, a complete transcription would be possible], (ii) be exhaustive (i.e. work for any electronic/electrical component). Other examples include allowing to understand what would happen if the frequency of the electricity changed, or if a power plant produced energy in excess, etc.
I insist: I'm not an electrical engineering. I'm just curious :)
AI: Using analogies to fluid dynamics (air/water) is useful for some purposes for the complete novice, but it also can lead to confusion. If someone really wants to understand electricity, they need to dispense with the fluid analogies and just learn how electrical fields and charges work. There really isn't a global analogy.
I find it useful to refer to William J. Beaty's articles about electrical misconceptions.
Also to the web site All About Circuits.
And finally, the more in-depth reference book, The Art of Electronics by Paul Horowitz and Winfield Hill.
|
H: Understanding current flow in example
When I have series circuit with 3 light bubbles the voltage in second should be less than in first and the voltage in third should be less than in second. Conventional current flow is from positive to negative while electron flow is from negative to positive. Which light bulb will get the lowest voltage - the one closest to negative charge of battery or the one closest to positive charge of battery? (correct me if my reasoning is wrong)
AI: Assuming that the three light bulbs have identical characteristics, the voltage in their terminals will be exactly the same for each one. In this way, the sum of the voltages of the three bulbs will be equal to the voltage of the source, as follows
Vs = Vb1 + Vb2 + Vb3
where: Vs = Voltage source (battery)
Vb1...3 = Voltage of bulb 1...3
The difference in voltages when measuring (e.g. with a voltmeter) depends on the terminal that you use for reference (negative, ground reference). If you measure with respect to the source's negative terminal (typical measurements), the bulb closer to the positive terminal will measure the maximum voltage, then the second and the lower voltage for the third.
The bottom line is that when measuring the reading is a sum of the voltages across the device's terminals, but the voltage in each device must be exactly the same.
|
H: ATtiny External Clock not working
So, I've been wanting to break away from the arduino abstraction for a while now. I made a board that has an ATtiny10 on it with a crystal and an output. I cannot for the life of me understand what I am doing wrong.
Here's the problem: When I select the clock source, the AVR stops working.
I had a custom PCB (small one) made to mount everything on.
Thinking I didn't do something right (even though schematic looked right)
I changed design and made another one (for the second one, I had traces with clock surrounded by a ground plane (Did not work still) [Also, the first design was using everything but the AVR sourced from ebay. Thinking maybe it was a quality issue the second board is sourced entirely from Mouser]
Lastly, to make sure I wasn't an absolute idiot, I bought a breakout board and just breadboarded the circuit. This still performed just like all the others
It works just fine with the internal oscillator, but as soon as I program to change clock source it stops.
Note that I added R2 to keep the MOSFET pulled down but I do not populate it for programming it, as TPI (Tiny Programming Interface) uses pullups on that line and I cannot populate that if I am going to program the chip
Page 21 of the datasheet regarding changing clock
Page 22 of the datasheet regarding the prescaler (Clock prescaler not timer prescaler)
I am using a MkII programmer from Atmel and these are the fuse bits:
Output External Clock
0xFB
This was set through Atmel studio and I have used a couple different ATtiny's and the chips kept these settings once set, so I am pretty sure the fuses are writing correctly
Now the code: (This is the whole program, the timer portion works (obviously not though once the clock switches))
#define F_CPU 8000000
#include <avr/io.h>
#include <avr/interrupt.h>
void initClock()
{
// Setting CLKPSR does not affect the problem (It doesn't work regardless of what this is set to)
// I have tried this before and after setting CLKMSR
CCP = 0xD8;
CLKPSR = 0;
CCP = 0xD8;
CLKMSR = 0b10;
}
void initPorts()
{
DDRB |= (1 << PORTB0); // PB0 = OCR0A
}
void initTimer()
{
// I posted this code just in case, this works as expected (but only on the internal oscillator)
// We want Compare Output Mode, Clear OC0A on Compare Match
TCCR0A = (1 << COM0A0);
// Overflow setting
TIMSK0 |= (1 << OCIE0A);
// We will not use a prescaler
// This also starts the timer
TCCR0B = (1 << CS00) | (1 << WGM02);
// This is the value at which the timer will restart
OCR0A = 8299;
// Set external interrupts
sei();
}
int main(void)
{
initClock();
initPorts();
initTimer();
while(1)
{
}
}
Surely there has to be something I am missing. I've tried to read and reread the especially the clock sections of the datasheet in order to figure it out myself. I am stumped though. Maybe someone could help me understand my mistake.
Thank you! Please let me know if there is any more info I can add to make it easier to understand
Attiny10 Datasheet
AI: Using the two leg crystal is not possible with the specific device. There is only the option to use an external clock source, so you can use an external oscillator like the following one and apply the clock pulses to the CLKI pin (pin 1).
Unlike the two leg crystal that needs additional circuitry inside the mcu and two capacitors, this four pin crystal oscillator is a complete oscillator that only needs power to generate the clock.
|
H: Diodes and CMOS 4060 (14-stage counter)
Take a look at this popular circuit for a fridge alarm based around the 4060 binary counter (http://free-electroniccircuit.blogspot.co.uk/2012/02/refrigerator-alarm-schematic.html):
One thing I notice is that the diodes connected to pins 3 and 6 are "reversed". I think I understand why this is the case: that when these pins go high, after a time interval specific to the output pin (and adjusted by the RC arrangement at pins 9 and 10), the current is blocked from flowing through the diodes and instead flows through the transistor base pin causing the buzzer to sound. My assumption is that when pins 3 and 6 are not high that current freely flows through R4 and the diodes and into the "output" pins 3 and 6.
My question is this: is it "healthy" to pass current though IC pins that are specifically output pins? Is this a common arrangement?
AI: The conection of those diodes is called wired AND, i.e. the output (= common node after the diodes) is high only when both inputs are high.
The current flowing through the outputs is Ub / R4 = 3V / 100kOhm = 0.03 mA which is well below the max. output current this IC can sink.
So: yes, it's common. It is not unhealthy.
(What you might have in mind is that currents caused by voltages above the supply voltage of the IC and even more by voltages below GND at any input or output must be avoided. This is, however, not the case here)
|
H: STM32F102 USB Programming
I am currently designing a board for a STM32F102 chip which needs to be able to use the USB bus to transfer data while the chip is running. However I also want to be able to program the chip through usb while developing the software.
I want to make sure that while designing the board I wont do anything that makes this impossible later on, so I am asking for some clarification on some things.
First of all in accordance with the USB standard, because the STM32F1 supports full speed usb, I have a pull-up resistor on the D+ line.
Now, in order to boot from the main flash the boot0 pin must be logic 0, so I will connect that to a pull-down resistor on the board. In order to use the included bootloader (which I believe is what I need to program via usb) the boot0 pin must be logic 1 and the boot1 pin (which is a gpio however is an input on reset) should be logic 0.
Assuming I am understanding all of this information correctly, what would be the best way of going about being able to program the chip when a usb cable is plugged in? Can I use the usb V+ and GND to set the logic levels needed on the boot pin? or should I connect those to the boards V+ and GND and use a switch to set the boot pins accordingly?
If there is any other information required I'd be happy to help you understand what I need or am asking for better.
AI: I have some bad news for you: the STM32F102 (and I suspect the STM32F1xx devices generally) don't have a USB bootloader, only a UART bootloader. You need an STM32F2xx or STM32F4xx to get a USB bootloader loaded into the system ROM image.
You have many alternatives, including:
Use the UART bootloader, possibly with a USB-UART bridge IC like the FT232.
Provide your own USB bootloader that you load in via some other mechanism.
Use a JTAG/SWD programmer like the STLinkV2 (they're really cheap, but quite slow as far as JTAG goes). This is your best option because it means you can debug when coding.
|
H: Procedural blocks in verilog
We have two types of procedural blocks in verilog: initial and always block.
The statements inside these blocks are executed sequentially. Does that affect the timing of these signals? For example, in the code below:
initial begin
a = 1'b0;
b = 1'b1;
end
Will the assignment of b will take place a small time after the assignment of a?
If not what will be the difference between this and the concurrent blocks in verilog, i.e.,assign statements?
assign a = 1'b0;
assign b = 1'b1;
AI: Does that affect the timing of these signals?
Not really.
Yes a&b are evaluated sequentially but in the same simulator timestep, not seqential in terms of electronic design.
initial begin
a = 1'b0;
b = 1'b1;
end
a and b are essentially evaluated in parallel. but your simulator can not do that, the only time that this needs careful consideration is if you rely on previous results.
The following are just examples and would imply latches in some case and should not be used in RTL like this.
always @(posedge clk) begin
a = y;
b = a; //this is b=y
end
is not the same as:
always @(posedge clk) begin
b = a; //This is old y
a = y;
end
For clocked systems (implying flip-flops) we use non-blocking (<=) the following 2 examples are the same:
always @(posedge clk) begin
a <= y;
b <= a; //this is old y
end
always @(posedge clk) begin
b <= a; //This is old y
a <= y;
end
|
H: Bluegiga BGScript Accelerator sample. I want to understand the example code
I started BGScript few days ago. I have many questions about BGScript. Any help will be appreciated. Thanks!
*My goal is advertising with accelerator data via BluetoothLE. I am going to use ADXL345 as an accelerator.
I could advertise with temperature data. The source code is here (Almost same as reference code) http://qiita.com/zono/items/2e6290e91f5b3728daa9
*My questions are
1 How to read port data?
According to "hardware_io_port_config_direction", the direction is the setting of I/O.
For example, hardware_io_port_config_direction(1,$7) means Port1_7pin is used as Input, isn't it?
2 I want to understand the meaning of the accelerator sample below.
Dim temp (10)
Dim spiresult
dim channel
dim tlen
event system_boot(major ,minor ,patch ,build ,ll_version ,protocol_version ,hw )
call gap_set_mode(gap_general_discoverable,gap_undirected_connectable)
call hardware_io_port_write(1,$7,$3) # Why port 1? The Datasheet shows P1_7 is "DCDC on/bypass control". Why $7? Just "7" with out "$" is not correct? What $3 means?
call hardware_io_port_config_direction(1,$7) # It means Port1 7pin is used as Input?
call hardware_io_port_write(1,$7,$7) # What $7 means?
call hardware_spi_transfer(0,2,"\x0a\x06") # The Datasheet shows P0_2 is "UART CTS". What is "\x0a\x06"? What this lien meaning !?
call hardware_io_port_write(1,$7,$3) # This line already called. Why is it nessasary?
call hardware_set_soft_timer(32768,0,0)
end
event hardware_soft_timer(handle)
call hardware_io_port_write(1,$7,$7)
call hardware_spi_transfer(0,2,"\x18\x00")(spiresult,channel,tlen,tmp(0)) # What is \x18\x00?
call hardware_io_port_write(1,$7,$3)
call attributes_write(x_data,0,2,tmp(0:2))
call hardware_io_port_write(1,$7,$7)
call hardware_spi_transfer(0,2,"\x1c\x00")(spiresult,channel,tlen,tmp(0)) # What is \x1c\x00?
call hardware_io_port_write(1,$7,$3)
call attributes_write(y_data,0,2,tmp(0:2))
call hardware_io_port_write(1,$7,$7)
call hardware_spi_transfer(0,2,"\x20\x00")(spiresult,channel,tlen,tmp(0)) # What is \x20\x00?
call hardware_io_port_write(1,$7,$3)
call attributes_write(z_data,0,2,tmp(0:2))
end
event connection_disconnected(handle,result)
call gap_set_mode(gap_general_discoverable,gap_undirected_connectable)
end
3 What is cdc.xml. Is it necessary?
4 Can I debug using display? I want to display x,y,z_data on screen.
AI: You are using a front end language to program an 8051 with a proprietary BLE transceiver, the binary-only driver libraries of which are otherwise only compatible with a fairly uncooperatrive, expensive, windows-only C compiler and IDE. But most of your questions can be understood through the generic 8051-ness of it and the fact that you are interfacing a well-documented peripheral.
According to "hardware_io_port_config_direction", the direction is the setting of I/O. For example, hardware_io_port_config_direction(1,$7) means Port1_7pin is used as Input, isn't it?
That would depend if the function's documentation says it takes a port pin number or a power-of-two place value. My suspicion (almost certain given the way it is used later in the code and the match for how the 8051 I/O ports work) would be on the latter. So this is not a reference to port pin 7, but rather to the combinations of port pins 0, 1, and 2, with values of 1, 2, and 4 which together add up to 7.
call hardware_io_port_write(1,$7,$3)
Why port 1? The Datasheet shows P1_7 is "DCDC on/bypass control". Why $7? Just "7" with out "$" is not correct? What $3 means?
Controlling a DC/DC converter is a possible alternate function of Port 1 pin 7, but if not configured (or software driven?) for that purpose you can also use it as a general purpose I/O. However, the idea that this is a reference to port pin 7 is almost certainly a misinterpretation.
Instead, 7 is the combination of the place values of port pins 0, 1, and 2. It would appear that BGscript syntax uses $ to denote a literal value or possible a hex value, we can't tell from the number given, but you could by reading the documentation. We'll get to the reason for the specific values in a minute.
What's really interesting though is that there are two constants instead of just one. It may be that the first is a bit mask which restricts which port pins' values can be altered by the call, and the second sets those values. To be sure you would have to check the function documentation.
call hardware_spi_transfer(0,2,"\x0a\x06")
The Datasheet shows P0_2 is "UART CTS". What is "\x0a\x06"? What this lien meaning !?
The documentation will tell you for sure, but this appears to be writing a count of 2 bytes to the SPI 0 synchronous serial engine. Or perhaps 0 indicates that it should not use a hardware chip select - check the documentation. "\x0a\x06" is clearly a payload of two bytes to be written, values 0x0a (10 decimal) and 0x06 (6 decimal).
Now examining a typical sequence:
call hardware_io_port_write(1,$7,$7)
call hardware_spi_transfer(0,2,"\x18\x00")(spiresult,channel,tlen,tmp(0))
call hardware_io_port_write(1,$7,$3)
call attributes_write(x_data,0,2,tmp(0:2))
The two io_port calls set port one to a value of 7, and then 3 before and after an SPI access. This would appear to assert the bit with a value of 4 - ie, port pin 2 during the SPI transfer. That's fairly sensible and suggests it is being used as the SPI select pin to the peripheral. The only thing odd is the ordering - usually SPI selects are active low and so we'd expect to see it written to 3 (pin 2 = 0) before the transfer and back to 7 (pin 2 = 1) afterwards. Does the ADXL345 have an active-high SPI select?
The final line of the block appears as if it is writing the measured data to something in the BLE system so that the measurement can be obtained by a remote device.
3 What is cdc.xml. Is it necessary?
That sounds like something involved in enabling CDC-ACM virtual serial port communications with a PC via the CC2540's USB port.
4 Can I debug using display? I want to display x,y,z_data on screen.
Yes, possibly if you have virtual serial output over USB as above. But you'd have to check the Bluegiga docs to learn how.
|
H: Why is my microcontroller passing a current through it when not connected?
MCU: ATTiny13
I noticed this after trying to debug why pushing my switch (connected via R2, a 507kOhm pulldown resistor) makes the LED dimmer while depressed. The switch was powered by the same supply line as the Vcc input to the microcontroller.
Upon disconnecting the Vcc input (Pin 8), I noticed that the LED was still lit when the switch was depressed. If I removed a connection from the ground pin 4, the LED still lit up, but less brighter.
The circuit below represents what I observed. The switch is removed to simplify the problem:
Why does this happen, and how can I stop it? It is interfering with the output when the button is depressed.
Here is a picture of the circuit on a breadboard. The supply line (5V is the red wire, Ground is black):
AI: Inputs of many modern CMOS devices have ESD protection diodes from the I/O pins to the supply rails, which hope to divert transient overvoltages to the supply before they cause damage.
A side effect of this is that the chip can, at least to a degree be powered through an I/O pin, once the pin rises enough against the (unsupplied) supply to forward bias the diode. Even in technologies without explicit protection diodes, it could happen to a degree, though often resulted in very unreliable operation (classic mistake - forget to power a chip and see it "sort of" work - I did it myself with an SPI flash this past January that somehow never got a ground, and would provide expected responses right up until I tried to write flash locations).
Generally you do not want to power a chip this way - it is outside the absolute maximum ratings, and the protection diode may not be sized to carry the full operating current. You do see it at times though, both in intentional experiments, such as an RF-powered ATTiny RFID tag emulator experiment, or accidentally in cases such as trying to measure power consumption of a sleeping MCU and having it actually draw power from your serial debug port rather than the supply you are trying to measure.
|
H: How does USB 3.0 negotiate power states?
I noticed, in another question, a comment regarding USB power states. I know that USB 2.0 negotiated power by tying the D+ and D- lines to specific voltages but I can't seem to find any information on USB 3.0 power state negotiation.
Since USB 3.0 has two sets of D+/D- lines, and I can't seem to find any information on this, does it either:
Pull both sets of data lines to specific voltages
Send actual data through to ask for power instead of setting static levels
Just pull one set of data lines to the specific voltages?
Or something else?
Bonus points if you can find the actual voltage levels or data for the different states.
AI: I know that USB 2.0 negotiated power by tying the D+ and D- lines to specific voltages
Not as per USB Specification. The battery specification signals the "charger" via a short (low resitance) between D+ and D-.
find any information on USB 3.0 power state negotiation
As in the USB 2.0 spec, look in the Standard Configuration Descriptor. The bMaxPower field definition is updated in the 3.0/3.1 USB specs. From USB_3_1_r1.0.pdf, Table 9-21:
Expressed in 2-mA units when the
device is operating in high-speed mode and in 8-mA
units when operating at Gen X speed.
|
H: Are UV LEDs really dangerous?
I just bought some UV LEDs
I bought them for testing banknotes and identity papers. I read the documentation and saw some warnings about UV light in which the vendor advises not to look directly at the light and not to expose skin to the light.
Can I use these LEDs safely ?
AI: The limits of "safe" emitted light are very complicated. You can read about the basics here.
A rule of thumb I have heard is if the emitted power is over 5mW, protection should be used. Since the LEDs you linked are capable of 10mW, yes they can be harmful. Do not use them until you understand how they can be harmful and how to prevent it.
UV is particularly dangerous because we can't see it so our blink reflex won't help. To safely work with these LEDs you should get a pair of glasses that block the possible wavelengths the LED can emit, 390 to 405nm ±2.5nm. Examples here.
This paragraph answers an edited out question in the OP wondering why he had a UV pen with no warnings. As for your UV pen light question, it is likely the power was low enough that it was not harmful. Less than 0.39mW (roughly) is considered eye safe so under that no warning would've been required.
|
H: Compute for resistance (Resistance circuit)
Hi how do you solve this problem? I am confused.
simulate this circuit – Schematic created using CircuitLab
Find \$R_{AB}\$, \$R_{CD}\$, \$R_{EF}\$, \$R_{AE}\$
I came up with this:
\$R_{A-B}\$ = 1 \$\Omega\$ ,
\$R_{C-D}\$ = 4 \$\Omega\$ ,
\$R_{E-F}\$ = 7 \$\Omega\$ ,
\$R_{A-E}\$ = 2 + 5 = 7 \$\Omega\$
AI: Have you covered equivalent resistances? Essentially, it is a way to combine resistors in series or parallel until you get a single resistance, working your way from out to in.
Let's say you want to find \$R_{AB}\$.
First, your have a series combination \$R_5\$, \$R_6\$, and \$R_7\$.
$$
R_{5,6,7} = R_5 + R_6 + R_7 = 18 \Omega
$$
simulate this circuit – Schematic created using CircuitLab
Now you have a parallel combination between \$R_4\$ and \$R_{5,6,7}\$.
$$
R_{4,5,6,7} = \frac{R_4 \cdot R_{5,6,7}}{R_4 + R_{5,6,7}} = 3.27 \Omega
$$
simulate this circuit
You are almost done! Now, since you are looking for the equivalent resistance between A and B, you have a series combination for \$R_2\$, \$R_3\$ and \$R_{4,5,6,7}\$:
$$
R_{2,3,4,5,6,7} = R_2 + R_3 + R_{4,5,6,7} = 8.27 \Omega
$$
simulate this circuit
Last Step!
You have a parallel combination between \$R_1\$ and \$R_{2,3,4,5,6,7}\$:
$$
R_{AB} = \frac{R_1 \cdot R_{2,3,4,5,6,7}}{R_1 + R_{2,3,4,5,6,7}} = 0.892\Omega
$$
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.