text stringlengths 83 79.5k |
|---|
H: Microcontroller and decoupling capacitors on the VDD layer
I have a microcontroller design that is implemented using a two layer PCB. All the components need to be placed on the bottom layer due to the fact that there is a display in the top layer.
In short, I ended up placing all the components in the same layer as the VDD power. The initial design without copper pour intended to be like the following picture:
However, after placing copper pours, the result was this:
At first thought, I believed that there were no problems at all with the result: The capacitors where near and there were big traces to the processor pin. But as a second thought, I realized that it could be defeating the purpose of the noise suppression capacitors as I was now giving the noise source a low resistance path into the processor's power pin. Therefore, I changed the copper pours to avoid this low resistance path and forcing current to go into the capacitors leads as shown:
In essence, I'm asking anyone that has expertise in this matter to provide some comments and guidance about this design. Is there anything I am missing? I also don't see any problem with the fact that the processor is in the same layer as the VDD signal; if there is any problem, please comment.
EDIT
It is indeed a mixed signal plane. Pipe's comments makes every sense for me thus I'm renaming VDDD plane to VDD.
AI: First of all, you don't have a VDD plane (What's VDDD? I'll call it VDD). You have a mixed signal plane.
There's absolutely no problem having the processor on the same side as the VDD copper. If it was, it would invalidate every two-layer PCB I have ever seen. Don't worry about that.
Since you have already made sure that all your current paths are laid out exactly as you want them, I see very little need filling the plane with VDD. From your initial layout, I suggest that you simply route your power traces back to the supply. This assuming you have a ground plane on the other side. Otherwise try to route the power traces close to the corresponding ground. |
H: What does "bolt-on" mean in this Arrow Electronics' job posting?
I came across of Arrow Electronics job posting, and wondering what term "bolt-on" means. While I can find generic description of this term, I can not understand how it relates to the electronics and duties of the job holder. I found subsection "bolt-on (chassis)" at Digikey website, does this "bolt-on" have any relation to electronics / component product line being sold? Or it is a property of the candidate they are looking for? Please advise.
CLEAR CATEGORY: Sales w/ Sales bolt-on’s
...
Manage all resources to grow the business with Field Application Engineers, Field Marketing, Asset, Business Process Excellence (BPE), Assignees, customers, suppliers (bolt-on for CE), Customer satisfaction (bolt-on for SE)
...
Support the company credit policy (bolt-on for SE)
Update: if you have an urge to press close question button, consider this before doing so -
This question, while is not about electrons, chip and op-amps, is about entity, playing role in EE and which has, most probably, influence on you and your life;
This question is NOT about job, but about probably industry-specific term;
Prove that this term bolt-on has no specific meaning in EE / electronics manufacturing / electronics business. I have never seen this term before anywhere, and I am not a native English speaker;
Last, but now least. Think about your fellow EE colleagues who may be also looking at such masterpieces from Arrow. By closing this question, thus not allowing giving (more) answers and replies to it, you may give disservice to them.
I am waiting for answer from the agency, it seems they will refer to Arrow's HR (the only contact for them), as they appeared also not having idea what it is.
Update (as a response to Jeanne): let me explain the history of why I asked this question. I have got JD from agency, and the target job is located in the country with English being non-primary language, while used to be taught in the schools. The link to JD in UK I posted in the question above is reference for you how it looks like in my JD (mine is not online). I have classical British business education, but this "bolt-on" got me stuck, and stuck just at the top of the document.
My first thought was that it is sales of something relating to bolts or bolting. So the first link to the heat sinks and product lines related to parts being bolted. This was the time I decided to ask this question.
Next thought was about "bolt-on" as idiom, meaning "additional". If considering JD this way, I would say it is about sales person sitting on at least 3 chairs (self, some SE and some CE), which is business nonsense, and must have been explained differently.
As I did not see this idiom anywhere else, I still think it has to do with business Arrow Electronics is in, or to culture of this company in particular.
And by the way, there're some idioms even Brits and native English speakers are not able to get without solid context.
Update: it seems we have a consensus here that "bolt-on" is not related to EE (product line, some specific EE business term or business technique). Let me get response from the agency (if they will ever provide one).
Final update: agency got stuck, and they did not go to Arrow for clarification. Both answers should be correct ones, and the best reply is by @JRaefield (below the question, he did not make it an answer). Thus I choose @pipe answer as best one (he has answered first and has the lowest score at the time of assignment).
Thanks everyone for the participation, and my apologies for being EE off-topic.
AI: Not that I'm qualified to answer this, but my assumption when reading the description is that the responsibilities are those typical for sales, but with additional responsibilities bolted-on.
That is, you'll have to do a little bit more than just typical sales-things. What is bolted-on to this role is specified later on, such as Customer satisfaction and Support the company credit policy. |
H: Where is the positive and negative on an antenna?
What I am wondering is how to build an antenna. Upon unscrewing my telescopic antenna from it's base, I see only a metal screw base, nothing more. The F Connector has a positive and negative (or ground) connector, the outside is negative and the pin in the center is positive, but I don't see how to make an antenna like this. Where do the positive and negative connectors lead to if the antenna is basically a metal stick?
AI: I think you might be getting confused between monopoles and dipoles: -
Look at the left picture above - it is called a dipole and it requires a balanced two wire connection. It produces and receives radio waves but, along the horizontal centre line the electric and magnetic fields are neutral and you could insert a thin horizontal conducting sheet in that plane and the operation of the dipole would be unaffected.
You can even short that conducting sheet to ground and it would still be unaffected. So then we come to the monopole (on the right). It has taken what I have said and drives just one half of the dipole arrangement with respect to earth. Do you see the difference?
A monopole requires one wire connection to the antenna and one wire to ground. The wire to ground can be very tenuous (as per a transistor radio tuned to FM) and that connection relies on the radio's 0 volt capacitance to ground to form that connection. Sounds unfeasible but it's true - do some math on what capacitance is needed and you'll figure it's true. |
H: Altium not starting!
So I use Altium for designing and on most days a quick restart generally makes things normal. But today Altium refused to start at all.
I could see in task manager multiple instances of Altium though all were frozen.
Any way to get the Altium to run or do I need to uninstall and install the whole thing again?
Also any ideas why such a thing would happen so any mistakes can be avoided in the future?
Thanks!!
AI: This happens to me quite frequently. A couple of things to try.
Try opening the workspace directly. If you save your workspace into a specific folder, then use that workspace. On Windows 7 my workspace defaults to C:\Users\sglover\AppData\Roaming\Altium\Altium Designer {B7BBF47B-2F84-45EA-954F-607E59116D16}\LastWorkspace. Yours may be similar.
If that doesn't work then you may need to delete the workspace and all of the temporary files that Altium creates. On my Windows 7 PC these are in 2 places:
C:\Users\sglover\AppData\Local\Altium
C:\Users\sglover\AppData\Roaming\Altium
The safest way is to rename these Altium folders to "Altium old", then try restarting Altium. You will need to "kill off" any instances of Altium that are still running by using the Task Manager first. |
H: 3.3V step up to 5V using BJT
I'm using an Arduino Blend Micro with outputs that provide only 3.3V and I need to control a MOSFET that needs 5V on its gate. Can I step up the voltage from 3.3V to 5V using a single BJT?
AI: The current in my coil is about 20A with 16V. The speed is not really
important, it's only to choose which coil I want to measure. Any power
supply.
Try this type of BJT interface to your MOSFET: -
The "switch" is just your 3.3 volt logic level input - feed it into Rb (maybe 470 ohms). Rc should be a couple of kohm and V2 should ideally be no less than 9 volts but it's likely the 16 volt that feeds your coil is fine. Make sure your coil (the load) has a reverse protection diode else your MOSFET will quickly die. If you think that the 16 volt rail may get a little higher, consider putting a zener diode across the BJT to protect the MOSFET gate from over-voltage. |
H: Is it acceptable to use 1uF decoupler on a 7805?
I am feeding an arduino, presently through its Vin pin, with a 0.9V drop on its onboard regulatorZ I'd of course like to feed it via its 5V pin, which has a strict upper limit of 5.5V. I don't have any 7806/7808s, and already soldered the 7805 in place. I also have no 0.1uF caps, my nearest value is 1uF. The 7805 briefly spikes to 6-7V when powered up. I need to absorb that spike - can I get by with a 1uF cap on the output?
I am sorry for this trivial post, but I would be very sad if my arduinos died. I have already ordered 7808s and more suitable caps.
AI: In theory, we want the output of a 7805 to be 5V, no matter what. The regulator surely does its best, but there are two things that it needs to react to:
output current demand
input voltage
Ignoring the output for now, when you switch on the input, the voltage rises with a certain speed, and if that speed is faster than the internals of the 7805 are designed to react to, it will lag in regulating the voltage down, leading to higher output voltage than desired.
Usually it should not happen to really go that far beyond the 5V, but it is not totally inconceivable.
You can hide that voltage spike by adding more output capacitance, but how much is mostly a thing of experimentation. You should also add some good input capacitance to slow down the rise of the input voltage to give the regulator more time to react.
If you worry so much about the output voltage not going out of spec, there are some things you may want to consider:
protect it with a zener
use some kind of switch to only switch on when the voltage is stable
use a better regulator, possibly one with a shutdown/enable pin that you set up with an RC to go on when the input voltage is a bit more stable. |
H: Spark Gap in EMP Generator
I recently got into eletronics, and there are some concepts I am having a hard time understanding. I was looking around youtube and saw this video of a small EMP generator, I understand the basics of it, the magnetic field inducts a current thus frying electronics, but what I'm interested in is why there is a spark gap in the schematics. What does it do ?
AI: Presumably the high voltage converter is rectified and put through a multiplier, otherwise this circuit wouldn't work. The capacitors in the multiplier are charged up by the DC and when the voltage becomes high enough to jump the spark gap, all of the energy stored in the capacitor(s) is dumped into the coil, thus producing a powerful EMP. You can think of the setup as building up pressure until it reaches a certain point, and suddenly releases all of that pressure all at once. You can see how that would be much more powerful than simply passing the current through the coil. |
H: A confusion about a transfer function's Bode plot and s domain view
Recently I have been stuck with a simple Bode plot and H(s) comparison.
To begin with, here is the transfer function:
H(s) = 1/s
For Bode plots I write:
H(jw) = (jω)^-1 = 1/(jω)
For the magnitude and phase I use:
|H(jω)| = 20*log(abs(H)) versus log(ω) and here is the plot:
You see above at ω = 0 the dB is finite and in this case it is zero.
Now I 3D plot |H(s)| on the s-plane and try to see how it will show up along the imaginary axis. It is because the Bode plot should be the projection of |H(s)| on the imaginary axis.
Now below is the plot of |H(s)|:
As you see, for the same transfer function 1/s the projection of |H(s)| on the imaginary axis is not the same with the Bode plots I obtained at the beginning.
The Bode plot is logarithmic but the at ω = 0 projection of |H(s)| on the imaginary axis goes to infinity, on the other hand in the Bode plot it is zero.
What is wrong here?
Edit:
From the answer I found out the problem was I was blindly plotting versus log10(ω).
Actually when transfer function is in dB it becomes as:
But on the other hand look what happens below when you plot the Bode plot linearly
ω versus |H(jω)|:
MATLAB plots infinity as 1.
AI: You see above at ω = 0 the dB is finite and in this case it is zero
No, that is not true; \$\omega\$ = 1.
Look at your graph - you are are plotting against a base of log\$_{10}(\omega)\$.
At \$\omega\$ = 1, H(s) will be 0 dB. 0 dB = unity or 1.
For an integrator, at zero frequency, gain will be infinite because that is where the pole is. |
H: Using Tim2 (84MHz) to blink Led for every 500ms - STM32F407VG
I developped a code in ordrer to blink a Led every 500ms using the timer 2 with a frequency of 84Mhz.
I generate the file "system_stm32f4xx.c" to have a frequency of 84MHz for Tim2.
I modified the file "stm32f4xx.h" by adding the line
#define HSE_VALUE ((uint32_t)8000000)
I modified the file "startup_stm32f4xx.c" by uncommenting the function SystemInit() and adding it before the main() in the function Default_Reset_Handler().
After that I created the project show below.
The problem is that I do not get the excepted result, The led blink every 100ms :
#include "stm32f4xx.h"
#include "stm32f4xx_rcc.h"
#include "stm32f4xx_gpio.h"
#include "stm32f4xx_tim.h"
void InitializeLEDs()
{
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD, ENABLE);
GPIO_InitTypeDef gpioStructure;
gpioStructure.GPIO_Pin = GPIO_Pin_12 ;
gpioStructure.GPIO_Mode = GPIO_Mode_OUT;
gpioStructure.GPIO_OType = GPIO_OType_PP;
gpioStructure.GPIO_Speed = GPIO_Speed_50MHz;
gpioStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(GPIOD, &gpioStructure);
}
void InitializeTimer()
{
// Ftim2 = 84Mhz
TIM_TimeBaseInitTypeDef timerInitStructure;
RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM2, ENABLE);
timerInitStructure.TIM_Prescaler = 84000 - 1; // counter rate is 1ms
timerInitStructure.TIM_Period = 60000;
timerInitStructure.TIM_CounterMode = TIM_CounterMode_Up;
timerInitStructure.TIM_ClockDivision = 0;
timerInitStructure.TIM_RepetitionCounter = 0;
TIM_TimeBaseInit(TIM2, &timerInitStructure);
}
void delay_ms(uint16_t ms)
{
TIM_SetCounter(TIM2, 0); // Make sure TIM2 Counter start from zero
TIM_Cmd(TIM2, ENABLE); // Enalbe TIM2
while(TIM_GetCounter(TIM2) < ms); // Wait ms Miliseconds
TIM_Cmd(TIM2, DISABLE);
}
int main(void)
{
InitializeLEDs();
InitializeTimer();
while(1)
{
GPIO_SetBits(GPIOD, GPIO_Pin_12);
delay_ms(500);
GPIO_ResetBits(GPIOD, GPIO_Pin_12);
delay_ms(500);
}
}
Here is the result :
AI: You want to learn how to use those automatically generated code. Modifying them requires really good understanding of how it works.
As to your code, read the manual on how those functions work, in conjunction with the datasheet. Pay particular attention which variable is 16 bit or 32 bit so that your values given to those functions don't overflow.
Lastly write your code so that it does what you want to do. For example to produce a 0 5s delay on a 84mhz clock needs 42million cycles, to be broken down between the prescaler and the reload register. You can figure out what the right values should be.
It is sufficient to say that what you have aren't right. |
H: How do you prevent a speaker from interfering with an array of buttons that use a voltage ladder?
Short story
I have a PCB with 3 buttons on it, each button connected in series with a different value resistor forming a voltage ladder (schematic below). On the same PCB, I also have connected a speaker. The negative terminal of the speaker is connected to the ground plane of the PCB and then the positive terminal is connected to a pin on the PCB.
This entire PCB is actually the handheld microphone of a CB radio and is connected to the main unit through a cable. The sensing of the analog voltage from the buttons is done by an IC on the PCB of the main unit, on the other end of the cable. The problem is that whenever audio is played back through this speaker (be it even static noise) it somehow messes up the buttons. If there is no audio, the buttons work correctly. If there is audio, buttons no longer respond.
Can anyone shed some light as to why / how the speaker interferes with the voltage ladder button array and how I can prevent this interference from happening and have the speaker play audio and have functional buttons at the same time?
Long story
I have a small CB radio transmitter / receiver that has a handheld microphone.
Originally, the microphone had 3 buttons (PTT, channel up and channel down) and, obviously, the actual mic. The speaker is placed inside the actual CB radio unit.
My issue is that the original speaker isn't loud enough to be heard, especially with the AC on. I noticed that the handheld microphone also had what seemed to look like a slot for a speaker, so I took it apart and, indeed, it had a slot to comfortably fit a 35mm diameter speaker. Maybe a different CB from the same line up came with a speaker in the handheld mic. So I thought why not take it apart and add a speaker so that I can hold the mic close to my ear so I can hear better.
I then began studying the circuitry inside the mic and this is what it looks like:
simulate this circuit – Schematic created using CircuitLab
Notice the Extra pin. That pin was not connected to anything on the PCB. The traces for that pin seem to lead to an extra slot for another resistor but the trace ends there and is not connected to anything.
I bought a 35mm speaker, glued it in place, soldered the positive terminal to the Extra pin on the PCB and the negative terminal to a free ground plane via on the PCB.
Finally, I opened up the main unit, traced the cable from the mic and I noticed that the extra pin on the mic was actually connected to the ground plane on the main board (when I was testing for continuity on the microphone PCB, the cable was unplugged from the board so I did not notice that the extra pin and the GND pin were connected). I desoldered the old speaker, then the cable connected to the extra pin and then I soldered the cable to the pin on the PCB that was connected to the positive terminal on the old speaker.
So now I have a new speaker whose negative terminal is connected to the ground plane on the mic PCB, positive terminal is connected to the extra pin, and finally the extra pin connected to the speaker+ pin on the main board.
AI: Based on the original circuit which looks like all hi-impedance, I'd assume the cable is pretty small gauge wire and is not intended to carry speaker currents.
If so the latter could introduce a significant voltage drop along the ground wire. This will of course result in that signal getting coupled back into the buttons line AND the microphone line.
Adding a capacitor between the buttons in and local ground on the main board would improve the situation for that signal. However, the feedback loop that sends the sound back into the microphone may be a more troublesome issue.
If this is indeed the cause, ultimately, you really need another wire for the speaker negative.
If it's a shielded cable, you may consider separating that as either the signal ground or the speaker ground.
ALTERATIVELY
Since, when no buttons are pressed, the button signal is just a long antenna attached to presumably a fairly high impedance pull-up, there will be a considerable amount of cross-talk between the speaker wire and that open ended wire. If there is enough, whatever is monitoring that line may get fooled.
In this case the same capacitor trick should work. Though I might be tempted to add one at both ends for this case to remove the antenna effect in general with the addition of say a 1 Meg resistor in parallel with the capacitor at the microphone end to limit the lines impedance.
NOTE:
If you do add capacitors it may be prudent to also add a small resister, perhaps 100\$\Omega\$, to the PTT switch to limit the discharge current and prevent arcing on that switch. |
H: Selecting a cable for 12V and 24V off-grid solar system
I have two systems connected to 1500W power inverter. Per case as shown below, what size (4mm, 5mm, 6mm ....) cable should I buy?
Note: Based on my researches, the smaller ah output the thinner cable thus the system becomes more reliable, safer and cheaper etc. It is also suggested not to go above 83ah, if possible.
Case 1) One 12V 120ah battery. Output is 12V 120ah. 1500W/12V=125amp
Case 2) Two 12V 65ah battery (wired in series). Output is 24V 65ah. 1500W/24V=65amp
AI: Ampere-hours [Ah] is a charge. It says nothing about power, so you cannot determine your cable sizes from that. Batteries have a "12 Voltage, 120 Ah capacity" value. Don't mix that up with amperes [A]. They are not the same.
Your 1500W inverter will draw up to 125A from 12V, or 62.5A from 24V. It is generally adviseable to have lower currents because of smaller losses and easier construction, as long as you don't leave the low voltage range. (I would even advise to get your hands on a 48V inverter and battery set to drop the losses even lower.)
A rule of thumb is at minimum 0.1mm² of cross section per ampere of current. The lower the system voltage and the longer the cables, the more cross section per ampere you want to reduce the voltage drop. I recommend at least 0.2mm²/A for the 24V system, and 0.3mm²/A for the 12V system. (Same: don't mix up cross section [mm²] with diameter [mm]. They are not the same.)
So, I recommend:
4mm² for 31.25A@48V
12mm² for 62.5A@24V
35mm² for 125A@12V
Short cables may be much thinner. |
H: PCB Mount Relay Causing Reset
Working on existing PCB which has reset issues. Have been able to solve all reset problems except the following:
Using a PCB mount T9AS1D22-24, upon micro going low on Q3 base (K3-A coil de-energize), micro will occasionally reset.
Have attached circuit for viewing. Anyone have suggestions on how to better filter this?
Relay giving me fits is http://www.mouser.com/ds/2/418/NG_DS_1308242_T9A_0915-719064.pdf
AI: In my experience, issues with relays causing problems typically come back to the protection across the relay coil. I would try a capacitor across the relay coil. While diodes are, I believe, a bit more typical, I have fixed many relay issues with capacitors. See Protecting microcontroller from inductive loads, which looks at the difference between protection methods. |
H: Neutral and the earth are bonded at the main panel or the substation but why is only earth wire used for safety?
Typical distribution system can be illustrated as:
Here are my premises (and assumptions):
1-) Chassis in a house must be connected to the earth, not to the neutral.
2-) The earth and the neutral are connected together at the substation.
Imagine one lives in a house and there is no earth in the outlet. I have seen such apartments and never understood how they are allowed to wire houses like that.
Including this web-site, I encountered similar questions (so this might be duplicate but the reason is I didn't comprehend the given answers such as this one) but never understood one thing. And here is my question:
Is there an "easy" example showing the fact that connecting the neutral to chassis is a bad idea? An illustration of a scenario helps a lot.
AI: As others have mentioned primary reason is earth/ground line is a backup line separate from the neutral line to provide two fault protection.
That is, more than one thing needs to fail. For a grounded chassis device the chassis can become live only if two (or three faults occur).
Two fault case: Earth connection broken AND Live wire shorted to chassis.
Three fault case: Earth connection broken AND Neutral wire shorted to chassis AND Live-Neutral reversed at outlet.
There is actually a single fault case too though.. "Earth pin is wired to live at the outlet..." but there is nothing you can do about that one...
Also, under normal circumstances the earth line should have zero current flowing through it. That is quite different from the neutral line that can have 10s of amps running though it which can produce significant voltage drops at various points along the conductor. The ground line "SHOULD" be at zero potential everywhere.
By the way, the wiring you show for House#1 is not legal in these parts. A separate ground is required at the residence, usually clamped onto the incoming water line if it is a metal pipe, or to a long ground spike. Neutral may or may not be tied to this ground at the fuse box. This provides better local protection as opposed to relying on the electric company and the integrity of the service which may get disrupted (torn down) during a storm.
Is there an "easy" example showing the fact that connecting the neutral to chassis is a bad idea?
Yes, it is unfortunately very easy and common for bad wiring to exist where line and neutral are reversed at the outlet. Most appliances don't care, but if you plug your device with the neutral tied to the chassis into such an outlet.. well you can figure out the rest.
Further there is the broken neutral line scenario which can also be quite lethal. Consider the drawing below.
simulate this circuit – Schematic created using CircuitLab
Lets assume appliance 4 used the neutral to ground the chassis. Since neutral does not actually go anywhere the chassis is really floating.
However, what happens when you turn on appliance 5. The neutral line coming out of appliance 5 is then pulled up to the live rail. Appliance 4s chassis will also become live. Appliance 5 could be in another room on the other side of the house...
Imagine one lives in a house and there is no earth in the outlet. I have seen such apartments and never understood how they are allowed to wire houses like that.
Standards vary around the world and age makes a big difference. People seem to forget that residential electricity is a relatively new phenomenon. In the early days things were A LOT more dangerous. It is only through time that we have developed more common and safer standards. Though, as I hinted, some parts of the world are still rather lagging due to the costs to replace everything... Canada/USA for instance, where you can still stick a plug into an outlet while touching the live pin.... |
H: Emitter follower/Common collector confusion
I'm in the need of a buffering circuit for a project and I would like to use a common collector amplifier or emitter follower for this purpose. Above is a schematics of the circuit I'm looking into.
However, I'm having slight trouble understanding this circuit, specifically why the voltage at the output is the input voltage minus the base-emitter voltage drop (around 0.7 volts). Doesn't the capacitor C1 cause a voltage drop? It has capacitance, therefore it has impedance. If this circuit is used as a unity-gain current amplifier (buffer), I want only a small amount of current to enter at the input. Therefore, C1 should be quite small capacitance (because current is the voltage divided by the impedance, which in turn is inversely proportional to the capacitance). But if it has large impedance, I think it would have a larger voltage drop across it, and the output voltage would be input voltage minus the capacitor drop minus the diode voltage drop.
Somehow I think I'm thinking about this circularly, and I can't really make sense of what's happening. Can somebody explain to me why the output voltage is (almost) the same value as the input, and how the capacitor values are chosen?
EDIT: What if there is a load across the output? Say, a small-ish resistor. If the input capacitor is also small impedance, would there now be a quite large current through the circuit from input to output, defeating the whole purpose of the buffer?
AI: You have shown an AC amplifier. The average input current is essentially zero, and the average voltage is whatever your load drags it to. The emitter of the transistor sits at roughly \$V_{Supply} \cdot \frac{R2}{R1+R2} -0.7V\$ if R3 isn't too low value, but that emitter voltage does not make its way to the output except momentarily when power is applied.
The input impedance should be about R1||R2 for frequencies in which the amplifier is useful, that's ignoring the series impedance of the capacitor and the loading of the base, both of which should have much less effect than R1||R2. |
H: 3 Phase Dyn5 transformer neutral groundig
What happens when a Dyn transformer grounding fails? The transformer has mixed loads (1phase, 3phase) also unbalanced. It is going to act as an isolation transformer or ...? Will the phase and line voltages remain the same?
AI: If the ground connection opens in a grounded neutral system, nothing much will happen assuming that there are no other problems. It will not influence the balance or imbalance of the system. There will be some high impedance paths to ground such as capacitance between grounded metal and wiring, motor windings etc. The voltage from any point in the system will be determined by those ground connections. Any ground fault that occurs will not trip any circuit breaker or blow any fuse. The fault connection will then define the voltage to ground at other points in the system. |
H: Additional resistor in feedback loop of bridge audio amplifier
Here is the bridge configuration of the TDA7294 audio amplifier, from its datasheet:
Everything is clear, despite the 22 kOhm resistor connected between output of "top" amp (pin 14) and inverting input (pin 2) of "bottom" amp. Could someone explain what is the purpose of this resistor? Why it should be here?
AI: What you may have failed to notice is that there is a 22 kΩ resistor from the output of both amps that is connected to the inverting input of the lower one.
Notice that Vi is fed to the top amplifier only. (That amplifier is configured as a non-inverting amplifier with the gain set as \$ 1 + \frac {R_f}{R_i} = 1 + \frac {22k}{680} = 33 \$.)
The other amplifier is wired as an inverting summing amplifier. Since the non-inverting input is tied to ground (through a 22 kΩ resistor) the amp output will swing until the non-inverting input is 0 V. This will happen when the junction of the two 22 kΩ resistors is at zero volts. This in turn will occur when the output of the lower amp is the inverted form of that of the upper amp.
Figure 1. Moving the mystery resistor in-line with its twin sister may make things a little clearer.
I suspect that the 680 Ω resistor is there because the configuration could be used as a stereo amplifier if the other channel is fed into the left of the grounded 0.56 uF capacitor on the lower amplifier. In this case the second 22 kΩ resistor would be omitted. In bridge mode the 680 Ω resistor should have zero potential difference across it so it could be left out. |
H: decreasing the range of an lnfrared emitter
this is probably a weird question that has never been asked... but I was wondering how/if it is even possible to decrease the range of a infrared emitter?
here is why I need to know:
I am playing around with making laser tag weapons and I was working on a shotgun. how I have always seen shotguns is they do more damage the closer you are! so I am trying to decrease the range of the infrared led. is that even possible?
If you guys have any ideas please let me know! I'm new to using infrared emitters so I was hoping y'all could help me out :)
AI: As someone who has played around with laser tag weapons, there are some easy options.
The better, as a permanent approach, is simply to increase the resistance of the current limiting resistor that should already be in series with the emitter (or add a second resistor). LEDs will glow even down to very small currents, so try different resistors until you find one that gives the range you want.
A shotgun may be best with a bare, un-lensed, emitter. Longer range guns normally have lenses on the front to focus the beam.
A quick fix, for instance to cut the power when playing indoors, is to place opaque card in front of the LED with only a small hole in it. |
H: Tuning BJT avalanche noise
I'm playing with the idea of building an audio noise maker. I found several nice sources. Most seem to be based on PN junction avalanche noise. As a starting point, I put this on a breadboard:
It works, but I'm not sure I understand it completely.
Q1 generates the noise and Q2 amplifies it. In order for the noise to be audible (or exist?) at the output, RT must be delicately tuned. There is a sweet spot, and moving the pot's wiper in either direction away from that spot causes the noise to stop.
Why is this? Why is it not enough to just ensure that the RT voltage divider places Q1's emitter above the BE breakdown voltage?
Note: Don't think it matters, but I'm using 2N3904's
AI: With Q2's collector resistor of 10k, more than about 11 mA collector current will cause Q2 to go into voltage saturation - you want less than 11 mA peak collector current. It is not easy to guess what base current is required, since Q2's current gain can vary over a wide range (perhaps 100 to 300).
And the reverse breakdown voltage of Q1's base-emitter junction is not known either. It is usually around 7-8 V (data sheet says it could be as low as 6 V). Q1's base-emitter junction has to reach this voltage to generate even a little current for Q2's base. Transistors other than 2N3904 are built differently, and may have much different breakdown voltage \$ V_{(BR)EBO} \$.
You'd like Q2's base current to be somewhere in the 16 - 50 uA ballpark, depending on Q2's current gain. This current is generated by Q1 only when voltage across it exceeds its breakdown voltage. So you're quite right...you only have to exceed breakdown voltage a little bit to generate noise current. But too much noise current saturates Q2: the "sweet-spot" window is narrow.
The Thevenin equivalent resistance \$ R_T \$ of the variable resistor might be about 1000 ohms. If \$ V_{(BR)EBO} \$ is 7 V, then any Thevenin voltage \$ V_T \$ above about 7.1 V will saturate Q2 with too much base current. |
H: How can I interface a Raspberry PI GPIO to an open collector circuit to send / receive data?
I have a GPIO from a Raspberry PI connected to a Nintendo 64 system like so:
From what I've gathered and observed, the data line on the N64 system is an open-collector output. The line is tied high when data is not being transmitted and pulled low to transmit.
The PI supports pull up/down configurations for the GPIO pins, but I don't see anything about an open-collector configuration.
With my current setup, I am able to read data from the N64 with the PI. However, I'm completely stuck on how to pull the data line low in a non-destructive manner using the GPIO pin, and also read from the same pin.
Is this something I can accomplish without additional hardware? Or do I need to add something like a transistor that I can switch with the PI to connect the data line to ground? If I do that, how will I read data?
As you can see, I know just enough to thoroughly confuse myself, but not enough to solve the problem.
Thanks for your help!
AI: Assuming the Raspberry Pi is just a consumer of data its GPIO would be configured as an input, and whether or not you enable a pull-up resistor would depend on if that's built into the controller or not. I can't think of a reason why the Raspberry Pi would ever actively drive the data line. I would guess you need to enable the pull-up on the Raspberry Pi, because otherwise what's the point of having an open collector interface on the controller. You might need to use an external pull-up resistor if the internal pull-up is too weak; the tutorial I reference below suggests 2.2k Ohms, whereas the internal pull-ups on the Pi are likely > 30k.
I wonder whether you're actually going to be able to get sufficiently frequent / deterministic sampling of the signal on the Raspberry Pi by polling the GPIO though, in order to decode the (presumably) serial data coming from the controller. I'm not familiar with the N64 controller protocol, so it's hard to say.
I found this reference on the internet, which might be helpful to you:
To understand how to interface with an N64 controller, one must first
understand the protocol that a genuine N64 uses to interface with the
controller. All data is transmitted on a single, half-duplex wire (the
signal wire plugged into pin 25 above). When this wire is idle, it is
high (hence the pull-up resistor). If a falling edge is detected, it
means that bits are being transmitted. Bits are transmitted in 4μs
intervals. For a 0, the wire is low for 3μs and high for 1μs. For a 1,
the wire is low for 1μs and high for 3μs. In order to read a bit, you
must simply wait for a falling edge, and then read the wire 2μs after
the falling edge. If the wire is high, the value is a 1, if it is low,
the value is a 0. All transmissions end with a 1 bit that is not
followed by a falling edge, called the signal bit.
Looks like a serial Pulse Width Modulation encoding. I'm skeptical that one can decode this with a Raspberry Pi easily. It would, on the other hand, be trivial to decode with a microcontroller, e.g. using pin change interrupts and/or hardware timers / input capture interrupts.
Update
Seeing as it is a bi-directional bus, you should indeed never set the GPIO to an output-HIGH. When you want the output to be HIGH, you just set it as an input with pull-up enabled (or no pull-up maybe). When you want to output LOW, set the GPIO to an output low. Again though, I doubt you can get the timing right with a Pi given the O/S in the way. |
H: Replacing a PC's AC-DC converter with a DC-DC converter for mobile power supply
I'm going to be purchasing a mini PC to act as a mobile work station in a set of field experiments. The field locations do not provide power, so I'm trying to come up with a mobile power supply.
For starters, the mini PC utilizes an AC-DC adapter with a rating of 19V and 65W. I've spoken with a few technicians about the mini PC and I was told that it could theoretically demand more than the 65W supply with everything maxed out (apparently never happens), but the system typically operates around 30W. For the sake of being conservative (insert safety factor here), lets assume I'll be operating the system at 60W under full load.
Based on extensive research, in an otherwise non-existent application of portable mini PCs, there are two options I'm looking at
Portable battery bank for laptop
Auto/marine deep cycle battery w/ DC-DC converter
Let me first identify the power capacity requirements I'm looking for. The system needs to run remotely for 12hrs, with the idea that I could return home in the evening and plug in the battery to recharge it for operation the next day. During the 12hr span of the experiment, the system will be running at full load for 30mins, then "go to sleep" for 30mins. This cycle will be repeated for the full 12hrs.
Based on my power requirements and operating times, I've made the following estimates:
6hrs @ 60W = 360Wh
6hrs @ 20W = 120Wh
------------------
Total = 480Wh
Again, those are pure estimates, which will suffice for this question. Unfortunately, option 1 listed above doesn't present much of a market with solutions in the 500Wh range. The options that did present themselves were relatively expensive in comparison to solutions presented in option 2. I suspect this is due to the Lithium VS Lead Acid batteries. The weight isn't really an issue, so I'm leaning towards option 2, using a marine deep cycle battery with a DC-DC converter. I have found solutions that provide 12V and +70Ah to give +840Wh which is more than enough.
If I go this route, I have to find a DC-DC converter to replace the AC-DC converter to connect the mini PC and battery. Sure, the other option is to buy an inverter, but from what I've read, the inverter is a complete waste of energy, in that it makes a redundant conversion with unnecessary losses. My question is on how to choose a proper DC-DC converter.
I'm not an electrical person, so go easy on me. A lot of this stuff is brand new, but if I cook the system out of ignorance, my boss will have little sympathy. Anyway, if the original AC-DC converter was rated at 19V and 65W, that would give up to ~3.4A. Now I'm assuming the converter is purely a "passive supply", meaning that the mini PC takes what it wants at 19V, but can take no more than 3.4A at a time. That is non-electrical logic for you.
If that is correct, then purchasing a DC-DC converter that is rated at say 100W should be fine? It simply "supplies" more power, but in a "passive" sense, where the mini PC can take it if it wants, or leave it?
I've found some DC-DC converter options that take 12-14V input, and output at a select voltage ranging from 12,14,16,18,20,22V with a maximum output of say 100W. If the logic above is correct, then I should have no problem hooking this up with 12-14V input from the battery and selecting 18V output to the mini PC? The mini PC simply pulls the amps it needs, but can not exceed 100W/18V = 5.5A ?
My confusion comes from how the converters work. Do the "actively" push the wattage through to the mini PC or do they "passively" provide the wattage to the mini PC? If they push it, then it seems that I need a DC-DC converter that matches the rating of the AC-DC converter or less. If they simply provide it, then the DC-DC converter can exceed the specs of the AC-DC converter without any issues.
Any help on clearing this stuff up would be greatly appreciated!
AI: Yes, DC-DC converters do "actively" convert one voltage into another, but with some loss, with efficiency 80-90%.
So, if your computer consumes maximum 3.4 A at 19 A (assuming absolute max), a normal DC-DC converter will take 3.4 * 19 /12 /0.8 = 6.7 A from a 12-V battery.
There are plenty of automotive adapters for laptop power. For example, DELL-compatible 65W mobile supply, or TARGUS brand. |
H: Building a (toy) Ghost Detector
I'd like to build a ghost detector. I'm only just beginning the design stage, and thought I'd reach out for some suggestions.
Receiver: I'm planning to end up with a handheld device with an analog backlit meter, which illuminates when the house lights turn off. The meter will display the present of a particular frequency. I have lots of old FPGA projects which I can modify to use as the radio. Or maybe an Arduino for the logic and ADC interface to the meter? I haven't used an Arduino before.
Transmitter: Now to generate the ghosts... The "ghosts" should be some RF signal or frequency which can readily be received in a common household. While I have a good bit of experience in building transceivers, they have always been over coax or fiber. I'm not familiar with all the FCC codes for OTA, so I'd rather stick to detecting "ghosts" (ambient signals) which already exist. Which leads me to my questions:
Q1 Which frequency should I look for? The lower the better, to keep costs down. The project is for my kids - I'd like for them to be able to walk around and find the presences of "ghosts" coming in and out of range. So the signal should be readily available, but intermittent (attenuation by the home's structure, perhaps). Would 60 Hz work?
Q2 I think it might be fun to have the house lights flicker when the meter hits a high mark. To do this, I would have to transmit after all, but the signal could be very low power - just enough to trigger a remotely controlled wall socket. Surely the socket is a COTS device, but if any of you have done this before, or know of a suitable unit, I'd appreciate the information.
Any other suggestions or ideas would be greatly appreciated.
Note I'm not looking for real ghosts here. It's just a toy for the kids.
AI: Q1
60/120/180 Hz for sure
Those black-brick switchreg battery chargers: 50KHz to 1MHz.
LCD/CRT displays line-rate 50-200KHz
AM radio (540--1620Khz)
Use magnetic pickup: 10 turns of happy yellow solid-conductor wire, around a big oatmeal can (paper or plastic shell). |
H: Capacitive Voltage Divider and Discrepency in Output Signal
Background
I designed a capacitor voltage divider for the purpose of measuring the voltage step up of a resonator. Before I measure the voltage step up I wanted to measure the voltage divider ratio to ensure it matches the theory.
My Circuit and Theory Result
(LTSpice Parameters: Vin = Sinewave,5Vpp,@ 40MHz)
Theory
$$V_{out}=\bigg(\frac{C_1}{C_1+C_3}\bigg)\cdot V_{in}= \frac{V_{in}}{V_{out}} =~ 76$$
Physical Measurement
Signal generator parameters (Sinewave, 5Vpp, 40MHz)
Measured output with Oscilloscope (Input Impedance = \$10M\Omega, 13pF\$)
Result: \$V_{in}=5V, V_{out}=0.2V\$. Hence \$\frac{V_{in}}{V_{out}}= 25\qquad\$ [\$32\%\$ off!]
Question:
Why is my measurement of the output voltage of my capacitor voltage divider not matching the theory? Is there some parasitic capacitance or some problem with my measurement technique that I am not taking into account? Thanks for the help.
AI: A problem is that LTSpice doesn't like "MHz" for what you think. Instead, LTSpice thinks you meant milliHertz, when you wrote it out that way.
So you need to change that to read "40Meg", instead. That will help you with LTSpice, anyway.
Regarding syntax here, you can use Mathjax (I think it's called that.) Or, at least, the version of it they support here. You use either "\\$" to bracket an in-line equation, or "$$" to bracket a block equation.
See this link: MathJax basic tutorial and quick reference for some good info to try out.
Regarding your scope measurement, I don't know. I think you are saying that you are measuring way more than you expect. Is that correct?
Is this on a solderless breadboard? If so, there is capacitance there (significant enough in your case, as I've seen figures in the several pF range) and it may be affecting \$Z_1\$ far more than \$Z_3\$. |
H: Math Regarding Battery Discharge
Good Day everyone :)
I'm new to electronics and it'll be my 2 week practicing it as my hobby though i've done a lot of DIYs and stuffs just by following tutorials but when my friend ask me regarding the maths of my projects, i can't retaliate at all since even i researched for 2 days, i haven't gone far to understanding the math specially on batteries.
I have made a DIY regarding USB charger and its block sequence is like this:
12v Sealed Lead-Acid Battery -> 5v Voltage Regulator Circuit -> 2x (Li-Ion TP4056 Circuit Module) -> 2x Smartphone Battery
I want to know how would i compute this entire project with regards how much Ah, Volts, power, battery consumption, etc. if there will be 1 smartphone that will be charged and if it will be 2 smartphone also.
Some specs of this entire project are as follows:
a) 12v SLA Battery 10Ah
b) 5v Voltage Regulator 1A output
(i don't know the efficiency of voltage regulator, i just used LM7805 https://www.sparkfun.com/datasheets/Components/LM7805.pdf)
(my 5v voltage regulator circuit is like this: https://i.stack.imgur.com/beL4b.png)
(added some:)
100uF 25v cap before 0.33uF cap
10uF 10v cap before 0.1uF cap
some 1n4007 diodes from its ground and output
feedback 1n4007 diode from its output to its input as protection they said
c) Li-Ion TP4056 charger 1A output
d) Smartphone batteries 4.2v 3000mAh
It's ok for me if only formulas will be given with respect to discharge, power, etc for me alone to do the math, i just need some guidelines because to be honest, i don't know how would i explain if my projects are efficient or later will have a drawback, doesn't last long, not practical, etc. though i really wanted to know how would i compute the battery consumption/discharge on this project.
I hope you can help me because I'm overwhelmed right now, i have a lot of tabs on my browser to search that don't have guide where to start. There's always a miss or a variable or process i don't know that applies on the answers i see on web :(
AI: First off you can use Wh to give an ideal world, everything 100% efficient calculation.
12V, 10Ah = 120 Wh source.
3.7V, 3Ah = 11.1 Wh destination.
So if we could do things perfectly we could charge 10.8 batteries. The real world number will obviously be lower.
Charge rate will only have a minimal impact on the final system power usage, the power supplies will vary in efficiency a little with different current draws but not enough to make a huge difference in the answer.
The battery charger is a linear regulator so the current input is independent of output voltage and only depends on the output current.
So to put 1 Ah into the battery we need to take 1 Ah from the 5 V rail. This makes this stage ~74% efficient. (3.7/5 = 0.74)
Assuming a switching power supply is used to step down from 12 V to 5 V then 1 A on the 5 volt rail will require 5/(12*e) amps from the 12 V supply where e is the efficiency of the power supply.
Since you didn't give a number for this let's go with 85% for now, the real number could be higher or lower.
So 1 A at 5 V requires 5/(12*0.85) = 0.49 A from the 12 V supply.
Which means that to put 1 Ah into your Li-Ion battery you will need to take 490 mAh from your 12 V battery.
If your 12 V battery is 10 Ah and your Li-Ion battery is 3 Ah then you should be able to charge it roughly 6.5 times.
Exact numbers will be a little bit lower due to other losses in the battery charger and the batteries themselves but these will generally be small in comparison to the impact of the factors above. |
H: How to convert a device pluggable to a car lighter, changing to a regular home socket
I bought an air compressor that is powered by the car lighter in my car. It does the job when I want to inflate my car tires, but if I want to use for something else like there are 3 bikes in our house and they all have to be regularly check, it becomes a bit of a hassle.
I'd like to change the adapter of the air compressor from a car lighter to a regular adapter, but I'm not sure what should be the voltage and amperage? Or will this depend on the air compressor specs?
AI: Get yourself a cheap power supply with a built in 13.8 VDC port. I have an old one from Radio Shack that I bought 20 years ago, and still use for exactly this purpose.
Your cigarette lighter plug will socket directly into the supply - into the round hole just above the terminals.
Another option is to get a supply like this:
iSaddle, 12 VDC, 10 A. It's more restrictive, but great price. |
H: Is it a good PCB design practise to choose components with the same footprint?
Most of the components I have selected for my project have 2012(mm) footprint while some others have 1608, 3225 and 6432. Does it matter that some components have a different footprint? What is a good design practise?
AI: Generally you will have some choice for many parts- for example, resistors that are not critical in value or dissipating a lot of power can be (inch) 0402, 0603, 0805 or 1206. Ceramic capacitors that are not near the limits of what can be made in a given size may be available in several case sizes.
There are a few other factors- the size of the part affects the overall size of the PCB, which may point towards smaller sizes. You may have reels and reels of parts on the shelf and wish to use them. The price vs. size curve is typically bathtub shaped with the smallest available parts expensive and few suppliers, and the larger parts (which are used less and less in high volume) more expensive and harder to source.
If you are hand soldering the board, (inch) 0402 = metric 01005 and smaller are harder to handle than larger parts. They also come more to a reel.
For high power dissipation resistors, or very high accuracy resistors (especially of higher values) larger sizes are advantageous or necessary.
For capacitors- you may be able to buy the value and voltage you need in an 0603 from one supplier at a high price and with nasty voltage coefficient, but there are a plethora of suppliers making 0805 parts which are better and cheaper.
Assembly wise, it doesn't really matter too much- provided you don't go nuts on making the parts ultra-tiny. Most PCB assembly suppliers can handle the various sizes (though at the very small end some may have older equipment that can't handle really tiny parts well).
As a practical matter, larger resistors are often marked, which can be an advantage. Parts smaller than 0603 (inch) are seldom, if ever, marked.
You may notice that 'glue' logic chips come in quite a wide range of packages, and logic families, just as the market is narrowing due to increased use of CPLDs, FPGAs, and incorporation of similar (very small scale, usually) functionality on processors. So I would suggest being careful about picking packages without multiple sources if the product has a long life cycle. It is not always the largest packages that become discontinued, sometimes the smaller ones don't catch on. |
H: DC-DC converter bypass for VIN = VOUT question
I need to develop a device that requires 5V power. The device must be powered from 5V (USB) or 12V. I need such a system that will bypass the DC-DC converter when it works from USB and enable the DC-DC converter when it works from 12V.
Will my solution work?
I want to use a voltage comparator with some voltage dividers and voltage reference, so it can short the input and output of a DC-DC converter when the VIN is (let's say) <6V with a P-MOSFET, thus disabling the DC-DC converter and providing the power to the device.
I want to use TPS54331. What will happen if I feed 5V to the DC-DC converter when it configured to output 5V? Will there be a drop? I haven't found this info in the datasheet.
AI: You could save yourself a lot of messing around by using a buck-boost converter like this: -
The USB supply can be fed via a low-volt-drop schottky diode to the input (Vin) and if you have 12 volts also present at the input it will take over and power the converter.
Another option: -
You can get these types of devices from TI too like this: - |
H: Friction Coefficient of AC motor
Does the Friction Coefficient "B" of AC Motor changes with the change of a load connected to an AC motor? OR it is always constant?
AI: The coefficient of friction is the ratio of the force of friction between two bodies and the force pressing them together. The only friction in most ad motors is the friction in the shaft bearings. That is probably what the "B" refers to in the question. The coefficient of friction is normally considered to be a constant, but it can change over time due to inadequate or failing lubrication and normal wear. There could also be a small change due to a change in operating temperature.
The force due to friction is independent of speed. The force on the bearings is often only the weight of the motor's rotor, so the force due to friction may not change due to load. If the load is belt driven, the load will cause a side force on the bearings called "overhung load." That could cause a change in the force due to friction to change due to load changes. If the shaft supports a pump impeller or a fan, the load could cause a thrust force on the bearings that would change with speed and load.
In addition to the kinetic friction described above, the bearings have some static friction that only causes a force that acts at the transition between transition and motion. That would be pretty much constant except for changes in the effectiveness of lubrication.
In addition to bearing friction, motors have aerodynamic drag or "windage" that is a type of friction between the moving parts of the motor and air. Most motors have some windage that is deliberately added by incorporating a fan or rotor fins for cooling purposes.
AC motors with slip rings have brush friction in addition to bearing friction. |
H: Antenna Matching Network
I am trying to match a gsm antena, doing it on a pcb, first time in practice. I understand the whole process to adapt it, I've done it in simulators. However, I don't understand the need for a pi matching network, since (theoretically) and LC circuit is enough, or a series and shunt capacitors. So why the extra component?
Plus, I understand even less the suggested pi matching network on the uC datasheet. It shows 2 shunt capacitors with a normally 0-ohm resistor in between. Aren't the capacitors redundant?
When working on a pcb which components should I prefer to do the matching? Are stubs a bad idea? I never see them referenced to do the matching.
I forgot to add:
I'm going to do this with a vna, the configuration I have is the antenna pin from the uC directly connected to the matching network and then the antenna. Should I do this with the uC powered or turned off.
DataSheet: https://cdn-shop.adafruit.com/datasheets/sim800h_hardware_design_v1.00.pdf
Suggested pi-network:
Hope was clear enough,
Regards,
Pedro Lopes
AI: However, I don't understand the need for a pi matching network, since
(theoretically) and LC circuit is enough, or a series and shunt
capacitors. So why the extra component?
Think about what a simple inductor and capacitor provide regarding the input impedance. At resonance, the impedance looking into the LC network from the chips point of view is resistive because at resonance the phase angle is 0 degrees. However, from the perspective of the antenna it doesn't see a resistive impedance and this will be critical for a lot of antennas.
So, the network is designed to look resistive in both directions and, as a result, it doesn't quite run at resonance. The extra capacitor makes the network symmetrical so therefore, for the sake of impedance phase angles, it only needs to be analysed in one direction.
That extra capacitor (from the perspective of the chip or the antenna) turns the off-tuned LC (that now looks more inductive than resistive) into an impedance that looks purely resistive. This is because that extra capacitor is like power factor correction. In fact it IS power factor correction if you look into it. It looks resistive both ways providing you design the values to suit the operating frequency, the antenna impedance and the chip's output impedance.
Regarding the suggested pi network, those components can be fitted by you (the user) to suit the particular antenna you choose. |
H: stm32f103c8t6 help
I bought a STM32F103C8T6 evaluation board (which I have not received yet).
See link
But I'm a bit lost in how to start with it.
I have some experience with Arduino Uno/Mega.
I found already that the Arduino IDE supports them, so that's a good starting point.
However, even before seeing one, I have some questions I cannot find:
Do I need more to program than an evaluation board? I mean with the Arduino, it's a matter of just connecting an USB cable from the PC to the Arduino. Can I do the same for an STM32 eval board?
Do I need an USB-TTL adapter?
I cannot find information what the meaning of the pins is ... they are similar to the chip itself, but not all of them. And there is a lot of info about the chip, but not about the board itself.
also I have trouble finding generic information, like simple examples/starting guide.
note: buying this STM32 is just to find out if I can use it. For my (hobby) project I need eventually something with at least 128 KB RAM (thus an STM32F4...).
Update:
regarding 1.
1a. Why is an STLINK needed ?
1b. And which one with emulator or without?
without emulator
with emulator
My eval board + STM32 is only 3 euro, this will add relatively much cost
AI: I wrote a series on getting started on quite a few popular mcus. specifically for the stm32f1, I wrote a page on getting it started with CoIDE, Keil and Arduino.
https://dannyelectronics.wordpress.com/2016/04/22/getting-started-with-stm32f103-arduino/
https://dannyelectronics.wordpress.com/2016/04/22/getting-started-on-stm32f103-keil/
https://dannyelectronics.wordpress.com/2016/04/22/getting-started-on-stm32f103-coide/
I also implemented arduino on a few ARM chips (ARMduino), including the STM32F100: https://dannyelectronics.wordpress.com/2017/05/27/armduino-a-generic-approach-to-porting-arduino-to-arm-cortex-m-chips/
you may find them helpful.
as to your questions:
you don't need st-link. but it makes your life much easier.
you don't need a usb-ttl. you can use st-link instead.
it is a minimalist implementation so those pins are just what they are: pins.
the datasheet is your best friend. depending on what you are starting with (SPL, HAL, or rolling your own), the examples can be vastly different.
The use of a vendor library is usually one of the first decisions you have to make. The IDE/compiler decisions are relatively simple. |
H: What is this waxy stuff?
I just opened up an old piece of electronics. While salvaging, I found a board with this waxy stuff on it? What is this and what is its use?
P.S. The substance I am talking about is the lightly tanned wax on the top right of the board.
AI: Am guessing that the wax-covered part of the circuit is a radio-frequency oscillator. The coil of wire has been hand-tuned by spreading its turns so that the oscillator frequency matches up with other (transmitting? receiving?) equipment. The wax stabilizes this coil so that it doesn't shift frequency.
Disturbing the wax can de-tune the oscillator. |
H: Static error in analog-to-digital conversion
I'm testing ADC and quantization noise on a microcontroller (dsPIC33EP64GS506), but I've realized that I have a static error in a digital signal.
I measure a DC voltage on a voltage divider and my multimeter measures \$2.267~\text{V}\$, while the analog voltage reference is \$3.297~\text{V}\$. Considering 12-bit converter this should be converted to \$2816\$, but I get a DC value at approximately \$2809\$. This is way more than a simple quantization error.
I tried with longer sample times for an SH capacitor, but without any luck. I even tried with an oversampling filter and although I do get a better SNR, the digital signal mean value is not improved.
Can you please point out some reasons for this?
AI: Can you please point out some reasons for this?
For the ADC: -
Zero offset error as specified in the data sheet
Gain error as specified in the data sheet
Integral non-linearity error as specified etc..
Differential non-linearity error as specified etc..
Plus you have a resistor tolerance in your potential divider and you have a measurement accuracy in your meter. There are also leakage currents to consider that flow into and out of your ADC input - these can add errors if the resistors you are using are quite large in value.
And, if you are multiplexing the ADC among several inputs you need to provide enough settle-time between successive readings or you might get a bit of residual charge on the sampling capacitor that may not have settled down.
You should also consider that many ADCs inputs take a several-milli-amp surge when reading from an input and this can have a significant effect on accuracy due to the resistors in your potential divider.
It's also possible that you have inadvertently set the ADC to operate at a lower resolution. However, 7 least significant bits error in 4096 LSb total range is a 0.17% full-scale-error. Could you really expect much better than this (about 4 mV)? |
H: Is the optocoupler placed before or after the gate driver?
Is it
MCU - OPTOCOUPLER - GATE DRIVER - MOSFET
or
MCU - GATE DRIVER - OPTOCOUPLER
and why?
EDIT : it cannot provide enough power so it is used for signals therefore option 1.
AI: Option 1 is correct. The purpose of opto coupler is to electrically isolate the micro controller and driver circuits. Since micro controller i/o pin current driven capability limited to less than 100mA or less than that. So it can't able to drive the driver circuits. Opto coupler circuits consume less amount of current so it can be driven by micro controller. And also some times to meet the required voltage level to drive the gate driver. |
H: Minimum Switching Frequencies in Boost Converters
Why are switching frequencies for boost converters above the 100kHz range?
If I understand correctly, as the frequency increases from 100kHz upwards, the ripple current that is created from the inductor decreases, the current change over time decreases in the inductor, and components can be smaller because they don't have to deal with larger (relative) currents. However, they're countered by decreased efficiency from switching losses in the MOSFET, as well as losses from the core of the inductor.
So, given that you can increase efficiency by decreasing frequency, why don't switching frequencies occur in lower ranges; the 100Hz-10kHz range, for example? Is it that the current changes that the inductor has to deal with are too high and the inductor wiring resistive losses starts to dominate as the main source of power loss?
AI: Why are switching frequencies for boost converters above the 100kHz
range?
A powerful boost converter could operate in the low/medium kHz range and might do so because the power transistors used are inherently slow devices. The trick is to operate at a frequency where static losses approximately equal dynamic losses.
If I understand correctly, as the frequency increases from 100kHz
upwards, the ripple current that is created from the inductor
decreases, the current change over time decreases in the inductor, and
components can be smaller because they don't have to deal with larger
(relative) currents.
Ripple current sets the scene for how much energy is stored by the inductor and given to the capacitor cyclically. At higher frequencies this transfer is done more times per second hence, for the same power delivered to a load, the ripple current could be smaller but this doesn't quite deliver the same power (energy proportional to current squared) and so the inductance has to be reduced and this increases the ripple current. If you try and factor in the possibility of running discontinuous or continuous conduction mode then it's not as clear cut as you might think.
Components can be smaller, yes.
However, they're countered by decreased efficiency from switching
losses in the MOSFET, as well as losses from the core of the inductor.
Yes and no. Switching losses do increase but some core losses reduce such as saturation. However, eddy current losses (usually smaller than core saturation) will tend to increase and that is why you see significant development in making cores suitable for switching above 1 MHz.
So, given that you can increase efficiency by decreasing frequency,
why don't switching frequencies occur in lower ranges; the 100Hz-10kHz
range, for example?
At low frequencies the inductor saturation is a big factor - lower the frequency and saturation losses can suddenly sky-rocket. If you maintain the balance between dynamic and static losses in your MOSFETs that is usually the best frequency to aim for (as mentioned early on).
Is it that the current changes that the inductor has to deal with are
too high and the inductor wiring resistive losses starts to dominate
as the main source of power loss?
Lower frequency means less energy transferred per second and this means you have to run at higher currents (for the same power out) but don't get obsessed about this. Running CCM (continuous conduction mode) means the ripple current can be very small to transfer the same energy. |
H: Why is the input noise of an op-amp often lower than the Johnson noise equivalent to its input impedance?
As an example, the OPA227 has 3.5nV/sqrt(Hz) input voltage noise density (at 10Hz). Its input impedance is 10MΩ, which has an equivalent Johnson noise of 1μV/sqrt(Hz) at room temperature - much larger than what the datasheet quotes.
AI: An op-amp input might be connected to a voltage source that has some output impedance and that impedance is usually minutely small compared to the input impedance of the op-amp. This means that the net impedance is pretty close to the source impedance.
Hence the thermal noise at that input is pretty much determined by the source's output impedance.
For the OP227 it is usually the common-mode input impedance that is effectively loading the source and that is 1 Gohm. That puts it into even more perspective but, how high could the source impedance be you might ask - given that the offset current could be up to 10 nA, a source impedance of 1 Mohm would produce a DC error at the input of 10 mV and that is about a thousand times more than the inherent input offset voltage for the device.
So, nobody would really want to use this device with a source impedance of more than about 10 kohm else why pick an op-amp that has such a good offset voltage spec and then wreck the application performance with such a high source impedance.
So, with a source impedance of about 10 kohm you can see that this dominates over the internal impedance of the input (1 Gohm) by a mile.
Finally, the input voltage noise density has nothing to do with the input impedance and its potential thermal noise. If you are trying to make sense of one by looking at the other then please don't because they are unrelated. |
H: How to allow thread and interrupt safe writing of incoming USART data on FreeRTOS?
I have a [circular] buffer that is written with incoming data from the USART using IRQ. I also have other tasks reading data from the buffer as well. What should I do in a scenario where a task has the mutex for the buffer but IRQ executes with incoming data? Should I create a tmp variable which stores the data and sets a flag in IRQ so that data gets written to the buffer after the mutex is given?
AI: A FIFO buffer should not have a concurrency problem.
Obviously it will have when used with multiple writers or readers. But this device is not suitable for that purpuse. Use packets instead of streams if that is what you are after.
However, the implementation might have. Therefore the interrupt may not be executed during manipulations on the buffer.
In other words, the read/modify/write of the pointers may not be interrupted by the uart irq.
Other answers suggest that you should use the functions provided my FreeRTOS.
This is excellent advice. The FIFO or queues in an RTOS should have been made to be atomic to all relevant threads to prevent issues.
If you are afraid you will lose data you have two options:
- Increase size of buffer.
- Slow down data rate.
The "atomic" operation of the buffer operation should be less than the time required to receive one new byte, otherwise you will lose data. It may also need to survive the jitter induced by higher priority events. This shouldn't be a problem though, uart interrupts are supposed to be very short and should be able to preempt everyting else. |
H: Protection from fully charged battery
I want to connect a Li-Ion battery on a GSM/GPRS module expecially this one (http://www.electrodragon.com/w/GSM_GPRS_A6_Module). In general parameters is mentioned operating voltage from 3.3V to 4.2V
A simple Li-Ion battery when is fully charged goes up to 4.2V, somethings slightly above this. The question is, how can I protect the GPRS module from this fully charged battery's voltage? I'm looking for something efficient...
AI: All GSM/GPRS/LTE module I've worked with are fine when supplied from a single li-ion cell. As you see the range is from 3,3 to 4,2V. Li-ion cells never (should) get above this voltage, so you are okay to power it directly from a li-ion cell. |
H: Why can't you just average ADC samples to get more resolution from an ADC?
I'm trying to get more than 10 bits of precision from my Arduino ADC but I can't really figure out the theory behind it. An often quoted Atmel Application note (http://www.atmel.com/Images/doc8003.pdf) says that
It is important to remember that normal averaging does not increase the resolution of
the conversion. Decimation, or Interpolation, is the averaging method, which
combined with oversampling, which increases the resolution
Then what they propose for 'Decimation' is moving the decimal point. Which amounts to halving the binary reading for every place you move it so you might as well divide the base 10 value by 2 or 4 or 8 or what have you. Am I understanding decimation wrong?
AI: I took a look at the note and that is indeed a weird claim (or a confusing way of saying what they actually mean).
Perhaps what they actually mean is the point that if you want to get more resolution, you can't divide/shift the number afterward to the same scale as a single sample because (in integer arithmetic) that would throw out the bits you gained.
If your ADC samples are noisy, then of course you can divide to get a less noisy value at the original scale.
The other thing I thought of from just your question was the point that to do oversampling right you need to use an effective low-pass filter, and a straightforward moving average is not as good at being a low-pass filter as a properly designed FIR (or IIR) filter — but that doesn't seem to be supported by the text of the note. |
H: Inconsistent solder mask on vias
When looking at PCBs in consumer products or PCBs I have ordered from manufacturers myself, I notice that, while many of the vias are covered in soldermask, it seems like a few random vias are missing it for no apparent reason. This is true even if I specify soldermask to cover all of the vias.
Why is this? Does the soldermask get wicked down inside the vias during manufacturing? Is there a way to prevent this?
All of the vias on my projects are a minimum of 15 mils. If I used smaller vias would this not happen?
AI: Could be sloppy design, could be the solder mask just didn't stick.
However, it is generally better practice to relieve the solder mask around vias especially if the board is to be flow soldered. Solder filling the via improves the quality of the connection through the board.
If you WANT the mask to cover the holes, you are asking a bit much of a fluid to consistently bridge over air. Add in heating processes during soldering and the chances of a few popping is pretty high. |
H: USB Audio Input Jitter (?)
Hopefully this is the right sub to ask this question. Anyways, I'm working on a USB Audio device on a microcontroller and I'm having issues with getting a consistent audio input.
Some preface:
As of right now, I have connected the mcu and codec via I2S (codec is slave) with the following configurations:
MCLK = 11.2896 MHz
BCLK = 2.8224 MHz
LRCLK = 44.1 kHz
USB CLK = 12 MHz
When I do a simple DSP bypass (codec input -> mcu -> codec output), the audio is glitch free and awesome. However, when I enable USB, that's when things get weird. I'll get occasional glitches and the signal sometimes repeats itself. I'm not totally sure if this is because I'm not using enough buffers when writing to USB.
Right now my codec reads and USB writes are happening separately:
Codec Flow: Codec Input -> MCU I2S RX -> DMA Interrupt when I2S RX buffer is full
-> Write this buffer into USB buffers -> Calculate next input frame len
USB: USB initiates input -> Write buffer to USB endpoint -> USB Write Callback
called when USB transfer is complete -> Start reading next buffer
How I'm calculating my frame lengths:
#define AUDIO_POLL_INT 4
#define FRAME_BYTES 3
#define NUM_CHANNELS STEREO
// Calculate the frame length
uint16_t frame_len = 44 (44.1kHz/1000 samples) * NUM_CHANNELS * FRAME_BYTES;
// Every 10 ms, calculate frame length with additional frame (only applies to 44.1kHz sample rate)
if (!(frame_pos % 9)) frame_len += (1 * NUM_CHANNELS * FRAME_BYTES)
// Increment frame position per usb call
frame_pos = (((frame_pos + 1) / 8) * (2 << (AUDIO_POLL_INT-1))) % 10;
frame_pos = (frame_pos + 1) % 10;
Actual Question/What I think is going wrong (?)
I'm guessing there is some jitter issues due to the codec MCLK and USB CLK rates being different (11.2896 vs 12). I'm only guessing this because the interruptions/glitches happen pretty periodically. I also have noticed that the codec buffers will "catch" up to the USB buffers every once in a while (codec buffer will overwrite a USB buffer even though the USB buffer is marked "full"). However, I'm not sure how to stop this from happening because the codec would go out of sync and I would lose audio data. I also cannot speed up the USB transfers obviously... I'm transferring a max of 270 bytes per USB write for a sample rate of 44.1 kHz.
If anyone has had experience with USB audio and synchronization, your help would be appreciated! I'm not sure how to approach the problem from here honestly. If you're wondering, USB Audio output is fine though (with the exception of some channels not being synchronized).
AI: It's hard to be sure (since this is obviously not your actual code), but it appears that you have hard-coded the pattern of frame lengths on the USB side, on the assumption that the audio sample rate (i.e., the 11.2896 MHz codec clock) is strictly locked to the USB data rate (i.e., the 12.000 MHz USB clock). This would only be true if the codec clock was driven by a PLL that is referenced to the USB clock. In actual fact, they can be different by 10s or even 100s of ppm, given the usual tolerances associated with general-purpose crystals.
Instead, you should be picking the USB frame length dynamically, based on the actual amount of data you have in local buffers that you have received from the codec. If this total is above some threshold, you should send the longer USB frame; otherwise, send the shorter USB frame. This allows the average rate of the USB transfers to track the actual sample rate defined by the codec clock. |
H: Guitar to RCA video. Is it possible?
I've recently been playing around with analog video like composite to S-video and VCR related things like that. I've always thought it would be really cool to create some kind of analog video generator from sound.
If anyone could explain how composite video signals work and should look that would be great.
Some inspiration is from the "Atari video music" https://www.youtube.com/watch?v=BX1LVBLUYNs
I also have seen people make "Dirty video mixers" which is sort of the path I want to go down.
What I haven't seen is a guitar hooked into a TV. Is it possible to convert a guitar signal into a signal that resembles RCA video? Possibly an arduino could be a good way to go? All analog would be cool though.
Thanks alot for reading.
AI: At minimum, a guitar's signal would need to be passed through some kind of preamplifier to have any effect whatsoever on a 75-ohm composite video input. If the input was scaled to a suitable range but didn't have any sync pulses added, some analogue monitors might flash at varying intensities in response to the audio signal, but the results would probably not be very consistent or useful.
If you add horizontal sync pulses but omitting vertical, it may be possible to build a simple analogue circuit (probably 2-3 cheap chips, a couple capacitors, and a few resistors) to make an analogue TV act as a crude oscilloscope which sweeps vertically rather than horizontally. Adding vertical sync pulses would require adding another chip or two. The results would likely be rather crude, but would mirror what could have been built in the 1980s. |
H: How does this power inverter circuit work?
I'm looking for a power inverter for a DC voltage and I found this circuit on Wikipedia (I'm asking about the one on the bottom; ignore the one on top because it's the electromechanical equivalent of the one below.). I don't understand how it could possibly work, though. Isn't the negative terminal of the voltage source connected to the P-junctions, making reverse-biased connections to both transistors? And if that's the case, how do we get any current flow, much less a switch?
Here is the Wikipedia article that I found the circuit on.
AI: The emitter is negative (usually 0V gnd) relative to the collector which pulls coil current from a common V+ in either direction.
This primitive drawing uses NPN to create a "Push-Pull" free-running Oscillator determined by the LC characteristics of the transformer. The outer primary coils sample the drive current and polarity is such with delay that it becomes a positive feedback loop or AC coupled pulses to drive the base and maintain oscillation as a quasi-square wave with cross-over deadtime.
Since the core is shared , each NPN takes turns in driving the flux in opposite directions and the turns ratio uses the individual winding turns not the sum of both for voltage ratio from an effective conversion from dc to ac of;
Vcc=Vp-p + min. losses.
It is more common now to use MOSFET's and a controlled complementary gate signals with a defined dead-time to prevent shoot-thru across Vcc but this method guarantees a dead time but deadtime determined by slew rates then use optical feedback to control the clocks with precise controls on either skipped pulses for low power use or increase clock speeds or PFM for boost control or PWM for buck control.
For more SMPS topologies , read here. http://www.onsemi.com/pub_link/Collateral/SMPSRM-D.PDF |
H: Why is the PCB so large on this SMPS?
In a post regarding heat dissipation in a linear regulator, one answer provided this nice little pin-equivalent smps. It was a great reply, and I'll likely order a few myself.
I am wondering though, why is there so much empty space? It doesn't appear to need extra layers - except maybe a ground - and it looks like it could be far more compact.
Is there something going on that is not obvious from its appearance?
edit: to be clear, I was not the OP for the linked post. Just borrowing it for this follow-up question.
AI: All that copper on the back side (the leftmost of your three pictures) is acting as a heat sink for the switching IC.
If you read the datasheets for this kind of IC, they'll often specify a certain area of copper to be connected to the ground (or possibly the input voltage) pin to give adequate heat dissipation. |
H: Do buck converters/voltage regulators change max amperage?
I'm interested in dc-dc buck converters and voltage regulators. I want to know if the maximum amperage changes when you adjust voltage or if amperage is affected at all when changing voltage.
Thanks
AI: There are several different things that can limit the maximum output current of a buck converter, and of course the lowest sets the overall limit. Different configurations or ambient temperatures may change which limit wins, so it's not always easy to translate specifications for one configuration into another.
The output power can't be greater than the input power, and in fact 90% or so of the input power, depending on the efficiency. If the input power is limited, it will limit your output.
The inductor has two limits on its maximum current, thermal from \$I^2 R\$ losses (which will depend on ambient temperature), and magnetic saturation.
The input switch will have a limit on maximum current. It will have a thermal rating, and it may have a programmed upper limit set by the controller for protection. |
H: Theoretical max rate of input capture for a USB mouse and possible hardware limitations
I apologize in advance if this is not the correct forum for this question or if the question is too broad to answer. My background is in computer science and I work mostly in Java middleware so this is a bit out of my area of expertise.
I'm interested in capturing input from a mouse on a Linux operating system as quickly as possible. Let's assume I am working with a USB 3 mouse on conventional hardware (64bit i7 16gb ram). Can anyone recommend a way to formulate with some certainty the maximum input capture rate? Or if that is not possible could someone point out the most likely software, hardware, or physical phenomena that would act as the max limiter?
Some of my initial thoughts so far as to the max limitation
The smallest unit of time the system can keep
The transfer rate of USB 3
Speed of the physical signal sent from the mouse
AI: USB is a host driven protocol. The driver on the operating system initiates talking to devices, and it controls the (maximum) polling rate. The only thing a device must do is make data ready in a buffer for the host to read.
Some "gaming mice" offer (unnecessarily) high polling of 1kHz. This is a combination of fast software in the mice but also the host OS driver set up to poll at 1kHz.
I say unnecessarily high because most game engines won't process data at that frequency, even racing simulators are known to process physics data in the few hundred Hz range. But I suppose you're developing some custom application, so this could be non applicable to you.
The USB2, USB3, USB-C standard or plug does not change anything to the polling rate. I bet there is hardly any chipset out there that talks native USB3.x for HID input purposes, like mouse or keyboard. USB2.0 provides more than enough bandwidth for this purpose. If the mouse outputs horizontal/vertical movement (16-bit signed deltas) and 8 buttons (1 byte) at 1kHz, that adds up to 5kB/s or about 40kBit of transfer speed. Even on a 12Mbit line (which most mice/keyboards are) there is plenty of bandwidth left.
Case in point: my keyboard apparently uses 1.5Mbits signalling speed, and my Logitech G500s "gaming mice" 12Mbits.
Can higher polling rates be supported? Perhaps outside the books; but the device enumeration holds a "bInterval" endpoint field which is expressed in ms (valid range 1 to 255). |
H: What determines if a particular DAC is "good" for audio?
I want to generate low-end audio (sinewave, sampling rate 8kHz). How to determine if a particular DAC is okay for such application? Is it only the settling time (of course apart from resolution, interface, voltage etc.)?
For example the AD5601 has a maximum settling time of 10µs. At a rate of 8kHz a sample takes 125µs, so I would guess that this particular DAC could handle the sample rate. Is that correct?
AI: The AD5601 allows data bits being sent at 30 MHz, each packet takes 16 bits.
\$\frac{30 MHz}{16}=1.875MHz\$.
That means that you can theoretically make waveforms up to the Nyquist frequency which is \$\frac{1.875 MHz}{2} = 937.5 kHz\$.
\$937.5 Khz > 8kHz\$
The slew rate is 5 V/µs, that means that if you got a signal bouncing between 0 and 5 volt, a sine wave of 1Hz of amplitude 2.5 V has a maximum dv/dt at sin(0) => dv/dt = 1*2.5V => 2.5V, so a 2Hz sine wave got a dv/dt of 5V at t = 0.
5V/µs => X/s = 5*10^6/s, so 2Hz*10^6 => the slew rate supports a whopping 2 Mhz sine wave.
So yes, you are correct. That DAC is good enough for making sine waves sampled at 8kHz. What you said, 125 µs and 10 µs, together with the data speed & slew rate => why I said you were correct.
But let's reverse the formula, say you want to output what you sampled.
\$8 kHz × 2 = 16 kHz\$
\$16 kHz × 16 = 256 kHz\$
This means that you need to send one bit every \$\frac{1}{256 kHz} = 3.9 µs\$. |
H: Resistor ladder network component name
Very basic question I'm sure
I am trying to buy components for a project I am doing, but I cant get the name of a component right yet.
But it has to exist somewhere.
I want a resistor array but instead of the resistors in parallel I want them in series with a point to take a measurement off after each resistor.
I have inserted a circuit if I have not been clear enough.
simulate this circuit – Schematic created using CircuitLab
.
Basically my idea is to have Vcc and GND on the end two pins and the take a voltage off after each resistor.
I'm using this to get an analog signal of the different voltage to select different settings in my micro processor.
I don't mind using just a bunch of resistors, but I would like it in a one package device for a neater board and a bit of space saving.
Any ideas of the name of the component ?
AI: They are generally called resistor networks. The specific type you are looking for is called a series network.
E.g.: Bourns |
H: Buck Converter for 59V to 58V?
Some batteries last twice as long if they are kept to 80 percent of their maximum charge. It's good to add a small adjustment to undervolt a charger output by 0.5 - 1V. Myself i have a CC/CV charger that is .5 volts too high for a given BMS.
How can I take the voltage down by .5 - 1V at the output?
AI: simulate this circuit – Schematic created using CircuitLab
Figure 1. \$ V_{OUT} = V_{IN} - 0.7 \$.
A silicon diode will drop about 0.7 V when more than a few milliamps is running through it. |
H: Importance of Body Transconductance MOSFET
I am currently studying about small signal models of Common Drain & Common Gate configuration, where the body transconductance has significant effect on voltage gain and output resistance (when body effect is significant).
I also know the principle of body effect - body effect occurs when Vbs < 0; for NMOS device.
Common-Gate T-model
Common-Drain model
I am curious about how a designer of electronic circuits deals with the body transconductance values, since its value isn't given by data sheets. I doubt its can be neglected when performing hand calculations.
Can body effect occurs, although it is connected to most negative potential of NMOSFET? (Perhaps oscillations can make Vbs ≠ 0)
Can someone gives me an example or two, where body transconductance (it can be also referred as "body current generator" or "back gate") has a significant effect on a circuit as a whole?
AI: For integrated circuit design the backgate-transconductance can be found using design documents or simulation. For discrete circuit design the source and bulk are commonly connected so that it can be ignored.
Backgate effect in particular occurs because the backgate is connected to fixed potential while the source potential can change. If source and backgate are at the same potential (e.g. both at ground) then it can be disregarded.
NMOS Source-followers with the substrate connected to ground show a non-linear behavior because of the backgate effect. When the source and the backgate are connected and the current-source is a high output impedance, source followers work much better. |
H: How can I add to LTSpice the MC34063 model?
I found the MC34063 moden in the eevblog forum: link
How can I add it to the LTSpice to if I want to make a buck or boost converter it appears in for.example in the power product list?
AI: Copy the .asy file to the location where the LTspice symbol files are kept, I.e., C:\Users\Me\Documents\LTspiceXVII\lib\sym, and the .lib to C:\Users\Me\Documents\LTspiceXVII\lib\sub. Restart LTspice. |
H: Increase instead of dip in voltage in a AC to DC Motor Circuit
I have a very simple circuit. 120 AC into a rectifier output to a 120 DC motor. No caps or resisters. Literally a rectifier a DC motor with a thermal protected. No more no less.
When I power on the voltage at the outlet goes to 165 and stays there until power down.
Cannot figure out the cause. Any ideas?
AI: The motor will produce back-EMF, depending on the RPM, which effectively acts as a generator. If the motor is not under load, the voltage at the bridge output approaches the peak voltage of the AC waveform, because at the peak voltage of 120VAC RMS no power will be transferred to the motor (just enough to replace that lost by bearing friction and windage). The diodes only allow power to be transferred to the motor.
That peak voltage is \$\sqrt{2}\cdot 120\$ = 170V approximately.
As the motor is more heavily loaded, you would expect the voltage you read at the bridge output to drop. |
H: How to make a circuit to detect a cut cable properly
I want to make my own alarm system, I put a long cable from my alarm and a sensor, if the sensor's cable is cut, the circuit change it's logic state, and then I read it. But the problem is that the long cable has it's own resistance and other problem I have is the possible induction.
AI: Most alarm systems actually use a very simple system: If the input pins are connected together (or the input is connected to ground, or whatever scheme you choose) then the sensor is considered "inactive". If the sensor activates, or the wire is cut, the connection is taken open circuit and it is considered "active".
For instance:
simulate this circuit – Schematic created using CircuitLab
As long as the voltage at INPUT is pulled below the low logic input level (\$V_{IL}\$) the alarm is off. As soon as it rises above the logic high level (\$V_{IH}\$) the alarm sounds. If you have particularly lossy cable or it's in a very noisy environment you can adjust R1 to compensate.
For extra security you could make your sensor more active and have a self test mode. Add a fourth "test" wire that triggers a test, the result of which is to activate the sensor as if it were triggering the alarm - however your software knows to not sound the alarm, instead to just note that the sensor is functioning properly:
simulate this circuit |
H: Model of capacitor at breakdown
I have looked through the web and couldn't find a model of a capacitor at the moment of breakdown.
After a circuit that I built failed, I took a few capacitors to test and found out that some of them breakdown before they reach the rated breakdown voltage. I
also found out that the current is bigger than I expected.
From data sheet : 10nF capacitor @ 100V rating
Some of them broke at 96ish V and some after 100 V (not exactly at 100 V).
The current rating was high as kA which I can't understand. Is the ESR and ESL module are still relevant at the breakdown?
AI: 1st you must read and follow the defined test method for the voltage rating and ensure you have high quality parts that meet spec. otherwise if either is not true , you have no margin or failure. Cap reliability depends on margins and are better from "name-brand" high quality Japanese companies and less likely from Chinese low cost parts where you can expect these anomalies.
When ESL is not a factor with prober test probing, you can expect Ceramic ESR*C=T values in the range of 0.1ps to <100ns depending on size and thus short circuit current Isc, will be defined as Imax=V/ESR when scope bandwidth is not a limitation.
e.g. 10nf in a low ESR X7R 603 ( COG is lower ESR*C but also small max C) I might expect
Other details
The DC breakdown voltage (BDV) can below than the DC BDV which is due to an effect called the double-layer capacitance (memory effect known in all ceramic materials except COG/NP0) where near rated voltage a partial discharge, PD can occur in ANY dielectric including air, if there even just a trace amount of mobile ions or contaminants hard to eliminate completely. When these ions detonate between particles of insulation they arc and drop the voltage across those molecules thus raising the voltage of the balance of the insulation causing more particles to zap resulting in a Relaxation oscillator effect if you current limit the applied voltage.
In a pure vacuum or ultrapure plastic or ceramic part, the PD may be at 99% of the BDV, and with DC applied and current limited, the PD has more time to build up speed under the high E field forces and if DC is not current limited then the follow-on DC current can destroy and blow up the cap. But IF current limited to low energy, only burns some particles inside. PU and some PE plastic caps are known to "self-heal" when this occurs even with the grid across the cap, because the particle size is so small the energy only detonates the particle into an insulator again or in some designs by Panasonic using distributed fusing, the defect only is fused open reducing the total capacitance by a small amount.
The bigger the gap and the bigger the Q=CV, the more pico-coulombs of charge get dumped by the PD, when the energy is enough to cause a cascade of events, it will result explosion limited by energy supplied V^2/ESR. Thus ultralow ESR caps like ceramic and e-caps can discharge more energy while plastic tends towards self-healing by design only. Batteries are exactly the same in these characteristics except the ESR,C values are different where capacitance from high dielectric constant, \$\epsilon_r\$, results in >10k Farads from a tiny LiPo cell or AA alkaline but the ESR will limit the energy and conductor faults or insulator faults from excessive contaminants and high temp may also result in explosive venting an hopefully fusing all dependent on the battery energy and ESR.
The rating for the highest quality cap or dielectric ought to have the same BDV for AC and DC as long as the range of voltage stays exceeds the design limits. Polarized caps can have AC current as long as the reverse DC voltage does not exceed 10% for failure and 5% for margin depending on duration.
If you suspect PD before BDV, reduce the ramp rate just below threshold and wait 1 minute or use a slow ramp V ust below threshold.
Conclusion
You should expect 10% margin at least at room temp and perhaps no margin at max rated temp or expect it to degrade in BDV at high temp. So sounds like you either have a test method or quality problem. |
H: Sensitivity list rule in HDL
I have a little confusion about sensitivity list rule: all signals that are read in the always block must be included in the list. When including the posedge CLK and EN in my sensitivity list, I get value of x changed when either of signals in the sensitivity list changes. Thus, if EN changes in the middle of the clock cycle, x changes accordingly, which is expected. However, this is not the outcome I wish to get:
always @(posedge CLK, EN)
if(EN)
x <= 1;
else
x <= 0;
I need the value of x to change only at the rising edge. Therefore, I remove the EN from the list to achieve desired outcome. But then, this violates the rule.
This is, probably, a very trivial question, but could someone clarify what's the proper way to implement it?
AI: Forget that rule. Here's a simpler one:
If you want sequential logic, use always @(posedge clock) (or negedge). You don't need to mention any other signals in the sensitivity block.
(You can sometimes also use sensitivity lists like always @(posedge clock or posedge reset) for reset signals, but don't try to get too fancy. It's very easy to create something that won't synthesize.)
If you want combinational logic, use always @(*).
This is a shorthand (introduced by Verilog-2001) that makes the block sensitive to every signal that's used in it. There's no reason to name every signal anymore -- that syntax is obsolete and unnecessary. |
H: Driving a MOSFET with fastest rise time possible
I'm working a circuit to send very short pulses to a load, with the requirement that the pulses have the fastest rise time possible (~10ns or less).
I've picked out a driver that has a fast rise time, the UCC27524P (http://www.ti.com/lit/ds/symlink/ucc27525.pdf).
I have a question about choosing a MOSFET, is it the driver that determines the rise time or the MOSFET's rise time in it's datasheet?
I couple of MOSFETs I'm looking at has rise times of around 20ns, are they simply unable to switch any faster?
I've attached a simple circuit to illustrate.
AI: It's both the driver and the mosfet that determine the rise time. The net rise time is going to be about twice if both driver and mosfet are similar. You might also be interested in fall time and this can be harder to achieve especially if the gate isn't driven negatively when removing gate charge.
If the data sheets say 20 ns and there isn't some obvious improvement in the example circuit used to measure rise time then you are probably out of luck. Keep plugging away and look for better mosfets. I think there is a new type out referred to as something like silicon-carbide technology but don't quote me on it. |
H: How to get 3.3V output from Vishay 6n137 high speed Opto Coupler?
I am using 6n137 opto-coupler to drop down 5v pulses to 3.3v level pulses. I found in data sheet the minimum input voltage is 4.5V at Vcc. and the circuit given in the data sheet has pulled up Vo to Vcc using RL resister. Is it ok if i supply Vcc with 5V and pull up Vo to another separate 3.3V level,to get 3.3V pulse output? as shown in below figure.
data sheet 6n137
AI: As the datasheet says, the device has an open-drain NMOS output.
This means the output of the device looks like this:
simulate this circuit – Schematic created using CircuitLab
Which means the output cannot drive itself to a voltage, but can pull the signal down to ground. It does have a small internal leakage of up to 1μA so if it goes into a very high impedance input, even without a pull-up resistor it will eventually float up to a voltage between GND and Vcc.
But, since the device cannot drive a voltage on its output directly, you are free to pull-up to any voltage you require, just keep an eye on the fact that the output will only go to 0.3V to 0.6V if the resistor is small (hundreds of Ohms), so for very low voltage signals, like 1.2V that may not be low enough to be considered "off".
The value of your resistor will depend on how fast you want your signal to go back up. If you have fast signals, in the MHz range, or need fast flanks, you'll probably want less than one kilo Ohm. For slower stuff and slower edges, say 10~100kHz range or even lower, probably 3.3k to 5.1k will work fine. But it does depend on the amount of trace or wire connected to the output as well. Bigger trace makes it slower, because those have more capacitance. |
H: How can I calbrate my power meter?
I used to work for a company that made power meters but only worked on the desktop application (user interface) side of things and never really learned completely how some processes occur, like the calibration process. So in order to learn something that I've always been curious about I decided to make my own power meter
What I know and what I think I know
I know some regulations that define the number of points per wave (for example, @60hz must have 64 samples) given a desired precision. I know the equation for Vrms, Irms, apparent power, active power, power factor, real power and these things I can measure in the hardware I made (one TP and three TCs, I plan to do a software phase shift for the other two voltages, which I would guess is not good enough for any standard, but OK, or else I can add a phase delay with capacitors at the input of the ADC ... also TCs are really expensive).
The thing is that I know that the obtained values are calculated using a calibration constant, so ... Vrms = Kc * sqrt(1/N*(v1^2+v2^2+..+vn^2)) and the same for current, so the other calculations that derive from this are subject to the calibration constants. From what I've been reading this calibrations constant is Kc = (real high voltage - read low voltage)/(read high voltage - real low voltage) and there is also an offset, which is calculated in a similar manner., so the above Vrms =Kc * sqrt(1/N*(v1^2+v2^2+..+vn^2)) + Ko, where Ko = offset????
The problem I know I'm facing
The problem that I'm facing is how to implement the calibration process. According to a national standard O know that a device must be calibrated with another device (calibrator) that is at least 3 times more precise. So if I want to achieve 1% precision I'd need to calibrate it against a device that is at least 0.3%. I know that I'd need to calibrate it with PF=0, PF=1, PF=0.5 AT LEAST but I'm still unsure as to how I would calibrate it. My former company used a calibrator and then they had to write a program to send commands to it (change from delta to star configuration por example, change voltage, current, PF etc) and then they'd read both devices compare and generate a calibration constant. From what I remember it's not a very fast procedure, requires A LOT of math and I'm unsure as to how I'd learn about the necessary math.
What I've been told
Some people have told me that a calibration process is a well kept secret by companies, but that doesn't really add up, there must be a theory behind it and a base method that can be used and learned from books/internet and then after I gain the knowledge I'd be able to tweak the base method to achieve my goals.
What I want to know
Does anyone know about any good books/websites/articles about the calibration topic? I've been trying to research this but not having much success. And what about international standards for calibration? I know about ISO/IEC 17025:2005, but I think that only applies for laboratories that want to be certified and I just want to learn about how a real calibration process can be done for my meter. Or if you prefer you can answer me in detail in the answer, but I think that'd be a lot to task
PS: I have a notion of what I need to know, but there are certainly more things that I'd have to really know before going forwards. I'm an EE with a few years of desktop applications experience and then I quit that job and I've been working as a firmware developer (more my area of knowledge)
AI: THere are 2 or 3 power phasors computed for each Line voltage and current: 2 lines and 1Delta , Assuming you are not in North America the line phasors angles are at 2phi Vac/120 deg and in North America split 240Vac/180 deg.
Phasor power angles are straight forward
PF = |cos φ| = 1000 × P(kW) / (√3 × VL-L(V) × I(A))
Each line may be calibrated for resistive and reactive loads or some matched combo that is -45 deg then compute if any phase error.
P(W) = |S(VA)| × PF = |S(VA)| × |cos φ|
kW = √3 × PF × A × V / 1000 * k (scaling factors)
you already have the RMS sample conversion formula
As far as the ADC is concerned a stable Vref is used for conversion and it may have errors for ; offset and gain and missing codes (monotonicity error) due to digital noise crosstalk on the analog Vref or signal like 00011111 to 00100001 skipping a step
good design self-checks calibration using a precision slow ramped test signal to test every code, linearity, gain and offset error. with correction factors ( sometimes done yet often ignored )
I used to work for a company that designed wireless 2 way meters for power, gas, water using the ISM band with multi tiered data repeaters at 928MHz in the mid 90's. 1 second response time but scheduled Mux's otherwise. Headend software integrated into Utilities database. But technology got sold out to Itron in Seattle. a prime supplier of US power meters after 7 yrs. I was there for the last 4. Iris Systems Ltd. Winnipeg.
Traceability to NIST standards and Utility Specifications are two topics for further discussion.
Cheers
Tony |
H: Can I run a 12v fan off of a 9v power supply for LED lights and are there any side effects
I have multiple (9v 1500mA to 9v 3500mA) LED light fixtures that I have tested chaining a single fan (12v 5.2w and 12v 0.16A fans) and they seem to work under the brief test with enough air flow for my needs.
Anything I should be careful about while doing this and any direction to better understand if there are concerns or how to calculate? I am a software engineer, just getting into electronics via raspberry pi projects, so still learning as I go. The actual project right now is regulating / climate control of multiple dart frog terrariums.
AI: There is generally no harm in running a fan or any DC motor on lower voltage.
If the voltage is too low, then the motor will not run (or continue running if already spinning but not start), because there is not enough torque generated to oppose the “cogging” effect of the layout of magnets inside the motor. (This effect is why when a fan is turned off you will see it bounce and stop at a particular angle, and you can feel it by pushing the blades around). In this case, the motor is stalled and in principle this could burn out the motor just like any other stall, but that is less likely as the voltage and therefore the stall current is lower.
If you find that a fan promptly starts up at a given lower voltage, then you should feel free to use that lower voltage.
If you need a fan to operate at a wide range of speeds including very slow ones, then rather than changing the supply voltage, it is better to use a fan which has a PWM (pulse-width modulation) input, which is driven by a microcontroller or other oscillator (e.g. a 555 chip) you provide and tells the brushless motor controller inside the fan what speed to run at. Because the controller has access to the full supply voltage when needed, it can start up and run at much lower speeds.
Since you're interested in climate control, this might be a good future project — a temperature-controlled fan. It can be done with a single-purpose fan control IC, a microcontroller, or even with separate chips (an oscillator and a comparator at minimum).
Finally, I'm guessing that you don't have this problem, but just to avoid any confusion for other readers: from context, when you say "LED power supply" I assume you mean a regular (constant-voltage) 9 V power supply, not a constant-current LED driver. You should not run a fan off the output of a LED driver. |
H: Power Dissipation VS Switching Power
It amazed me recently to have found 3 tiny Sot-232 transistors inside a 12V led controller. It can't be serious, but after digging and testing it with my 10 watts power LED mounted on a CPU heatsink for 30 minutes, the huge heatsink was hot to touch, yet when stupidly touching the tiny SOT-232 transistor, it was not even warm. It's a AO3400 N-Channel MOSFET; According to the datasheet, it's Max Vds is 30V, and Id is 5.8A.
Question 1, so technically is this tiny transistor capable of switching up to 30V * 5.8A = 174 watts?
Question 2, but according to the datasheet, it can only dissipate 1.4 watt. What is the difference between Power Dissipation VS Switching Power?
Question 3, Again, according to the datasheet, we only get 5.8A when VGS=10V; but since I am planning to use this with a MCU which has a HIGH voltage level of either 3.3v or 5v, what is the approximately expected switching current? and how it's calculated?
AI: AO3400 30V N-Channel MOSFET ...Can it switch 30V * 5.8A = 174 watts?
Yes that's the guideline assuming you consider heat and thermal resistance.
based on Rds with drops with Vgs above threshold and often need 4x threshold.
2, but according to the datasheet, it can only dissipate 1.4 watt.
yes but only if ambient =25'C then reduced to 0.9W @ 70'C
3.... @ 3.3v or 5v, what is the approximately expected switching current? and how it's calculated? ...
Pd=Vds²/Rdson using Vgs to get Rdson from Fig 5 at max case temp Tc, where Tc_max=Tamb +Pd*Rθja where I choose max Tc= 85'C at max ambient at T=40'C
Figure 5 gives nominal RdsOn then compute ; Vds, Pd and T rise from Thermal specs 100~125'C/W unless you choose better board conductor material or thermal design
Its a low Vds max switch with very low Vgs threshold, so it has more switching capacitance than others of higher V but the ratio of max power switching/ max dissipation is the almost same as ratio of max R load at max power to RdsOn minimum
e.g. at 30V 5.8A, load = 30/5.8=5.2R while RdsOn from Fig 5 at 85'C @5V=Vgs ~30mΩ
thus switch power ratio = 5.2Ω/30mΩ = 173x
Relays often have a power ratio of 1k~2k while BJT's may be as little as 10x |
H: How should I interpret the analog switch states of the ADG788?
After reading the datasheet, this is how I interpret the switch states of the ADG788 analog switch:
This interpretation is based on the "Truth table" in the datasheet:
Nevertheless, it feels a bit counter-intuitive. It is weird that the B-poles are connected when the inputs are 0. Wouldn't it be more "intuitive" if the A-poles would be connected at input zero?
I'm a bit worried. It wouldn't be the first time a datasheet makes an error.
AI: It would not only be more intuitive if zero activated the first pole, but also more traditional (see the CD4053). And the ADG786 in the same datasheet works that way.
However, the datasheet is unambiguous, and explicitly shows in the image on page 1 that the ADG786 and ADG788 have opposite polarities:
Also, the datasheet got its fourth revision years ago, so it is extremely unlikely that this would be an error that somehow was not detected.
If this does not remove your doubts, you have to test it yourself. |
H: Designing footprint for LFCSP CP-8-13 what should be the pad size
I am scratching my head to create a footprint for ADA4817 which comes in LFCSP CP-8-13 package. I reckon this package is only used by Analog Devices.
The main problem is I do not know what should be the pad size for the pins. The pins are stated to be 0.25mm in width and 0.40mm in height with a semi-circle ending:
So these are my concerns:
What should be the pad size be (copper) for each pin
What should be the glue size be (for stencil)
The copper shape should be a rectangle, or I should care for that round ending on the pads?
My other concern is the distance between pins and the exposed pad. Can I get away by making the exposed pad footprint smaller than the actual exposed pad size? e.g. going with a 1x1mm square instead of 1.4x1.4mm?
AI: So, there can be no general answer. The shape and size of pads depend on very many things, among these:
Purpose, usually a mixture of the following, dominated by one purpose:
Thermal transfer
mechanical stability
high current capability
impedance matched high frequency signalling
PCB fabrication tolerances
Component placement tolerances
thermal and mechanical aspects of the soldering process
So, if you're doing a board with a high-quality PCB manufacturer to be assembled by high-end pick and place machines and soldered with a well-calibrated reflow oven, then the pads will usually be minimally, if at all, wider than the pins, unless certain pads should be wider to allow for an all-around "solder taper" for more current or heat transfer capabilities.
If on the other you're sending this off to some unknown least-cost manufacturer and plan to assemble the board by hand, by all means, make the pads as wide as possible without risking solder bridges, and add a lot of exposed are outside the pad outline, where you can actively transfer heat into the solder paste.
Now, considering the free space between pins is but 0.25mm, I'd say: go for pads that are exactly as wide as your pins, and pray you get your manufacturing tolerances low enough! |
H: What is the bypass capacitor at the emitter of a common-emitter amplifier for?
Why do we have the by pass capacitor parallel to R(E) in this amplifier circuit? They say it is to bypasses the RE resistor for AC signals but then why is it required to by pass the R(E)
They say that it is to avoid the negative feedback by the resistor but i do not understand the concept of negative feed back in this case? What's negative feed back and why to get rid of it?
AI: It is tricky to see where the negative feedback is in a common-emitter amplifier but, consider what happens when the emitter resistor isn't present i.e. the emitter is connected directly to 0 volts. The signal input into the base then becomes an input into a grounded and forward biased diode.
Because the base-emitter region is a diode, when you raise the base voltage (NPN transistor) you get the input impedance characteristic of a diode: -
Picture taken from hyperphysics and simplified.
You should be able to see that a small change in base-emitter voltage produces a large change in base current around the 0.6 volt area.
So, if the base current changes from 2uA to 100 uA over the base voltage range 0.5 volts to 0.7 volts then the collector current is going to try to change by a value that is hFE times higher i.e. it will change from 200 uA to 10 mA (assuming that the BJT's hFE is 100).
If you have a 1 kohm collector resistor and a 15 volt supply, then the initial voltage at the collector due to the 0.5 volts at the base is: -
15 volts - (200 uA x 1 kohm) = 14.8 volts.
When the base voltage rises to 0.7 volts the collector voltage falls to: -
15 volts - (10 mA x 1 kohm) = 5 volts.
On the face of it that is a voltage amplification of \$\dfrac{14.8-5}{0.2}\$ = 49.
So here's the first point - we don't always want high gain voltage stages and so we put in an emitter resistor and, as soon as collector current tries to flow, that emitter resistor raises the emitter voltage and thus the base-emitter voltage is starting to be prevented from acting like the forward biased diode as explained earlier - in this respect it is negative feedback - if too much collector current tried to flow the base-emitter voltage is reduced so that too much collector current cannot flow.
An impact of this is that there is now a signal voltage seen at the emitter and that signal voltage becomes virtually the same signal voltage as at the base but about 0.6 volts DC lower (for an NPN transistor). After all, it's just a forward biased diode in series with an emitter resistor i.e. this should not be unexpected.
Now, because it's reasonable to say that emitter and collector currents are the same, the circuit's voltage gain tends to become Rc/Re and, no longer do we have a strong dependency of voltage gain on hFE and temperature (Vbe changes with temperature at -2 mV per degC).
Another benefit from having an the emitter resistor is the resulting improvement to the base input impedance. Without the emitter resistor, the input impedance is that of a forward biased diode and this will change cyclically (and highly non-linearly) with the signal superimposed on the bias. This inevitably causes distortion of that signal.
With the emitter resistor present, any diode characteristic is swamped by the emitter resistor value multiplied by the current gain hence, with a 100 ohm emitter resistor and beta of 100, the impedance projected to the base becomes a diode in series with 10 kohm.
The bypass capacitor is an attempt to make voltage gain for AC signals larger than the DC gain set by Rc and Re. It adds problems and it solves some problems and is very much a mixed blessing. Input impedance for AC signals pretty much falls to the value when not using an emitter resistor. |
H: Logic Simplification using boolean laws problem
I am new to this, I am stuck on simplifying this logic equation. Any help would be great, thank you.
The equation is:
$$
Y = \bar{A}\bar{B}\bar{D} + ABD + \bar{A}\bar{C}\bar{D} + ACD + BCD
$$
AI: Y = ~A~B~D + ABD + ~A~C~D + ACD + BCD
Let's see what the Karnaugh map says, just so I know the goal and also so I can test if the equation given is minimal.
Y= BA
00 01 11 10
DC 00 1 0 0 1
01 1 0 0 0
11 0 1 1 1
10 0 0 1 0
So the equation given is already minimal. However, there's 3 of them that overlap at DCBA and 2 at ~D~C~B~A.
That means that I should be able to factorize a little bit.
So we got this:
Y = ~A~B~D + ABD + ~A~C~D + ACD + BCD
Y = ~B~A~D + ~C~A~D + ABD + ACD + BCD
Y = (~B+~C)~A~D + (AB + AC + BC)D
Y = (~B+~C)~A~D + (AB + (A + B)C)D
And I doubt you can factorize it further than that. |
H: how layout high speed pulse PCB traces?
I am working on a PCB design layout, 3 PCB traces, 350kHz pulse signals (logic 3.3V and 0V) are to send via PCB traces. are there any design rules for this type of signaling through PCB traces?
AI: @peufeu traces into 6n137 opto-coupler and traces from output of it to the fpga. typical Tplh 48ns. – oppo 8 mins ago
\$\frac1{48\,\text{ns}}\approx \frac1{50}\,\text{GHz}=20\,\text{MHz}\$, take this times 5 to get basically all relevant sidelobes of the sinc spectrum of a rectangular signal, get 100 MHz; so no high frequency or high speed signal in the modern sense.
For 100 MHz, it's still good practice to make sure your trace is constant width, and runs over a ground plane, and isn't directly near sensitive other lines.
Without knowing your circuit, it's hard to advice, but considering the input side of your optocoupler has a typical forward current of 20mA, I'd argue that unless you have an extremely low impedance signal source, no further load matching needs to be done.
Note: 20mA is a lot for a 48ns pulse to ask for from a simple output driver, so make sure the driven pins of the FPGA are spec'ed to deliver that much current, or find a less current-hungry optocoupler (still check!). |
H: Can I order PCB/chip manufacture from provided LOTOS specification?
Is there a way to automatically deduct PCB and/or chip design from formal problem specification of a problem (task) which supposed to be solved on a PCB/chip?
I'm currently implementing solution with OpenCL to be run on GPGPU in conjunction with CPU. To decide which part of an algorithm must be run on CPU and which on GPU I had to manually calculate speed of sorting on CPU and GPU and divide by speed of GPU <-> CPU communication.
All sorts of such problems, I think, can be solved automatically by applying of problem description upon hardware specification.
Googling all of these brought me to pretty complicated and abstract topic of formal methods where LOTOS seems to be one of them.
I learned a little bit of electronics and know that in-circuit electronic processes and components are very well mathematically defined and deterministic, so automatic PCB/chip layout must be able to be deducted from problem description. But I can't find any working tools/libs which can already do it.
I wonder if there is already working solution of how to do it?
P.S. Problem I'm trying to solve is about ~50 lines of somewhat close-to-machine specification, but I had to write already ~5000 OpenCL/C++ code to run the solution upon a device which at first glance is at least 10000(!) times less effective (speed*power-wise) than analog ASIC would be. I feel like I wanna cry :(
Somewhat close task specification of my problem in C-like pseudocode:
[declarations]
struct A { float Temp; float Value };
A Mem[ MEM_COUNT ];
A Cur[ CUR_COUNT ];
[process #1]
A S;
S.Value = getCurrentInputValue( attachedCamera/Mic/textFile/etc. );
S.Temp = 1;
Cur[ end ] = S;
for each C in Cur:
C.Temp += 1 - mod( C.Value - S.Value ) / C.Value;
approximately sort Cur by Temp;
[process #2]
A C = Cur[ 0 ];
for each M in Mem:
float sum = 0;
//farthest set is defined as each (MEM_COUNT / FARTHEST_COUNT)'th A starting from M
for each farthest of M:
sum += farthest.Value / FARTHEST_COUNT;
M.Temp -= mod( sum - M.Value );
[process #3]
A M = find M with the most Temp from Mem[];
outputValueToAttachedPin( M.Value );
And I would like to tweak MEM_COUNT, CUR_COUNT and FARTHEST_COUNT to see the resulting speed/price/power/etc. As I know, today's CPUs designed so that a program needs to do ~300 operations per every memory access, but in algorithm above it goes up to FARTHEST_COUNT accesses per operation. So, ASIC would be 300*FARTHEST_COUNT times more efficient?
AI: Currently, no. Formal methods have successful uses in restricted domains : static timing analysis (that an FPGA or other digital circuit) meets the timing constraints you ask for, for one example.
It can also prove properties about software or hardware - such as correctness of a program written in SPARK (based on Ada) - eliminating the need for runtime checks, guaranteeing the impossibility of buffer overruns, integer overflows, etc.
A little more generally, formal can potentially prove the equivalence of two designs - or a design and a higher level specification - exposing errors in the design, for example. See "equivalence checking" in ASIC design - hasn't made it down to FPGA tools yet, as far as I know.
But formal methods don't - yet - allow synthesis of a detailed design at a high level. (One could argue that a compiler is a formal translation of a "high level" specification in C or Ada, into an assembly language design, but I don't think you'd regard C as sufficiently high level, and I'd agree.
In any case, comments suggest you are dealing in the analog domain, which is arguably even more backward, SPICE netlists still seem to be state of the art. You may wish to flesh out the question with something specific - perhaps illustrating 1 or 5 of your 50 lines of specification, to give us a better idea what you're asking. |
H: Realizing a multitasking program with Timer Interrupts
This is my attempt to realise multitasking (well almost) through interrupts. In this example, Task 1 is: Toggle LED connected to PB1 at 2Hz (Timer 1 is used, OCR1 can hold values upto 65535), Task 2 is: Toggle LED connected to PB3 at 61Hz (since Timer2 OCR2 is 8bit). It seems to be working too.
Have i understood the concept of multitasking right?
How can i allocate time slices for a "Task" or is it not possible in this case?
Can i replace the "Task" from toggling LED to ADC measurement or receiving bytes on USART? Or would that be realised differently?
Here is my Program:
#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
#define COMP_REG_VAL 61250
void timer1_init()
{
DDRB |= 1<<PB1; // Set PortB Pin1 as output
TIFR1 |= 1<<OCF1A; // Clear Output compare flag
TIMSK1 |= 1<<OCIE1A; // Enable Interrupt on Output compare match
TCCR1B |= ( (1<<CS12) | (1<<WGM12) ); // Prescaler Fosc/256 ===> 62500
}
void timer2_init()
{
DDRB |= 1<<PB3; // Set Port B pin3 as Output
TIFR2 |= 1<<OCF2A; // Clear Output compare flag
TIMSK2 |= 1<<OCIE2A; // Enable Interrupt on Output compare match
TCCR2A |= ( (1<<WGM20) | (1<<WGM21) ); //FAST PWM mode
TCCR2B |= ( (1<<WGM22) | (1<<CS22) | (1<<CS21) | (1<<CS20) ); //Fast PWM MOde, Prescaler=fosc/1024
}
int main (void)
{
sei();
timer1_init();
timer2_init();
OCR1A = COMP_REG_VAL/2;
OCR2A = 255;
while(1)
{
}
}
ISR(TIMER1_COMPA_vect)
{
PORTB ^= (1<<PB1); // Toggle Pin when overflow occurs
}
ISR(TIMER2_COMPA_vect)
{
PORTB ^= (1<<PB3); // Toggle Pin when overflow occurs
}
AI: Have I understood the concept of multitasking right?
there are different flavours of "multitasking", some more sophisticated than others. in a nutshell, it is about time sharing to provide the perception of concurrency.
How can I allocate time slices for a "Task" or is it not possible in this case?
your approach to multitasking is less conventional. typically, it is a scheduler that switches in and out of tasks periodically. so the "time slice" is fixed.
Can I replace the "Task" from toggling LED to ADC measurement or receiving bytes on USART? Or would that be realised differently?
that can be tricky. the key challenge is to interrupt a UART transmission in the middle of it and only to execute the same UART transmission in the ISR. not all microcontrollers are capable of that, and even if they are, it should be approached with caution. |
H: What influences prepreg thickness?
I only have experience with low-speed boards that are 4 layers at most.
I want to get into full-speed USB 2.0 and 100Mb/s ethernet, so I need some impedance controlled traces. Instead of doing something professional first, I want to put together a hobby board that does these speeds.
Advanced circuits, the PCB house that I use, has this pdf about stackup thickness. I've spent about an hour googling, but I haven't come up with clear reputable results to the following questions related to stackup thickness:
What is pre-preg? What is its purpose in manufacturing? I always thought that we just glued copper to an FR-4 sheet and then photoexposed it.
Why does pre-preg thickness change depending on how much of the pcb is filled up?
If I order an "impedance controlled" board, will the pre-preg thickness be better controlled? How is this process different than "regular" boards?
Is there a textbook or nice, long app note that talks about all the nitty-gritty of pcb manufacture?
AI: "Pre-preg" is a sheet of FR4 which is pre-impregnated with uncured epoxy resin. So it is flexible and somewhat plastic in nature.
Pre-preg is used in between pieces of "core". The core is, as you say, made with copper on both sides. The copper is then etched. Basically, core is like a two-sided PCB. Once all the layers are stacked together, the epoxy and glass fiber of the pre-preg fill the gaps between the copper areas in the core. Because of its plastic nature, the pre-preg oozes into the gaps. This is why the finished thickness of the pre-preg depends somewhat on the fill factor of the copper layers adjacent to it.
On a controlled impedance board, the manufacturer will manipulate several variables to achieve the desired impedance. This may even include slight changes to the trace width. I do not believe the control of pre-preg thickness is any different in a controlled impedance board. Controlled impedance is not magic. The layout still needs to be designed to achieve the target impedance. The manufacturer will just guarantee that it ends up within a certain range. |
H: Is RS-485 a suitable physical layer for Atmega chips in a home monitoring situation?
I am intending to build some Atmega based home monitoring chips. I want to monitor temperature, humidity, and current levels. Current level monitoring would be done with an inductive pickup on AC lines. Additionally I want to have some pins on each monitor that can be used as remotely commanded GPIO.
My plan is to use Attiny84 chips to implement this. Each board would be fed with +15 VDC and +7 VDC. I can regulate this with 780x series regulators to +5 VDC and +12 VDC for powering the chips and any other sensors or relays I may wish.
Power delivery would use two pairs in Cat5e cable. Devices are to be daisy chained together. This leaves two pairs in the cable remaining. From what I have read, RS-485 seems like an attractive solution for data and control. The last device needs a termination resistor connected to it, but that should be easy.
If I understand correctly, adding a chip to my circuit like a MAX485 only adds the physical capability for RS-485 signaling. I still need a software implementation to communicate and furthermore and actual protocol for multiple devices to exchange data. I would have up to 12 devices daisy chained together with a single master. In a half-duplex RS-485 system, the bus basically acts like a party line.
The master device would perform the following functions in order during each communication round.
Sending a sync signal. This would be a known byte pattern, followed by an identifier and a checksum. The identifier would be a unique identifier for this communication "round". Additionally this data sequence would include the identifier of a slave device which is permitted in this round to send data.
Waiting for a grace period. This grace period is used to allow any unknown device to come transmit to the master a request to join the network.
Receiving data from the slave device designated in the sync data sent in step 1.
Sending control commands to any number of slave devices. This includes GPIO commands and join network acknowledgements. All control commands must be acknowledged later by the slave in a transmission back to the master.
The slave devices would be in one of two states
Unacknowledged by the master. It synchronizes on the sync signal and transmits in the grace period. In an ideal situation, the master transmits back an acknowledgement during step 4 of the next communication round. If the device does not receive this it waits a random number of rounds before trying again. This permits collisions in the grace period caused by multiple devices attempting to transmit to eventually be resolved.
Acknowledged by the master. The device transmits sensor data when indicated by the sync signal sent by the master. The device sends acknowledgements of control commands back as well during this time period. It ignores communications to and from other slaves with the master.
The idea behind this is that the RS-485 implementation in the Atmega controller is going to be software only. The device obviously cannot transmit and receive data all the time or it would not be useful as a sensor device. The length of a round in real-world needs to be large enough that error in the chips built in oscillator is insignificant. In this way, synchronization based off the signal from the master can be kept for several rounds without actually needing to receive or transmit data.
During the joining phase, this allows synchronization allows the slave to correctly identify the time period to transmit a join request.
Once the slave is on the network, it allows the device to know when to listen for permission to transmit and to receive data. It also means the device has an option to "skip" a round or rounds of communications to go perform sensor measurements, command GPIO, or whatever I need. The theory being that if the device was just permitted to send sensor data it will not be requested permitted to again immediately, nor does it actually have any new data.
The issue with this is that since a slave effectively drops out of the communications layer for at least one round, all commands to slaves must be acknowledged with a message back to the master. This permits the master to simply retransmit commands until acknowledged. This also means commands should be descriptions of state, not state changes. There is a very real chance a slave will execute a command more than once. I don't know exactly how acknowledgements will work, but it will probably just be a message consisting of an identifying number and a checksum.
Whatever checksum I use in this system needs to be cheap to compute because I'll be doing it on chips that only have 8 Mhz or so clock speed and are 8-bit computers.
The biggest drawback to this system I can see is that if the slaves are all power cycled for some reason they will all collide when trying to join the network in the grace period. This means it may take a very long time until they all rejoin the network.
Am I missing anything significant with this? Are there any big decisions I need to make that I have completely ignored? Is my understanding of RS-485 as as big party line accurate?
AI: The biggest drawback to this system I can see is that if the slaves
are all power cycled for some reason they will all collide when trying
to join the network in the grace period. This means it may take a very
long time until they all rejoin the network.
If you have a limited number of potential addresses (say 256) the master can always poll a currently unconnected slave address to see if it has sprung into action. So if you have 20 actives slaves, then the master polls a 23 rd slave each "round" and numerically increments the unconnected_slave_address for the next "round". It will only take a few seconds to do enough rounds to find a new slave and then the job is done.
No need to have a grace period; just one more slave slot will do the trick and when a new slave (or errant slave) is found it gets listed as "active".
And yes, RS485 is a suitable physical layer for this.
My plan is to use Attiny84 chips to implement this. Each board would
be fed with +15 VDC and +7 VDC. I can regulate this with 780x series
regulators to +5 VDC and +12 VDC for powering the chips and any other
sensors or relays I may wish.
I would use low drop-out regulators and I would give the drop-out voltage a little more headroom - there will be maybe a volt induction from your local home AC wiring and this means the regulators need a bit more space to regulate properly.
I would also consider using Manchester encoding so that you can high pass filter the data received without fear of corruption. 100 kohm biasing after the capacitor should be OK no matter how many slaves you have in place i.e. it won't destroy the impedance matching from end to end of the cable. I don't know what data rate you intend to run at but working at or above 9600 Baud seems sensible to help the high pass filter block any AC pertubations. Yes I know RS485 is a current loop but if you can inject a little bit more hardware security at the design stage it will pay dividends.
Designing for Manchester encoding also gives you a better chance to implement RF links should there be a need for any in the future.
Just a few thoughts on doing this if writing your own protocol. |
H: Is the Friis Formula outdated?
It looks to me like the Friis formula is outdated. We can replace it with the E and H near field formulas, that converge into the same value in the far field.
I found it hard to use the Friis formula, whenever I switch from nearfield into farfield move, there is a sudden 20-30 dB error lag between the nearfield value and the farfield value. I don't think there is any kind of boundary that just does that, I think the values smoothen out and slowly converge.
So basically the Fraunhofer Boundary λ / (2 * π ), is a very stiff method to figure out the edge of the farfield, and it's prone to a lot of error. I think it's outdated.
Instead using the nearfield formulas introduced by Dr. Hans Gregory Schantz, seems like a more smooth way of looking at things:
It certainly works in the nearfield, it was verified by experiments. And there is no reason why it would not stretch into the far field. And basically the far field instead of becoming a stiff boundary like the Fraunhofer Boundary, it becomes like a smooth convergence point:
In this test I simulated a 2x 1 m long antennas 50 m distance from eachother, but it's like this for any other parameter.
As you can see if we go with the Fraunhofer Boundary using the Friis formula, the Farfield starts at 1.2 Mhz, however the nearfield formulas didn't converged yet, nor there is a concrete point of convergence. It looks like the Farfield Boundary at this case starts more like at 104.6 Mhz.
So it looks like the Fraunhofer Boundary is an obsolete concept, I think it's more dynamic than that, and there is no boundary, I think the impedance differences just smoothen out as frequency increases until it slowly reaches the free space impedance.
Edit 1: Sorry actually, the "d" in the formulas represents the distance between the transmitter and receiver, not the boundary sphere.
Edit 2: And the Fraunhofer Boundary doesn't start exactly at 1.2 Mhz, but somewhere between 806 Khz and 1.2 Mhz, I didn't calculated the exact frequency. However it doesn't matter, either way, there is still a high difference between the 2 fields's path loss. So I guess the far field starts when the impedance reaches that of the free space, which is more like at around 104.6 Mhz.
AI: Is the Friis Formula outdated?
Well, you probably can say the Friis formula doesn't work so well when the EM wave hasn't fully formed and the impedance (as E/H) isn't 377 ohms but, it's not expected to work that well in the near field or on the borderline.
So, is the Friis formula outdated? No, because in the far field it works as expected and will be continued to be used.
Have you shown that another formula is simpler in the far field? I can't see that you have. Have you shown that another formula is more accurate in the far field? No I can't say that what you have said is convincing.
I would be very interested to see how the two formula outcomes converge mathematically (or numerically) but I'm unsure that your table is demonstrating that. Maybe it isn't meant to demonstrate that?
Another thing that puzzles me about the table of numbers is that you haven't demonstrated that you have factored-in the fixed antenna length of 1 metre. Clearly, at about 75 MHz a quarter wave monopole is tuned at 1 metre length but, like I said, your table doesn't show how you have factored this in at lower frequencies where it's impedance becomes very capacitive.
Don't get me wrong on this, I'm not trying to be picky; I'm just trying to understand what your table fully reflects in the real world (not that the friis equation is all-together real-worldly). |
H: How to wire up the XP Power 8-pin isolated DC-DC converter?
I want to use the XP Power IEU0312S12 12V DC-DC converter but can't see how I should wire this.
What do they mean with "Single" and "Dual" ?
Can I put 12V on Pin 1 and 4 and then get the output on Pin 5 and 7 without connecting any external component or doing something else, is that it ?
What do they mean with "Common" ?
The datasheet can be found here
AI: That series of DC-DC converters is available as both single output and dual (+ and -) output versions.
The IEU0312S12 has a single 12 volt output, so you use the "Single" column in the pin connection table.
You should apply the input voltage to pin 1 (negative) and pin 4 (positive). Take the output from pin 5 (positive) and pin 7 (negative).
For the dual output versions, "Common" is the "zero volt" point between the + and - outputs. |
H: Inaccuracy in the GPS data
How can I get the inaccuracy associated with the GPS data. For example when I read lat, lon, speed, heading data from a GPS receiver, how can I get an approximation on the inaccuracy that is associated with each of these data. For example the x position might be +-10m accurate or the speed might be +-3m/s accurate.
Can I obtain these inaccuracy from the GPS chip datasheet?
AI: Can I obtain these inaccuracy from the GPS chip datasheet?
No, because that's not a static thing – it depends on how many satellites your receiver receives at the moment, how strong the signals are, how long the receiver has been observing, at which temperature the receiver is operating, your speed, at which angles the satellites are, at which rate temperature is changing, your height, the availability of secondary info (like AGPS data), component aging...
Many GPS transmitters do emit standard format GPS messages, and these can (but not necessarily do, although it is a common feature) a positional variance estimate, which you can directly extract from these messages. Consult your GPS chipset's datasheet and any NMEA reference, if that's the format your GPS gives you. |
H: AXI Stream Pipeline
I have following design and need to insert pipeline stage between components A and B (design doesn't meet timing constraints in Quartus II due to long data path between them)..
Simple register won't do since interface (basically simplified AMBA AXI4-Stream with START of frame signalization) between them is handshaked (B sets READY signal when it completes work on data and is ready to receive another). Work usually happens in one clock tick (so READY is almost always high) but it doesn't have to be and I need general solution to use throughout my design.
What do you (or industry) use in these cases? I don't really want to reinvent the wheel :)
AI: AXI stream requires a skid buffer that can store two data words. Here is as example of an AXI stream skid buffer in Verilog: https://github.com/alexforencich/verilog-axis/blob/master/rtl/axis_register.v |
H: Is VHDL for digital circuits only?
Both Wikipedia and other SO questions about VHDL vs Verilog mention digital when describing VHDL.
Can you use VHDL to design analog circuits?
AI: Not in its base specification.
VHDL stands for V(HSIC) H(ardware) D(escriptive) L(anguage) with VHSIC standing for Very High Speed Integrated Circuit.
There is an analogue extension to VHDL which is VHDL-AMS
https://en.wikipedia.org/wiki/VHDL-AMS
VHDL-AMS is a derivative of the hardware description language VHDL
(IEEE standard 1076-1993). It includes analog and mixed-signal
extensions (AMS) in order to define the behavior of analog and
mixed-signal systems (IEEE 1076.1-1999).
The VHDL-AMS standard was created with the intent of enabling
designers of analog and mixed signal systems and integrated circuits
to create and use modules that encapsulate high-level behavioral
descriptions as well as structural descriptions of systems and
components.[1]
VHDL-AMS is an industry standard modeling language for mixed signal
circuits. It provides both continuous-time and event-driven modeling
semantics, and so is suitable for analog, digital, and mixed
analog/digital circuits. It is particularly well suited for
verification of very complex analog, mixed-signal and radio frequency
integrated circuits. |
H: Transistor Collector Heats Up
I used power transistor to drive high power LED (used in streetlights)
I added resistor between the Transistor Collector and the LED to verify which part of the transistor causing too much heat, and found out that it is really on the collector part.
Originally, the LED is powered up by 42 DC Volts so I wanted to keep that source level.
I added Photoresistor to turn ON/OFF the LED
The problem is that the transistor heat much.
I also wanted to keep the luminous/power dissipated by the LED as much as possible.
UPDATE: I don't know the specs of the LED but I know the original power source of it: 24V - 40V; 0.45A - 0.8A; Maximum 42V
AI: Oh, cripes. I'll add a BJT circuit that uses your existing TIP122. You don't specify the LDR, so I can't be sure I've got the hysteresis thresholds right. But I think these will do. I'm offering this because it's probably the "least change" to what you have now and it may work okay for you, assuming that I read you correctly when you updated your question. (But I lack enough information to know for sure.) I'm also assuming here that it is easier for you to grab a couple of jelly bean PNP BJTs than it is to grab a specific comparator IC.
Here it is, below. I'm going to stay with your drawing format which buses the power supply around. I don't like doing that, because it can distract from understanding the circuit. But I suspect it may communicate better in your case. So I'll stick with the format you are currently comfortable with.
simulate this circuit – Schematic created using CircuitLab
I kept the \$200\:\textrm{k}\$ resistor near the LDR in your circuit, because I don't know what caused you to use that value. I felt safer keeping it in place, for now. You can adjust \$R_1\$ to change the light level threshold, a bit. Also, \$R_3\$ and \$R_5\$ have useful effects when you change them. But I think I really need to know what LDR you are using (datasheet?) before I can offer much better. At least, this provides a very versatile topology that can be adapted to your needs when more information is available. The basic idea is solid and it uses a key part that I know you already have (the TIP122) adding only a minimum number of cheap parts to get the rest done for you. |
H: Where is the benefit in SQI parallel interface over SPI? Parallel vs. serial
Microchip is offering a number of serial SRAM chips with a communication protocol called SQI which is similar to SPI but with 4 parallel bits written at each CLK toggle.
If you can spend the extra 3 pins this makes sense. You can achieve a throughput of 4 times the rate of SPI.
However there is a catch - SPI is supported by all modern MCUs as a hardware module so it runs automatically and very quickly and CLK rates of several MHz are not a problem.
SQI is not supported by hardware so you have to bit bang the protocol. If my MCU, for example, runs on an 8MHz system clock and it is executing most instructions in a single cycle (AVR) I can expect SQI CLK rate of under 1MHz. This is based upon software SPI implementation which is also sub 1MHz and has slightly less code in it.
So let's say I can transfer 4 bits at a time, using SQI, with 800 KHz CLK (real world numbers), that is 3.2 Mbits per second.
However I can run SPI at 5MHz and get 5Mbits of data with less code and without having to wait with my application code while data is being sent or received over the communication lines.
So what is the point here? What am I missing?
AI: SQI is not supported by hardware...
Your premise, while correct for your particular MCU, is flawed in the general case. The MCUs that you have been looking at may not have SQI (which I believe is the same as Quad SPI or QSPI), there are many devices with hardware support for QSPI. (Note that "QSPI" is a confusing acronym because it is sometimes also used for "Queued SPI", which is different.)
For example: Many ARM MCUs (for example, STM32 and Atmel SAM) have a hardware peripheral that can do x1, x2, or x4 SPI and some execute from QSPI storage in addition to using such peripherals for data storage.
Most FPGAs support configuration over master serial (SPI) in x1, x2, or x4 widths. Some can even use dual QSPI flash chips for a full eight bits per clock. See the Xilinx 7 series configuration UG, ctrl-F "quad".
In these applications, the QSPI is not bit-bung, and is therefore four times faster. For your specific microcontroller (and many small 8-bit MCUs), you are correct and you will be better off with a regular x1 SPI flash. With many many microcontrollers, applications processors, and FPGAs, there is hardware support for x4 SPI and it is far faster. |
H: Is a resistor required between VCC and Data for my temperature sensor?
I'm using a TinyDuino with a Protoboard to measure temperature with a DS18B20. I was following this tutorial but am not getting any valuable information back on the arduino when I try to read the value on the data port.
I just started reading around and it looks like most people put a resistor between VCC and Data. I'm fairly new to electronics, so 1) I don't know why the tutorial doesn't mention this and 2) I'm not sure what putting a resistor between those two would do?
Any help or explanation appreciated.
Edit
Here's a schematic from a site which uses a resistor. The only difference is my board has VCC, one site said to connect VDD on the sensor to VCC, this one shows it connecting VDD to 5V. I'm not sure the difference
AI: The document with all your answers is the DS18B20 datasheet. Whenever you have questions about a part or interaction between multiple parts, the datasheet(s) should be the first thing you look at.
One of the more relevant statements from the datasheet:
The control line requires a weak pullup resistor since all devices are linked to the bus
via a 3-state or open-drain port (the DQ pin in the case of the DS18B20).
This pullup may also provide parasite power. Figure 1 shows a 4.7k resistor between V_PU and DQ.
Additionally, also from the datasheet:
The 1-Wire bus requires an external pullup resistor of approximately 5kΩ; thus, the idle state for the 1-Wire bus is high.
That should answer your second question. To answer the first question, it's likely because it's a tutorial for using a TMP36 temperature sensor, which is completely different than a DS18B20. The TMP36 is an analog output temperature sensor, the DS18B20 is a digital temperature sensor that communicates via the 1-wire protocol (proprietary to Maxim), and consequently, there is really nothing in common between those two sensors. You will want to use a library that implements the 1-wire protocol to communicate with that sensor. |
H: How to connect toroidal transformer from wall power
How to I connect 240v from a wall powerpoint to a toroidal transformer?
I've searched all over, and I'm a complete novice, and I cannot find anything that explains what I need to know at my level of understanding.
It is a 240v 20va 15v+15v toroidal transformer. It has two blue primary wires, and four secondary (red, black, yellow, orange).
I have the hot (brown) line coming from my power cable running to one of the blue primaries, and the neutral (blue) line coming from the power cable running to the other blue primary.
I then have the red + black running to a rectifier bridge, and the yellow + orange running to another rectifier bridge.
There is no voltage output from the output leads of the rectifier bridges. No voltage output from the secondaries.
I've got two of these toroidal transformers set up identically, and neither are working.
What am I doing wrong?
Thanks in advance.
AI: The wiring was correct as follows:
Mains:
Brown (hot) to one primary blue
Blue (neutral) to one primary blue
Secondaries:
Red going into AC input of rectifier bridge A
Black going into AC of rectifier bridge A
Orange going into AC of rectifier bridge B
Yellow going into AC of rectifier bridge B
Output voltage of secondaries: 15VAC
Bridging output of both rectifier bridges with a 2.2uF cap.
Output of combined secondaries from both rectifier bridges: 48VAC
The problem was that I was not using the multimeter properly. |
H: Safe Power rating of resistor for my circuit
I am working on circuit shown below
Current flowing through circuit is 88.235 mAmp
I = V/R = 24/272 = 88.235mA
which generates heat of
68*88.235*88.235 = 0.529 Watt
I have used resistors of 1 watt but it generates little heat.
Will this resistor sustain for longer time?
or
should I increase the wattage?
AI: Are you asking whether a 1 W resistor is OK with a sustained 0.53 W power dissipation?
Yes, that is fine within reason. The resistor will get hot, that's normal, the power is turned to heat and it will be designed to cope with that heat under normal circumstances. If you were to put it in an oven, in a vacuum, or cover it in thermal insulation then things could be different. But if it's sitting in a normal room then it won't be a problem.
It may also be an issue if all 4 resistors are pushed up next to each other, leave some space between them.
A higher wattage rated resistor will get almost as hot, it will still be getting the same amount of heating but it will normally be larger giving it more surface area to use for cooling. |
H: VHDL tutorial for the Lattice ECP5 Versa Development Board
I have got this Lattice ECP5 Versa Development Board and I am going to be working with it in the future. Right now I am looking for some good VHDL tutorial which will help me Play with the board and get confortable with before moving to the real Project I will be working on. Any good link is welcome.
Regards
AI: If you are new to VHDL, I can recommend a series of lectures on YouTube, they are not aimed specifically at your dev kit but should be a great help.
Here is a link to the first lecture "VHDL Lecture 1 VHDL Basics"
https://www.youtube.com/watch?v=BDq8-QDXmek |
H: Operating an adjustable voltage regulator below minimum Vout-Vin
I used an LM350 adjustable voltage regulator https://www.onsemi.com/pub/Collateral/LM350-D.PDF and to keep the wattage dissipated by the device to a minimum I have opted to make the output voltage 24VDC. Max current drawn is around 500mA. The input voltage can vary from 19VDC to 32VDC but will be 24VDC under normal conditions (24V Vehicle Supply). When the input to the circuit "Vin" is below 25.1VDC the regulator Input-Output differential will be too small and the regulator will not regulate the voltage. I cannot find any information if this will have any negative consequences eg increased noise or limiting of current flow? The circuit is intended only to limit the voltage when it goes above the normal 24V and some noise filtering as a by-product. Is there any reason not to use the regulator in the "non-regulating" / "drop-out" state most of the time?
AI: Let's have a look at datasheet Figure 10 "Dropout Voltage". At 500mA it will be a bit above 1.5V.
When operating in this mode, the output pass transistor will be fully on (saturated in this case, since it is a NPN bipolar).
If this was a PNP pass device LDO, you would expect excess ground current, as the regulator attemps to saturate its output device. However, this one uses a NPN, so the excess base current will simply go into the output. No problem here.
The regulator will not regulate anything though, this means it will act either as a resistor or as a couple of diodes in series, so output voltage may vary depending on current draw. Also, output voltage will follow input voltage, so input noise will not be suppressed.
If your load works on 19V, and you have 24V input, and the load can tolerate the regulator not rejecting input noise, then you're fine. In this case it would simply act as a voltage limiter.
If you also want to filter noise, then something like a capacitance multiplier with an output voltage limit would be more suitable.
EDIT: Example
simulate this circuit – Schematic created using CircuitLab
This is a simple capacitance multiplier. It lowpass-filters the input (RC network) to filter out noise. Zener limits the voltage. I put in a CFP (double transistor) for lower output impedance, so you can say that's the "luxury" version! |
H: Individual Led vs LED Strip
I am thinking of making my own LED lamp - That is, have an array of LEDs and power them off, maybe, a battery pack? The power source I am lenient, I'll solve that issue when I get to it. My main question is regarding the LEDs
Is it more efficient to individually solder, say, 20 or 50 individual 5mm LEDs like these:
Individual LEDs
By soldering them, I mean taking two pieces of long wire, and soldering the all the positive ends of the LED strip to one wire and all the negative ends to another wire, and power it on from the two ends of the wires.
Or should I simply buy a LED Strip and break it up into little strips and slap them onto a template?
My main concern is energy consumption - the LED strip requires 12v, whereas the individual LEDs require 3.2-3.4v. Since I will be powering them off lithium ion batteries, each battery has a range between 4.2v and 3.2v. I will be regulating the voltage with a buck boost converter. TO power the individual LEDs, I'll need only one battery, whereas for the 12v I will need multiple batteries so that they are not stressed.
As well, are LED strips generally brighter than the individual LEDs, which are 15,000mCD each?
Each individual LED is, say, 3.3v and draws 20mA. for 20, that's 1.3Whrs.
AI: The answer is "it depends".
If you want a flashlight, with a nice beam, then you need optics, thus it is much easier to use one high-power LED so only have to purchase one optic (lens or reflector).
If you want diffused light, then having many light sources (many LEDs) is easier to work with.
Now, if you use batteries, you'll be interested in the efficiency of your LEDs (ie, lumens/W) to maximize battery life. So you need to be aware of that. There is a compromise though, as LEDs with pleasant warm light and good color rendition tend to be less efficient. Very high lumens/W LEDs are usually "cool white" and low-CRI which isn't that good for stuff like reading or ambient light.
As well, are LED strips generally brighter than the individual LEDs, which are 15,000mCD each?
mcd (tmillicandela) has nothing to do with light output. A candela is a lumen per steradian, the latter being a unit of ANGLE. This means the same LED chip, which puts out the same amount of light (lumens) can be 100 mcd or 10000 mcd depending on how the optic in front concentrates the light into a wide or tight beam. If you want to make a lamp for diffuse ambient light, you need low-mcd, high lumen LEDs.
Each individual LED is, say, 3.3v and draws 20mA. for 20, that's 1.3Whrs.
W is power, not Whr which is energy.
Now, DO NOT wires your LEDs in parallel. Since all LEDs have a bit different voltage drops, the one with the lowest voltage drop will hog all the current, then burn. Then the next one will hog the current... etc.
If you got many LEDs, you need to put them in strings with resistors to equalize the current. Or use only 1-3 high power LED.
Losing less power on the resistor means putting more LEDs in series (ie, using higher voltage) but if you start from one 3.6V LiIon cell, boosting above 12V will also be less efficient. So 12V is OK.
12V LED strips will lose some power on the resistor. 3 high power LEDs in series will not (but may be more cumbersome to use, your choice). |
H: How to write a big text on Eagle schematic?
When you choose a text from the tools bar, and put it somewhere, it will create a text that appears on the pcb.
I would like to create a text just to mark things on the schematics only, and I want it big and clear.
How do you add a big text to mark things on the schematics ?
How do you add a shape, for instance a square, to mark things on the schematic, not pcb ?
AI: but this text is green
Because you must change layer you put text into, for example, to "Info".
and there is no way to change it's size/font/etc
After you place text into schematic, you use info tool on it, and you should be able to change size, ratio and font type in that window. Actually absolutely the same as in board editor.
So if texts are not transferred between schematics and pcb, why is it matter to set the layer?
Because each layer is having its purpose. If you put text into Nets layer (not sure it is correct doing so), EAGLE will treat it as signal, which may need to get wired at the board level (again not sure, never tried this extreme case). Next, you can turn specific layers on and off, it is good practice to put appropriate objects in respective layers so that you can property visualize them.
I did and it really changed the color from green
There's Layer settings icon, you can turn layer visibility in that window, and you can see default layer color there. In general your text changed to gray because you moved text into another layer which identification color is gray. |
H: how to go from eagle design to Part list
I am looking for a maintainable, shareable and scalable process to output a complete part list (as in "Part N°XXX from supplier YYY") From an Eagle project, when it seems to only be able to provides a BOM ("Component type XXX with value YYY").
Is there a way to do that using Eagle alone, or do i have to process the BOM, in excel for example?
AI: You can use attributes. There are also ULP's out there that use an external database.
But to be honest, eagle is the wrong tool for the job. If you are looking for that level of automation and integration, you should use a higher end tool. |
H: Is acetone or isopropyl alcohol better for removing rosin flux?
For removing rosin flux from my board, should I use Acetone or Isopropyl Alcohol? I need an easily available solvent.
AI: Acetone being used to clean circuit boards can be problematic. The biggest issue that I found was that it leaves a residue in the board that still requires several other cleaning steps to get rid of including IPA and hot water.
Even IPA can leave a residue as it dries.
There is also the problem mentioned in the comments that the acetone can dissolve certain plastics to the great detriment of your electronics assembly. I've seen it eat away the plastic winding wraps on small transformers as an example. |
H: Op-Amp Slew Rate
I've been searching for a very-small package op-amp and not having much luck. LTxxxxxx (edited out) would be ideal however the slew rate is just too low. Is there a way of controlling/increasing slew rate using external components?
The op-amp is used to be used as a voltage follower for 10kHz signal.
Edit: I have intentionally given little information with regards to what I am after as I have looked up many different devices that meet my specification in slightly larger packages. While doing this search I got side tracked with the possibility of increasing slew rates, but could not find much information so I posed the question here. Sorry for any confusion.
Clarification:
I am not asking for suggestions of higher slew rate op-amps.
I was not thinking the particular op-amp I referenced should be higher slew rate.
I edited out the component name because a fellow SE'r suggested specific components may not be allowed (hence LTxxxx)
AI: Is there a way of controlling/increasing slew rate using external
components?
For a given op-amp and without adding complex circuits that make it unfeasible as a solution, there is no clever or subtle way of increasing the slew rate of a regular (or less regular) op-amp.
Clearly there will be a limited number of exceptions but these are likely to be specialist devices that probably won't be available in a low package size.
Possibly what might be a good choice for low voltage supplies is the OPA333 but you have given very little to go on so it's at best a guess that might point you towards a better solution. You can get it in a 2.1 mm x 2.0 mm package. |
H: Voltage regulator for Stepper and Microcontroller
I'm designing my first PCB for a personal project :
I'm planning to run a Stepper motor (3.8V 670mA/phase) with the DRV8834 driver and an Atmega328P from the same power source.
The power will come from a classic USB charger (rated at 5V, 2A) plugged in my PCB.
Do I need a voltage regulator on my PCB as the power coming should be already regulated to 5V by the USB charger ?
If so, would I need two voltage regulators one for the Stepper that will draw higher amounts of current at times, and another one for the stable microcontroller, or can I use one for both ?
I believe if needed I will go for an LDO 5V - 2A regulator like those found here.
Would it be a good choice ?
AI: Stepper motor coils have high inductance, which resists current changes by inducing an opposing voltage proportional to the rate of current change. In practice this means that to get the motor to step faster you have to apply higher voltage. Current limiting is then applied to account for the lower voltage drop at lower speed. This can be achieved by putting a resistor in series with each phase, or applying PWM which switches the power on and off rapidly to reduce the average current draw.
High performance stepper motors are usually operated on a higher voltage than their coil rating. 3.8V is the voltage drop across each phase of your motor when passing a constant (DC) current of 670mA, not the design supply voltage. To run it on 5V you just have to limit the phase current to 670mA.
The DRV8834 uses PWM to reduce current draw. The Pololu DRV8834 breakout board has a potentiometer for adjusting the current limit. |
H: measurement of differential signals using multimeter
Though differential signals are measured through oscilloscope or differential probe, i tried measuring the signals through a multimeter out of curiosity and my observation was that when a voltage was measured across Rs-485 'A' terminal and Ground, the multimeter gave high reading >100V.
Could not find the reason why the reading showed such a high voltage
. It would be great if anyone could help me with it.
AI: As you said in the question yourself, differential signals are usually measured using an oscilloscope. Using a multimeter may only give you reasonable results for DC-Offsets (or DC common mode signals).
Using a multimeter to measure the "changing" part of the waveform will generally fail due to several reasons:
Most multimeters have bandwidths for RMS measurements up to 10kHz. Differential signals are most often used way beyond that bandwidth.
Multimeters assume sinusoidal waveforms. If you were measuring a pure rectangle you could work with a conversion factor, but this will fail for transient signals like digital streams.
Generally you have very poor control over the aspect of the signal you are measuring, especially when there are "mute" intervals between frames. You will most likely compare two different signals, even when using two multimeters at the same time to measure N and P waveforms, since they are not synchronized.
If you still want to go ahead you should at least perform an analog differential-to-single-ended conversion (using a difference amplifier), so that you are at least not comparing different sections of the N and P signals. If the multimeter inputs are floating, you can also measure directly across the P and N lines. Similarly, you could use an OpAmp adder to measure the common mode part of your differential signal.
To sum up: Unless you specify exactly the multimeter you are using and exactly what waveform you are measuring, the results will be meaningless. Especially when the multimeter is in some kind of auto mode. |
H: How is 255 Tbit/s processed in optical fiber communication?
I have never understood how the new record breaking data transfer speeds are achieved in terms of converting from/to electrical and optical signals.
Suppose we have 255 Tbits of data and we want to transfer it in one second. (This is a real world achievement.) You got 255 Tbits stored in, let's say, 255 trillion capacitors (that's RAM). Now we are expected to be able to read each one successively, inquiring each bit so that one second later we have read all 255 trillion of them. This is obviously not orchestrated by a 3 GHz processor.
What about the receiving end? Pulses are coming at 255 THz, yet the refresh rate of electronics trying to read an incoming signal is by far not 255 THz. The only thing I can imagine is thousands of processors with their clock signals time division multiplexed (delayed) by less than 0.000000000001 secs. Although how to achieve such multiplexing also kind of brings me back to my problem with this thousandfold difference in frequencies.
AI: Rather than worrying about a research paper that's pushing things to the limit first start by understanding the stuff sitting in front of you.
How does an SATA 3 hard drive in a home computer put 6 Gbits/s down a serial link? The main processor isn't 6 GHz and the one in the hard drive certainly isn't so by your logic it shouldn't be possible.
The answer is that the processors aren't sitting there putting one bit out at a time, there is dedicated hardware called a SERDES (serializer / deserializer) that converts a lower speed parallel data stream into a high speed serial one and then back again at the other end. If that works in blocks of 32 bits then the rate is under 200 MHz. And that data is then handled by a DMA system that automatically moves the data between the SERDES and memory without the processor getting involved. All the processor has to do is instruct the DMA controller where the data is, how much to send and where to put any reply. After that the processor can go off and do something else, the DMA controller will interrupt once it's finished the job.
And if the CPU is spending most of its time idle it could use that time to start a second DMA & SERDES running on a second transfer.
In fact one CPU could run quite a few of those transfers in parallel giving you quite a healthy data rate.
OK this is electrical rather than optical and it's 50,000 times slower than the system you asked about but the same basic concepts apply. The processor only ever deals with the data in large chunks, dedicated hardware deals with it in smaller pieces and only some very specialized hardware deals with it 1 bit at a time. You then put a lot of those links in parallel.
One late addition to this that is hinted at in the other answers but isn't explicitly explained anywhere is the difference between bit rate and baud rate. Bit rate is the rate at which data is transmitted, baud rate is the rate at which symbols are transmitted. On a lot of systems the symbols transmitted at binary bits and so the two numbers are effectively the same which is why there can be a lot of confusion between the two.
However on some systems a multi-bit encoding system is used. If instead of sending 0 V or 3 V down the wire each clock period you send 0 V, 1 V, 2 V or 3 V for each clock then your symbol rate is the same, 1 symbol per clock. But each symbol has 4 possible states and so can hold 2 bits of data. This means that your bit rate has doubled without increasing the clock rate.
No real world systems that I'm aware of use such a simple voltage level style multi-bit symbol, the maths behind real world systems can get very nasty, but the basic principal remains the same; if you have more than two possible states then you can get more bits per clock. Ethernet and ADSL are the two most common electrical systems that use this type of encoding as does just about any modern radio system. As @alex.forencich said in his excellent answer the system you asked about used 32-QAM (Quadrature amplitude modulation) signal format, 32 different possible symbols meaning 5 bits per symbol transmitted. |
H: How can i find the source of a high pitched noise
I have one old power supply, it was dead but i decided to attempt to fix it.
Replacing all bad capacitors made it power on again.
Since i didn't had one 2200uf 10v capacitor i used one 2200uf 25v capacitor but i guess this should be fine.
but then i noticed that terrible whine.
https://www.youtube.com/watch?v=NKsqcYnQ_v4
i'm almost sure that it might be a coil or transformer whining on the second stage of the psu(the stage of the high frequency switching), but is packed in a tiny area it made almost impossible to pinpoint where is this whining part.
I'm sure it isn't a fan because even unplugging the fan the whine continue.
And i can't get a new atx psu because nowadays ATX psu have a strong 12V rail and older ones have a strong 5V rail(for example one Corsair CX600 is a 600W psu but only has 25A rating on the 5V rail, this 'revived' psu has 60A rating)
AI: I do this all the time, bringing back 1970s power supplies back from the dead.
Get yourself about 18in of aquarium tubing. Stick one end in your ear. Wave the other end around the board to find the noise source.
Perhaps clean your ears out first. And perhaps slightly shave off or melt the cut edge of the aquarium tubing, so you don't get 'paper cuts' inside your ear canal. |
H: ATMega328 attenuated potentiometer voltage
I've just got this problem:
I have a potentiometer with resistance of 50k and i have an arduino nano which has an ATMega328 IC on it.
I attached the potentiometer normally: two pins for source and gnd and one pin going to the arduino nano's analog pin.
If i turn the knob slowly, the potentiometer increase its reading linearly and nicely. But if i were to turn the knob rapidly, say from medium to low, the potentiometer momentarily jumps up to the source voltage and return to its normal reading after 2 seconds or so. I'm suspecting that's because the arduino nano's analog pin attenuate the voltage so much and momentarily give me wrong readings. I checked ATMega328's datasheet and they have an internal resistance of around 60k which makes sense perfectly.
I'm using the potentiometer in an alarm clock to set the time precisely whenever i turn it and it always momentarily jumps to the highest reading or to the lowest reading. I can always wait a moment to make the values stable again but that takes too much time.
I could have simply lower the resistance of the potentiometer to around 10k or 5k but do you guys have another solution for this?
Thanks in advanced.
AI: Make a follower aka buffer with an op-amp. Connect the potentiometer's output to the \$V_{in}\$ of the op-amp and \$V_{out}\$ to the Arduino.
A follower/buffer is great at making weak signals strong. |
H: Analog Reading of YL 69 Soil Moisture Sensor
I am using an ESP8266 12 F Module with 3 x 1,2 V Batteries.
I tried to connect an infamous chinese soil moisture sensor YL 69 like this (LINK) to the anaolog pin of the ESP8266 Module. The Module works from 3,3 Volt on to 5 V and comes with an electronic board that includes a potentiometer
I figured that since I am not going to use the digital output I don't need that extra board between ESP8266 12F and the sensor. The Sensor without the extra board offers two pins.
First Try:
First Pin: A0 Pin of ESP Module and Second Pin: Ground of Batteries
This got me some readings between 0.00 and 340 but it seemed quite unreliable and reacting slowly to changes.
Second Try:
A0 Pin of the ESP module to one pin and Pin4 of the ESP8266 12 F module to the other pin (the idea was that with this method I would be able to completely turn off the sensor while it's not needed and therefore increase durability of the sensor)
This got me some readings between 0.00 and 1024.
However while using digitalWrite(PIN 4,LOW); I still got readings out of the sensor... how if theres no current flowing?
I tried the same sensor with an NodeMCU Board that contains an ESP8266 chip. I used the extra board and the analog output and got very good and reliable readings.
Questions:
What could I do to adjust the setup so that the readings with the "naked" ESP8266 module match those of the NodeMCU model.
Why was I able to get some reading at the second try setup when digital pin 4 was turned off?
Is there a way to use the First try method but to shutdown the sensor completely when not needed so that it doesn't draw any current?
UPDATE Thanks again for the help: Here's my solution:
I connected VCC to one Pin of the Sensor and Ground via a 10 K resistor to the other Pin. Than I connected the Analog Read Pin from the ESP Module to a point between the 10 K Resistor and the Ground wire and I end up with usable reading between 0 and 1024 although I noticed that the readings reach 1024 quite soon but it is good enough for my uses.
AI: This sensor is not a "voltage generator", it is actually a resistance that varies with moisture. To measure it you should make a voltage divider. Connect a 10k resistor from AO to Vcc.
Inspect the original board and you will find this resistor standing between the sensor connector and the OpAmp.
Update: Turning off to increase sensor durability... I assume you are using the sensor as its main purpose - soil moisture measuring. If your ESP is totaly disconnected from any voltage potential like in a battery only operation and no wired communication, it will be fine to reduce the diferential voltage on both pins to 0. I am not sure can you switch the ESP's analog input to digital output - if you can, than you could write a 0 there. If not, you could use a small signal external n-channel MOSFET driven by some of the other pins to short this pin.
This of course will draw some current trough 10k resistor from batteries, which may not be such a good idea for a battery operated device. You could use another small signal p-channel MOSFET to disconnect the pull up resistor. Both p- and n- channel MOSFETS could be driven by a single digital output pin.
simulate this circuit – Schematic created using CircuitLab
If your ESP is also connected to other devices, incl. battery chargers, then a leakage current may flow trough sensor's GND to the soil and cause sensor plates' corrosion. Your option here is to isolate the sensor when it is not used - you can do it with a DPST (or DPDT) relay to disconnect both sensor leads. |
H: turning YM T8 SMD2835 110V led light tube into USB or Battery lamp
A few days ago the electric circuit of a T8 led tube broke, but when I measured the led all were ok. Then I came up with the idea of using them in an experiment and turning them into a usb or battery lamp.
The tube consists of 30 smd led 2835 connected, two lines of 30 leds connected in series, and they connected in parallel with each other. So I have had to change this and connect all the leds in parallel, one by one. And I have managed to light the lamp well, so far, I still have 30 LEDs to connect.
My question is if I need any resistance or capacitor, because when I connect them with a usb these will warm up a bit, and I do not want them to get lost.
Here I leave a picture of how they are staying, lit with an old tablet battery.
AI: LEDs should be run from a current limited or constant current supply. If you examine your original tube you should find some additional electronics to provide this current limiting.
In your setup you are running at constant voltage. This generally doesn't end well as small changes in voltage result in large changes in current.
Figure 1. IV curves for various coloured LEDs.
The voltage drop across an LED depends on the current but also on the chemical doping which provides the LED colour. (It's not just the colour of the lens that determines its appearance.)
If you follow the 'W' (white) curve for the sample LEDs on Figure 1 you can see that at 3.5 V it will pass 40 mA but at 4.2 V (20 % higher voltage) the current doubles to 80 mA. This small change in voltage may be enough to destroy your LEDs. Your LEDs are more powerful so the currents will be much higher.
Also bear in mind that the LEDs will vary a bit - even within a batch - and at a given voltage some will pass more current than others.
My question is if I need any resistance or capacitor, because when I connect them with a usb these will warm up a bit, and I do not want them to get lost.
Normally each LED or series string will have an in-line resistor to limit the current in that string.
USB provides 5 V at up to 0.5 A (500 mA) on a standard port. By feeding at 5 V you may get close to destroying the LEDs but since you have so many in parallel it is more likely that the USB port will shut down on current overload.
If you read the Edison-Opto datasheet for those devices you will see that they run at about 150 mA each. That means that your USB port could power three of them at full brightness.
You will also see that at this current they will drop a maximum of 3.0 to 3.6 V (depending on the "bin" grading that you purchase). That means that if you connect them to a 5 V PSU they will try to draw much more than 150 mA each. If you have a good enough PSU it will be able to burn out all of your LEDs.
simulate this circuit – Schematic created using CircuitLab
Figure 2. Adding a 15 Ω resistor in series with each LED will limit the current to < 150 mA. |
H: Finding Alternate Comparator by Pinout?
I am using the TS391IYLT in a design, but need to swap it with an alternate that has rail-to-rail capabilities. The issue I'm running into is that the pinout is somewhat irregular; see below. Most comparators I've found have a similar pinout, but IN- and IN+ are reversed.
Is there any way to search for parts by pinout? Such that the results only show chips with the same pinout?
AI: It is common that if one manufacturer makes opamps with one particular pinning that that same manufacturer will tend to use that for many of their proprietary parts. So I suspect that you would have best luck searching through data sheets for the parts from the same manufacturer.
Second source type parts will of course not be like this and would follow the pinning used by the rest of the industry. This can be one strong incentive to use more generic parts.
As you do your search if you find that 95% of the op-amps that are in SOT23-5 packages all have this pinning:
OUT
VCC-
IN+
IN-
VCC+
Then there is a strong incentive for you to consider changing your design to accommodate the above pinning.
SOT23-5 packages are small but since just the IN+ and IN- appear to be swapped between your part and other common op-amps I would recommend performing etch-cut and hay wires rework to a couple of boards for testing and then move forward to change your artwork to use a part with the more common pinning. |
H: Mouse Wheel Rotary Encoder ... encoding wrong
OK, guys - I'm pretty confused here.
I bought a cheap wireless mouse to gut and use in a project. Right now I'm trying to get the rotary encoder behaving, but (while it IS behaving) it's behaving oddly. If we call the pins 1, 2, and 3, in the mouse circuit board, 1 is joined in a solder blob with the casing, and that's all tied to +3v. 2 and 3 and hooked to individual pins on the IC.
I'm trying to figure out the pattern for the encoder so I can detect which way it's spinning, but that's where I'm getting confused. If I measure the resistance between 1 and 2, it alternates every "click" of the encoder/mouse wheel. However, when I measure the resistance between 1 and 3, it toggles the exact same. The resistance between 2 and 3 toggles the exact same as well. I would I expect one of the pins to be "on" for 2 clicks and "off" for 2 clicks to provide 4 unique "addresses" on the encoder, but that's not happening.
Am I missing something? Suggestions welcome.
AI: Mice encoder wheels are normally quadrature encoded. The mechanical indents may or may not correspond to a change in the encoded signal.
A quadrature encoded signal normally involves 2 individual outputs. Let us arbitrarily label them A and B. When rotated in one direction A will change state followed by B. After further rotation A will again change state followed by B. If rotated in the opposite direction, B will change state followed by A. Then, after further rotation B will again change state followed by A.
The sensor which drives output A should be 90 degrees out of phase with the sensor which drives output B. However as long as the two sensors are at different locations (angles) this quadrature encoding scheme should work.
Knowing this, we can devise a logic circuit (or the equivalent in software) to determine in which direction the encoder wheel is rotating and how far it rotated. |
H: AVR timer output when Data Direction Register set to input
This question refers specifically to an ATmega328P, but probably can be generalized to most or all AVR MCUs.
Known 1: When the Data Direction Register (DDR) for a pin is set as input mode, it is still possible to write to the PORT for that pin; instead of producing an output, the value written to PORT will just change the pin between pullup and tri-state mode.
Known 2: A pin can be configured to toggle its output state along with the waveform generation module in a timer.
Question: When the DDR for a pin is configured as input, and that same pin is also configured to change state along with a timer, will the timer waveform effectively just rapidly switch the pin between tri-state and pullup modes? Or will the pin behave more reasonably, staying in tri-state/pullup according to the PORT value?
I guess the question could be restated as: Does the timer write to the PORT register in order to change the pin's state?
The only thing remotely relevant I could find in the datasheet is the following line:
...However, note that the Data Direction Register (DDR) bit corresponding to the [timer] pin must be set in order to enable the output driver.
AI: The "I/O-Ports" section of each AVR datasheet gives a detailed treatment of what each "virtual" output affects. In the case of OCnx, PVOV is directly affected, and PVOV is defined as "Port Value Override Value - If PVOE is set, the port value is set to PVOV, regardless of the setting of the PORTxn Register bit.". PVOE is set to OCnx ENABLE, controlled by COMnx. Therefore the OCnx value is not written to PORTx, and will always be output on the pin with an appropriate value in DDRx regardless of the setting of PORTx. |
H: Decimate ADAR7251 Sigma-Delta ADC Output
I'm working with a Analog Devices ADAR7251 Sigma-Delta ADC. It has multiple sample rates to choose from (1800 kSPS, 1200 kSPS, 900 kSPS, 600 kSPS, 450 kSPS, and 300 kSPS) but my application requires 112.5 kSPS. I plan on using the ADC in 450 kSPS mode and will decimate by a factor of 4 to reach the target sample rate. This ADC can simultaneously sample 4 channels and has a built in LNA+PGA for each channel. These features prevent me from changing to a new device.
I know the proper way to do it is to use a cascade of 2 half band filters. My question is can I do without them and simply take every fourth sample?
I'm aware that this particular ADC oversamples by a factor of 48xFs (21.6 MSPS in 450 kSPS mode) which relaxes the requirement for the anti-alias filter. I'm using a 3rd order Bessel Differential LPF (fPass @ 60 kHz, fStop @ 180 kHz with 20dB of attenuation). Additionally, my sensors are an array of electret microphones with a LPF frequency response rolling off around 20 kHz. I don't think there will be any significant signal power at a high enough frequency to cause aliasing that I have to worry about.
AI: The difference between taking every 4th sample, and cascading two half-band decimation filters, is one of noise aliasing.
In the first case, you resample all the noise in the wide bandwidth, and fold it into your signal spectrum.
In the second case, you remove the noise in the wide bandwidth, leaving only the noise that's already within the signal spectrum.
Where the noise has a flat spectrum, for instance with a typical SAR ADC, doing it the simple way leads to a degradation of 6dB in the signal to noise ratio (SNR).
In a sigma delta ADC, the noise tends not to be flat, but rises towards higher frequencies. You would have to study the specifications for your particular ADC, to see how much rising noise the designers have allowed through the decimation filters at any particular decimation setting. Doing it the 'easy' way could result in a much more than 6dB degradation in SNR.
The worst place from your point of view is noise around the Nyquist frequency, as this will fold down to the baseband. Unfortunately, this is likely to be where the ADC designers have eased up on the noise filtering, as it's a) harder to filter here and b) a long way from the passband, so likely to be of no consequence to a user at that final sample rate.
You will know from your application what SNR you need. It may be that the ADC provides enough margin for you to be able to tolerate 6dB or more degradation. If you can't, then you need to filter while you decimate. Note that a noise filter does not require much in the way of a stopband, so your half-band filters do not need a deep stopband. Unfortunately, in a halfband filter, the stopband depth is intimately related to the passband flatness, so you may need a longer filter anyway if flatness is an issue. It may be better to design a 4:1 decimation filter with independent control of passband and stopband, rather than kludge it with two halfband filters. Only detailed design with your specifications would tell. |
H: Feedback factor of Armstrong Oscillator
I am trying to find an equation for the feedback factor of an Armstrong oscillator in terms of the transformer inductances and I can't find one in books.
Am I correct if I say that the feedback fraction of the oscillator is the ratio of turns of the tickler coil to the primary coil? If so, according to this equation,
and assuming other inductance dimensions to be equal for the primary and secondary, is the feedback fraction equal to the square root of the ratio of the tickler inductance to the primary inductance?
AI: is the feedback fraction equal to the square root of the ratio of the
tickler inductance to the primary inductance?
Yes, that is the correct formula. Transformer inductance-ratio is the turns-ratio squared and this assumes perfect magnetic coupling. I think it's a fair assumption for two coils closely wound.
Background - the primary voltage sets up a magnetic flux that is shared between the two coils and the formula of note is Faraday's law of induction: -
\$V=-N\dfrac{d\phi}{dt}\$
Because the flux is shared by both coils, you can see that the input-output voltage ratio is also the ratio of the turns.
This means that the gain of the transistor circuit has to be bigger than the step-down factor introduced by the transformer's turns ratio. If the two inductors have a primary:secondary ratio of 9:1 then the number of turns is \$\sqrt{9:1}\$ = 3:1 and therefore the transistor circuit must have a gain greater than 3 to begin oscillations. |
H: Repaired a treadmill: safety check
A while ago I rented a treadmill out, and it was a high end one, with a 3HP motor. It is 240V 10A (I am in AU)
Anyway long story short, we got to keep the treadmill at the end of the rental period. The company did not want to come and pick it up from us (we tried for months to get them to pick it up but they did not come) and I offered to throw it away for them (to which we kept it instead). I think the reason the cfompany did not want ti pick it back up is simply because the treadmill was used (it was rental) and we did complain of some issues with it. It overheated sometimes and shut down, and the HR monitor was not working -- for all intents and purpose, they really couldn't -- and should not have -- rented it out to anyone.
I left it outside for a few months, where it rained and whatnot. When I put it back inside to test it out, this is what happened:
The buttons were not all working, only some of them were working. The start button in particular did not work, so it would not start
I opened up the motor and cleaned around the PCB for a bit, there were some leaves and spider webs. Dust was plentyful and that was taken care of. Fans were also cleaned (as I assumed that that was what had caused the OH issues before). No visual damage was observed on the capacitors.
I tighten the belt, lube it up abit and lo and behold - it now turns on! Fantastic.
My concern is that, is there anything else I should be aware of? Given that it was left outside, and I only did a rudimentary maintenance of the treadmill, I do not want to motor to fail or for it to set on fire. I have tested the safety features which do work, and I am planning on letting it run for a day under the assumption that, if it were to fail, it would fail then and there and not sometime down the track. What do you guys think?
AI: Advice herein is offered with NO RESPONSIBILITY for outcomes.
I (longish ago) used to design parts of the console portion for exercise equipment. I should NOT be regarded as an expert therein but I have a good idea of what they do and are liable to do.
A 3 HP treadmill is ALWAYS potentially able to maim and kill people (even Australians)(and maybe even some NZers).
After the history you describe there is a somewhat higher chance of it trying to do so but it should be safe enough [tm] if suitable care is taken.
You say "the safety features do work".
(1) ENSURE that you understand how the user cord clip cutoff circuitry works and
Ensure that it is "FAIL SAFE".
(2) ALWAYS USE IT.
It is unlikely but possible that the unit will suddenly go to full speed instantly one day. This should ALWAYS be assumed to be possible with any such gear BUT more likely after spiders ants rain mice and Murphy have had their say.
ENSURE that you are happy with the worst case consequences of it going to full speed. Worst case is usually being flung backwards.
But, also, ENSURE that you cannot be trapped by the belt catching clothes or body parts at belt exit point (or anywhere else).
2000 Watts ~= 200 kg.m.s
At say 5 m/s that's about 40 kg of belt pull.
The chances of anyone directly resisting the pull on the belt manually in an emergency situation is about zero. Even Australians. So, be sure the safety systems both work AND remove belt pull fast enough to make worst case emergencies less worse.
Treadmills CAN be stalled by wedging the belt or applying braking force at a mat-roller interface. (I knew a not always well behaved sports equipment maker (no longer alive) who could and sometimes did (I was told 2nd hand) burn out competitor's treadmill motors at tradeshows by applying a shoe enclosed foot onto the belt above a drive roller. Not recommended [tm] but may give you some extreme emergency safety stop ideas.
As with any such device - have your health, accident and life insurances paid up and able to cover worst case outcomes. |
H: Altium pin error
I'm a beginner with Altium Designer 17.1 and I'm facing difficulties. I'm designing a PCB but when I compile the project this error is shown.
I'm using ports, they are set on global.
Also, I'm having another problem. I made a NMOS Schematic and this error is shown :
I made the pins and everything worked fine (this error isn't shown in the compilation, only the error above) but when it comes to the PCB, they are implemented on the PCB but aren't linked to other components.
Thank you for your help.
AI: First and foremost: Always make sure to hit Project -> Recompile instead of Project -> Compile (Recompile will take all sheets into account, not only the one you're working on). The first error should disappear. If not, make sure that the pins are actually connected (can be an issue when you're designing in a metric system for the schematic as Altium will usually use DXP units (which are imperial). Also let us know your settings in the project properties (Hierarchical, Automatic, ...).
As for the second issue. You need to match the Pin designator. Your schematic symbol probably has Pin Designators 1,2,3; your PCB symbol probably has Pin Designators (well, actually Pads) labeled G,S,D ... you need to choose one over the other. Those must match. |
H: What is this type of interface?
what is this type of interface, located at the very edge of the PCB? What's interface standard, and what is pinout? The 5 holes in yellow circles is GND.
AI: That looks like half of a Mictor connector footprint for a logic analyzer. Mictor connectors are relatively high speed connectors that usually have 38 surface mount signal pins in two rows of 19 and five through hole ground pins in the center line. This footprint looks like that, but with the surface mount pads only on one side. It's possible that the pads on the other side are routed off on this board, but could be left on for development models. |
H: What is the difference between characteristic impedance and input impedance in transmission lines?
What is the difference between characteristic impedance and input impedance in transmission lines? When are these quantities are equal?
AI: What is the difference between characteristic impedance and input
impedance in transmission lines?
Characteristic impedance (\$Z_0\$) depends on the transmission line and its physical properties. Mathematically it can be shown that if you know the inductance (L), capacitance (C), resistance (R) and conductance (G) per unit length, \$Z_0\$ is: -
\$\sqrt{\dfrac{R+j\omega L}{G+j\omega C}}\$
And of course these quantities can be deduced from the physical dimensions, dielectric properties (including dielectric losses) and conductivities of the materials used.
when these quantities are equal?
If you have an infinite line then input impedance = \$Z_0\$
If you terminate a non-infinite line in \$Z_0\$ they are equal
If you terminate the line in an impedance not equal to \$Z_0\$ then, providing you choose the correct line length, the impedances can be made equal.
This last bullet point makes use of the relationship between input impedance, load impedance and \$Z_0\$ in the following way: -
\$V_P\$ is velocity of propagation as a ratio to speed of light and, for normal coax cables is about 0.7 but \$Z_0\$ is dependent on R, L, G and C. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.