text stringlengths 83 79.5k |
|---|
H: Charging appliances with chargers of different amperage (safety & duration)
Safety
Will the battery or charger be damaged if I use a 1A charger to charge a 2.1A appliance?
Will the battery or charger be damaged if I use a 2.1A charger to charge a 1A appliance?
Duration
I have tried both of the above. What I notice is that when I use the 1A charger to charge the 2.1A appliance, the charging time is extremely long. I understand that because Q = It, a smaller current would take longer to deliver the same amount of charges.
Conversely, when I use the 2.1A charger to charge the 1A appliance, should I expect the charging time to be shorter, or the same as if I used a 1A charger?
AI: A properly designed charger will not take any damage (apart from maybe a blown fuse) if the load is too high. That of course does not apply to 2$ charges from China..
The current rating of a device usually is the maximum current it consumes, given the specified input voltage (range). So no, using a 2.1A charger on 1A device shouldn't change the charging speed.
This applies in the general case, where a "charger" simply is a constant voltage source. There are some exceptions to this though, so be careful, unless you know what you're doing. |
H: Jack barrel contact diagram?
I've come across this diagram, I researched a bit, but I don't get what this contact is supposed to do. The circuit below is an audio effect, and I'm confused because it apparently doesn't mean that it will power the circuit when the Jack is connected?
What are your thoughts? Help is really appreciated :).
I post the complete diagram, because i have another contact at the output.
AI: The jack is being used as a power supply switch. If the symbol used is the normal one for a stereo jack, the plug must have its tip and sleeve shorted together to make battery negative connect to ground when it is plugged in. The signal would be fed into the circuit via the ring contact.
However I suspect that the circuit is drawn slightly wrong, and the battery should be connected to the ring contact. That way a mono plug could be used, as its sleeve should be long enough to touch the ring contact. |
H: What is the name of the following cable?
Instead of wrapping cables I will like to make the connection by using the following type of cable:
what is the name of the female and male cable with this circular end? I will like to buy this type of cable so that I can connect and disconnect cables in an easier way. Without the name I cannot seem to find it on google.
AI: Those are "barrel plug" for the male end, and "barrel socket" for the female end, both sometimes called "barrel jack". Make sure to measure both the outer and inner diameters with calipers since they come in many, many sizes (with 5.5/2.5mm and 5.5/2.1mm probably being the most common). |
H: Inductor held with hands
I have a fairly simple problem, but as I am a newbie in electrical circuits I was hoping someone might help me understand the principles of things.
I have a circuit with an inductor of L = 0,102H a resistor of 20k ohms and a voltage source of 10V. The question is how much current will 'accumulate' (if thats even how it works) and if I were to disconnect S1 (or flip it so that that the voltage source would no longer apply) what would happen to the body (represented as a resistor).. How much voltage there would be and how much current would run through it. Also in what manner would the current run?
AI: When you close the switch, current through the inductor will build up linearly at a rate of di = V*dt/L = 98A per second.
When you open the switch the final current will initially keep flowing (in the same direction) through the inductor. Since the switch is open the only possible path is now through the body. If the body's resistance was 20kΩ and you opened the switch after 1 second, then the current would reach 98A and voltage would spike to 98A*20kΩ = 1.96MV.
Since the current is flowing in the same direction through the inductor it must go in reverse through the body (ie. upwards in your diagram) compared to the current that was flowing through it when the switch was closed.
As the magnetic energy in the inductor is drained out the current (and voltage) will decay exponentially with a time constant of L/R, so the body will only receive that 98A at 1.96MV for a short time. As to what would happen to it, how should I know? - I'm an engineer not a doctor! |
H: About ADC's 'No missing code'
Some 16 bit ADC's specifications has "No missing code: 14 bits min", like ADI's AD7656. I want to know where the 14 bits locate in the 16 bits. Does it mean the high 14 bits?
According to the definition of 'No missing code', the missed code can be one or more of the possible 2^n binary code. Assume a 16 bit ADC with 1 bit missing code, no matter where the missed code locate, i can safely use it as a 15 bit ADC, right?
And i want to know the relation of DNL and 'No missing code', i think if a 16 bit ADC specified with DNL = +/-4 LSB, i can assume the no missing code is 14 bit, right ?
AI: Since the high bits are the only ones that can be contiguous over the entire input range, this specification must refer to the high bits. |
H: What is the use of transistor in the input side in TTL logic family?
Second transistor will turn ON and OFF if input voltage is directly connected to its base terminal. Then why a coupling transistor is used at the input side of a TTL logic gate?
AI: Because with it you don't have to worry about the amount of current being fed in, nor do you have to worry about shorting your positive supply to your negative supply (which also has to do with current). |
H: AVR TIMER0 treating with prescaler and without to blink a led
I am playing with ATMEGA168A's TIMER0. CPU is running at 20MHz and there are two treatments.
a) Blink a LED at 20ms frequency by using a 1024 prescaler. In that case i count the the times that an overflow occurs for the frequency that prescaler of 1024 'gives' me. And according to the formula, to achieve 20ms delay with 1024 prescaler, timer should overflow 1 time and in the second loop to count 145 'ticks' more. With that method LED is blinking but offcourse we cannot see it. Here is the code:
#define F_CPU 20000000UL
#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
volatile uint8_t total_overflow;
void timer0_init(void)
{
// Setting the 1024 prescaler
TCCR0B |= (1 << CS00) | (1 << CS02);
// Initialize Timer0
TCNT0 = 0;
// Initialize the overflow interrupt for TIMER0
TIMSK0 |= (1 << TOIE0);
// Enable global interrupts
sei();
// Initialize total_overflow variable
total_overflow =0;
}
// Interrupt service routine
ISR(TIMER0_OVF_vect)
{
total_overflow++;
}
int main(void){
DDRB = 0b00000001; // SET PB0 pin as output
timer0_init();
while(1)
{
if(total_overflow >= 1)
{
if(TCNT0 >= 145){
PORTB ^= (1 << 0);
TCNT0 = 0;
total_overflow = 0;
}
}
}
}
b) Blink a LED at 20ms frequency but without using any prescaler. CPU and this time runs at 20MHz. Here occurs that to achieve a time delay of 20ms, TIMER0 needs to overflow 1568 times and in the 1569th time to count 160 more 'ticks'. In that case the LED doesn't light. Here is the code:
#define F_CPU 20000000UL
#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
volatile uint8_t total_overflow;
void timer0_init(void)
{
// Setting the no prescaler
TCCR0B |= (1 << CS00);
// Initialize Timer0
TCNT0 = 0;
// Initialize the overflow interrupt for TIMER0
TIMSK0 |= (1 << TOIE0);
// Enable global interrupts
sei();
// Initialize total_overflow variable
total_overflow =0;
}
// Interrupt service routine
ISR(TIMER0_OVF_vect)
{
total_overflow++;
}
int main(void){
DDRB = 0b00000001; // SET PB0 pin as output
timer0_init();
while(1)
{
if(total_overflow >= 1568)
{
if(TCNT0 >= 160){
PORTB ^= (1 << 0);
TCNT0 = 0;
total_overflow = 0;
}
}
}
}
Any idea why this happening ? Am i doing something wrong or there is a limitation on how many times a timer can be overflowed (<-- that seems silly idea).
Thank you.
AI: total_overflow will never be larger than 1568 because you are using an 8bit unsigned integer for the job, which can only count to 256 (0-255). Change
volatile uint8_t total_overflow;
to
volatile uint16_t total_overflow;
so that your variable can hold high enough values.
EDIT: Also, you should move the declaration of your total_overflow to main instead of having it global and set it to 0 straight away.
int main(void){
uint16_t total_overflow = 0;
(...)
while(1){
(...)
EDIT2: Sorry, disregard first edit as I didn't see you increasing the variable in interrupt context. |
H: Do serially connected diodes share equal reverse voltage?
If I place three cheap 200 V rated diodes across a 500 V supply instead of one expensive diode, is the system guarantied to work correctly?
My worry is the situation at which two of the diodes share 150 V and the remaining 350 V appears on the other diode, bringing out the holly smoke. Would something like that happen?
simulate this circuit – Schematic created using CircuitLab
AI: No, the voltage does not distribute equally.
The reverse leakage current for diodes is not a carefully controlled parameter, and can vary substantially from unit to unit, even from the same manufacturing batch. When placed in series, the diodes with the lowest leakage current will have the highest voltage across them, which will cause them to fail, which in turn will apply excessive voltage to the remaining diodes, causing them to fail as well.
The usual solution is to put a high-value resistor in parallel with each diode. Select the value of the resistor so that the current through the resistor (when the diodes are reverse-biased) is about 10× the worst-case leakage current of any diode. This means that the reverse voltage that appears across the diodes will not vary by more than about 10%.
Note that this still means that you need some margin in the ratings of diodes. For example, for 600V of peak reverse voltage, you should use four 200-V diodes, not three.
There is another phenomenon that comes into play as well. The diodes will not all "switch off" at the same speed when going from forward bias to reverse bias. Again, the "best" (fastest) diodes will fail first. The solution for this is to also place a capacitor, about 10 to 100 nF, in parallel with each diode. This limits the risetime (dV/dt) of the reverse voltage, allowing all of the diodes to switch before it rises too high. |
H: Correct use of diodes in car stereo
Could I check my use of diodes in the following circuit?
I'm wiring a new car stereo head unit into my motorhome (RV).
I'm going to use most of the standard radio harness connections. However I would like to run the 12V power from the leisure battery so we can listen to the radio whilst parked up without the engine on and not drain the main battery.
The question I have is around the wire going into the head unit from the ignition circuit to turn the radio on when the ignition is on. I want to add to this a separate connection from the leisure battery with a separate switch. I want the radio to come on when I either turn the ignition on or switch the leisure battery switch.
I was going to use two diodes so that the leisure battery didn't interfere with the ignition circuit.
Have I got my wiring correct?
Will single 6A diodes do the job?
Thanks
AI: As it is difficult to determine exatly how the batteries are charged from the alternator it is not possible to be totally certain what would be the best way to proceed. If there is a double (diode bridge) output alternator or some other existing battery disconnect system then diodes later may not be needed as the head unit could connect to the Aux battery all the time and if this runs flat you would have to start the engine to charge it and this may automatically connect the two batteries already.
If you want to operate it from the main battery with engine not running you couldconnect the ACC line to control a relay that will supply Main power (NO) to the head unit (COM) when the ignition is on and then feed from the Aux battery (NC) when the ignition is off. You will have a power glitch when you cycle the ignition.
If the batteries are connected together at the alternator then none of the extra stuff afterwards realy matters as both will drain together.
You can have a look at the large selection of solutions that have been invented for your situation in the list of pictures blow. There are smart products and DIY solutions, some of those solutions will not work and you can ask here if you want to confirm a specific case. The important thing is to establish how the two batteries are currently separated from each other at the moment when not charging and if the second battery would be nice to have available for starting if you let the main battery run flat with the headlights illuminating your campsight.
Some of these are intended for high currents and others for slower charging only. Some will sense the main battery voltage and only hook up the other if the main battery if mostly charged.
https://www.google.fi/search?q=dual+battery+caravan+OR+rv+controller+-solar&client=firefox-a&hs=dWl&rls=org.mozilla:fi:official&channel=sb&biw=1366&bih=673&tbm=isch&tbo=u&source=univ&sa=X&ei=cz5OVKyLCsm-ygO4koLoCA&ved=0CFMQsAQ#rls=org.mozilla:fi:official&channel=sb&tbm=isch&q=dual+battery+caravan+OR+rv+relay+-solar&imgdii=_ |
H: What is the drawback of a high-value resistor for positive comparator feedback / hysteresis?
I'm building a simple circuit which has an LM211 comparator at its heart. The positive input is connected to a 10k-10k resistor divider across the supplies, stabilized by a 1uF capacitor. Hysteresis is provided by 1.8MOhm from the output to the positive input.
The signal on the SENS line is a slowly changing resistance hooked up to +5V on the other side.
Everything works perfectly on a breadboard, but I wanted to check a few things before finalizing the board layout, and came across a TI application note which says in paragraph 6:
It is a standard procedure to use hysteresis (positive
feedback) around a comparator, to prevent oscillation,
and to avoid excessive noise on the output because the
comparator is a good amplifier for its own noise. In the
circuit of Figure 2, the feedback from the output to the
positive input will cause about 3 mV of hysteresis. However,
if the value of Rs is larger than 100Ω, such as 50
kΩ, it would not be reasonable to simply increase the
value of the positive feedback resistor above 510 kΩ.
However, it doesn't say why a high value feedback resistor is "not reasonable". I built up my circuit on a breadboard, and it seems to work fine, I can definitely see good hysteresis behaviour with the 1M8 resistor as compared to without it.
So, what is the drawback?
AI: Olin is right about the problem with C23: it lowers the bandwidth of the positive feedback rendering it useless. Just decoupling the supply close to the divider will do the job.
In fact, that is probably also the reason why TI wants to keep the feedback resistance low in value. If the value is too high, the input capacitance of the op-amp alone will already lower the bandwidth of the positive feedback, so on a noisy signal the hysteresis will not work. Normally you would like the hysteresis to be faster than the response of the op-amp; this will be probably be the 510K TI talks about.
If you make sure the highest (noise) frequency that can reach the negative input will be lower than the feedback response, you should be in the clear; however, making the feedback faster then the op-amp can react will be the better option. |
H: How to "push buttons" on voltage ladder?
I have a quite simple task I can't wrap my head around. I have an old home 5.1 sound system with optical input that plays sounds from my media center. Its remote broke, and while I tried to fix it, I understood how much I hate having one more remote on my desk.
I'd like an microcontroller to "push" the required sequence of buttons to wake sound system up and make it switch to desired AV2 audio input.
I found service manual with schematic in PDF, it appears that buttons are just a "voltage ladder":
The device guesses which button was pressed by measuring the resistance (ranging from 200 Ohm to 1K). In theory I can easily solder 2 wires and apply the required resistance between them myself.
The problem is that I don't really know how to do that.
Do I need to make an array of transistors with similar resistors and close the circuit through required resistor one at a time? But won't the voltage drop on a transistor make this approach impossible?
Or should I use some form of analog output (PWM + "low pass filter")? But won't the voltage of my microcontroller fry the circuit of the audio system?
I can fit a relay board inside, after all, but it is stupid.
Please point me in the right direction.
(as far as I can understand, the circuit operates on 4.8V)
AI: You have many options open to you, depending on a) how small and discrete you want it to be, and b) what your level of expertise is.
The simplest method is just to use some devices to short out the buttons thus emulating a button press. Options include:
Small reed relays
NPN transistors
Opto-isolators
A more complex option is to replace the whole board with a digital potentiometer. The voltage seen at KEY1 is determined by the ratio of R873 to a combination of R837, R844, R849 and R860. It's basically running as a voltage divider. You can use a digital potentiometer to replace all those resistors and buttons and just set the required resistance to get the right voltage at that pin. You would have to calculate the voltages each combination of resistors would equate to and ensure that the digital potentiometer (or combination of digital potentiometers - you can chain them together to increase resolution) can give an accurate enough voltage for it to be seen as the correct button press, and that very much depends on the device reading the buttons.
Simplest would be little reed relays - fairly discrete and simple to wire up. |
H: XMega bootloader - How to make use of the functions in assembly source file
Its been two days I'm trying to write a Bootloader for ATXMega32E5. The Atmel studio doesn't have boot.h header file supporting XMega.
As a result of searching and googling, I found two ASM header sp_driver.S and sp_driver.h. Even after the two readings and trial, I couldn't find how to use that asm functions in the embedded C code.
If someone came across this way, do help me in creating a bootloader. Or to create a makefile linking the source and header with the C file. That way I can call the functions and I will make my own bootloader
AI: The functions in the assembly file are just like any C functions that get linked by AVR-GCC when you include the sp_driver.S and sp_driver.h files and call those functions from your bootloader code. For instance, put this in your main code's header file:
#include "sp_driver.h"
and then call any of the functions from sp_driver, e.g.
SP_EraseApplicationPage(Address);
SP_WaitForSPM();
Make sure the sp_driver.S is included in the compile list so the compiler and linker can find it. |
H: Turn 9V device off using 3.3V logic level signal
i'm facing the problem to turn a 9V (battery) powered device OFF using the output of a 3.3V based microcontroller. To do this i already threw together the following circuit (which works - assuming i drew it correctly...) EDIT: oops, the pulldown resistor R5 should of course not be 220ohms but something bigger.
The device I have to switch off is represented by LED1 and the digital Output from the microcontroller by switch S1. The problem this circuit gives me is the high voltage drop of about 1V which would probably toggle the device to battery-low mode. Is there any alternative circuit i can use that has a very low voltage drop? And also, the design should be "fail safe", so the microcontroller could die/become unresponsive/whatever and in most cases the device will still be functioning like in my example above. Thanks
AI: Change your load-driving PNP for a P-channel MOSFET. Also, you want a pull-up resistor on the gate of that MOSFET to ensure it switches itself off when the NPN switches off.
The NPN should also really have a pull-down on its base to keep it off when its input is HiZ or disconnected.
This is a circuit I use all over the place: |
H: How long does analog to digital conversion take?
I am analyzing Voltage signals from many channels which have passed through a multiplexer for analog to digital conversion, before reaching the computer. I am wondering how long the conversion takes, and whether there is a correction applied i.e. interpolation of the digital signal to give exact correspondence in time across signals.
Perhaps the answer is device-specific although I would have thought that someone might know roughly how long it takes per signal...
AI: There are a number of different types of ADC available on the market, using vastly different technologies.
How long a conversion takes depends on the technology used.
The three most common types you find these days are:
Successive Approximation
These are the most common type found in microcontrollers and similar devices. The speed is governed by a clock - often an incoming communication clock for external SPI or I2C controlled ADC chips - so the speed of them is usually limited to the speed of the communication bus. It usually takes as many clock cycles to capture a value as the sampling resolution, so a 10-bit ADC would take 10 clock cycles to sample. Typical rates are in the hundreds of Ksps up to 1.1Msps in some MCUs.
Sigma Delta
These are higher quality than the SAR ADCs above, but a lower speed. They are usually used in audio applications, such as the line-in on your sound card. They take multiple samples then average them (over-sampling) to create a higher resolution value than is actually sampled.
Flash or Direct Concversion
These are the big boys. They grab a value and directly convert it in one clock cycle into a binary value. They are fast - very fast - and consequently are also expensive. They are the kind of ADC used in things like oscilloscopes, video processing systems, etc. They can sample in the multiple Gsps range.
So how fast your ADC is depends on what type you are using. |
H: Area under Dirac Delta function
What is the difference of the area calculation for the Dirac delta function when using different limits of integration?
$$\int_{-\infty}^{\infty}\delta(x)dx = 1$$
but
$$\int_{-\infty}^{t}\delta(x)dx = u(t)$$
AI: When integrating to only \$t\$ there are two cases: if \$t < 0\$ then the integral is \$0\$, if \$t \geq 0\$ then the integral is \$1\$:
$$\int_{-\infty}^{t}\delta(x)dx = \begin{cases} 0\text{, }t < 0 \\ 1\text{, }t \geq 0\end{cases}$$
But this is just another way of writing the unit step function \$u(t)\$ so
$$\int_{-\infty}^{t}\delta(x)dx = u(t)$$
Since $$\lim_{t \to \infty} u(t) = 1$$ then it is also true that
$$\int_{-\infty}^{\infty}\delta(x)dx = 1$$ |
H: What was the crysistor?
I'm reading through Jim Williams' "Analog Circuit Design: Art, Science and Personalities", and a mysterious component called a crysistor is mentioned. There are a few clues in the text, like the fact that it was a superconducting magnetic memory that "showed promise of revolutionizing the computer world". I can't find any reference to the crysistor aside from this book. What was the crysistor and how did it work?
AI: I suspect it might have been the conflation of cryosistor (a completely different germanium cryogenic unijunction-like device that worked on the principle of impact ionization) and crytron (not to be confused with the krytron which is used to make loud noises).
I think he was referring specifically to the crytron and got the name mixed up a bit in his memory.
The chapter is not error-free (for example, it refers to "new low-temperature superconductors" which would not be an advantage, especially compared to liquid helium).
Here is the actual quote, courtesy of Google books:
The IBM paper describing the crytron which I linked above was published in October of 1957, so it would have been fresh news in 1959 when Mr. Wilensky graduated. |
H: Can I put 2 voltage regulators (5V) in parallel to dissipate the heat better?
I connected around 10m of christmas light LEDs to a 5V voltage regulator (lm7805). It gets quite hot, put I can still touch it without burning my finger. So in is within its temperature range (120 C max). It's a self regulating voltage regulator so I am not affraid of it burning itself.
But to ensure that my christmas tree wont burn, can I put 2 regulators in parallel to dissipate the heat better?
AI: No, but depending on what your power source is you may be able to do 2-stage regulation to spread the heat - for instance, if your source is 12V then lower it to say 9V first with a 7809 then drop it from 9V to 5V with the 7805. If you're even higher than that, then you could use a 7812 first to drop to 12, then the 9V, then the 5V.
Either that or just use a switching regulator, such as a UBEC used by RC vehicle enthusiasts (available for a couple of $ from eBay or most RC model shops). |
H: Identifying two 6 pin SMD packages
I need some help identifying these 2 SMD parts. One says .3Ft and the other says .1Ft. They each have 6 pins.
They are found on a DCC decoder for model trains.
AI: Sometimes googling SOT23 and the marking works!
This time it got close enough to identify the package as a SOT363.
Apparently they are simply transistors - the BC857 and BC847. See the section "Marking" on page 2 of each datasheet. |
H: Where to simulate and test Microprocessor designs?
I'm reading book on computer architecture by Patterson and Hennessy. Now I'm much interested in designing a real-time working microprocessor. But i didn't have any idea where to start from! I started to learn VHDL so suggest me something from where i can design processor from gate level and implement it on real working hardware.
EDIT: Since I mentioned that I'm a bit familiar with VHDL so simulation using VHDL will be more easy. But what i am actually concerned is that if VHDL simulates my design perfectly will this design also work well on real time hardware(FPGA Board)? What are the precautions to be taken to ensure same OR is there any other software(tool) which is more nearer to reality and considers most of real time challenges in simulation?
To be more specific i want to know how engineers at Intel, IBM, Tilera or AMD design, simulate and verify their Processors designs? What are those techniques and processes?
AI: This is pretty much what VHDL & Verilog are for! These languages allow behavioral description of digital systems (and yes, also structural). Both languages share many similarities however I am only familiar with VHDL so my answer is based on that.
A hardware description language allows you to define a certain behavior or structure of your digital system accurately according to various real time limitations you will encounter at the chip level. The language is hierarchical in its approach to design which is similar to the way a system designer would approach such a task (using abstraction levels). You can describe the most simplest digital building block of your system, with the real time constraint you will have, and use it together with other components to create a higher level design and on turn, use that one for a higher level design and so on. Coding in this style will allow you to simulate your final chip in a level which is low, however above above the electric level (this is no SPICE).
I saw someone mentioned an FPGA and here is a tricky part about HDL where a newcomer might mistake writing code that is for simulation purpose vs. writing code which is for compiling and execution on an FPGA. These are two different things and code that is meant for simulation and have "artificial" constraints is code that is usually not fitted for running on an FPGA and it won't compile. VHDL is a complex language and it can do many things being so powerful, writing code that you can download can be viewed as a subset of the language and this is not exactly what you are after. You can do that, and see that everything works but this will be of little help when in comes to the actual chip design. |
H: Finding equivalent capacitance
How do you find capacitance when the switch is closed, and how do you find it when it's not? Our professor just skipped this. You would help a lot of people!
simulate this circuit – Schematic created using CircuitLab
AI: Here's how the topology morphs: |
H: I'd like to improve this design to support ICSP
I'm new to electronics and this is my first circuit. I have some questions about implementing ICSP in this design. This is a bit of a long post with quite a few questions so I'll apologize in advance for its length. Unfortunately I don't have a mentor who I can ping questions off of so any help is greatly appreciated!
I'm using an Atmel ATtiny10 microcontroller to drive an RGB LED.
The circuit is powered by two 3V CR2032 batteries in series which provide 6V.
The batteries are connected to a fixed-output voltage regulator which converts the battery power down to 5V for the ATtiny.
Three of the ATtiny's four I/O pins are connected to the LED's three anodes via current-limiting resistors (the fourth MCU pin is unused with an internal pull-up resistor enabled).
So far this is pretty basic stuff, and it works on a breadboard.
I'd like to add ICSP functionality so I can program the ATtiny in-circuit when this is moved to a PCB (for initial loading and later if I want to modify my firmware). Here are my questions:
Q: What is the best/preferred way to supply power to the ATtiny during programming (my programmer is an Arduino and not the expensive dedicated programmer from Atmel)?
There seem to be two options:
Supply power through the existing battery+voltage regulator components, or
Supply 5V via the programmer directly to the VCC pin on the ATtiny via a header/ICSP pin.
Q: If I go with option 1, do I need to be concerned about isolating the circuit from my programmer/Arduino? The Arduino is powered by a USB connection from my computer and I don't want to fry it. If I do need to be concerned about power isolation here, how is it done?
Q: If I go with option 2, I believe I'll have to put a Shottky diode between the regulator's Vout and the ATtiny's Vin to prevent current from going the wrong way into the regulator (i.e. from the programmer to the regulator's output pin).
A diode here seems to present a number of problems:
It adds an extra cost to the circuit.
It adds another part consuming battery power.
The voltage drop across the diode will cause the ATtiny to see less than 5V at its Vin, which is probably undesirable (due to clock destabilization).
Q: Are the concerns I just listed about the diode all valid concerns? I haven't designed anything with a diode yet so I don't have any experience with operational practicalities.
Q: Is there a different/better way to get power to the ATtiny for programming that I haven't thought of?
Q: Two of the pins used for programming the ATtiny will also connect via the resistors to the LED. What steps should I take to isolate the programmer from the LED?
I ask about this because I've tried to program it with the LED connected and the programmer usually hangs (you can see in the schematic where I connected the programmer, to nets PB0 and PB1). I had hoped the resistors between the pins and the LED would be enough to isolate the LED but it doesn't seem to do the trick. Disconnecting the LED allows the programming to succeed, however I won't be able to disconnect it once everything is soldered to a PCB.
Q: In a very general sense, what steps are usually taken by ICSP designers to isolate pins that have to be dual-purposed for programming as well as circuit control?
Thank you!
AI: A few things about your basic circuit before I address your specific questions.
i. Every IC needs a decoupling capacitor. For this circuit, that applies to the linear regulator and the microcontroller. For the microcontroller, as with most ICs, a 0.1uF capacitor between VCC and GND is typical. The capacitor should be as close as possible to the physical pins of the chip. The linear regulator takes a little more thought. Most regulator manufacturers will specify what kind of capacitors and what value to use on the input and output. This particular one does not, but they do provide a test circuit that should be good enough for your purpose:
ii. Every kind of linear regulator has a "dropout voltage" (VDO). The dropout voltage is the minimum difference in voltage between the input and the output. Your L78L05 has a dropout voltage of 1.7V. That means the minimum input must be:
$$V_{INmin}=V_{OUT}+VDO=5V+1.7V=6.7V$$
Your 6V battery pack is less than 6.7V, which will not allow the regulator to regulate to 5V. Instead, you'll get something closer to 4V. That may not be a problem for this particular circuit, but you should be aware of that. There are plenty of linear regulators available with much lower than 1.7V VDOs.
Now on to your specific questions.
It normally doesn't matter where the microcontroller gets power during programming, as long as the power source is clean and stable. So either supply the power from your battery pack or from the programmer itself. But only choose one. If you leave the battery pack connected while enabling power from the programmer, they may conflict with each other. Whichever voltage source is slightly higher will try to push current into the other one, which won't make either one very happy. My recommendation would be to power the circuit off the battery and not the programmer. That way you don't have to keep removing the battery every time you program the board.
One possible complication here is if your circuit contains high-current components that might activate during programming. It is likely the programmer will not be able to supply enough current to keep the voltage stable if there is a lot of current draw from elsewhere. In a situation like that, it would be required to use your own power supply during programming.
You don't need to isolate the programmer when using the battery as long as the programmer's voltage supply is off. The only stipulation here is that the ground references of your circuit and the programmer are tied together. Otherwise, no special isolation is necessary.
If you do use the programmer's power, putting a diode on VOUT isn't a bad idea, but in may not be necessary. Unfortunately, the datasheet for the L78L05 does not give a absolute max voltage on the VOUT pin relative to the VIN pin. However, I have routinely applied external voltages to the output pins of unpowered linear regulators without a diode in between without problems. Without a specification in the datasheet, it's hard to know for sure. But I don't suspect you'll have a problem.
Yes, those are all valid concerns about adding a diode.
If you use the battery pack for power instead of the programmer, there are no more concerns.
Using resistors to isolate the other components from the programmer's pins is a common approach. However, you still need to be aware of how much current might be drawn from the programmer's pins. When a pin on the programmer goes high, the LED will light up. With a 100 Ohm resistor, a 2V LED may sink 30mA (\$(5V-2V)/100Ohm = 30mA\$). That's probably way more than the programmer's data pins can source. That's undoubtedly why the programmer is hanging up.
Since you can't make the resistors any larger without making the LEDs dimmer, you can use digital buffers to remove the load on the programmer pins completely. Other types of components may need different types of isolation circuitry. But resistors and buffers cover most situations.
simulate this circuit – Schematic created using CircuitLab |
H: How to toggle a reset in a counter made up of JK flip flops
I have been playing around with a small circuit which at the moment consists only of a counter made up of 3 JK flip flops. Like so:
What I want to add is a reset input pin that will set the 3 LEDs to 0/off but I am not sure how to implement. I know that you need to input a 0 for the J and a 1 for the K to trigger the reset behaviour but this is what I am struggling with.
Any ideas would be very appreciated.
AI: Brhans' comment is correct, most JK flip-flops have either Reset inputs or both Reset and Set inputs. Interestingly, the JK flip-fl;ops provided in the CircuitLab editor don't have Resets either.
The following circuit should do what you need:
Right-click and select View Image for a large picture.
It took a fair amount of logic (three pairs of AND/OR gates) to steer the clock from its counting configuration to the one needed to reset the flip-flops. For testing, I used a 1 Hz clock.
The K inputs are always at 1 (+5v), the J inputs are 1 or 0 (ground) depending on the state of the reset pushbutton. When it is not depressed, the line going to the J inputs is pulled high by the 4K resistor.
I am showing just a simple switch for the reset, which is not debounced; in a real circuit this would probably be a logic output from some other part of the cuircuit.
The three NOT gates are to provide a short delay (ns) so the J lead is pulled to 0 before the clock goes from 1 to 0, clocking the flip-flops.
I simulated this in CircuitLab and it seems to work well. |
H: Using diodes to mix 2 audio signals into one set of speakers
I have the audio output of 2 computers connected to only one set of speakers.
Each computer uses one of these external USB sound cards:
And I use this splitter cable to wire the signals together:
The whole thing works, but with some minor problems:
There's a little bit of noise when the speakers are set at max volume
One audio signal sounds a bit louder than the other
When recording the microphone input, sometimes the audio output of the other computer becomes the mic input
So obviously the two signals are interfering each other and also each signal finds its way into the other sound card because the splitter cable is meant to be a splitter and not a mixer.
So I thought if I could solve this by adding diodes to each side of the splitter cable so that each audio signal goes to the speakers only and not to the other sound card.
Will this idea work?
What kind of diode should I use for that?
AI: As mentioned in the comments, diodes are not the way to go. They will massively corrupt your audio signal, and it will just sound utter rubbish.
The simplest method is to use a passive mixer. That simply consists of two resistors per channel:
simulate this circuit – Schematic created using CircuitLab
You can tie all the ground wires together without resistors.
This of course is assuming you are using a powered speaker set, and not just raw speakers. |
H: Arduino controlling high voltage DC source, Opto-Isolator
I need to create a circuit that I can use an Arduino to control a 400~500 DC voltage source.
I am not used to opto-isolators, but I was thinking about using it to separate both systems. But I cant seem to find one that can handle 500V DC in the Vcc port.
My thought process(I am not sure how to create and opto-isolator, so assume the LED and transistor in the middle are the opto-isolator):
If you guys know a better way to completely separate both systems please give me your input.
BTW the current is very low, below 1mA.
simulate this circuit – Schematic created using CircuitLab
AI: If response times in the ms are acceptable, you could use an optically coupled pair of back-to-back MOSFETs such as the CPC1393GRTR.
This particular one can switch 600V at up to 90mA, with maximum on/off times of 5ms and maximum 'off' leakage of 1uA. It would typically drop less than 100mV at a few mA.
Isolation voltage input-to-output is 5000V claimed, you'll have to evaluate if that's safe enough for your application. |
H: Why does Ethernet on UTP have much greater range than other modern protocols?
OCuLink, SATA, USB 3, and Displayport all provide on the order of a few Gbps per signaling pair, and are limited to a cable length of just a couple meters. Ethernet via comparable cabling provides comparable speed, but 50 times the length! For example, 10GBaseT over cat6a can do 100m. What accounts for that extreme difference?
I'm asking in electronics rather than networking since this is a physical link issue, not a networking issue.
EDIT: although latency doesn't appear to be the explanation, people have brought it up, which gave me an idea: why don't all high-speed wired protocols incorporate a latency measurement upon connection (with an upper limit of 200ms for all practical purposes), and add some fixed number of clock cycles to that measurement to establish the retry timeout value for the duration of the connection? Then the timeout is never set higher than necessary, yet all connections ranging from one meter to thousands of kilometers can be accommodated without being limited just by latency. Noise measurement and cancellation, adaptive rate, etc to achieve high speed at long range are more complex, and unnecessary for protocols designed for a few meters or maybe a few tens of meters, but just latency measurement seems very simple and worthwhile, and would avoid arbitrary latency limits like in USB 2 yet without requiring standardizing on an excessively high timeout limit. It just requires a ping, then count the clock cycles until a reply is heard. (To avoid silly misunderstandings: I don't mean ICMP ping; I mean a PHY-to-PHY ping.)
AI: First, the technocal answer:
For one, USB3 and SATA both use thin stranded twisted pairs (USB3 spec states to mak the cable 'as thin as possible', with 26-34 AWG given as example). 10GbE uses four solid relatively thick twisted pairs (23 AWG minimum). The thicker and solid strands create a larger surface area which in turn means lower resistance to high frequencies (which travel on the our layers of the wire due to skin effect).
Secondly, SATA is designed as a disk interface. It doesn't need to be able to exceed the disk's performance. USB is limited by the fact that USB doesn't support DMA (direct memory access) so for higher speeds, the peripheral's CPU becomes a limiting factor.
Ethernet is designed to use dedicated hardware supporting a multi-point to multi-point topology. It needs to sustain data rates far over that required from a single station. It is therefore also much more expensive.
Lastly, delays become a significant factor at these speeds. Ethernet however is specifically design for a high-latency, lossy medium and as such can deal with long cables. (S)ATA is the exact opposite - to deliver maximum performance latency needs to be kept to a minimum.
Costwise, ethernet requires the use of magnetics for galvanic seperation. This is important because the longer cables mean you cannot use a common ground between systems. Since the magnetics (basically transformers) are phyisical devices that cannot be implemented on pure silicon, they are expensive. A complete Ethernet PHY will cost a couple of dollars minimum, while a USB chip can be made for a few cents. For DSL, the story is similar.
In summary, it isn't the cable that is necessarily the limiting factor (although they're designed to cost too).
The non technical, and maybe more 'real' answer is that each technology is designed to meet its specific requirements at a specific time. The physical layer is only a small part of the story.
So why does one support longer distances than the other? The answer is 'because they're designed that way'.
It all comes down do 'design to cost / requirements'. The main reason so many different transmission protocols exist if because there is 't one that meet all requirements for everything. As such, companies design new systems that meet all their requirements, but one other. Yes, it would theroetically come up with a single system that covers 90% of everyone's needs, but that then immediately means the companies can't make money on their own proprietary systems. Furthermore, anything you can come up with will be out of date in a few years. |
H: Finding equivalent capacitance part II
Here's part I!
They helped me a lot. But this problem is harder so if you can tell me where, if, I went wrong.
When first switch is closed, the other one's opened. And in reverse.
Here's solution one.
Here's solution two.
P.S. Series come before parallel, right?
AI: Neither of the solutions is correct, I think that the arrangement misled you.
I've rearranged the capacitors. Does it help in calculating the total capacitance?
The trick is, figure out how the current flows from A to B, where it branches and where it merges again.
Case 1
simulate this circuit – Schematic created using CircuitLab
Case 2
simulate this circuit |
H: What is Vcc-2 referring to in the Texas Instruments Tech Sheet for the SN74AS138?
Total noob here.
The tech sheet can be found here: http://www.ti.com/lit/ds/symlink/sn74as138.pdf
In the VOH parameter for the SN74AS138 on page 5, it states that it's MIN is VCC-2.
What does that mean? What is referring to? Is it referring to the actual VCC minus 2 volts? So 2.5V for VCC = 4.5V?
Here's the snippet I'm talking about:
AI: It is a simple sum.
It refers to the output voltage when an output is HIGH (\$V_{OH}\$) as a minimum (it's in the MIN column) of 2 volts below \$V_{CC}\$, so if \$V_{CC} = 5V\$ then \$V_{OH}\$ will be at least 3V.
For CMOS you will often see something like \$0.6V_{CC}\$, where the value is 60% of the \$V_{CC}\$ value. |
H: How can I achieve symmetrical analogue low-pass filtering?
I am experimenting with VCFs for an analogue music synthesiser. Initially I tried a 3-stage low-pass filter based on the sinewave-generator circuit in the LM13700 datasheet but having removed the oscillator, as per schematic below:
I find that its effect on a squarewave, as the filter frequency is swept, is not symmetrical. A series of scope traces shows the effect of the sweep:
If the low-pass filter is meant to attenuate higher harmonics, I would expect to see the square soften to a sine whilst retaining its symmetry. Using a Max293 active switched-capacitor filter does give a more symmetrical sweep (ignore the apparent clipping, it's due to the input running to the rails):
Question:
Can anyone explain in simple terms why these filters have different effects on the waveshape symmetry (I assume it's something to do with phase shift in the analogue circuit) and whether the asymmetry can be avoided by using a different analogue design rather than having to use an active filter (with its associated downside of the clock frequency breaking through)?
Thanks
AI: The two filters have similar amplitude responses, but different phase responses. In other words, different harmonics of the original square wave are being delayed (phase shifted) by various amounts by the first filter, but they have a more nearly constant delay (linear phase shift) in the second filter.
While the two waveforms look very different on an oscilloscope, they do actually have essentially the same harmonic content, and will sound very similar if not identical to the ear. Human hearing is actually very insensitive to phase relationships of this sort.
It's relatively difficult to build linear-phase filters in the analog domain, while it's quite easy to do in the digital domain, particularly with an FIR filter. But you need to decide whether the results differ enough in your application in order to make the effort. |
H: What to do with unused pin?
I am designing the Vishay VCNL4010 proximity sensor into one of my PCBs. This sensor has an interrupt pin that I don't need to use. Is it OK to just leave this pin floating ("unconnected"), or will this cause problems somehow?
AI: Normally I'd say it won't be a problem: it's an output pin, so it won't be floating as the device itself will drive it.
However, if we look at the datasheet, page 5, first note:
The interrupt pin is an open drain output. The needed pull-up resistor may be connected to the same supply voltage as the application controller and the pull-up resistors at SDA/SCL. Proposed value R2 [a pull-up for the INT pin] should be >1 kΩ , e.g. 10 kΩ to 100 kΩ.
Proposed value for R3 and R4, e.g. 2.2 kΩ to 4.7 kΩ, depend also on the I2C bus speed.
For detailed description about set-up and use of the interrupt as well as more application related information see AN: “Designing VCNL3020 into an Application”.
If we look at this application note, Designing VCNL3020 into an Application, page 2:
The SCL and SDA as well as the interrupt lines need pull-up resistors.
I suppose that this is only needed when this line is actually used. However, it's always good to follow the datasheet, and that extra resistor will still fit in your circuit, hopefully. So I'd recommend you to use a pull-up resistor between 10kOhm and 100kOhm (as suggested in the datasheet excerpt) to the input voltage. |
H: Why is there a separate Floating Point Units in some micro controllers
I would like to know why there is a separate FPU peripheral in some high end micro-controllers even if the small end 8 bit controllers can perform float calculations on their own.
I tried experimenting with a float division on a pic 18 controller which does not have an FPU (Majority of 8 bit family does not have an FPU)and found out by debugging(ICD 3) that @48 mhz clock a simple division of float variable takes minimum 800+ clock cycles.
I don't have a controller with FPU on my side as of now to test with.But still I
would like to know what effective difference and edge does the addition of a FPU
make or provide .
AI: While FPU are typically slower than the main CPU, they are much faster in calculating with floating point because they use hardware implementation of the floating point operators. In order to better understand what happens, consider that a floating point operation consists of several steps.
For instance, an addition is roughly:
Comparison of the exponentials;
Scaling of the significand according to the exponentials' difference;
Sum of the significands;
Rounding of the resulting significand;
(possible) adjusting of the result's exponential.
Note that these operations must be performed separately on a fixed-point CPU, and each may take more than one cycle to be computed.
If you design a dedicated unit that can in part parallelize these operations (e.g rounding and adjusting the exponential), you can save significant computation time. |
H: Does this linear current source driver deliver constant current?
I was reading on LED driver designs, and I have a question about the linear current source driver. In the circuit below, will D1 ever turn off when there is too much current through R2? In other words, will D1 turn off when Q1 turn on?
Because the base and the drain are driven by the same voltage Vcc, I am assuming Q2 is an N-Channel MOSFET (and not a transistor). And I can see when Q1 is activated, Q2 turning off because the voltage at the node between R1, Q1 and Q2 would be ~0V (GND).
However, there is no mention of this side effect. Ideally, the circuit regulates current in itself without switching off the LED.
Is my assumption false and does this circuit works like a constant current source?
AI: Both Q1 and Q2 are BJT transistors. That is indicated entirely by the shape of the symbol. Furthermore, they're NPN type BJT transistors.
BJT transistors look like this:
MOSFETs look like this:
This circuit limits to a specific current only if the value of R2 is correctly chosen to correspond to that current. You want the voltage across R2 to equal about 0.7V when the current reaches your specified maximum. When the voltage across R2 reaches 0.7V, Q1 will begin conducting across its collector and emitter. That will drive the voltage at the base of Q2 lower, which will effectively reduce the current through Q2. The more Q1 conducts, the less Q2 will conduct. The combination of Q1 and Q2 acts as a negative feedback system that maintains the current through Q2 at a maximum value or less.
So, for example, let's say you wanted to limit the current through the LED to 50mA. Using Ohm's Law, the value of R2 should be:
$$R_{2}=\frac{V_{R2}}{I_{R2}} = \frac{0.7V}{0.05A} = 14\Omega$$
The magic value of 0.7V is used because that's approximately the voltage that the base-emitter junction begins to conduct on most BJT transistors. When the base-emitter begins conducting, it allows proportionately more current through the collector-emitter. |
H: How can RS-232 DTR / RTS pins be used for power?
I want to interface to this device where (sec 4.2) states
can be powered from the DTR and RTS handshaking lines by having one
high and one low
Also, Wikipedia states:
No method is specified for sending power to a device. While a small
amount of current can be extracted from the DTR and RTS lines, this is
only suitable for low-power devices
I would like to understand how RS-232 allows DTR / RTS to be used as power.
What polarity / voltage levels should be observed?
Can they be permanently wired or do they need to observe a protocol?
I'm particularly concerned that if I just wire DTR / RTS permanently to power then the handshaking protocol will screw up (assuming the device I'm interfacing to observes the handshake protocol).
AI: I am currently using the DTR lead for two designs. Like all RS232 leads, the voltage varies from a minus voltage (unasserted) to a positive voltage (asserted). The voltage range is anywhere from ±3v to ±12v. Frankly, I have never seen a voltage amplitude lower than ±5, and that was from a PC COMM port.
The spec for your device says to power the RS-232 interface using +12v on the DTR (asserted), and -12v on the RTS lead (unasserted), for a total of 24 volts. It says it needs 20 ma. This may or may not be possible depending on the RS-232 interface at the other end.
When I did this, there appeared to be a resistor in series with the line at the other end, which acted as a current limiter. I "harvested" between 5 and 10 mA from the DTR line. Even that caused the voltage to drop a bit.
I suggest testing this out first, by measuring the voltage on the DTR and RTS leads with a multimeter. If they're not -12 volts, you can forgot supplying power this way.
If it is -12v, then put a 1210 Ω resistor across the DTR and RTS leads, assert the DTR line and measure the correspond leads to see if the voltage holds up (+12v). You can assert the DTR line either in software (attribute of the COMM function in the Windows API), or for this test, use a program like RealTerm, which has the ability to control the various handshake leads under the Pins tab in its user interface.
I wouldn't worry about the handshaking; if they are telling you to power their interface this way, then it must not be an issue. |
H: What do the terms "cuts" and "jumpers" mean?
specifically, with respect to the electrical grid.
Here's an excerpt from something that I'm reading that I don't understand:
Switching operations, including applying cuts and jumpers, can be operated in ganged (all phases in one operation) or un-ganged (one or more selected phases) mode.
AI: The context appears to be switching of a power grid while troubleshooting and repairing things.
In that context, a 'cut' might be where you physically cut a conductor (as a prerequisite to repairing it with a new bit of conductor.)
A 'jumper' might be where you temporarily connect two conductors which aren't usually connected, for the purposes of working around a fault.
The software in question seems to be for monitoring the status of a power system in real time, so that the grid operator can tell which bits of the grid are alive (not safe to work on), and which bits are dead (safe to work on). Tracking 'cuts' and 'jumpers' would be important as they are very temporary by nature, and might not be well tracked by software which has a fixed model of switching locations. |
H: Can I just connect two CR2032 batteries in parallel?
I'm designing a device with a small current draw that will mostly sleep in a very low power mode and I need to use button cell batteries due to a limited thickness. I would like to double time between batteries needed to be replaced by using two or more CR2032 batteries connected in parallel, can I just connect them in parallel directly or do I need additional circuitry to prevent charging or discharging one battery from others while the device is sleeping?
AI: If this is for mass production, then no, you cannot do this. It is never recommended to parallel primary (non-rechargeable) batteries. The reason is that if a charged one is connected to a discharged one, the current will flow into the discharged one, and charging primary cells is a big safety no-no.
If you can devise a circuit method to prevent charging of the cells under all circumstances, then you can do it. (For example, maybe you can accept the voltage drop of a Schottky diode). But otherwise, use a higher capacity button cell. There are many varieties out there.
If you are just goofing around at home, then by all means go ahead. But you should make a point of removing both batteries before you replace them. You might consider adding a resistor in series with each battery to limit the equalization current, just in case you accidentally put a fresh one in parallel with an old one. |
H: What's the difference between CC2564 and CC2564MODN bluetooth TI chips?
As per title,
what's the actual difference between these two chips?
I dug extensively the TI site but I cannot find such info..
AI: The CC2564 is Bluetooth 4.0 compliant. The CC2564MODN is Bluetooth 4.1 compliant.
... Fully Compliant with the
Bluetooth 4.0 Specification Up to the HCI Layer
versus:
Fully Certified Bluetooth 4.1 Module
Compliant Up to the HCI Layer |
H: Fastest time a PIC can set and clear a pin
What is the fastest time a microcontroller (PIC16 in this case) can be set and cleared? It is defined by the frequency, but I don't know the formula to calculate the fastest time that a single pin can be set and cleared.
Assuming the frequency (XTAL) is 20MHz, and there are no delays in between, what is the time needed for the pin to be set and cleared?
For example:
RB2=0;
RB2=1;
RB2=0;
What is the time that RB2 is high?
AI: It depends on the particular PIC, since some PIC's can execute one instruction per cycle, and others for example, execute one instruction for every four cycles of the system clock.
Although the OP asked for info re a 20 MHz PIC16, since that has already been addressed, I am showing information for the fastest version in all the different families of PIC's. Where there are significant differences between parts in various subfamilies, like the PIC24F/PIC24EP, and PIC32MX/PIC32MZ, I am showing both separately.
I got the numbers by going onto the Digi-Key website, looking up parts for each family, and then selecting the highest speed. I then pulled up a datasheet on an example part, which also verified the MIPS value.
Family Clock Speed I/O toggle time
PIC10F 16 MHz 4 MIPS 250 ns
PIC12F 20 MHz 5 MIPS 200 ns
PIC16F 20 MHz 5 MIPS 200 ns <--- example in the original question
PIC16F 48 MHz 12 MIPS 83 ns
PIC18F 64 MHz 16 MIPS 62 ns
PIC24F 32 MHz 16 MIPS 62 ns
PIC24EP 70 MHz 70 MIPS 28 ns
dsPIC30 40 MHZ 30 MIPS 33 ns
dsPIC33EP 70 MHz 70 MIPS 28 ns
PIC32MX 100 MHz 100 MIPS 10 ns
PIC32MZ 200 MHz 200 MIPS 5 ns
If anyone has any corrections to make to this table, please don't hesitate to edit it.
MIPS is million instructions per second. I/O toggle time is the amount of time the I/O pin would be either on or off in nanoseconds (ns), and is computed as one million divided by the MIPS number.
All of these processors have the ability to turn an I/O pin on or off in a single instruction. The instructions themselves varies per processor. |
H: Will solder usually connect copper vias on a 2-sided PCB?
I've seen videos where the board is suspended in a solution with an applied voltage to plate the vias, but I don't really have the resources to do that. Is soldering parts a reliable method to ensure a connection on both sides of a double-sided board? Some of the parts sit on the board in such a way that it's not possible to tell if solder melted onto both sides. If this is not a reliable method, is there some other, simple way to connect the vias?
AI: If you don't get your boards electro-plated (the process you say you don't have the resources to do), then you'll have to solder the component pads on the top of your board whenever there's a track reaching them. Solder alone is never enough to ensure continuity between both board sides.
Soldering components on the top layer can be inconvenient at best, or just impossible, depending on the component and the PCB design. For example, headers are easy to access from the bottom, but they usually have a plastic support that gives them mechanical strength and that sits flush on top of the board. DIP sockets also brings problems as they sit flush on the board as well.
Soldering components on the top layer is usually a bad idea because it hinders maintenance. You may assemble your board in an order that lets you access hard to reach pads, but when all the components are placed, you may be left with no access to those pads. In my experience, because these pads are harder to reach, the soldering quality suffers and these solder joints end up being the first to fail.
To work around those problems, I suggest you do the following:
Use a single-sided board whenever you can. Try to place components carefully so that they make single-sided routing easier and try and route all that you can on the bottom layer. I usually change pin assignments if that makes routing easier. If you need to cross tracks, use plain jumpers (I usually use remains of through-hole components for that). I use the top layer to represent the jumpers. Also, plan to use horizontally placed resistors and capacitors as jumpers. I've done just that in the picture below, on ATmega328P pins 2 and 3 - serial TX & RX.
If you can't make a single-sided board for some reason, make sure your tracks only change sides at vias, like in the places marked in orange in the picture below, and not at the component pads. You can then solder a piece of wire on both sides of your board on those vias. I usually use the sewing method (more below). This will make for a much more robust solution than soldering at the components pads.
Make the vias really large (I use 0.07 inch or ~1.8mm). If you follow rule #2 above and only make tracks change sides at vias, those large vias are the only features you'll have to match between both sides of your board. Large vias will also make soldering easier.
You may get away with soldering ceramic capacitors and resistors on the top layer, but I don't recommend that. I'd just re-route the board to try and bring most, if not all tracks to the bottom layer.
As I mentioned above, to make the vias electrically connected, you can use the sewing method, which consists of passing a bare wire through the vias like you were sewing the board (see image below). Then you solder the wires on both sides of the via and cut the remaining wires with a cutter.
(source: youritronics.com)
This was extracted from this other answer of mine. |
H: Metal connector case connection when using a plastic housing
I'm designing a board with 2 SFP connectors and I am not sure what I should connect the cage pins to. The manufacturer recommends connecting the case pins to chassis ground but my product is in a plastic housing.
I read this article but it assumes a metal housing. Should all the case pins be connected directly to ground? Or do I need a local plane under the cage and AC couple it to ground?
AI: The main reason that an SFP connector needs to connect to the chassis is to provide EMI blocking. That is, the cage around the SFP connector forms part of the overall shield that prevents the circuits behind it from radiating.
If you believe your design will not cause radiation even with a plastic housing, there is no particular need to connect the SFP cage to the chassis.
It's probably still a good idea to connect the cage to some circuit ground potential (possibly through a high-value resistor), just to prevent it from being floating metal, which could cause problems of its own, either in terms of radiation or susceptability. |
H: Total voltage towards load?
What would be the resulting voltage in a DC circuit like this:
Where there are three voltage sources, it seems that two are in parallel(20V,5V)
opposing 15V source So would the total voltage be (20V + 5V - 15V?)
Here is the similar circuit but with a load that is at 2 Ohms:
V1 + V2 are together opposing V3 correct?
AI: The way you present the circuit in your question is very difficult to follow. Here are the same circuits drawn in a more logical way. It helps to take some time to draw the circuits in a way that's easier for others to interpret.
simulate this circuit – Schematic created using CircuitLab
Notice that V1 and V2 are not strictly in parallel. The diodes isolate them from each other.
The circuit without a load is a little confusing to solve if you're thinking of ideal components. What happens to ideal voltage sources when you connect them together? Infinities are involved. And it doesn't bring us any closer to understanding what's really happening.
Luckily non-ideal components in the real world makes this a little easier. We know immediately that D1 will not conduct. Whatever the voltage on the cathode of D1 is, it'll be larger that 5V. So we can ignore V2 and D1 in both versions of the circuit.
The anode of D2 is 20V, which is larger than the 15V from V3, so D2 will conduct. Right at the cathode of D2 will be 20V minus the forward drop. That will undoubtedly be more than V3's 15V, so current is gonna flow into V3. In the circuit without a load, one of three things will happen.
1) If V1 and V3 are "stiff" enough, they both hold their respective voltages. The current out of V1 and through D2 will increase until the natural resistance of the physical wire connecting D2 to V3 provides the necessary voltage drop according to Ohm's Law. So the voltage on that wire will actually be a linear function along its length. Physically closer to V1, the voltage will be closer to 20V. Physically closer to V3 will be closer to 15V.
2) If V1 is "stiffer" than V3, the current flow into V3 will elevate its voltage to be closer to V1. In that case, the voltage along the wire will be closer to 20V. In a real world battery, this might make V3 explode.
3) If V3 is "stiffer" than V1, the current draw out of V1 will cause V1's voltage to drop. In that case, the voltage along the wire will be closer to 15V.
The circuit with the 2 Ohm resistor is a little easier. Assuming the voltage sources are adequate, the left side of the resistor will be about 20V minus the diode drop. The right side of the resistor will be 15V.
EDIT:
Based on discussion in the comments, it looks like you're trying to come up with a way to make V1 and V3 cancel each other out so V2 dominates. Since you haven't explained exactly why you're doing this, I'll take an academic approach without regard to practical implications.
Voltage sources will cancel each other out if they're in series and in opposite polarity to each other. And they do not share a common reference voltage of any kind. Therefore, to make V1 cancel V3 and allow V2 to dominate, you would simply do the following. Notice the orientation of V3 relative to V1.
simulate this circuit |
H: Why can't analog video be compressed like digital video (example inside)?
I'm learning the basics of analog and digital TV signals and I came across
this (original link, now gone) short article (see the next page as well).
Why can't analog video signals be compressed in a similar way to digital signals when using MPEG-2 (refer to the article above where they give a basic example of what I understand by MPEG-2)? why can't "repeated" pixels be ignored in analog to reduce the bandwidth usage as in digital?
To see what I mean refer to this question. There you can find the following picture:
Why can't you simply "ignore" (by not modulating it) a line of pixels (assuming it didn't change between frames) and reduce the data signal frequency and therefore the bandwidth usage?
AI: You can compress analog video so it uses less bandwidth, at the cost of quality: slow scan television. Used to transmit live television from the surface of the moon, in blurry monochrome. These days we can have colour HD from the surface of Mars.
It's worth looking at how the various digital compression techniques work in detail, but they all rely on storing previous frames or bits of the current frame and computing based on the difference from the current frame. There are two reasons you can't really do this with analog:
there is no random access, fast, analog memory. The delay line mentioned by Brian Drummond is pretty much the only practical technology for analog memory, and it gives you the same signal at the same speed at a future time.
analog computation is bandwidth-limited and lossy. Gain-bandwidth product limits the extent to which you can speed it up.
Note that every frame of HD h264 decode will involve hundreds of millions of individual arithmetic operations. Encoding even more operations. |
H: Same Priority Interrupt on ARM Cortex M0
I have two two interrupts of the same priority; each has its own interrupt service routine: ISR_A and ISR_B.
When interrupt A occurs, ISR_A executes... what happens if interrupt B occurs while ISR_A is executing? Will ISR_B execute after ISR_A has finished? or will ISR_B never execute?
I am using a Freescale KL25z Arm Cortex M0+ with GCC
AI: The core ARM architecture supports two different types of interrupts - pulse sensitive and level sensitive. (See ARMv6-M Architecture Reference Manual, Section B3.4.1) In either case, if two interrupts happen at the same, or one of them happens while the first interrupt is being processed, the second interrupt will be processed when the first interrupt service routine returns and re-enables interrupts.
The source of a level-sensitive interrupt will stay active until the interrupt service routine clears it. If the interrupt service routine does not clear the interrupt source, a second interrupt will be generated as soon as interrupts are re-enabled. The source can be cleared by reading a data register for instance, or in some cases by explicitly clearing a flag.
The pulse sensitive interrupt will set a flag that will generate the interrupt, however the pulse needs to be long enough for the processor to catch it. If the pulse is not long enough, it will not be caught. The interrupt service routine needs to explicitly clear the flag.
I am not sure what will happen in the case where two level sensitive interrupts happen at the same time and the interrupt service routine does something with the peripheral that will acknowledges both interrupts. An example of this would be a USART driver that was handling both Rx and Tx interrupts. I believe that the second interrupt will not be seen since it is no longer active when interrupt are re-enabled. I am right in the middle of an ARM project and unless someone posts the answer, I will do some testing and edit this answer with the results. |
H: Does modelsim support shift right arithmetic in verilog?
I am using ModelSim PE Student Edition, and I am trying to write a module which shifts right arithmetic. After searching online, and consulting a Verilog textbook, I found to shift right arithmetic I can use the ">>>" operator. However when I attempt to do so and simulate the module, it only does a regular shift ie if the msb is a 1, it doesn't copy 1's into the shifted places, instead it is putting 0's. Below is a sample of what I am doing.
module shifter(
input [31:0] shamt,
output reg [31:0] result
);
reg[31:0] temp;
always@(*)begin
temp=32'hfff00fff;
result[31:0]=temp[31:0]>>>shamt[4:0];
end
endmodule
AI: It does, however you need to make temp a signed value and do not specify the range when using the arithmetic shift. Specifying the range in the arithmetic shift casts a unsigned value.
reg signed [31:0] temp;
always @* begin
temp = 32'hfff00fff;
result[31:0] = temp >>> shamt[4:0];
end
Alternatively, you can cased it as signed with $signed
reg [31:0] temp;
always @* begin
temp = 32'hfff00fff;
result[31:0] = $signed(temp[31:0]) >>> shamt[4:0];
end
Working example(s) here |
H: ATmega128 output compare normal mode. Generating a waveform with ISR
So here are specifications:
-prescaler of 8
-Channel A
-pulse_width is determined by user defined degrees (converted to clock ticks)
-pulse_period is 40000 clock ticks (20ms)
-Normal mode
-Timer3
So we have a move_servo(unsigned degrees) where all it does is convert the degrees to clock ticks and store it in pulse_width. Ok no problem.
Then we need ISR(TIMER3_COMPA_vect). This interrupt is supposed to actually generate the waveform where pulse_width would be high and (pulse_period-pulse_width) would be low (so total pulse length is 20ms).
Now I am not quite understanding how the OCR3A register works. My thinking for the ISR was to have a flag variable so that the first time ISR goes off, it sends pulse_width out of OCR3A, then set flag, next time it goes off it sends off pulse_period-pulse_width (which will be low and is the wait time between each movement of servo) and will set flag to 0 again.
But writing to OCR3A will move servo right? Will my plan work in the toggle mode for normal mode? So every other trip into the ISR sends out the "wait time" which is low so it doesn't move servo?
My question is basically am I on the right track? Or if not can anyone help me understand how to generate a random lengthed pulse followed by a "wait time" waveform in normal mode?
This is ATmega128 again fyi
THANKS!!
AI: In Normal mode a timer does not reset when an output compare matches. Your first value in OCR3A should be the pulse width, and the second should be the pulse period. You will need to reset the timer by hand once the pulse period elapses. And read very carefully all the warnings in the datasheet about modifying OCR3A and TCNT3 while the timer is running. |
H: I keep coming across the term "bubble pushing in logic gates."
Can anyone please simply explain to me what it is? A simple little lesson or answer would be appreciated.
AI: Bubble Pushing(or Bubble-to-bubble convention/ Bubble Matching)
I'm not sure if this what you are referring to, but that's what googling 'bubble pushing' yielded. I've personally never heard this term before.
Bubble pushing is a technique to apply De Morgan's
theorem directly to the logic diagram.
Change the logic gate (AND to OR and OR to AND).
Add bubbles to the inputs and outputs where there were none, and remove the original bubbles.
Logic gates can be De Morganized so that bubbles appear on inputs or outputs in order to satisfy signal conditions rather than specific logic functions. An active-low signal should be connected to a bubble on the input of a logic gate.
According to this, it's just a visual way of performing de Morgan's theorem vs doing it on paper with boolean algebra. |
H: How can I use a greater USB charge current without device enumeration?
I'm designing a device with USB communications, using an STM32F105 microcontroller. It has a LiPo battery, which charges from the USB port using an LTC4077 charge controller. It will generally use a high-current charging port to charge the battery, but will sometimes be plugged into a PC for data communications.
To stay within the USB specification, the charge controller initially allows a charge current of 100mA. If the STM32F enumerates with an appropriate USB host, it asserts a logic line telling the charge controller to take 500mA.
I have a power switch in between the battery/charger and the rest of the circuit. When the switch is off the microcontroller doesn't have power, and the battery will charge at 100mA.
Q: How do I charge at a higher current without microcontroller intervention?
The USB Battery Charging Spec 1.2 (found here) gives different hardware options for charging ports, to allow "Portable Devices" (like mine) to determine the capabilites of the charging port without enumeration. For example, a "Dedicated Charging Port" (with no communications capability) puts a 200-Ohm resistor between D+ and D-. If the Portable Device detects this connection, then it can assume the device can supply higher current.
I have found some charge-management IC's, such as the MAX77301, which handle this detection and set their charge current levels appropriately. However, they do their own enumeration, and do not pass through the USB data. I assume they can't be placed in parallel with the data communications path.
What am I missing? What is considered good practice, to accomplish what I am looking to do?
Thanks.
AI: You can put a charge detector in parallel as long as you keep the stubs extremely short. I have done this before with a Fairchild charge detector. Don't remember the exact part number off the top of my head.
Or you could take a look at the BQ24392 from TI. It does its own enumeration (well, not enumeration... it does the charger detection upon initial connection, then connects the USB bus to the host), but it passes the detection results out, and it incorporates a USB bus switch so that the USB traces pass through it to the host. No stubs. It is specifically designed with USB 2.0 in mind. It correctly detects every type of charger in the known world, whether the charger is compliant with USB specifications or not.
But there may be a simpler option. How big is your battery? For smaller batteries (say less than 1 Ah) it may be easiest to simply always enable the 500 mA of current draw from USB. Of course, this means you will not comply strictly with the USB spec which dictates that until a profile is assigned, you have to stay under 100 mA. But in practice, it will work OK. It is rare, nowadays, to find a host which will object to the 500 mA being pulled from the USB port. |
H: Charge a Lipo battery and power a circuit
I purchased this LiPo charger and I plan to connect the GND and BAT connections to the battery and an external circuit at the same time.
In the datasheet the reference drawings are for battery charging only but there is a part that says:
The MCP73831 is designed to operate in conjunction with a host microcontroller or in a stand-alone application
Which makes me believe it's intended to power a microcontroller as well.
My question is about connecting the battery and the external circuit to the BAT input at the same time while charging the battery. How safe is this?
I know the LiPo charging process goes through Constant Current and Constant Voltage, but if there is going to be an external circuit in parallel, I guess this can mess with the Constant Current part, since the Charger will regulate a constant current for both of them, while the current going into the battery might not be constant, since the external circuit current demands might change with time. Is this safe, or can it damage my battery?
To be fair, my circuit will be a low power one, but I rather to read an answer that covers all the cases so I can prevent issues with future projects as well.
AI: Your concern is well-founded. If the battery is connected directly to the system load, there is no way for the charger to know how much current is going to the battery and how much is being used by the system.
For this reason, many chargers isolate VBAT from the system power rail (VSYS). In general, I would say that it is acceptable to put the system load in parallel with the battery when the system current is much smaller than the charge current, OR if the system current is very consistent. In that case, you can just crank up the charge current setting on the charger to account for the system current. But if the system current varies over a wide range, or is not consistent from unit-to-unit, I would look for a different charger IC.
As a side note, it appears that the MCP73831 does not have a charge timer. In other words, the only way for it to terminate charging is when the acceptance of the battery becomes sufficiently low. Normally, state of the art chargers would also have a timer, so that if the battery acceptance never becomes sufficiently low, charge will terminate anyway after allowing a generous interval of time. This lack is even more worrisome since you cannot separate the battery from the system load. The system load will make the battery acceptance appear higher than it really is, and the charger may never terminate, but just float at 4.2 V forever.
I recommend you ask Microchip about this, in case I am mistaken. But if it really is the case, then I have to suggest you look for another charger, because it is not safe to float lithium ion or polymer cells indefinitely at 4.2V. There needs to be a timer so that charge always terminates.
TI uses the term "power path" to describe chargers which keep the battery separate from the system. They are not the only ones with this feature, but I think searching for power path will help you to find chargers that do this, from TI and other vendors. |
H: USB - Tolerable voltage drop
For a system I am designing I need go over 500mA limit for a very short time (30mSec). I have designed my system such that during the over 500mA period I am able to sustain my circuits using internal caps. (Internal caps can maintain voltage for my operation). However on the bench using a bench supply I see that I drag the voltage down (500mA constant current mode) to 4.5 during this 30mSec.
Is this allowed? What can go wrong ? (Would USB disconnect ?)
AI: If you exceed 500 mA of current draw, then the result is going to be highly dependent on the exact implementation of the source current limiting.
It is possible that there will be no current limiting and you will have no issues at all. It is possible that there will be a PTC or similar electronic fuse. This will likely allow you to draw over the limit for brief periods. It is also possible to have a hard current limit that will either drop the voltage to clamp the current, or it will trip and disconnect the input voltage entirely.
The proper solution is to add enough capacitance so the transient over 500 mA will be supplied by the capacitors instead of the source. It might be a good idea to add some sort of current limiting to the power rail to make absolutely sure your device does not exceed 500 mA. A small-value resistor may be sufficient. Or you may need to turn to some sort of active current limit circuit. Something like a PTC will not be fast enough to prevent an external current limit from tripping. |
H: Tie Arduino - ATMEGA328P reset pin directly to +5V?
I would like to know if it's okay to tie the reset pin on an ATMEGA328P directly to +5V without using a resistor to avoid random resets and lower part count. If it's not okay, can you explain why it's not good practice?
Thank you for your help.
AI: Application notes related to RESET are in Atmel AVR042: AVR Hardware Design Considerations, Connection of RESET pin on AVRs paragraph. I would not connect RESET directly to +5V but via external pull-up resistor. It does not block RESET and leave option opened just in case is neeed. Or what about leave it floating and use RSTDISBL to disable external reset by FUSE. |
H: EMF transmission from cell phone's battery
According to Cell Phones & Wi-Fi―Are Children, Fetuses and Fertility at Risk?
While one can put the phone in ‘airplane mode,’ which disconnects it from Wi-Fi and the Internet, the cell phone still emits magnetic fields from the battery, shown to have equally important biologically consequences, including links to childhood asthma and obesity from fetal exposures.
Is ELF the magnetic fields it is referring to? If that is so,
how many mG or μT are considered to have health effects (if any) or
is a cell phone's or tablet's battery's magnetic field transmission too low to be considered?
AI: That article you linked seems to be of an unqualified source, note that the same "Dr. Mercola" who wrote this is also active in other contra-scientific movements like "vaccines cause autism", "GMOs are evil", "flouride kills you in 1000 different ways" and similar.
Now, disregarding the opinion of this "Dr. Mercola", please consider that there are government regulations regarding ELF. Exposure to very strong electromagnetic waves can damage body tissue, but for that to occur, the waves need to be pretty strong, way stronger than your tablet/cellphone could ever generate.
For instance, in regards to induction stoves, the Swiss government recommends a distance of at least 30 cm to your cooking surface for most of the time. But keep in mind that these stoves are built to create strong electromagnetic fields, strong enough to get ferromagnetic materials hot. So basically, if the electromagnetic waves of the phone are not enough to cook inductively with (they aren't), your child should be safe with less than 30 cm of distance to the phone.
Also note the statement of the WHO that "to date, no adverse health effects have been established as being caused by mobile phone use."
So basically, your children are safe. |
H: LED strips: 46% resistive losses?
I recently bought these LED strips. They are supposed to run on 12V/72W and have 300 x the SMD 5050 LEDs on it.
Schematic:
simulate this circuit – Schematic created using CircuitLab
The voltage values on the schematic have been measured with a multimeter. "560" is written on the resistors.
As you can see, the resistors account for 5.6V - that makes 46% of the voltage (or power) consumed by the strip!! Is that normal?
AI: This is normal enough. This is done because
People are being lazy, cutting corners and cost and reusing strip backing which is also used for white LEDs.
Because they can
You are 1000's of km away, they do not expect repeat business, they do not care what you think.
These strips allow 3 LEDs in series to be connected across the supply. when white or blue LEDs are used Vf (forward or operating voltage) per LED is typically in the 3.0 to 3.5 Volt range or 9 to 10.5V typical. When operated on 12 Volts they thus dissipate 9V/12v tp 10.5V / 12V or 75% to 85%+ in the LEDs. when Red LEDs are used Vf is about 2.0 - 2.2vper LED or 6V to 6.6V total resulting in the result that you see. If they cared they could make a design that uses 4 LEDs in series (8V - 8.8V) or just possibly 5 in series (10V-11V) although the latter has too little head-room voltage dropped acrtoss the resistors.
If you care enough about the excess dissipation and if the resistors are accessible you could sort out one series resistor per 3 series LEDs and operate then from around 10V or short out two resistors and run then from about 8V. This is quite a lot of work and unlikelt to be attractive except where power use if of vital importance.
Interest only: If dissipation at 12V is 72 Watt then dissipation when modfied to run on 8V would be abpt 48 Watt - or 24 Watt less. If run "24/7 for a whole year (8765 hours) and if electricity costs 25 cents per unit then after one year of continuous use you would have saved about $50 in power costs!.
[ 8765 hours x 24 W/*1000 W/kW) x $0.25 = $52.59
Adjust figure for actual hours/day and unit cost of energy.
If you ran these continually for 8765 hours it's likely that their light output would be much reduced. The reasons for those are the same as those at the top of this answer.
Added:
As Olin says, they will be 56 Ohm resistors.
I = V/R = 2.8/56 = 50 mA.
As far as I can tell from the image the LEDs use 3 die in parallel (each brought out on two pins) and then a resistor connects to the next LED in a set of 3. Each die is probably rated at 20 mA max so 60 mA for 3 - so running at 50 mA is slightly conservative which is good.
This is a very unusual design as only one series resistor is strictly necessary per set of 3 LEDs. Thy may have done this so each resistor dissipates 140 mW instead of having one only but needing it to dissipate 420 mW.
This MAY be OK but it is likely that th
ADDED: Efficiency, seller integrity, ...
Note: I might buy these if I needed them if the price was right. They probably represent typical offerings. The following is re what they claim - not why you shouldn't buy them :-)
Claims:
In the ad they claim A++ energy efficiency.
In the ad they claim "Save power more than 90% by ordinary bulbs".
Reality: Use 5 lumen/Watt for now for "ordinary bulbs". To achieve their claimed 90%+ less they'd need 50 l/W LEDs at 100% of input energy used by LEDs.
Factor in the fact that only about 53% of the input energy is used by the LEDs and
you'd need 50/0.53 = 94 l/W.
A thin clear polycarbonate cover gives 10% light loss.
So their waterproof covering made of ??? is liable to cause 20%+ loss
20% loss means LEDs need to be 94/0.8 = 117 l/W. (Or 104 l/W at 10% loss).
Apparently identical LEDs on Alibaba advertise "15 l/W (24 l/W available").
This may allow for the cover but not for the resistors.
Even if it did allow for the resistor loss as well the effective lumen's Watt in the Alibaba case mentioned would fall FAR short of the levels needed to meet the advertised claims.
This is not untypical for this class of product. Even allowing for filtering losses, assumptions of l/W of incandescent bulbs etc (1) There is no way they meet their 90%+ claim (2) The A++ claim would be actionable legally in my country (NZ) by a government department at no cost to the complainant.
The 50,000 hour claim is garbage. Ask me how I know! :-)
The price is an utter ripoff, but blaim the reseller for that.
I bought Chinese made 5m reels of LEDS in India retail in 3 reel lots for about $US6/reel (no remote control). Remote adds minimally. Astoundingly good.
Out of China they cost more (than Chinese made LEDs bought in India) but not vastly so. BUT if you are buying in 1's on ebay and that's the best value available and it suits you then buy them. Just don't believe anything they say :-).
The 300 LEDs in the heading and 150 in the body is (probably) due to a 12V strip heading being used for the 24v description. The 72W does not match your calcs = probably about 90W if Volt figures correct.
LED Z (efficiency - usually in l/W (lumen/Watt)) depends on colour, % of rated output run at, temperature, MAKER, ... & more. Use white as reference as these are common.
Nowadays at full power a Z of 90-110 l/W is goodish. Best reasonably available tend to be 120 to maybe 140. Run LEDs below full power and Z rises maybe 10% to 20% at very low I. Run cold it is maybe 10% up. Very very best top bin LEDs at say 30% power at 25C (BIG heatsink+) are around 200 lumen/Watt. Lab samples now exceed 300 l/W.
For low power high efficiency LEDs I use small NSPWR70CSS-K1 that have been out for ?4? years now. 125 l/W at 70 mA. 165 l/W at 30 mA. Superb. |
H: Testing an I2S slave device
i have a MEMS mic with digital I2S output. What is the easiest way to test that my microphone communicates right?
No need to verify the sound, i just need to verify on bit level that communication occurs. For example how can i test it with an oscilloscope?
input and outputs are listed:
data sheet: link
AI: You need to provide 2 clocks - one is a division of the other.
The main clock is the "bit clock", aka the Serial Clock. This is one clock per data bit transferred, and 32 bits of data per sample.
The secondary clock, normally known as LRCLK is the left / right channel clock. This divides the data stream into pairs of samples, one for the left channel, one for the right. This is 64x slower than the serial clock, and is known as one "frame".
So a frame consists of two samples, each 32 bits in size (only 24 bits of that 32 are actually used).
Now comes the elusive WS pin. The "Word Select" pin. This is actually the LRCLK pin of I2S. It selects which of the two samples, left or right, is currently being requested. It is compared to the state of the L/R pin, which is normally hard wired to either Vcc or GND, and if it matches then the microphone clocks its latest sample out through the serial data pin. If it doesn't match, then the serial data line is high impedance.
It's designed like this so you can have two microphones on one I2S bus. One would have its L/R pin tied high, and one with L/R tied low, so as the LRCLK alternates it activates each microphone in turn, and you get a stereo signal.
Theoretically it should be possible to tie the L/R pin to the WS pin so it is always seen as the current word is valid, and the same microphone would respond to both left and right channels.
The bit clock should be 64× the desired sample rate. So if you want 44100Hz sampling, that's 44100 frames per second, or 88200 samples per second, or 2822400 bits per second, so a 2822400Hz clock.
So in summary:
Apply a 2822400Hz clock to SCK. Apply the same clock / 64 to WS (44100Hz). Tie L/R either HIGH or LOW. CHIPEN should be tied HIGH to enable the microphone as a whole.
By the way, the clocks must be synchronised - so one should be derived from the other.
You should then see data coming out of SD. |
H: Set function to specific address in PIC18F with the HI-TECH C compiler
I want to put a function in an specific address of memory like PIC C Compiler (#org).
I'm using MPLAB X, HI-TECH compiler and PIC18F4550.
In PIC C compiler:
#org 0x1000, 0x2000
void MyFunction()
{
}
//In other part of code I'll use: asm("goto 0x1000");
How to do this in MPLAB X with the HI-TECH compiler?
AI: IIRC, you can set a function to an absolute address by using the "@" qualifier:
void MyFunction() @ 0x2A0
{
...
}
So the function MyFunction will be placed at address 0x2A0 in Program Memory. |
H: Pull up does not work
I got a breadboard with some logic on it. Including it's own power suppply. It is connected to my Arduino Mega 2560 to fill a shiftregister with some bits. Whenevery my arduino is in a undefind state i want the shiftregisters to be dissabled to prevent the hardware from hazards. Undefind means when it is turned off. Since the logic has it's own powersupply it could damage some of the hardware which i toggle with the registers. (toggling transistors with a lot of leds on it)
So i added a pull up to the "blank pin" of the shiftregister(2k 10k 18k). But it does not work as expected. In this case it dows nothing(The test leds still are in some kind of undefind state when i turn off the power of the arduino)! If i delete the gnd line between the arduino and the breadboard it works.
So here is some small shematic (Not compplete but the important things):
What am i doing wrong?
Edit. Sorry i am not that good in drawing this schematics...
AI: The "OE" pin doesn't function quite as you think. It doesn't set all the outputs to "off" as you would hope. Instead it sets all the outputs to "high impedance". This is like disconnecting all the wires from the outputs that connect to the transistors, leaving the transistors' bases floating, in an undefined state.
You should connect pull-up or pull-down (depending on the default state you want) resistors to all the outputs so when OE is disabled the transistors get pulled into the correct state.
Update:
After discussion this sounds like the Arduino, when powered off, is interfering with the voltage on the OE pin. The effect is called "back powering" where power flows out of your circuit back into the unpowered circuit, which can damage one or both circuits. The power flows backwards into the IO pin of the Arduino, then up through the ESD diodes to its internal Vcc bus, then through its internals into GND.
By disconnecting the Arduino's ground you're breaking that circuit, so the power doesn't flow.
The simplest fix is probably to fit a small diode in series with the OE pin:
simulate this circuit – Schematic created using CircuitLab
Another, perhaps better, way would be to switch the OE using an NPN transistor:
simulate this circuit |
H: Difference between spectral efficiency and bit rate
I am reading articles about error correcting codes, facing to a term "spectral efficiency". Due to the context, I guessed that it means "bit rate", but I wonder are these two terms equivalent or not? I will be thankful if you guide me
AI: I had done some research some time ago on space communications, here is my memory test: spectral efficiency is the ratio of the datarate achieved by the signal bandwidth occupied, or how the initial bandwidth is altered - before it is actually transmitted. This is a property of the modulator, which modulates a high frequency carrier wave in function of the data to be transmitted in order to make it easier to propagate through the medium (air generally). As said below, it can also be used to increase the datarate in physical communication lines where the bandwidth is limited.
There are various modulation techniques, and some of them are more efficient than others; as I said in that thread, a simple multilevel amplitude modulation enables you to transmit several bits per clock period. For 4 levels for example, 2 bits are transmitted per clock period, so compared to the initial 1 bit per clock cycle that's a 2 bits/(s.Hz) spectral efficiency. Combining phase and amplitude can lead you to much higher values, but there are many techniques and here you'll find a comparison table (along with the definition of spectral efficiency...). 4G LTE achieves 30 bits/(s.Hz) for example, which is amazing. 64-QAM (combined phase and amplitude information) which I believe was used at the beginning of ADSL, is 6bits/(s.Hz) for comparison.
However, spectral efficiency must not be mixed up with encoding efficiency, which happens further upstream just before the modulation process and relates to how many bits are appended to the initial data frame in order to be able to detect on the receiving end if some of the data has been corrupted. I'm not sure whether the table I've linked above includes the encoding efficiency; probably since some efficiencies are below 1bit/(s.Hz). Some encoding schemes are very heavy, sometimes based on state machines that enable you to recover corrupted data in order to decrease drastically the bit error rate (which is a constraining requirement on your datarate).
To sum up, link data rate gets, with respect to the feed data rate, decreased by encoding, then increased by modulation - and it all depends on the techniques used (more or less complex). That's only when there is no encoding, and no modulation, that datarate = bandwidth in value (still different units) and the spectral efficiency is 1bit/(s.Hz). That's why you'll usually see "symbol rate" out of the modulator (and encoder I think) instead of "data rate". |
H: Output Pin of Burleigh PZ-150 Amplifier Driver Analog High-Voltage Power Supply Unit
I have found a Burleigh PZ-150F Analog Amplifier Driver. However, I could not locate the manual. What connector cables are compatible with the output port of this amplifier? It seems there are two male pins and two female pins.
AI: That looks like a Lemo connector. |
H: How to interpret complex commands from serial with arduino
In a project involving a serial communication and an Arduino I would like to use the serial interface to run multiple routines on the board.
The idea is to send a unique string with tags and values in order to execute several istructions at the same time. Let's say that we want to set the heading of an aircraft to 180°, the altitude to 3 meters and 20 cm from the ground and to maintain a horizontal profile with roll and pitch angle of 0°. The string would be:
X,heading,180,roll,0,pitch,0,altitude,3.20,X
For simplicity's sake I'll suppose to send a less complex string such as:
X,tag1,tag2,tag3,val3,X
X,Roll,Con,Kp,1.12,X
In order to receive and elaborate the string I've tried using 3 arrays of chars and a few counters. Here is the code:
byte byteRead;
// Store decimal numbers, determine decimal point
double num1, num2;
double complNum,counter;
int numOfDec;
boolean mySwitch=false;
// Use a boolean var to enter in the command receiving mode.
// If you are interpreting several commands type this could be a way
boolean cmplx = false;
// arrays to store tags
char opt1[3];
char opt2[3];
char opt3[2];
// Counters to determine tags
int optCount=0,letterCount=0;
void setup()
{
Serial.begin(9600);
num1=0;
num2=0;
complNum=0;
counter=1;
numOfDec=0;
}
void loop()
{
/* check if data has been sent from the computer: */
while (Serial.available())
{
/* read the most recent byte */
byteRead = Serial.read();
if (byteRead == 'X')
{
if (!cmplx)
{
// begin of the string
cmplx = true;
}
else
{
// end of the string - reset values
cmplx=false;
optCount=0;
/* Create the double from num1 and num2 */
complNum=num1+(num2/(counter));
/* Reset the variables for the next round */
// Debug Stuff ignore it
Serial.println();
Serial.print(" opt1: ");
Serial.print(opt1);
Serial.print(" opt2: ");
Serial.print(opt2);
Serial.print(" opt3: ");
Serial.print(opt3);
Serial.print(" NUMBER: ");
Serial.print(complNum);
Serial.print(" letterCount: ");
Serial.print(letterCount);
Serial.print(" optCount: ");
Serial.print(optCount);
// How to reset arrays?
opt1[0] = (char)0;
opt2[0] = (char)0;
opt3[0] = (char)0;
num1=0;
num2=0;
complNum=0;
counter=1;
mySwitch=false;
numOfDec=0;
}
}
if (byteRead==44)
{
// Comma
optCount++;
// Debug stuff
Serial.println();
Serial.print("Virgola numero: ");
Serial.println(optCount);
letterCount = 0;
}
// Listen for a capital letter or a normal one
if ((byteRead>=65 && byteRead<=90) || (byteRead>=97 && byteRead<=122))
{
// Debug stuff
Serial.println();
Serial.print("lettera (Ascii value): ");
Serial.print(byteRead);
Serial.print(" ");
if (cmplx)
{
if (optCount==1 && letterCount<=3)
{
opt1[letterCount] = byteRead;
// Debug stuff
Serial.print("letterCount: ");
Serial.print(letterCount);
Serial.print("opt1: ");
Serial.print(opt1);
}
else if (optCount==2 && letterCount<=3)
{
opt2[letterCount] = byteRead;
// Debug stuff
Serial.print("letterCount: ");
Serial.print(letterCount);
Serial.print("opt2: ");
Serial.print(opt2);
}
else if (optCount==3 && letterCount<=2)
{
opt3[letterCount] = byteRead;
// Debug stuff
Serial.print("letterCount: ");
Serial.print(letterCount);
Serial.print("opt3: ");
Serial.print(opt3);
}
letterCount++;
}
}
//listen for numbers between 0-9
if(byteRead>47 && byteRead<58)
{
//number found
if (cmplx)
{
/* If mySwitch is true, then populate the num1 variable
otherwise populate the num2 variable*/
if(!mySwitch)
{
num1=(num1*10)+(byteRead-48);
}
else
{
num2=(num2*10)+(byteRead-48);
// Counters used to correctly store decimal numbers
counter=counter*10;
numOfDec++;
}
}
}
// Looks for decimal points
if (byteRead==46)
{
mySwitch=true;
}
}
}
Once the opt1, opt2 and opt3 arrays are correctly populated I can compare them with tags and then call the respective routine.
The problem
I'm pretty close, the code stores the decimal numbers correctly but it doesn't with the arrays. The output I get inserting this string
X,Rol,Con,Kd,1.12,X
is the following:
lettera: 88
virgola numero: 1
lettera: 82 letterCount: 0 opt1: R
lettera: 111 letterCount: 1 opt1: Ro
lettera: 108 letterCount: 2 opt1: Rol
virgola numero: 2
lettera: 67 letterCount: 0 opt2: C
lettera: 111 letterCount: 1 opt2: Co
lettera: 110 letterCount: 2 opt2: Con
virgola numero: 3
lettera: 75 letterCount: 0 opt3: K
lettera: 100 letterCount: 1 opt3: KdX,Rol,Con,Kd,1.12,X <- WTF?
virgola numero: 4
virgola numero: 5
opt1: RolConKdX,Rol,Con,Kd,1.12,X <- WTF?
opt2: ConKdX,Rol,Con,Kd,1.12,X <- WTF?
opt3: KdX,Rol,Con,Kd,1.12,X <- WTF?
NUMBER: 1.12
lettera: 88
How to reset arrays of chars quickly and why do I get arrays completely messed up?
AI: I really think you ought to step back and re think the idea of doing this with strings, and consider designing a binary protocol. In addition to better organizing your code, you will end up with something that is less prone to error, results in shorter transmissions (and more compact code), and will better lend itself to future enhancements. Backward compatibility will also be hugely easier! For example, you could create a some simple structures like the below, which then could be easily placed or recovered from a send or receive buffer, through the use of structure pointers.
typedef struct mcTag {
unsigned char srcAddr;
unsigned char dstAddr;
unsigned long version
unsigned char numCmds;
unsigned char hdrLength;
unsigned char cmdLength;
unsigned short totalLen
unsigned short crc } MyControlHdr;
typedef struct ctrTag {
unsigned char cmd;
long param1;
long param2;
long param3;
long param4; } MyCommand;
unsigned char buffer[255]; // or worst case message size
MyControlHdr * pCtrlHdr = (MyControlHdr *)(&buffer[0]);
Again the above is just to illustrate an idea. By defining a header to start every message, you can now add things like source and destination addresses. That one little addition could allow your project to easily send and receive from multiple senders, or at least differentiate between them. The header would be placed first in the communication buffer, and filled using the pCtrlHdr pointer, as easily as this...
pCtrlHdr->srcAddr = 1;
pCtrlHdr->dstAddr = 1; // maybe you'll make 2555 a broadcast address?
pCtrlHdr->version = 1; // possible way to let a receiver know a code version
pCtrlHdr->numCmds = 2; // how many commands will be in the message
pCtrlHdr->hdrLength = sizeof(MyControlHdr ); // tells receiver where commands start
pCtrlHdr->cmdLength = sizeof(MyCommand ); // tells receiver size of each command
// include total length of entire message
pCtrlHdr->totalLen= sizeof(MyControlHdr ) + (sizeof(MyCommand) * pCtrlHdr->numCmds);
Then you could place your commands in the buffer (2 in this case) like this
MyCommand * pMyCmd = (MyCommand *)(&buffer[sizeof(MyControlHdr)]);
// first command in this message
pMyCmd->cmd = 3; // might indicate heading
pMyCmd->param1 =100; // various data, perhaps X,Y, and Z
pMyCmd->param2 =5;
pMyCmd->param3 =0
pMyCmd->param4 =0;
pMyCmd++; // moves pointer to next command position in message
pMyCmd->cmd = 6; // might indicate a speed directive
pMyCmd->param1 =8; // various data, unused items left 0
pMyCmd->param2 =0;
pMyCmd->param3 =0
pMyCmd->param4 =0;
Finally, you might want to add a CRC of the entire message, back in the header. This of course would require a separate CRC calculation function.
pCtrlHdr->crc = 0; // dummy temp value
pCtrlHdr->crc = calcCrc(buffer, pCtrlHdr->totalLen); // crc function
Now again this is just a simple example of what you might do with a binary protocol, and here are some of the advantages.
The receiver can instantly test for the integrity of the whole message, by checking the transmitted CRC against a local calculation. CRCs are important! Serial drivers are notorious for dropping characters, turning a "100" into a "00"!!!. And, if you ever decide to migrate to radio, you can easily check for a bad message caused by interference.
If you ever add anything to the header or command structure, and commit to always adding new items at the END of each structure, you can now write receiver code that can easily compensate for your version changes and remain compatible. And since the size of the headers and commands are included in the message, the receiver code can even compensate for expanded header and command sizes. The inclusion of an actual version is also helpful to detect when things change to the point where a compatibility issue might exist.
All sizes and buffer positions in the code are now done by the compiler, reducing the risk of error.
The biggest advantage is that this kind of protocol planning will make your code much easier to write, debug, and maintain.
On that last point, in my previous life I wrote a ton of communication drivers over the years to recover data and perform control over many devices, over serial, radio, and network links, with several other coders. When there was a device with a binary protocol to be dealt with, it was always a pleasure to write the driver. But when it was an ASCII protocol, consisting of strings and decimal numbers, we would all cringe. The lengths we would have to go through to account for every possible error would consume much too much time, be difficult to fully test, and in the end would often fall short and require endless fixes. And just as bad, since it was ASCII (presumably to make it easier for a human to read) any manufacturer upgrade or change to the device would always cause unforeseen bugs, breaking not only our own driver code but the manufacturer's as well! :-) A binary protocol, with a little planning, will make your project much more friendly to maintain, and you will definitely thank yourself for going the extra mile when the project expands, or goes to a radio link! :-) |
H: What does a resistor do?
OK, very basic question here.
I read lots of books, searched quite a bit, and every description I read seemed to talk about the flow of electrons and right away go too deep in theory for me to grasp the basic principle of their use.
I understand a resistor limits the "flow", so that an LED doesn't blow up for example. But I fail to understand exactly what a resistor does to current and voltage...
Do resistors affect both current and voltage? In what manner?
AI: Electric flow is the motion of electrical charges through a material. Resistance is the physical obstruction of these moving charges.
A certain amount of energy is required to keep these charges in motion, and since the energy drop is proportional to the amount of charge kept in motion, this results in a voltage drop across the material since electromotive force (in volts) is energy (in joules) per charge (in coulombs).
Since it is a physical obstruction, it also restricts the rate at which charges can move across a given point per unit time. This results in a maximum current, since current (in amperes) is charges (in coulombs) per unit time (in seconds).
And as it turns out, if you apply more or less electromotive force across the same resistance, the current increases or decreases exactly linearly. This gives rise to Ohm's Law, which states that electromotive force is proportional to the product of current and resistance, that is, \$E = IR\$. |
H: Which component cannot handle the higher wattage?
First time posting a question, so hopefully I've stated all the required details.
As the title is not very specific, here is an explanation of my project. I'm making a revised version of the magnetic table lamp, as shown here:
http://www.instructables.com/id/Magnetic-table-lamp/
The electronics inside are shown in the schematic below. I use a W10M bridge rectifier (1.5A, 50-1000V), a CD263 capacitor (100V), 39ohm/1W resistors, 12V power supply and a LED 3V,0.15A.
Now here's my question: I messed up a bit with the construction of the cubes, which resulted in a high resistance and thus high voltage drop in between my cubes. I tried to fix this by switching to a 24V power supply, and 120ohm/3W resistors (a bit power-heavy, but a lower influence of the resistance between cubes). However, things get smelly and I think a component is not suited for this voltage. Can anybody pinpoint what causes the problem?
AI: Calculate how much power each component is dissipating, and compare that to its rating.
$$Watts = Volts \times Amps$$
Assuming you are using an AC supply, the output of the rectifier should be about 24V (it could be over 30V if your capacitor is large enough to hold the peak voltage). Two 3V LEDs in series drop 7V, leaving 17V across the 120Ω resistor. We can calculate the current through the resistor using Ohms Law:
$$I = \frac{V}{R} = \frac{17V}{120 \Omega} = 0.142A$$
Now calculate the power in the resistor:
$$17V \times 0.142A = 2.4W$$
How hot will a 3W resistor get when dissipating 2.4W? If it is a metal oxide or wirewound type then it's probably rated for a temperature rise of ~200°C at 3W. Therefore at 2.4W it will rise to about \$\dfrac{2.4}{3} \times 200 = 160 ^{\circ} C\$ above ambient. That is why things are getting smelly - the resistors may be able to handle the power, but they are getting very hot doing so. |
H: How do I correctly estimate heat output for heater wire
This is based on a problem that came up today. During the course of this problem I realized that I wasn't so sure I understood the relationship between wattage and heat produced.
In the past we did a test in the lab using .305 Ω /ft wire. The jacket is rated for 150C. We were able to get about 6.5A (at 3.66V) out of it at 24C ambient, with out exceeding the jacket rating. I want to estimate what the ampacity of 0.027 Ω/ft wire is. So I am wondering if I did it correctly, because this amperage seems a little high for the wire to handle, then again most copper wire is only rated at 90C.
So the math I did on it was this
So you do
.305 * 2 = .61 Ω /ft
6A^2 * .61 Ω = 21.62W (I^2*r = W)
21.96W * / 2ft = 10.98 W/ ft
So would it be safe to assume that if I did the same with a 0.027w/ft wire with the same jacked I would arrive at this amperage?
If you start with
11W/ft * 2ft = 22W
0.027 Ω * 2ft = .054 Ω
Sqrt(22W/(0.054 Ω)) = 20.18A
ETA: we are planning on testing this tomorrow when we get some wire in. So we shall find out.
AI: I don't quite follow your calculations. But if you are doing I^2 *R as the power, and assuming the same max power for each wire.. then that's what I would have done.
However I went here and it looks like I*R is about constant. (?)
(I had to plot it.) Still looks linear.
Maybe someone can tell us both why.
Edit: I*R dependence. (Thanks Spehro, it was suddenly obvious on the drive home.)
No matter the thermal loss mechanism (convection, radiation..) It will go as the area of the wire. 2 * pi *r * l (r - radius and l - length), so bigger wire will need more heat to get to a given temperature. (more later) |
H: What are the units of the output of an ADC?
How would you write or label the output of an analog-to-digital-conversion? I don't seem to have a good grasp for the english when I try to write this out.
counts?
arbitrary units?
For example, if I want to write this out as algebra or label in a chart:
raw signal [au]: 200
AI: "Count" would be the most appropriate term, since they are in fact countable. Full scale on a e.g. 12-bit ADC would be from 0 count to 4095 count. |
H: May I power atmega32a-pu microcontroller from AA batteries?
I need to provide +-4.5V to the microcontroller. That would be fine by having 4x rechargable batteries, but how is it with current? On each AA battery is written min.2550mAh. I am not sure but I think that max what I can put to the microcontroller is around 500mA.
Could you please advice me how to do it? Should I use resistors? Am I right about the 500mA?
AI: Depending on your clock speed, you can run as low as ~2V. The microcontroller will also use far less current at low clock speeds. See the datasheet for more exact numbers, there will be a chart for the clock speed and minimum required voltage to operate. The current consumed can be calculated per Megahertz, but may also not be linear. Higher clock speeds (16-20Mhz) will consume far more than 8Mhz, and the difference is not linear.
Your microcontroller will not consume more than ~50mA (this is what an Atmega328P at 16Mhz uses). If it's consuming 500mA you are doing something horribly wrong, and probably a short circuit somewhere.
If you put 2 AA batteries in series, run at 8Mhz internal clock, you should get about 300-500 hours of run time. This is about 2-3 weeks of constant operation, not considering any other circuit losses or silliness.
Also the capacity of a battery written in Amp-hours (or Milliamp-hours) does not really relate to it's ability to source current. Internal resistances and different battery chemistry will determine it's current output and how much the voltage sags under load too. For example I have a little 260mAh lithium ion 3.7V battery that can pump out 5 Amps if it wanted to - but this is not good for it ;)
Your AA batteries, and batteries like the standard 9V "transistor" battery have terrible current output capability which newcomers to Electrical Engineering often don't know. You would be lucky to get a few hundred milliamp out of a standard (NiMH) AA battery. More in parallel will give more current output, and more capacity, but obviously only as much voltage as a single one. |
H: 24 volt on microprocessor input pin
I have got my hands on a Intel Edison system on chip. I would like to use it to detect non-zero voltage. For example I have a test point that could be either 0 volt or 24 volt and I want to detect which using the microcontroller.
What ways are there to achieve this? Is a simple voltage divider the way to go? Is there any disadvantages of doing that?
AI: A voltage divider and a tiny bit of software is the cheapest and smallest PCB space I can think of. Shown below is a 1/10 divider, so you should be safe up to 33V on the input, and perhaps even more if the Edison has [any?] good clamping protection diodes. The capacitor is there for simple noise reduction, it is optional if you are good with firmware.
simulate this circuit – Schematic created using CircuitLab
Otherwise, give this a go! The NPN BJT called Q1 in the schematic diagram acts as a switch, taking the node below R1 to 0V when the 24V signal becomes "high". The diode D1 protects Q1 from nasty voltages, and the 10K resistor R2 can be higher if you wanted. Currently it will put 2.4mA into the base of Q1. The capacitor is there to act as a minor RC filter to help with bouncy/noisy goodness.
simulate this circuit |
H: How to make Eagle package with dual row surface mount tails?
I'm doing a project using the OMNETICS dual-row connectors (http://www.omnetics.com/neuro/pdffiles/A79025-001.pdf). I'm a bit lost about how to make the package for it in Eagle, as the connector has horizontal surface mount rails that's supposed to solder on both the top AND bottom of the board (straighten the solder pins so the two rows straddle a board).
Any help (or perhaps library for this part) is appreciated.
AI: The PDF you linked to clearly shows SMD pads on the same side of the board:
In Eagle, in the package for that part, place a SMD pad where each pin touches the board. Usually you want to make the pad a little larger than the contact area, particularly in the direction away from the package. I often at 20 mils past the end of the pin. This allows for a little initial alignment error, leaves a place to put a scope probe, and makes it easier to visually inspect the solder joint. On this inside, I usually just leave 5-10 mils.
In your case, there are two rows with the outer row covering up the inner row. There is little reason to extend the pads for the inner row. However, you want to treat the two rows symmetically so that the surface tension of molten solder on one row doesn't pull the other off its pads. You also need to make sure there is sufficient room between the pads of the inner and outer row. |
H: Why do Nintendo 3DS games have 17 pins?
I took a good, hard look at one of my Nintendo 3DS games today, and I realized that there are actually 17 pins on the game that connect with the console. Why? I was under the impression that "everything" needed to be to a power of 2?
AI: Digital Data, based on its nature of binary states, is a power of 2. While this is still true for hardware, there is lots of overlap. Any given digital signal will have two wires/pins involved, the signal and a reference. That reference pin is normally Ground. But a single Ground pin can work for multiple signals.
The 3DS has 17 pins because of need. Some of these are also serve multiple purposes. From http://3dbrew.org/wiki/Gamecards
There is a single power source, multiple Ground pins, 8 data pins (shared, 8 bit parallel bus for the Rom, and 3/4 pins for the serial bus SPI eeprom), a reset pin, a Interrupt/Removal pin (if you pull the cart out or if its not there at boot), a Clock pin, and a pair of Chip Selects. Finally a Not-Connected pin, likely for debug or factory purposes.
For the most part, all of these pins are referenced to ground, and they are Powers of 2, because their outputs are binary. Remember, a 2^1 is still a power of 2. |
H: General form of a Transfer Function
A professor is writing the general form of a Transfer Function as:
$$H(s)=k\cdot s^{l}\cdot \frac{\prod\limits_{i=1}^{m}\left(1+\frac{s}{z_{i}}\right)}{\prod\limits_{i=1}^{n}\left(1+\frac{s}{p_{i}}\right)}$$
but in every book and in every source that I have found is never mentioned that way. The poles and zeros are never in fractions in the numerator and denominator. Am I missing something? Has anyone any source to explain the logic behind this specific form of Transfer Function?
AI: There is nothing to be surprised at. A transfer function can be shown in one of the two following notations.
$$ H(s) = K\dfrac{(s-z_1)(s-z_2)\dots(s-z_n)}{(s-p_1)(s-p_2)\dots(s-p_m)} $$
$$ H(s) = \dfrac{b_ns^n + b_{n-1}s^{n-1}+ \dots + b_0s^0}{a_ms^m + a_{m-1}s^{m-1}+ \dots + a_0s^0} $$
The first one is good for seeing the locations of poles and zeros at first glance, and for performing partial fraction expansion. The second one is good for easily extracting the differential equation between input and output, also for transforming into state space form. Each notation has their own advantages and handicaps under every topic. |
H: Bi-directional High-side NFET switches -- drains or sources connected together?
TL;DR:
When using two N-FETs to implement a high-side switch should the FETs be arranged so the drains are connected together, or the sources?
Some additional facts about the current design:
1) A boost supply is being used to drive the gates above high side.
2) The gates of the two FETs are tied together.
3) The supply voltage is ~40V -- bigger than the Vgs rating (+/-20V) of the FETs.
More details:
I'm working on a battery management application and need a bi-directional high-side switch to block current to/from the battery. One way to do this is by putting two FETs back-to-back, in opposite directions, as below.
edit: Note that the arrow in the diagram suggests these are PFETs. As far as I can tell, this is a typo, and should be the other way around (MAX1614 is a high side N-FET driver.)
However, opinions on the matter seem to differ as to whether the protection FETs should be arranged with sources tied together, or drains. If you look carefully at the pictures, you'll see that the FETs are arranged with drains connected together in the first, and sources tied together in the second.
As far as I can see, the first design is fine as long as the supply voltage does not exceed the Vgs specification of the FET. However, if the supply is above that, then the maximum Vgs sustained by the FET closer to the load (the left one, in both diagrams) will be the supply voltage. This will happen when the gate is driven low (i.e. to ground) whenever the gates are turned off.
Am I missing something? Is there another, more clever way to do this that I just don't know about?
AI: Since the gate voltage is specified relative to the source terminal of a MOSFET, it's much simpler if you connect the sources together, and use that node as the "reference" node for the gate driver(s), as shown in your second diagram. Note that you can also tie the gates directly together if you do this. |
H: What's the relationship between samples and bits?
I was talking to a friend today that I have a transmitter which is capable of sending 128 samples/second. Note that each sample is a voltage level represented by a floating point decimal. He then insisted that I call it a 7 bit system since 128 is 2^7.
What useful information can I possible get from representing the samples/second in number of bits? What can each bit physically represent?
AI: Your transmitter can send 128 samples of data. Each sample contains a x number of bits depending on your transmitter. If your transmitter is a 8 bit transmitter then you can send 128 times a 8 bit sample in one second. |
H: Background functionality of a mobile phone
I'm asking this question out of curiosity. In general, we have around 6 to 7 radios in a smartphone. the modulation schemes, estimation procedures, synchronization methods are different for each radio. How do the people who develop a smartphone, fit all these radios on to a single chip?
And also I've studied that ARM processor will be used for basic call initiation, call forwarding and call receiving.
So is there an ARM processor that is present along with the SOC, or everything is fit into the a single SOC.? Or they use an FPGA to fit all the radios.?
Thanks in advance
phani tej
AI: Have a look at a teardown of e.g. the iPhone: https://www.ifixit.com/Teardown/iPhone+4S+Teardown/6610 . Especially step 9 of that page. There's the ARM processor, the A5, which counts as the "main" SoC. Next to it is the radio processor, Qualcomm RTR8605, which Chipworks have a teardown of: http://www.chipworks.com/en/technical-competitive-analysis/resources/blog/iphone-4s-teardown-a-closer-look-at-the-chips-inside/?lang=en&Itemid=815
The die shot makes it clear what's going on. You can see several blocks with distinct boundaries, and a number of inductors (the octagonal ring structures). Each of those is for a different radio function.
No mass-market product would use FPGAs, it's too expensive. |
H: ATmega8 LED blinking project not working properly
I am making a simple project using ATmega8 microchip. I uploaded this code to the AVR:
#include avr/io.h
#include util/delay.h
int main(void) {
DDRD = 0b10000000;
DDRD = 0b01000000;
while(1) {
PORTD = 0b10000000;
_delay_ms(100);
PORTD = 0b00000000;
PORTD = 0b01000000;
_delay_ms(100);
PORTD = 0b00000000;
}
return 1;
}
It basically turns on and off two different LED's which are connected to pin (AIN0) PD6 and (AIN1) PD7.
When the system is working, the AVR can deliver power to just one of the LED's properly. Other LED has a significantly low brightness. When I measure the voltage delivered to the bright LED which is connected to PD6, it takes approximately 2.3 volts, and the dimmer one which is connected to PD7 takes approximately 1.2 volts.
Why I am having this issue? Is it about the code that I wrote or is it about the chip itself? On the other hand when I light just one of the LED's on either PD6 or PD7 with a simple code it works just fine. So there is no problem with pins, connections or LED's I use. (I also could not copy and paste the package names here correctly! So it is correct too.)
AI: You are overwriting your initialisation. First you set D7 as an output and all other pins on port D as a input. In your next statement you set D6 as an output and all other pins including D7 as an input.
To fix this use this instead of both initialisations:
DDRD = 0b11000000;
you can also use this:
DDRD = 0b10000000;
DDRD |= 0b01000000;
if you want to setup more outputs use |= instead of =. |
H: Is it possible for a VHDL component to have multiple architectures?
Just a thought I had: is it possible for a VHDL component to have multiple architectures if outputs are not modified by both? If so how can we select the one to use at synthesis time (like the C preprocessor)? What happens if multiple architectures can coexist and outputs conflict?
AI: To supplement @vermaete's answer:
An entity defines an interface to a box; an architecture defines what's inside. If you don't have the same interface, you don't have the same entity. If you have the same port names, but each architecture uses them for different purposes, well, that's legal, but maybe not advisable - it depends on the specifics.
If you want to use multiple architectures simultaneously, an alternative to configurations is just to use direct instantiation:
U1 : entity my_lib.my_comp(arch1)
...
U2 : entity my_lib.my_comp(arch2)
...
If you want to use only one at a time, some sort of configuration is probably the way to go. |
H: connector for 25Amps
I am using the OSTT7020150 connector for my board.
This connector has capability to connect wires 10-25AWG which means it can tolerate about 25Amps(from the AWG chart). Now, when designing the board, I have seperate planes for both Vcc and GND. But, my doubt is regarding the drill dia and the solder masking.
Pls see the picture below of the board with the connector(i am showing the bottom view).
It shows the VBAT (VCC) and GND. But can such a small drill be sufficient to pass 25Amps. I am a bit surprised. Can you advice me on this. Also, is it suggested that I keep that area solder mask free so as to let out heat and help in heat dissipation. Kindly advice me please.
AI: Your decision to route that amount of power using an internal layer is poor choice IMO. From what I understand, the via in which the component lead is seated, is the bottleneck connection.
Please excuse the crudeness of the following depiction - I tried to emphasize how soldering through-hole leads on outer layers makes sense. It allows larger mass of solder to be in the way of current, therefore decreases resistance.
(Amount of arrows indicates current cross section/conductance)
simulate this circuit – Schematic created using CircuitLab
There's one more thing to consider. It's not always guaranteed, that your plated holes will be 100% filled with solder. In such case, the situation is even worse, as the currents have to travel up and down the via's plating.
Bottom line is:
Solder high-current leads to outer layers and if needed, provide heavy via stitching to a layer of choice afterwards. |
H: Finding a DTFT of a signal
I'm trying to figure out what's the DTFT of \$ (-1)^nx[n]\$. (I'm given the DTFT of \$x[n]\$)
So I tried this, but I can't figure out how to proceed from here, if this is even correct.
Any help and advice would be appreciated!
\$F_{DTFT}\{ (-1)^n x[n] \} = \sum\limits_{n=-\infty}^\infty (-1)^n x[n] e^{-i\theta n}\$
\$=\sum\limits_{even \space n's}x[n]e^{-i\theta n}-\sum\limits_{odd \space n's}x[n]e^{-i\theta n} =\$
\$=\sum\limits_{k=-\infty}^{\infty}x[2k]e^{-i\theta 2k}-\sum\limits_{m=-\infty}^{\infty}x[2m+1]e^{-i\theta (2m+1)} = ?\$
Thanks!
AI: Note that \$(-1)^n=e^{i\pi n}\$, so you get
$$\sum_{n=-\infty}^{\infty}x[n](-1)^ne^{-in\theta}=
\sum_{n=-\infty}^{\infty}x[n]e^{i\pi n}e^{-in\theta}=
\sum_{n=-\infty}^{\infty}x[n]e^{-in(\theta-\pi)}=X(\theta-\pi)$$
The spectrum is just shifted by \$\pi\$. This is basically a consequence of the modulation property. |
H: Is accelerometer taking as much power (current) as it needs?
I want to connect accelerometer to an oscilloscope. I have 3x AA rechargable batteries (2550mAh).
I was told that e.g. microcontroller knows how much amps should it take and it wont burn if I connect it to those batteries.
But e.g. LED would burn. What about accelerometer? Is it able to take as much amps as it needs or should I use resistor?
Any other advices and tutorials provided regarding accelerometer+microcontroller or accelerometer+oscilloscope are appreciated.
This is my accelerometer (ebay title): GY-521 6 DOF MPU-6050 Module 3 Axis Accelerometer Gyroscope Module for Arduino
Will it work also with Atmega32 even though it's written there for Arduino?
AI: I had already used one of those modules. It can be powered with a voltage from 3V up to 5V.
It can virtually work with any microcontroller that have a I2C peripheral.
Be aware that you need to write some values to its configuration registers before you can get any data from it.
The accelerometer reference is MPU-6050, you can look for the datasheet on the Internet. There is one covering the registers and other covering its general characteristics. |
H: What is the "temperature code" of a soldering tip?
I am looking for a replacement tip similar to the ones below on the picture. On the bottom of my tip there is a number 6 which might be this "temperature code" that I found next to these types of tips on certain sites. I already found out that these are magnetic tips, but I'm not sure about the significance of the number. Does it even matter?
I only found this old soldering iron recently so it's quite new to me, and I'm not sure if these tips are rare, because they seemed harder to find.
AI: On the WTCP tips, the "code" is simply the temperature /100 in degrees F where it controls. So a '6' tip would control at 600°F or about 315°C.
They are available in 600/700/800°F. See the datasheet for the Magnestat irons and tips here.
The way these work is that there is a ferromagnetic part of the tip that is designed to lose its magnetism at the specified temperature (the Curie temperature - named after Pierre Curie) and a magnetic switch lives in the handle to turn the heater on and off.
The 600°F tip is fine for repair work and small scale production using 63/37 SnPb or 60/40 SnPb solder. For lead-free solders or for fast production work (skill matters more when then tip is hotter since it's easier to damage the board by holding it on too long) you may wish to use a higher temperature tip.
The tips should not be hard to find nor should they be expensive- there are many, many of these irons in the field, though most new ones probably use electronic temperature control rather than the Magnestat principle, hence different tips. |
H: Controlling 90 LEDs using one WS2811
I wanted to build a circuit where i would be able to control 90 LED's using one WS2811 and have a total of 60 WS2811.
In this circuit I hope to connect 30 LED's per channel, there is no need for me to control the individual LEDs thus there is no point in me going for the WS2812s which is commonly used.
I tried a few circuits that i saw online (sorry! dont have the links) and not of them worked, all i ended up was buring two of the IC's, and the circuit which did work I was unable to turn off the LED there was always a small amount of brightness.
Working voltage: 12V
No. of LED's per channel: 30
This is how the LEDs are wired
I believe this is the circuit that i used
EDIT 1:
I tried this circuit as well but the output is very low (brightness)
EDIT 2:
I modified the above circuit to 100ohm at R1 and 10k ohm at R2, the transistor T1 is BC547 and T2 is BC817. After modifying the resistors and transistors, I am able to get a much higher brightness however, if I am to connect the negative directly to ground the Strip (the one i am testing with) consumes 1A current but via this circuit it is consuming only 600mA. Do i need to change T1 for better results?
Datasheet:
LED: https://www.dropbox.com/s/wz7xp7ghupoif5z/SMD5050-warm%20white%20specification.doc?dl=0
AI: There is an older version of the WS2811, that's the WS2801.
This chip also has a constant voltage option, so you can control a FET with it that PWM's all your LEDs.
Have a look at page 10 of the datasheeet!
Edit: You would need some LEDs in series (say 3) with a resistor, you can then connect 10 of these sets of "3 leds and a resistor" in parallel, to feed everything from 12 volts.
To switch high currents with the WS2811, you can connect e.g. a 10k resistor from 12V to the OUT pins and drive a MOSFET (e.g. TSM2314) with the pwm signal coming from the OUT pins. |
H: Eagle: Make copper pour connect to entire SMD pad
So I have a design in Eagle with a few SMD components that have pads that should be grounded. I've done a copper pour (draw polygon->name GND->Ratsnest) to create a top ground plane. On some of my components the ground plane connects to the SMD pad, but only by four narrow traces (such as below):
I would like the entire SMD pad to connect to the ground plane. It's an RF design so grounding is fairly important. Has anyone experienced a similar problem?
AI: These are called "thermals" and they make soldering easier/possible. You can disable them in the properties window for the polygon.
If grounding is really important you might be better off with vias in the pad connecting it to a ground plane on the next layer down. |
H: transmission loss with microsd extender
Would a 20-30cm microSD extension cord suffer any kind of noticeable transmission loss? This is a passive extender - literally, a microsd card with wires coming off of it, and a card slot at the other end. Simple ribbon cable connecting the two ends.
EDIT I'm not making this - it's a store-bought thing. Here's a picture of what I'm talking about:
AI: I can't say with any certainty, but I think that for 20 to 30 cm it should work, as that length is just a small fraction of the wavelength of the data frequencies (around 10Mhz). But consider to use a ribbon cable with twice as many signals as you need (plus a couple of more) and connect every other wire to ground so that they decouple the electric field between the adjacent wires (each signal wire sees a ground wire at each side).
Use a couple of extra wires for the power and I suggest to put a small ceramic (or plastic) capacitor (something like 100n to 1u) between the VCC and GND at the microSD card's end to supply the drivers with some energy to make clean transients.
The cable will have some electromagnetic emissions, I'm afraid. But probably not so much that it would become a problem. |
H: Can't identify component
I was disassembling an old CRT monitor and I came across this component, but I've been unable to identify it. Can somebody help me with it?
It was found in the horizontal deflection circuit, next to the flyback converter.a
AI: That's an inductor, probably made by LG (or at least a clone of a part originally made by LG).
I'd hazard a guess that the -104- in the part marking could mean its 100uH maybe ...
Did you find it in the horizontal deflection circuit? |
H: Consequences of mixing lead and lead-free alloys when soldering
Would it be a problem to use a lead solder paste to solder lead-free BGA package parts? Are there contamination/compatibility issues? Does it affect the physical connection integrity between the board-component? How about using a lead-free solder paste for soldering components that contain lead? Which of the two is more reliable?
AI: Would it be a problem to use a lead solder paste to solder lead-free BGA package parts?> Are there contamination/compatibility issues?
Obviously there is a contamination issue, because your assembly is no longer lead-free, and couldn't be sold in jurisdictions that restrict lead content.
Does it affect the physical connection integrity between the board-component?
Conceivably you could also have a reliability issue, because the lead-free and tin-lead solder will not mix evenly during the reflow process. This will produce various alloys in different parts of the solder joint. Very likely there will be residual stress in the cooled joint, and stress is associated with tin whisker formation (and other issues) in the lead-free part of the joint. Whether this is a real issue or just paranoia, I'm not sure, but it's not something I would bet my job on.
Another issue is that in order to heat the assembly hot enough for the lead-free solder to melt, you will have to heat the tin-lead portion hotter than it's designed for. This can make the flux components of the solder vaporize too quickly, causing voids in the joint.
How about using a lead-free solder paste for soldering components that contain lead?
If the part is not designed for the higher temperature of lead-free reflow, it could cause reliability problems.
Also the mix of materials could still cause the stress issues, and mismatched temperature profile issues I mentioned before.
Which of the two is more reliable?
I would rather not do either.
If you can afford it, it's possible to have a BGA re-balled with new solder balls that match the assembly process you're going to use.
If you have no choice, or if you're doing a short-life project where reliability isn't critical, I'd probably do lead-free balls in leaded paste, because a greater percentage of the solder in the joint is designed for the temperature profile you're going to use.
Further Reading:
You can find more information about mixed-material soldering in the book chapter, "Backward and Forward Compatibility" by Jianbiao Pan, Jasbir Bath, Xiang Zhou, and Dennis Willie in Lead-Free Soldering, 2007. 173-197. Also available online. |
H: Power supply 5V
I need some help about choosing the best on board switching power supply that has the less electrical noise and longer life time between these schematics for a 5V 200mA board...
Heating is important too!
If any one can come up whit something better I will appreciate it!!!
AI: The 2nd one is a linear regulator. It is very inefficient, but cheap and easy to implement.
The 3rd one is good, but it involves custom transformer design. As far as I understand, you don't have knowledge in this topic. So, avoid it.
The 1st one is the one you should choose. Just choose the current rating of the inductor L1 correctly. |
H: Why are different currents used for charging batteries with the same voltage output?
I'm trying to understand the behavior of batteries a bit more. I've noticed that chargers for given batteries have different current capabilities. Do batteries need to be charged with a voltage that is near their nominal output? E.g., a 12V battery should be charged with 12V? If one charger for a battery has a 1A output and the other has a 2A output, is the higher current charger actually just supplying a higher voltage?
The batteries don't have some kind of semi-conductor-like physics going on which allows them to maintain a constant voltage drop with different current levels, do they?
AI: Batteries are usually charged with a bit more voltage than their "full" voltage, but the details vary widely. Often batteries that are deeply discharged need to be brought up slowly until they are reasonably full. Most batteries can be charged with simple logic that applies some fixed voltage or some fixed current, whichever is lower, if you're willing to give up some charging time. Even that doesn't apply universally though, like with NiMH. If you want the fastest possible charging time, you have to carefully do what the datasheet says to do.
A 2 A charger isn't going to produce a higher voltage than a 1 A charger, but it has more current capability. That means it is intended to charge a larger battery, all else being equal.
For the best answer, read the datasheet for the particular battery you want to charge and don't assume it applies to any other battery. |
H: How does someone initially design a digital system for HDL?
So I have really been hitting the example code hard this week in an attempt to better understand some HDL design basics, specifically FPGAs with VHDL. The book I am using (if anyone is interested) is "FPGA PROTOTYPING BY VHDL EXAMPLES" by Pong P. Chu.
After a few examples, I am starting to wonder.
How does someone initially design a digital system for HDL?
(Flowchart/Block diagram? Signal list? etc)
For example, I love to use Logisim to flesh out simple digital circuits. The graphical interface is easy to follow and I can get on-the-fly simulations without all the synthesis. But when I am satisfied with my Logisim design, I find it difficult to transfer that design into HDL.
Is there a way to understand how you should structure your HDL design, or does it just come with practice?
AI: I generally take a top-down design approach, and I start by drawing a block diagram that shows the interfaces among the top-level blocks. I then draw additional diagrams that represent the implementations of the top-level blocks in terms of lower-level blocks.
This hierarchy of block diagrams translates pretty much directly to the hierarchy of the HDL modules. Once I get to a low enough level of detail on the block diagrams, I start coding and stop drawing diagrams.
The block diagrams also function as dataflow diagrams, since they show at every stage how the data flows from one module to another.
When it comes to specific interfaces between modules, I also draw timing diagrams that show the details of the interface protocol. I also use timing diagrams to keep track of the flow of data through the pipeline stages inside a module. In both cases, these diagrams serve as a reference when looking at waveforms in the simulator during verification. |
H: Finding pulse period for output compare on ATmega128 (10-bit fast PWM)
Ok, so I have ATmega128 board. I have clock of 16MHz with a prescaler of 8 (2MHz). I am using fast 10-bit PWM to generate a waveform with a top value of 1023.
Given a number, the value put in OCR1A = pulse_period *(number/100).
The wave will be high for pulse_period * (number/100) and low until it reaches TOP, where the timer will reset.
However, given the information I have (which I gave in first few lines), how do you find the pulse_period when top is 1023?
Thanks for any help :)
AI: \${1024 \over ({16MHz\over 8})} = 512\mu s\$ |
H: Given hardware specs: How do I calculate the data bandwidth [bits/s] of this system?
I'm currently trying to buy a hardware that is supposed to extract your brain waves. In other words, a data transmitter.
I am looking at the hardware spec and I am uncertain as to how I should calculate the data bandwidth i.e. how many bits the system is able to send per second.
https://emotiv.com/product-specs/Emotiv%20EPOC%20Specifications%202014.pdf
I'm primarily confused between sampling rate and the resolution. What does resolution mean in this context?
Thank you for your help!
AI: Each channel produces 128 samples per second.
Each sample has 14 bits of information (but maybe 16 bits are transferred somewhere? that's not clear).
There are 14 channels.
So it looks like the total bandwidth is
$$14\times14\times128=25.088\mathrm{kbps}$$
Maybe 28.672 kbps are actually transferred, depending whether those 2 "discarded" bits in each sample are discarded before or after transferring them.
Edit
As Dave points out, there is a note that indicates the internal sample rate is 2048 Hz (really, 2048 sps). Given that the 14 channels are sampled sequentially, this indicates that likely there are 2 unused channel sampling slots, ans so the overall bandwidth being generated by the sampler is
$$16\times16\times128=32.768\mathrm{kbps}$$
Of this, two sampling channel slots and 2 bits per sample are not useful data. Whether they are actually transferred over whichever interface you are asking about is not clear. |
H: Implementing F using a demultiplexer and an extra AND gate
Use a 1-to-8 Demultiplexer and an extra AND gate to create the function:
F(x,y,z) = ∑m(1,3,5)
If I were using an OR gate I think this would be trivial, simply put the 1 3 and 5 from the demultiplexer in to an OR gate and have the output go to F. But using an AND gate for this, I have no idea how?
AI: Output F needs to be active for all odd numbers except 7. So...
LSB to mux 20 input, mux outputs '0' for even numbers and '1' for odd numbers. AND gate detects 7, output to mux 21 input forces it to output '3' instead of '1'. |
H: 1A Voltage Regulator - Maximum or output?
I want to design a circuit that has 12V1A output from a battery. I am using a 12V voltage regulator
Do I want a 12V 3A Regulator or 12V 1A regulator?
If a 12V 1A voltage regulator gives me a better dropout voltage, should I use that?
The current is dependent on what the load will draw, right?
Sorry if its a bit of a simple question, but even searching I can't find the answer, it just gives me different questions.
Thanks
AI: My awnser assumes that your battery can provide enough current / voltage.
You can use both voltage regulators, as the load only draws the current it needs. So if your load is drawing 1A constant, you can use any voltage regulator that has a output current of 1A or above. I would choose personally a voltage regulator a bit higher then the circuit draws. (So if the circuit draws 1A I'll choose a voltage regulator of 1.5A or higher) This is just to be sure your voltage regulator can provide the current that is needed.
Choosing between a low drop and a non low drop voltage regulator depends on the battery you are going to use. If your battery is like 15V a normal voltage regulator should do. Be sure to check the datasheet for the minimum input voltage when you are going to regulate it to 12V. |
H: Tactile pressure sensor and drift. Reading the datasheet
I am looking at the specs of tactile pressure sensor and I can't understand what this means:
"Drift: <3.3% per logarithmic time scale"
How should I understand this? Does this sensor drifts a lot or this is actual good. I am looking for cheap way for measuring wight changes over a long period of time.
Cheers Mitko.
AI: Tentative answer:
There may be some relaxation mechanism, the way a dent will appear in a carpet if you leave a chair leg sitting on it too long. This specification places an upper limit on the effect that will have on the reading.
So if you read 100N force after 1 second, the reading may have drifted by 5% or 5N (or less) after 10 seconds, 10N (or less) after 100 seconds, 15N after 1000 seconds and so on. (I am assuming they mean log(base 10) but the datasheet is not explicit on that point)
It's not obvious if there is a lower limit to this behaviour (i.e. 15% difference between 1ms and 1 second) but I would assume so, down to the 5 us specified settling time.
Another question is : does the same drift apply when you then remove the weight? (the chair leg depression disappears eventually after you move the chair). If I were contemplating this sensor the first thing I would do is get my hands on one and characterise it with actual measurements. It may be better than the spec, bearing in mind that future production may vary within these limits.
Whether this is good or bad depends on whether it meets your needs, and how well it compares with other sensor technologies within your budget. |
H: SMPS Inductor oversized vs properly sized
I am working on an SMPS for boosting an input voltage to drive a single string of LED's. The input voltage range is from 18 to 32 volts. The output voltage needs to be about 60V and the drive current is around 0.760 Amps. I am working on using the HV9912 as the driver chip. The frequency is set to approximately 200KHz.
The question I have is this:
I have calculated a required inductor rating of 90uH, what happens if I use something significantly larger(as in 2 or 3 times as large)? Will the duty cycle be the only thing affected? What effect does this have on the inductor current?
AI: The inductance is merely a requirement of the switched frequency. Also a higher inductance usually means higher package/device size for a given current rating. What you should be worried about is not the Henries, rather the actual current carrying capacity and saturation point of the inductor used.
Your boost converter's inductor should have a current rating (and saturation point) easily 1.5x times more than your intended output current. Ripple currents for boost converters can be quite high, so make sure your output and input capacitors have suitable ripple current ratings and low-ish ESR (their ability to handle ripple current, they get hot due to ESR).
Google around for some application notes on SMPS boost converter design, they will cover the important aspects for selecting and sizing inductors appropriately. I know that Microshop and Texas Instruments both have good ones i've seen before. here is one from TI on basic calculations for a boost converter's power stage.
Also note that having inductances x3 more than required can very heavily damp the start-up current and settling time of the SMPS control system |
H: Current overlap in Inductive Smoothing?
I have the following circuit implemented in the lab :
And the output was :
Can anyone explain why the current overlaps here ? I can't make sense of this.
AI: The energy stored in the load inductor forces the total current to be nonzero. When the voltage across the two diodes is equal (i.e., when the input voltage is zero), the load current is shared equally between the two diodes. When the input voltage is close to zero (within ± one diode drop), the current is still shared, but unequally. Outside of that range, one diode carries all of the current. |
H: Buffer circuit explanation
I just saw this question and was wondering how this circuit actually works, since I couldn't really figure it out, I though about asking it.
This is the circuit I am talking about:
Lets label transistors from left to right as: Q1, Q2, Q3, Q4. I dont really know where to start, how to analyze this circuit to figure it out how it works. What I am especially curious about is the purpose of Q1? Or what about the diode?
If someone could give a detailed description of the circuit I would be really thankfull.
AI: Q1 gets input current and voltage, and operates in "reverse active mode" to make current flow from VCC through the 6K Ohm resistor, through the Base, out the collector(!) and into the base of Q2.
Q2 then turns on, sourcing current in the usual fashion into the base of the output arrangement created by Q3 and Q4. When input A is high, Q2 turns on Q3, which grounds Q4 making the output high impedance, letting an external resistor pull up to VCC or whatever it's connected to.
The collector-emitter in Q4 is able to pull towards GND (perhaps not quite reaching GND though), and this is an "Open collector" style logic set-up, because the top (collector!) of Q4 is the connection to the outside world. You would probably have an external pull up resistor on the output, and when Input A is low, it will pull the output close to GND. |
H: Amperage for Sony SNC-VB630 Camera
I am trying to choose a right DC adapter for SNC-VB630 CCTV Camera but the only specs I could find in the official documentation was 'INPUT 12V DC'. Nothing about amperage. I have a 12V dc adapter with 400mA current at hand and I was wondering if that would suffice. How can I find out?
AI: If this is the correct camera the specs says
Power Requirements
PoE system (IEEE 802.3af compliant), DC 12 V ± 10%, AC 24 V ± 20%
Power Consumption : 6.0 W max
The current I = P / V
Then 500mA max to provide the camera with the power it may need.
Also this site also states the max, not sure of the language but it does say 500mA max. |
H: libmodbus trouble with reading from server
I have the following code for connection to a temperature sensor as my server using the libmodbus library in C,
#include <stdio.h>
#include <stdlib.h>
#include <modbus.h>
#include <errno.h>
int main()
{
struct timeval old_response_timeout;
struct timeval response_timeout;
modbus_t *ctx = NULL;
int rc = 0;
uint16_t tab_reg[64];
int i = 0;
int slave = 0;
int connected = 0;
int serial = 0;
ctx = modbus_new_rtu("/dev/ttyS1", 9600, 'E', 8, 1);
if (ctx == NULL) {
fprintf(stderr, "Unable to create the libmodbus context\n");
return -1;
}
modbus_set_debug(ctx, 1);
modbus_get_response_timeout(ctx, &old_response_timeout);
response_timeout.tv_sec = 10;
response_timeout.tv_usec = 0;
modbus_set_response_timeout(ctx, &response_timeout);
modbus_set_byte_timeout(ctx, &response_timeout);
slave = modbus_set_slave(ctx,247);
if(slave == -1)
printf("Didn't connect to slave/n");
connected = modbus_connect(ctx);
if(connected == -1)
printf("Connection failed\n");
if(connected == 0)
printf("connected\n");
//serial = modbus_rtu_set_serial_mode(ctx, MODBUS_RTU_RS485);
//if(serial == -1)
// printf("Didn't set serial mode/n:%s\n",modbus_strerror(errno));
rc = modbus_read_registers(ctx,0x27,2,tab_reg);
if (rc == -1) {
fprintf(stderr, "%s\n", modbus_strerror(errno));
return -1;
}
for(i=0;i<rc;i++)
printf("degrees %d\n", tab_reg[i]);
return 0;
}
It fails in the following section of code,
rc = modbus_read_registers(ctx,0x27,2,tab_reg);
if (rc == -1) {
fprintf(stderr, "%s\n", modbus_strerror(errno));
return -1;
}
with a connection timeout. could this be due to me setting up the connection to the modbus device the wrong way, or are there any libmodbus library problems anyone knows of that could be causing this? I am using this device http://www.epluse.com/en/products/humidity-instruments/humidity-measuring-modules/ee071/ on Redhat Linux 6.5.
AI: Strange that it uses 9600bps... most of the modbus devices I've seen use 19200 bps. Could you test it with the MODPOLL tool to see if you can communicate with it, and if/when you do, post the parameters that proved to be working.
As you probably know, there's two basic modbus protocols, MODBUS/ASCII and MODBUS/RTU. I didn't find from the datasheet which one it is using, so maybe you're using the other one. If it's using 9600bps, then it might very well be MODBUS/ASCII. |
H: Does the output of JK Flip Flop toggle continously?
As given in most of the texts and online resources, the JK flip-flop requires a clock signal with an edge detector circuit so that the flip flop will be sensitive to the inputs only when the clock signal undergoes transition from low to high(Positive edge triggering)
What would happen if the clock signal is directly applied to the JK flip flop? I'm not sure (correct me) if directly applying clock pulse to JK is called level triggering. The question arises when both J and K inputs are 1. Would it keep toggling at every high level(And output would be similar to flashing an LED from 555)?
We've performed the experiments of verifying function tables for all the latches and flip-flops in our practical sessions. But we have directly fed the clock output from 555 to the flip flops.
Does the type of triggering has no effect on functioning of a Flip-Flop?
AI: A flip-flop can only change state when there is a zero-to-one transition in the incoming clock. If J=1 and K=1, Q output will toggle at half the frequency of the CLK.
It may help you (or confuse you) to know that internally a flip-flop can be formed by cascading two level-sensitive latches, the first of which is low-level latching and the second one is high-level latching. When the same clock is fed to both latch enables, the first latch will settle its state when the clock signal (its latch enable) is low. The second latch will settle its state when the clock signal (its latch enable) is high. Note that the input of the second latch is the output of the first latch. The end result is an edge-sensitive device. |
H: GOTO a specific address in HI-TECH C Compiler PIC18F
I'm trying to jump to a specific address in HI-TECH compiler and the address is given dynamically.
I tried using asm() function but it looks like the argument must be a constant char[]. Is there another solution to jump to an address using goto or another function like goto_address(address) in CCS Compiler?
I tried this:
long address = 0xA20;
char addr[15];
sprintf(addr, "goto %s", address)
asm(addr); // Here argument error.
Thanks.
AI: This is the kind of thing most easily done in assembler.
If you need to do this regularly, you can create a assembler subroutine that follows the C subroutine linkage conventions. This would take a 24 bit argument that is the address to jump to. Remember to have the subroutine pop its own return address from the stack before doing the jump. The subroutine would write bits 23:16 of the address to PCLATU, bits 15:8 to PCLATH, and then bits 7:0 to PCL. That last instruction will actually do the jump, so everything else needs to be set up properly before the write to PCL. |
H: Eagle: Remove some text of a component label
I routed a small board that will get connected to a BeagleBone Black using two 8x2 pin header connectors.
As you can see on the picture there's two labels that are drawn out of the board layout so when I upload the board on OshPark the board is bigger that what it should be.
How can I remove those two circled labels without editing the eagle component library?
Do I have to generate my own gerber files and don't use the OshPark's website to generate them?
I'm new to eagle.
AI: Your best option is to edit the part. Don't be intimidated! Eagle parts are fairly straightforward, and you have the benefit of an already-built part to modify.
I've gotten to the point that I don't even use the libraries that come with Eagle. It takes me longer to verify the library part than to create my own :)
If you do edit the part to remove the silkscreen labels, I suggest making Pin 1 a square shape. This way you'll have some way of figuring out the orientation on the board itself. Once you're done, you'll need to click Library -> Update in your design.
Another option is to make the Gerbers, but even then you would need a gerber editor to remove the unwanted silkscreen...
Good luck! |
H: What is the best and simple circuit diagram for a radio receiver to receive radio waves in Citizen's Band
I am building a two way radio system using the citizen's band in India.
The transmitter is using a 555 timer IC clocked at a frequency between 26.957-27.383MHz to transmit AM waves.
Can you please suggest a possible circuit diagram (with components mentioned) for an AM receiver which will be able to receive requencies between 26.957-27.383MHz ?
The circuit diagram i am following so far is :
AI: The ZN414 was designed for AM broadcast frequencies, and is only good up to around 3MHz. However it works wells as an Intermediate Frequency amplifier and detector. You would need a Local Oscillator and mixer to convert the 27MHz signal down to below 1MHz, where the ZN414 is most sensitive. The most commonly used IF frequency is 455kHz, which allows you to use a standard CB radio crystal to select the channel.
The circuit below uses a BC547 in the LO, and a BF244B as the mixer (which also provides some amplification). The crystal must be cut for a frequency that is 455kHz below (or above) the channel frequency, eg. 26.67MHz for receiving 27.125MHz. When this local frequency is mixed in with the incoming signal through a nonlinear circuit (the BF244) sum and difference frequencies are produced. The difference frequency of 455KHz is selected by the IF transformer (which is tuned to this frequency).
However this not the simplest design. For simplicity with high sensitivity the Superregenerative receiver cannot be beat. It uses a single transistor with positive feedback, which causes the gain to increase exponentially until it breaks into oscillation. Then a quenching circuit is used to continuously reset it at a supersonic frequency. The result is very high gain with minimal parts count. This circuit is commonly used in cheap 'walky-talkies', r/c toys, and 433MHz remote controls.
Here is an example. T1 provides all the RF amplification and AM detection. T2 and T3 just amplify the audio signal. |
H: RC filter transfer function and gain
For a standard basic RC Filter, the transfer function is as follows:
$$
{ V_{out} \over V_{in} } = H(j\omega) = { 1 \over 1 + j\omega RC }
$$
However, when simulating the circuit, I find the output voltage to equal:
$$
{ V_{out} \over V_{in} } = |H(j\omega)| = \left|{ 1 \over 1 + j \omega RC }\right| = { 1 \over \sqrt{ 1 + (\omega RC)^2 }}
$$
Why is the actual output equal to the modulus of the transfer function, not the transfer function its self? What does the original transfer function tell me, if anything?
AI: The transfer function is not \$H(\omega)\$, it is \$H(j\omega)\$ (note the \$j\$, which makes it complex):
$$H(j\omega) = \frac{1}{1+j\omega RC}$$
This is important because the transfer function captures the phase in addition to the amplitude.
The amplitude is
$$|H(j\omega)| = \frac{1}{\sqrt{1 + (\omega RC)^2}}$$
by the definition of complex magnitude. This is the gain you measure from input to output and it may be all you care about, especially for a first order system. However, the phase $$\angle H(j\omega) = -\arctan(\omega RC)$$ can be quite important (e.g. for ensuring stability), especially for higher order transfer functions.
The main, direct use of the transfer function is to capture both gain and phase in one expression, but can also be used for time-domain analysis, as the transfer function is the Laplace transform of the impulse response. It is also useful for characterizing a multiple stage system, since the transfer function \$H(j\omega)\$ of a system consisting of stage \$H_1(j\omega)\$ followed by \$H_2(j\omega)\$ is simply \$H(j\omega) = H_1(j\omega)H_2(j\omega)\$ whereas in the time-domain you need to convolve the impulse responses \$h_1(t)\$ and \$h_2(t)\$ to find the overall system impulse response of \$h(t)\$. |
H: Manually Drill Vias into PCB
As shown in the photo below, the PCB design was sent for fabrication without the drill data. Is it still possible to drill the via holes so we can save the PCBs?
This is a 2 layer board, most of the traces are on the top, a few are below. Is it practical to send the drill file to a machining shop and have them drill the holes? Will the drill file already specify the holes, or is there a standard hole size which I can let the machining shop know?
AI: It will be possible to drill these if you have a very rigid drill press and carbide bits. Back the PCB up with a sacrificial piece of laminate, get bright light and safety glasses and get very close to get the holes near the center. Use the highest spindle RPM your drill press is capable of (30,000 RPM is not too much) and feed slowly, especially when the bits break through.
If your drill press is not rigid enough or the bits are the slightest bit dull, they will break off and can go anywhere, so safety glasses are not optional.
If you use steel bits (use the best cobalt steel if you try this) they may work okay, but they'll tend to skate around on the pad and not be in the center. Replace them every 50 holes or so as they dull in the glass laminate.
You'll still have to find a way to solder them on the top or add additional jumper wires from top to bottom. If that thing is a terminal block, for example, you'll have to add ugly jumper wires on the bottom to a number of the pads. It won't be pretty but it might help you debug.
I doubt it's economical to get a machine shop to do this unless the boards are very, very expensive or you're willing to pay a lot of money to compress schedule.
In the future, look at your files with a gerber viewer that includes NC drill files, make a checklist for what files have to be with a given number of layers PCB, and (IMHO) never do business with this supplier again. |
H: Will crosstalk be induced if signal running in parrallel to power trace?
I haven't come across any mentions of signals running in parallel with power traces. Everyt mention thus far has been two signals to each other.
If I have a low amplitude signal (sinusoid < 10khz) (10 mil trace), lets just say its 1V, and its running in parallel (10 mils) with a 5V power trace (30 mils) and there is an ground plane directly below. What happens to my signal ? What happens to my power ?
A few scenarios
Power trace feeds IC's directly
Power trace feeds decoupling caps directly which were chosen as the typical 100nF value.
Power traces feed decoupling caps directly which were chosen to have the largest capacitance possible for its footprint ? (This can be anything you feel is realistic)
Power trace feeds local reservoir caps and each reservoir cap distributes its power for a particular region of the board. All the components within that area have decoupling caps being fed from their local reservoir.
The order of the scenarios should be that would cause the power trace to go from most demanding to least demanding.
Edit
Added signal type - its a sinsusoid
AI: Yes there will always be crosstalk. This is caused by capacitive and inductive coupling of the traces. In most cases this will however not be notable because your signal is large compared to the signal that is coupled in.
Furthermore ripple on your power supply and large dI/dt in your power trace would couse much more noise to be coupled in your signal trace than a clean power trace without ripple.
The reason crosstalk is mostly known of signal traces is because signal traces have fast changes in voltage (high dV/dt) and/or fast changes in current (high dI/dt), but depending on your application this can be the same case for your power trace.
Edit: To answer the added question:
Decoupling is one way to solve the problem of high currents trough your power traces, thereby minimising crosstalk to nearby signal traces.
However it is not (always) good to have a higher value as decoupling capacitor. The smaller values (say 100nF) decouple higher frequencies (around 10MHz), whereas the large capacitors decouple the lower frequencies.
For your scenarios this would mean that case 3 is in most cases worse than case 2. |
H: Can I split a USB cable's male end, add a second male plug, and draw 10V from 2 ports instead of 5V from one port for a single device?
Say I have a device that accepts 10V @ 2A, and I have a wall-wart with two USB plugs that both output 5V @ 2A. Can I add a second male connector, connect both connectors to the wall-wart's two ports, and draw a cumulative 10V @ 2A?
This question's answer indicates that this would cause havoc for motherboards or other electronic devices, but there's a lot more going on with a motherboard than with a power block. Does this answer still apply?
AI: No you cannot!
Both USB sockets are probably even the same power supply so the 5V of both USB ports is connected to eachother and the 0V/GND is also shared.
If you had two different adapters with internal galvanic isolation (transformer) it would be possible to make 10V 1A of two 5V 1A USB ports. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.