text
stringlengths 83
79.5k
|
---|
H: STM32F407VET6 "RAM overflow" while using only 2/3 of it (as far as I know)
I need to declare ~153 KB buffer as a framebuffer for display (more precisely at least two buffers, as one must be in CCMRAM to have enough space) and as this MCU has 192 KB RAM in total, it clearly should be possible. But as soon as I declare buffer in CCMRAM (framebuffer2) to be of size 65536 and buffer in normal RAM more than 63798 (framebuffer1), linker gives me "RAM overflowed by ..." error.
I'm pretty new to this, so I don't know exactly why is this happening, whether it is wrong linker definition, or some debug features taking up space, or something else. I'm working with CubeMX generated HAL project in SystemWorkbench with Ac6 compiler.
linker definition:
/*
*****************************************************************************
**
** File : LinkerScript.ld
**
** Abstract : Linker script for STM32F407VETx Device with
** 512KByte FLASH, 128KByte RAM
**
** Set heap size, stack size and stack location according
** to application requirements.
**
** Set memory bank area and size if external memory is used.
**
** Target : STMicroelectronics STM32
**
**
** Distribution: The file is distributed as is, without any warranty
** of any kind.
**
*****************************************************************************
** @attention
**
** <h2><center>© COPYRIGHT(c) 2014 Ac6</center></h2>
**
** Redistribution and use in source and binary forms, with or without modification,
** are permitted provided that the following conditions are met:
** 1. Redistributions of source code must retain the above copyright notice,
** this list of conditions and the following disclaimer.
** 2. Redistributions in binary form must reproduce the above copyright notice,
** this list of conditions and the following disclaimer in the documentation
** and/or other materials provided with the distribution.
** 3. Neither the name of Ac6 nor the names of its contributors
** may be used to endorse or promote products derived from this software
** without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**
*****************************************************************************
*/
/* Entry Point */
ENTRY(Reset_Handler)
/* Highest address of the user mode stack */
_estack = 0x20020000; /* end of RAM */
/* Generate a link error if heap and stack don't fit into RAM */
_Min_Heap_Size = 0x200; /* required amount of heap */
_Min_Stack_Size = 0x400; /* required amount of stack */
/* Specify the memory areas */
MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 512K
}
/* Define output sections */
SECTIONS
{
/* The startup code goes first into FLASH */
.isr_vector :
{
. = ALIGN(4);
KEEP(*(.isr_vector)) /* Startup code */
. = ALIGN(4);
} >FLASH
/* The program code and other data goes into FLASH */
.text :
{
. = ALIGN(4);
*(.text) /* .text sections (code) */
*(.text*) /* .text* sections (code) */
*(.glue_7) /* glue arm to thumb code */
*(.glue_7t) /* glue thumb to arm code */
*(.eh_frame)
KEEP (*(.init))
KEEP (*(.fini))
. = ALIGN(4);
_etext = .; /* define a global symbols at end of code */
} >FLASH
/* Constant data goes into FLASH */
.rodata :
{
. = ALIGN(4);
*(.rodata) /* .rodata sections (constants, strings, etc.) */
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
. = ALIGN(4);
} >FLASH
.ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
.ARM : {
__exidx_start = .;
*(.ARM.exidx*)
__exidx_end = .;
} >FLASH
.preinit_array :
{
PROVIDE_HIDDEN (__preinit_array_start = .);
KEEP (*(.preinit_array*))
PROVIDE_HIDDEN (__preinit_array_end = .);
} >FLASH
.init_array :
{
PROVIDE_HIDDEN (__init_array_start = .);
KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array*))
PROVIDE_HIDDEN (__init_array_end = .);
} >FLASH
.fini_array :
{
PROVIDE_HIDDEN (__fini_array_start = .);
KEEP (*(SORT(.fini_array.*)))
KEEP (*(.fini_array*))
PROVIDE_HIDDEN (__fini_array_end = .);
} >FLASH
/* used by the startup to initialize data */
_sidata = LOADADDR(.data);
/* Initialized data sections goes into RAM, load LMA copy after code */
.data :
{
. = ALIGN(4);
_sdata = .; /* create a global symbol at data start */
*(.data) /* .data sections */
*(.data*) /* .data* sections */
. = ALIGN(4);
_edata = .; /* define a global symbol at data end */
} >RAM AT> FLASH
_siccmram = LOADADDR(.ccmram);
/* CCM-RAM section
*
* IMPORTANT NOTE!
* If initialized variables will be placed in this section,
* the startup code needs to be modified to copy the init-values.
*/
.ccmram :
{
. = ALIGN(4);
_sccmram = .; /* create a global symbol at ccmram start */
*(.ccmram)
*(.ccmram*)
. = ALIGN(4);
_eccmram = .; /* create a global symbol at ccmram end */
} >CCMRAM AT> FLASH
/* Uninitialized data section */
. = ALIGN(4);
.bss :
{
/* This is used by the startup in order to initialize the .bss secion */
_sbss = .; /* define a global symbol at bss start */
__bss_start__ = _sbss;
*(.bss)
*(.bss*)
*(COMMON)
. = ALIGN(4);
_ebss = .; /* define a global symbol at bss end */
__bss_end__ = _ebss;
} >RAM
/* User_heap_stack section, used to check that there is enough RAM left */
._user_heap_stack :
{
. = ALIGN(8);
PROVIDE ( end = . );
PROVIDE ( _end = . );
. = . + _Min_Heap_Size;
. = . + _Min_Stack_Size;
. = ALIGN(8);
} >RAM
/* Remove information from the standard libraries */
/DISCARD/ :
{
libc.a ( * )
libm.a ( * )
libgcc.a ( * )
}
.ARM.attributes 0 : { *(.ARM.attributes) }
}
output.map:
https://drive.google.com/open?id=0BynchtWoOt7aZzhXOFlDVURjMUE
AI: After investigating output.map I found, that the problem was simple typo. I had buffer declared as
uint8_t buffer2[64000] __attribute__((section("ccmram")));
which I blindly copied from OpenSTM32.org site and was probably for some different version of HAL. As the correct identifier of core coupled memory in my .ld script is .ccmram, not ccmram, linker was putting the buffer into normal RAM, therefore "RAM overflow". Correct definition is:
uint8_t buffer2[64000] __attribute__((section(".ccmram")));
with which buffer is placed into correct memory:
*(.ccmram)
.ccmram 0x0000000010000000 0xfa00 Src/main.o
0x0000000010000000 buffer2
*(.ccmram*)
Sorry for mistake, I'll leave this here in case it helps anyone (or future me).
|
H: Which opamp to use for differential reading of a shunt resistor?
I've made the following circuit, but I just can't get it to work. My LTspice simulation suggests that it should work, but it doesn't. I can get it to work in a normal inverted/non-inverted setup, but I need a differential reading.
I understand that some precision opamps have built-in precision resistors at a fixed gain?
I'm using the INA214 which has a gain of 100, but even that is giving me +-5% noise
Do you have any suggestions regarding a good 'through-hole parts only' opamp (e.g. DIP8) which is great for this purpose?
I've found a lot of SMD-type opamps, but they're a pain to work with. I'm looking for about 50-100 gain, with input range 0-80mV.
simulate this circuit – Schematic created using CircuitLab
AI: You have left out a number of important requirements, so I'll work from the assumptions which are easiest to deal with.
You do not specify the precision you need. Since you specify a 750 uohm shunt and an 80 mV signal range, you are clearly interested in 100 amp signals. Let's say you want 0.1 amp accuracy.
You do not specify your power supply. Since you want a DIP package, you're clearly pointing toward older op amps, so I'll assume you are happy with the older requirement for +/- 15 or +/- 12 volts.
You do not specify the frequency response you need. I'll go with 100 Hz or less.
With these points in mind, you can do pretty good work with a breadboard provided you take some precautions. The most important is establishing a ground point. What you should do is take the horizontal row just below your op amp and connect the two sides with a 1/2 inch jumper. Nothing longer, and if you can go with a 0.3 inch jumper that's better. Tie all ground points to this.
A very reasonable op amp for this application is the OP177, which is still available. Vos is 10 (typ) uV (equivalent to about 0.013 amps) and TC is about 0.3 uV/C max. Of course, it's horribly slow, with a GBWP of less than 1 MHz, but you can't have everything. It should do for the frequency range you're (apparently) interested in.
A circuit would look like
simulate this circuit – Schematic created using CircuitLab
The input RCs will reject common mode frequencies above about 100 Hz, so the op amp will be able to deal with the remainder, and pulse response is about .25 msec.
Note that, for accuracies even approaching 0.1 A, you'll need to use 0.1% resistors, and you'll be well advised to match your input caps. The 0.1 uF should be ceramics.
All connections should be as short as possible, and the use of jumpers to connect the components is forbidden.
Since you are obviously working in a high-current environment, ground noise coupling is likely a problem. You may well be advised to put your breadboard in a grounded metal box, and possibly use filtered feedthroughs for your signals. If so, putting the power supply in the box as well would be good idea.
|
H: Current distribution via current mirrors
I tried to distribute a current via pmos and nmos current mirrors (see the schematic below).
While the pmos and nmos mirros itself work fine, the distribution from a nmos to a pmos mirror yields an error.
The undermost red curve is the current through M9 (The first pmos mirror). This works fine. The other red curve is the current through M18 and M21 (The mirrored nmos current). Here I get a differnce.
The mirroring in pmos mirror M18, M19 then works fine again (blue curve).
My suggestion is that the mirroring depends on the Vds of the transistors but actually I'm not sure.
Can someone explain why this isn't working properly and how to fix it?
Edit: I'm aware of the channel-length issue. Therefore I have used large transistors with a W/L ratio of 1u/8u (schematic). Vdd is set to 1.2V
AI: Notice the tilt in this IV plot? Its for a bipolar.
FETs have the same tilt, except with FETs you have the degree-of-freedom to PICK A LONGER CHANNEL. Do so.
Examine 1u, 1.5u, 2u, 3u, 4u (scaling the Widths proportionately) and you'll be delighted.
|
H: Can an inductor/capacitor/resistor combo emit the same frequency as a given crystal oscillator?
Beginner in electronics and radio frequencies in particular interest me. That said I'm having trouble understanding what components are used when. When I initially searched about radio frequencies, most knowledge articles said those frequencies are produced based off of a crystal oscillator that'll oscillate at a specific frequency.
However, in some DIY FM transmitter tutorials I've looked at a lot of the circuits don't incorporate any crystal. Rather, the circuits incorporate certain capacitors, and a coil (inductor?).
In this case are they doing more or less the same thing? For example, if I had a crystal oscillator generating a frequency at 88.1 MHz.. could I create an equivalent circuit using capacitors & a coil that also produces an 88.1 MHz signal? If no, why not? If yes, is there a reason to use one over the other?
Appreciate any responses.
AI: Yes, you can build a oscillator with inductors and capacitors that will have the same frequency as your crystal oscillator. Using inductors and capacitors, you can reach frequencies much higher or much lower than you can reach with crystal oscillator.
The reason why crystal oscillators are used is because they have a much better frequency stability. Frequency stability does not matter much for an experimental DIY toy FM transmitter, but it does matter for many other uses.
|
H: Ampere hour and voltage
It's been a while since I had to deal with physics, in general, and I try to wrap my head around this and it's confusing.
So as I know, if you wire n batteries in series, Ah remains the same while voltage increases. While wiring them in parallel makes the Ah increase.
So in abstract, a battery can hold infinite Ah as long as the voltage is low enough since, in theory, you could split the battery into virtual ones that have lower voltage and are connected in series, and then you connect them in parallel. Also, this means, in theory, you can create a battery with huge Ah and low voltage. But this sounds to me somewhat infeasible (and limited by atom size).
But can I can't explain to myself why. Can you?
And I think it all starts because I can't completely understand why series batteries combine their Ah, even though is intuitive.
AI: To explain this to yourself, first you have to reject a common misconception.
Do batteries store Ampere-Hours? Nope. Wrong.
Batteries don't store any electric charge. Instead, batteries are chemically-powered charge pumps. The path for amperes is in through one terminal, through the battery, then out through the other terminal. Batteries are "electricity pumps," and they don't accumulate any coulombs or AH or electrons inside.
In other words, an ideal battery doesn't block the flow of charges. Instead it's a short-circuit. When connected to a load, a battery provides a complete circuit, with no beginning or end.
Doesn't this mean that, during electric currents, the battery DOESN'T provide any flowing charges?!! Yes, exactly right. The charges are provided by the conductors. Within the battery's (very conductive) electrolyte, the dissolved ions are the electric charges (and in lead-acid batteries, the charges are the acid's mobile protons. Flowing protons!) Then, out in the copper wires, the charges are the movable electrons of the copper metal.
So, what does "ampere-hour" really mean? It's a convenient way to express the total amount of coulombs that a fully-charged battery can pump through itself before being exhausted. When the battery is dead and the AH expended, it means that the chemical fuel inside the battery has been consumed, so the pumping-process comes to a halt. The ampere-hour is actually used as a measure of chemical fuel, rather than a measure of amperes or coulombs or electric charge. Fortunately the total of "chemical fuel" being consumed inside the battery is directly related to the number of coulombs pumped through. We don't need to somehow weigh the fuel remaining. Instead we can just watch the flow of coulombs.
So, in rechargable batteries, if we force the charges backwards through each cell, then the chemistry runs backwards, and the "chemical exhaust" gets converted back into fuel again. In a flashlight battery, the zinc chloride is turned back into zinc metal, and chemical energy is stored. Or in a fuel cell, the H2O gets "unburned" and forms new H2 and O2 gas. The battery is again ready to power your devices, converting the "fuel metals" back into solid "exhaust products." The fuel cell again can burn the hydrogen into water, or your Lithium cell burns the lithium metal into lithium salts.
So, notice that a "charged" battery is not full of charge. It's full of chemical energy, full of joules or KWH worth of chemical fuel. And, a "discharged" battery contains exactly the same amount of electric charge as a "charged" battery. Confusing yes! With batteries, the word "charge" refers to a charge of energy, and not an electric charge of electrons or protons. (Similar: when we "charge" a cannon, we give it a charge of gunpowder, not a charge of electricity.)
OK, original question: why do the Amper-Hours remain the same when batteries are hooked in series? It's because each battery only has enough chemical energy to pump a certain number of coulombs through itself. WHen hooked in series, the total number of coulombs don't add up, since the coulombs coming out of one terminal just goes right back into the terminal of the next battery in the chain. That means a certain number of coulombs passes through the entire chain. It doesn't increase as it goes! If one battery passes 1000 coulombs through itself, well, all the following batteries in the chain will do the same. The voltage does stack up, and so does the energy. But series-batteries pump the same total charge through themselves that a single battery does.
Will a water-analogy help. In plumbing, a "battery" is a constant-pressure water-pump that's powered by a mechanical wind-up motor, with some energy stored in the motor's spring. The spring-pump can be rated in flowrate-hours! Each waterpump can only pump a certain number of gallons before its spring totally unwinds. Stacking up many pumps doesn't alter the total gallons that the spring-motors will pump through the chain. (Stacking up many pumps will add up the pressures, which does add up the total energy produced by the chain of pumps.)
Note well that "Ampere-Hours" actually means "Coulombs-per-second times hours," which means the same as "Coulombs times 3600." One ampere-hour is just 3600 coulombs.
Second question: can we swap voltage for AH, while keeping the size of battery constant? Yes, to some extent. But cell-voltage is determined by the "corrosion voltage" where water touches conductor at the plate surfaces. You can alter the metal, and choose battery types between about 0.5V and 4V, but that's all. The voltage comes from the reactivity of the metal, and from the "aggressiveness" of the solvent action of the electrolyte. When water dissolves metal, the dissolving process is halted by the build-up of roughly 4V between water and metal, with the metal having negative polarity and the water being positive. Drop some metal into water and it dissolves furiously ...but the metal immediately charges up to ~4v negative, and the corrosion halts. Once this voltage appears, the water no longer can drag positive ions out of the negative-charged metal. The battery's own voltage is halting the corrosion of the plates. Different metals give different voltage, as do different electrolytes (such as H2O versus molten salt, molten sulfur, etc.)
So, you can have a few volts per cell, down to a few cells per volt, but nothing further. Cell voltage is limited by the chemistry, which is limited by the voltage-steps between electron orbitals in the conductive battery-plates.
On the other hand, you can make the plate-area larger and larger (from AAAA to D-cell, or far larger,) and that increases the total amount of "fuel," and increases the AH rating of each cell. Two or three volts per cell, but use infinitely-wide battery plates for infinite AH rating. Roll the plates into a cylinder for a "DDDDDDDDD"-cell with an infinite number of Ds.
|
H: Is high impedance important for a differential amp measuring a battery voltage?
I want to measure voltages of multiple cells which are connected in series. I want to do that using a differential amplifier. I read about low input impedance, and what to do about it in this case. So I found this schematic:
simulate this circuit – Schematic created using CircuitLab
I'm wondering, whether it's really important to have high input impedance here, because the battery has a very low resistance, so the input voltage of the OP AMP should be almost the same as the battery voltage, no? So is it indeed better, to add those two voltage followers, or stick with the simpler differential amplifier variation?
AI: To answer your actual question... As long as the R values are large you do not need the buffers for it to work as you imagine. However, be aware without them there will be some drain on the battery if the R values are not as large at the op-amp input impedance.
However, what concerns me more is the stack of batteries. If you plan on doing this for every battery in the stack, and the stack is large, at some point you will exceed the input voltage on the op-amp.
|
H: Identifying a switch symbol
Is the following sign a switch and if so, what kind if switch is it exactly?
It is used in the schematic of the ABB Eden (Adam & Eva) Module.
AI: It looks like non-latching normally open push button / switch
And you can see this table in datasheet:
So you have exact part number of that switch.
|
H: Power supply switch prevents Arduino from working
I've connected eight 8x8 leds matrices to an Arduino, to display a scrolling banner.
When I developed it on an Arduino Leonardo powered by USB, everything worked fine.
When I moved the solution to an Arduino Pro Mini, I tried to use the onboard voltage regulator (using the RAW pin) but it only worked half of the time (the other half of the time, I only had 2V on the VCC pin of the Arduino).
Even when it was working, the Arduino was very hot after a few seconds, so I assumed the leds required too much power for the onboard regulator, and I moved to a breadboard power supply (see picture).
That's where things start being confuse :
If I keep the power supply switch on and plug/unplug the power-brick to the main, it works flawlessly and I got 4.8V on the Arduino's VCC pin
But whenever I try to use the power switch on the power supply, the leds turn on but the Arduino doesn't do anything and its VCC pin is about 2.4V
I would like to know what I'm doing wrong, and how to prevent this kind of failure to happen.
PS: The power brick is ratted for 12V 1.5A; There are 512 leds but they are driven by eight MAX7219 and AFAIU only 64 of them can be lit at the same time
AI: Considering the number of LEDs, the current draw must be quite high, like 1-2 amps.
I assume the LED matrix needs 5V supply. It would be unreasonable to power it from a linear regulator (such as the one on your YwRobot board) because it would dissipate lots of heat. I see a SOT223 regulator on this board; if the LEDs draw 1 Amp, from 12V, it will dissipate (12V-5V)*1A = 7 watts, which is way above what a SOT220 can do. Therefore, it will overheat and shut down, or burn.
You should power it directly with a supply of appropriate voltage and current capacity.
I see from the picture that you run the high current supply through the arduino, which is definitely not recommended!
|
H: How to replace a LED driver with a plug-able power adapter?
I'm trying to build a small table lamp with a 1 watt led inside. I've got this working with a matching LED driver, however, this driver is not nicely packaged and would require me to create some kind of additional housing:
I would like to replace this driver with a more typical power adapter. The one you plug into a wall to charge your cellphone.
The problem is, I don't really know how to make that work. I know enough to be dangerous, which is why I'm asking this here.
From what I read on the package, the LED driver is supplying a constant current (300mA). So you can connect up to 3 1 Watt LEDs in series.
A basic USB power adapter is, I think, supplying a constant voltage of 5V. So, using a LED calculator and assuming that the LED is 3.3V (see below). I would need to add a 6.8 Ohm resistor in series.
So my question:
Is it as easy as adding a 6.8 Ohm resistor or is there something more I need to worry about?
This is the only info I currently have on the LED (I'm using the top one):
AI: You're right in thinking you can just use a resistor, but I'm not sure how you get 6.8 Ohms. 5V supply with 3.3V across the LED means 1.7V across the resistor. Divide 1.7V by 0.3A and you get 5.6 Ohms.
The power dissipated by the resistor will be 1.7 x 0.3 = 0.51 Watts. It will get slightly warm so I'd observe it under load for a while to make sure this wasn't going to cause a problem.
|
H: Is it possible to power an arduino-like device from soil?
I am exploring some IoT applications I could work on. One of them is a sensor that does some periodical measurements of soil and saves it into inner memory or broadcasts over low-power radio channel.
I'd make the device as low in power consumption as possible, e.g. small size, low-voltage transmitter, long periods when the device runs measurement (say 2 times a day).
I know there are many factors that can impact it, but is there a chance that soil around the device could give it enough power to function or is it impossible to count on it as a source of energy in a real world project and I should abandon this idea and use batteries?
The idea comes from the article about "earth batteries", which creates a battery by burying two electrodes in the soil.
AI: This isn't going to work. Think about it. If dirt to power worked, it would be done regularly. There are some ways that soil can help to get some energy, but these will be difficult to extract or the amounts would not be useful for most purposes:
Sufficiently wet soil can be the electrolyte of a battery. It wouldn't be a very good electrolyte, and the energy would come more from the plates that you'd insert into the soil than the soil itself. Therefore saying you're getting power from soil is a bit of a stretch.
From thermal differences. You can use soil as a big temperature averager, especially if you go a few feet or more down. The instantaneous temperature difference between the ground and the air represent power that can in theory be extracted.
Note that the Carnot efficiency is not your friend here. Carnot says that the maximum possible theoretical efficiency of a heat engine is Tdiff/Thot, when the temperatures are measured on some linear absolute scale, like Kelvin. For example, Lets say the soil is 68 °F and the air 90 °F. That's 293 °K to 305 °K, for a Carnot efficiency of only 4%. That means you have to have a large thermal connection to both the soil and the air to extract meaningful power levels.
I would look into solar cells. Perhaps these could keep a battery charged so that the device can run whenever it wants to, whether the sun is shining at that moment or not.
|
H: Thevenin’s theorem, find the voltage across R4
I was try to solve this problem many time but the final answer is always wrong and not like the one in the book "Vth=11.7 V"
i have a midterm exam this week so i hope i can know how to solve it early :(.
Thevenin’s theorem, find the voltage across R4.
AI: Try redrawing the circuit with the voltage source driving all of the resistors. You'll find that it becomes a simple divider between the 4.7K and the equivalent of the others, which comes out to about 1.449K. I came up with 11.78V across R4.
|
H: Block diagram for an analog audio amplifier,
I am attempting to design my own audio amplifier i have started the process with a block diagram. So far the "blocks" i have are:
Input audio signal → Band-pass filter → Preamplifier → Power amplifier → Load
The only restriction that has been imposed is:
No digital electronics
Is a buffer amplifier needed between the input and band-pass filter?
AI: The preamp would normally be the first stage, which is why it's called a preamplifier. It takes whatever the audio signal levels are (various line levels, mic level, etc) and normalises them. You put the equalisation and after that, and before the power amplifier (which has a high fixed current gain). Any level controls would normally be part of the preamp.
Basically, the preamp is the buffer.
Do you really need a band pass filter? What's it for?
|
H: Help with designing a peak detector
I'm trying to design a peak detector which can be cleared by using an pin on the arduino. To design the peak detector I was following this guide-How to make a peak detector circuit. I used the circuit shown in that post and it works fine.
I made some changes to the circuit to use mosfet as switches in order to clear the peak value stored and another mosfet to allow the output to the stored value for certain times.
The switch s1 is used to clear the stored value and the output across load r2 appears when the clock u1 is high
The problem: Now the problem i'm running into as you can see from the graph is once the switch s1 is closed and opened again, the peak detector stops working. Also how do i remove the spikes appearing at the output whenever the clock u1 is switching?
AI: Issue 1, you need a pull-down to ground on the gate of Q1. Mosfets have a high gate capacitance, than needs to be drained. This is a problem with your switch design that will not appear if the switch is replaced with the pin from the micro.
Issue 2, is also caused by mosfet capacitance. (You should also change Q2 to a p-channel.) Also it is not uncommon to add a low pass filter in the output stage of peak detectors to limit spurious switching signals. However, the spikes you see may be more the simulator than reality. Real clock signals do not have infinite rise times.
It's also not a good idea to short the output of the first op-amp like that. Add a small resistance after the diode and before the holding capacitor line.
|
H: How long would a 5v battery power supply run a 5v LED strip for
I have an LED strip which requires a 5v input, to run from a portable power supply. The power supply has a capacity of 2200mAh with maximum output of 1A.
How long would the power supply be able to power the LED's before it needed replacing?
AI: If the led strip takes the max of 1A it will be 2.2hours (2200mah/1000ma)
If the led strip is less that 1A use the above equation.
However, 2200ma will be rated at a particular load factor. Actual times may vary.
|
H: 2.2K ohm resistor in series with 1A power linear supply circuit, is that right?
Here's right after the bridge there's 2.2k resistor in series with the regulator.
This circuit is supposed to provide 1A current to the load! is that correct?
AI: I don't think that can possibly be correct. Maybe a typo for 2.2 ohms, which would be a plausible inrush current limiting resistor (but 1W rating wouldn't be enough). I would treat the entire design with great suspicion.
|
H: Power supply over-current protection mode: constant current
I am researching power supply over-current protection modes, and I have a question about constant current.
Wikipedia claims (https://en.wikipedia.org/wiki/Foldback_(power_supply_design)) that the current remains constant while the voltage goes to zero. Doesn't this violate Ohm's Law? R is not changing, I is not changing, but somehow the voltage can change willy nilly?
What gives?
AI: If you set your power supply to constant current mode, the voltage will change depending on the load. Pure Ohms law V = IR. If I is constant and you change R, V must change.
Obviously within the limits of how much V is available.
So when you set your current limit on the supply and watch the meters while you increase the load, at first V will be constant and the current needle will ramp up to the limit. After that the current needle will stay put and the voltage needle will drop.
|
H: Determining value of capacitor, in a opamp ampifier circuit
I am working on the follwing circuit, and have found all values for the components, except for C3 which i have a hard time finding.
My requirements are that it should be able to handle 40-16k Hz with a flat frequency response, and that i can change the gain of the amplifier.
Because of this i would preferably have a cut off frequency of 160k Hz in the circuit:
where
R3 = 7,3k ohm
R4 = 1k ohm
P1 = 0-242k ohm
The thing is that i see the last part of the circuit as a low pass filter, with the output on the negative terminal of the opamp.
The problem is that R4 is a part of it, and i will always have a gain lover than 1/sqrt(2) and therefor a cut off frequency does not seem to make sense.
How can i determine a value for C3?
AI: C3 is working against R4 to form a high pass filter, not a low pass. You therefore want to adjust C3 relative to R4 for the lowest frequency of interest.
To see how capacitors work as low or high pass, think what happens when you replace them with shorts (high frequency) or open (low frequency).
In this case, the overall opamp stage gain is 1 when C3 is open. When C3 is small compared to R4, the gain is (R3 + P1 + R4)/R4.
|
H: NOT logic gate with two inputs
If we assume that allowable inputs a, b and c are applied to the following logic gates, what is the output in terms of a,b and c?
I ran into the above problem, but I'm not sure if it makes sense. Because some NOT logic gates have two inputs which is not what I expect. I wonder if the problem is wrong or I'm missing something.
I need to calculate the output of the logic gates in terms of a, b and c with logic operators like: \$\bullet \$ for AND, \$+\$ for OR, \$\overline{a}\$ for NOT \$a\$
I appreciate if anybody can help.
AI: As a theoretical logic diagram this is pure nonsense. Inverter has only one input and connecting 2 outputs together means nothing.
As practical circuit diagram this can be valid. the special 2 input inverters can really be disconnect-able by the disabling signals. In practice we say "they have 3-state outputs". The 3rd state is called "high-Z" and that means "disconnected by internal electronic switch."
The rightmost a and c should not be the same as the leftmost a and c.
But if you really have this as written and 0 means "disabled" for the special inverters, then you have the following truth table:
a b c .....out
0 0 0 .....undefined (=no proper input to the rightmost inverter)
0 0 1......0
0 1 0 .....undefined
0 1 1 .....0
1 0 0......0
1 0 1 .....smoke (=a short circuit)
1 1 0.....0
1 1 1 ....1
|
H: low power reading of NC switch with mcu
I want to read the state of a normally closed switch (waterlevel sensor) with a MCU. The NC-switch is connected over two about 20 meter long cables. The MCU wakes up periodically and enables a external pullup (R5) and reads then back the signal on a GPIO input pin. The pullup is switched on by a transistor to minimize the idle current. The schottkey diodes and the series resistors are for protection against external induced voltages.
Will this circuit work?
If the switch is opened one wire-end will float most of the time when the pullup isn't active while not reading the state...Is this a problem?
Thank you for any comments on this.
AI: You are already using a 1M pull-up... how low current do you want to go?
That is also a wonderful antenna you have which is why I assume you have that 10nF cap in there.
You are aware the charge up RC time is 10mS right.
You need to do the math and see if the current drop you gain by switching outweighs the current you lose by staying awake long enough to let that settle. Which I doubt.
As for the floating part, since you protected it with diodes you should be ok though providing a discharge path for the cap would be prudent.
Personally I think something more on these lines would be more prudent. Use the output pin to drive the line directly and sense with the other. Also adds the benefit that you can modulate the output if need be to detect it is really the wire and not a short somewhere.
simulate this circuit – Schematic created using CircuitLab
|
H: How can I drive and measure the output of a bare ultrasonic parking sensor?
I want to use a parking distance sensor, specifically the common ones found on vehicle bumpers.
There are only two wires. How can I drive the sensor and read distance from it?
I specifically need to know what the input and output pulses should look like (voltage/duration).
Conceptually, I need to send a pulse of some magnitude and duration, and then measure the time before a signal is received back. That seems simple enough to be done with a 5V microcontroller and few other components, but I don't know for sure because I can't find much data on these sensors.
A common bidding site has the following 'data' for these sensors:
Allowable Maximum Input Voltage ( Vp-p): 140 (40KHz)
Pulse width: 0.5ms
interval: 20ms
Decay Time: ≤1.2ms
140V input pulse? Is that right or just a mistranslation? If it's right, I think it would be more cost effective to buy a driver for it.
This link suggests that the sensors in vehicles perform "both emission and reception", though that's not any sort of confirmation.
Note that I do not have of these sensors, and I do not have any supporting hardware for them (like a stock PCB).
AI: You've proposed a very intriguing question. Since you've offered up no datasheet, I've taken the liberty of using a freely available datasheet from a comparable bare sensor that can be used in 2 pin mode; That is, the same pin used for power sends back the distance of an object.
This model is the SRF005, and from the photo below you can see that the sensor itself, aside from the helping hardware, only has two pins:
Reading the documentation of the SRF005, Picaxe provides instructions on how it does this: It simply sends a 40kHZ burst out of the sensor, turns the pin into an input pin and measure the time it takes for the burst to be returned. With some basic calibration that can be stored in the micro, the time can be converted to a distance and sent out via SPI or RS232 or similar. See update below
That should answer your question on what the output pulse looks like: a 40kHz pwm signal (10uS wide), and the input should be very similar, allowing for noise distortion.
If you're going to build the circuit yourself, you will need to filter the noise on the input as well as scale the input voltage down to a level acceptable to your micro.
While the sensor I referenced doesn't have a 140Vpp maximum that you reference in your sensor, I suspect that has more to do with detectable distance, as it is an allowable peak, and not a nominal voltage level, I would experiment with different levels, starting with 12V and 24V and see if it has an effect on distance. Murata, the company referenced in your link, also makes a sensor with a 20Vpp square wave max version, if you don't have 140Vpp square waves lying around.
Update
ChrisStratton pointed out that my comment above about the SRF005 using 2 pin mode was erroneous, they are actually 'faking' a 2pin mode using the driver and micro.
However, as for why this works, essentially this transducer is made up of an excitation wire and a ground wire. On the send, you apply a voltage to the excitation wire to send out the physical signal, and on the receive, the echo of the sent ultrasonic signal vibrates the transducer and it generates a voltage on that same excitation wire. This can be done with simple additional circuitry, however TI makes the TDC1000 that does all the heavy lifting for you:
It is important to note though, that you don't know for certain if those sensors you're interested in are actually 'combined use', or a sender and receiver in a single package. As they are shipped in a pack of 4, it's entirely possible that 2 are senders and 2 are receivers, or that they are indeed 4 combined use. Murata makes both types.
|
H: Drive LEDs from a second source
Given that I'm using the following circuit (adapted from this forum post):
simulate this circuit – Schematic created using CircuitLab
Which takes a 24V (Nominal) input and converts it over to 3.3V for an input on the Raspberry Pi Compute module. I'd like to have an LED present on the board to signify that the input is on.
The issue is that I'm using the LM2676SX-3.3 to power the 3.3V, which provides a maximum of 3A, and I need to have 128 of these LEDs in the system. At the above values, each LED will consume 8.7mA of power which is 1.3A.
I'd like to power the LED from its own 3.3V source (probably another LM2676SX-3.3), but I'm not sure how to modify the above schematic to use a separate supply?
The other option is to power the LED on the 24V side, but it needs to support a voltage range from 12V to 32V as the input. I'm not concerned with a particular brightness as long as the LED is viewable.
So how can I modify this to use a separate source for D3 (considering I need to duplicate this 128 times, so low part count) or how can I run D3 off of the 24V side with a wide input range and not turn the enclosure into a small heater?
AI: You can put an LED in series with the opto-coupler LED, no other components required. It won't increase the power consumption at all.
It will increase the minimum voltage slightly but would still be within your 12v minimum voltage requirement.
From your resistor values it looks like the current through the opto-coupler LED is compatible with the required current through the illuminating LED. What value is the zener diode?
simulate this circuit – Schematic created using CircuitLab
|
H: JST 1.25mm connector soldering
I'd like to SMD solder the JST 1.25mm connector below with horizontal orientation aligning it to the side of the PCB (ie. in the end the male header should be plugged to the connector from the side of the PCB not from above the PCB). As visible the pins on the rear side are raised from the bottom plane of the connector so they don't touch the PCB when the connector is layed on it.
Is this connector meant to be soldered the way I described, or is it just a through hole connector meant to be soldered with a vertical orientation? If the former is true, how to solder it, just put enough solder paste/tin under the pins to fill the space?
What is the proper name for this type of connector?
The product link where I bought the connector:
http://www.ebay.com/itm/231443803216
Rear side-1:
Rear side-2:
Bottom side:
Front side:
AI: Is this connector meant to be soldered the way I described
Not really, but don't let that stop you.
or is it just a through hole connector meant to be soldered with a vertical orientation?
Yes.
If the former is true, how to solder it, just put enough solder paste/tin under the pins to fill the space?
Put pads on the edge of your board, something like the edge of an ISA PC card.
Put one or two plated through vias in each pad
Hold connector in place, flush with board
Solder
Solder will wick into the vias, and this will increase mechanical strength. It should be a bit stronger than simply relying on pad adhesion onto the PCB.
This isn't something you'd do in a fabrication run, because it has to be hand soldered, but it'll be much stronger than a wimpy SMD connector. Like the micro-USB in your smartphone/tablet which falls off the board if you plug in the charger wrong.
I do it all the time with 0.1" headers for prototyping, and the headers will bend before the solder breaks.
|
H: Proper or instinctive design choices for trimpot direction
We all know its customary for a VOLUME control on any audio product should require turning CW to make it louder. In fact for user accessible rotary adjustments, clockwise almost universally means "more". This despite the fact that all plumbing faucets do the opposite. But it seems whenever I design a circuit where a trimpot makes the most sense, I'm always self debating this, and even when I reach what I think is a sensible decision I often find I'm later second guessing myself.
Consider, for example a trim pot that limits the maximum GAIN in an amplifier. On the one hand, it would seem to follow the "volume control" logic that CW should be more gain. But then again when you make adjustments looking at a schematic, sometimes it seems like the opposite might make more sense. Especially when only 2 legs of the trimmer is used, maybe CW should always mean more resistance.
I doubt there is a right or wrong to this, so I always try to notate my schematics with an arrow near the trim pot wiper with either "CW" or "CCW". Right or wrong, that way at least I know what to expect. But for as many times as the final adjustment direction didn't seem to make as much sense as I thought it would on paper, I thought it might be interesting to see if there is some consensus or set of conventions, as there already is for user level adjustments.
AI: It seems logical to my way of thinking that CW is "forward , up, and more" of any parameter you are adjusting such as Black Level or White level which are opposites or simply "more resistance" using pins 1 & 2.
The pins should be numbered "one TWO three " which also is to say the CW direction of wiper rotation from 1 TO 3. That's always been a Bourns® standard.
;)
|
H: How Does One Go On Charging Ni-Cd Battery's
Its a simple question but I can't seem to find any info on it. I have two Ni-Cd batteries (listed bellow) so i want to know how to charge them? And how to know if they are completely dead or are still alive. Each battery has 3 cells with the same type of package style as shown in the images.
Rating 3.6V 300mAh - Reading Voltage = 0.3V
Rating 3.6V 600mAh - Reading Voltage = 0V
AI: The normal charge rate for Nickel Cadmium (NiCd) cells is 1/10th of the capacity for 14 hours.
For the ones you have there the first would require a constant 30mA with the second needed 60mA.
You could use a resistor from 12v to provide the constant current but keep monitoring the voltage and current to determine if anything unusual occurs.
The voltage should not go over ~1.5V per cell.
NiCd are not legal in new equipment so those are old (The data code on the second is 0904 probably meaning 9th week of 2004). They have probably degraded to the point where they do not function well.
When the batteries get old not only do they have reduced capacity but they also tend to have high self-discharge so even if they do charge up they may discharge by themselves in only a few days.
As the other poster indicates cadmium is toxic so they should be disposed of in an approved manner.
You can learn more at Battery University.
|
H: How convert a 3.3v PWM signal to a 5v PWM signal
I want to drive an array of leds with a transistor, no more than 240mA the things is that im dimming them with PWM works fine with 5v PWM but im having problems with 3v3 uc because with full 3v the leds are not fully bright, I try to solve it using attaching the gate of another transistor to Vout like below but is not working. Any advice?
By not Working im mean that PWM dimming is not working, LED's are always fully on with this approach
Its supposed to drive around 120mA per led array, this are the led datasheet
both transistors are BC337-40 (1A collector current, cant post datasheet link due to reputation)
simulate this circuit – Schematic created using CircuitLab
Wich one can be a suitable "new NMOS"?
AI: Thanks so much for your linked LED datasheet. (Nice specification sheet, by the way.) This makes it clear, as does your modified schematic now, that by "array" you mean "two" and that these are LED devices and not LED modules. This greatly improves the question.
It doesn't answer all questions. For example, the PWM rate you intend on using might be important in developing a practical design. But a practical LED intensity control doesn't need to be controlled at a finer resolution than 5 or 6 bits. And with a rep-rate of say \$100\:\textrm{Hz}\$, we still are on the order of \$150\:\mu\textrm{s}\$ periods and very little need for extremely sharp switching edges. So almost any modern parts used in modestly designed circuits is likely to work "well enough."
The answer with the least external parts is to find an NMOS which can easily switch your required current while at the same time driven from perhaps \$V_{GS}\le 3\:\textrm{V}\$. So something like this:
simulate this circuit – Schematic created using CircuitLab
I used two \$15\:\Omega\$ resistors here. (Use \$\frac{1}{2}\:\textrm{W}\$ size if you believe you won't ever short out the LED or else instead use \$2\:\textrm{W}\$ if you want to be absolutely safe even when the LED is shorted.) I think that's preferable. But that's not locked in. Other nearby values may work well for you.
The indicated NMOS is likely to itself drop significantly less than \$100\:\textrm{mV}\$, when driven from your \$3.3\:\textrm{V}\$ I/O pin and the I/O pin impedance is probably enough to avoid any worries about high frequency ringing on the gate. And the NTE4153 is about 40 cents in singles and it is in stock at Digikey.
But here's the problem. I used the typical case figure of \$3.15\:\textrm{V}\$ for the LED drop to specify the \$15\:\Omega\$ value. But the fact is, it could also be as little as \$2.8\:\textrm{V}\$ or as much as \$3.6\:\textrm{V}\$, unless you take the time to bin your devices or else buy them binned for you. (At the nominal current of \$120\:\textrm{mA}\$.) With the resistor values I gave, you may see anywhere from \$90\:\textrm{mA}\$ to \$145\:\textrm{mA}\$ through the individual LED. That's quite a range. So you may need to tailor the dropping resistor value together with the LED itself, if you plan on having them both appear approximately the same brightness. Or else bin the LEDs by hand or buy them pre-binned for you. (This isn't an uncommon problem and companies producing aircraft instrumentation, for example, go to some lengths to ensure that the apparent color and brightness of their entire LED display is well-matched.)
I also like to use BJTs (actually, I prefer using them.) But in that case, you usually have to consider the idea of the "rule of thumb" of using a current gain (\$\beta\$) of about 10. And given the current requirements you have, perhaps getting near to \$300\:\textrm{mA}\$, this implies a base current of \$30\:\textrm{mA}\$ and it's not likely you can achieve that.
There are two answers to that. One is to just assume (or get a BJT that allows you to assume) that the switching \$\beta\$ is more than 10. And this works. Most BJTs will switch well with \$\beta=30\$, or higher even, at these collector currents. In that case, you might decide that this is not a risky proposition and that perhaps delivering a base current \$\le 10\:\textrm{mA}\$ will be acceptable. In that case, you can get by with a single BJT. The other answer is to use two of them to get the necessary base current down, sufficiently.
The first case would look like:
simulate this circuit
In this case, I used a BJT that provides some nice curves and one of them exactly at \$I_C=300\:\textrm{mA}\$, providing some "typical" values for the collector-emitter voltage given the assumption about your base current drive. Roughly speaking, they say that \$V_{CE}\approx 140\:\textrm{mV}\$ in this case, which is probably acceptable. Power dissipation in the BC817 would be modest -- perhaps \$50\:\textrm{mW}\$ and almost certainly well under \$100\:\textrm{mW}\$ -- which is fine, too.
You could go to a second BJT, as I mentioned. But I won't add that schematic here unless you care about it.
The above schematic shows a base resistor value that discounts any I/O pin impedance. And besides that, you will have to ensure that your I/O pin is capable of at least \$10-12\:\textrm{mA}\$, too. In practice, I find that I/O pins often are capable of \$10-12\:\textrm{mA}\$ but that you may see as much as \$1\:\textrm{V}\$ voltage drop when doing that. So perhaps you should consider trying \$150\:\Omega\$ as another value to try out, as well. Or something nearby. (Don't take the value of \$220\:\Omega\$ as gospel.) The exact value will depend upon your I/O pin characteristics, too. (This fact is one more reason why an NMOS might instead be preferred.)
You can't just directly strap these LEDs together as you showed in your (newest) schematic; particularly, without any precision binning. They vary too much for that. The variability in the voltage drop of your LED devices (and it's substantial) can mean very different currents through them.
You could consider putting the two LEDs in series. Of course, their currents would be the same then. But this might require a voltage supply well above \$7.2\:\textrm{V}\$ and you haven't indicated a desire to go in that direction.
[Another approach might be some kind of buffered current mirror source pair where the current is set by an emitter follower current sink that you drive with your I/O pin. But that's also getting kind of crazy and adds still other problems to solve, including dissipation. There are also ICs which will do all this for you. So that's another way to go. And finally, you could consider separating the LEDs, using the same current control resistors for both, but calibrate the PWM % values differently for each LED. Again, that's also getting a bit crazy.]
So I just think the resistor idea is "good enough" to get by. If you really feel the need to further balance the currents, then you should either adjust the resistor values or else pre-bin your LEDs before pairing them up.
In case you want to go seriously insane on a circuit with a pair of LEDs and are willing to provide a \$+9\:\textrm{V}\$ supply rail instead of the \$+5\:\textrm{V}\$ rail, then here's a circuit that will provide current control and some improved (over BJT alone) thermal stability of the LED drive current (it should stay within 5% over quite a range of temps.)
simulate this circuit
I've even divided up the PNP power distribution into two cheap (less than a penny) transistors to keep their dissipation at or below about \$100\:\textrm{mW}\$ each. That should keep their temperatures in free air quite safe and reasonable and their collector currents well below absolute maximums.
Drive current from your I/O pin should be only about \$1\:\textrm{mA}\$, which almost any I/O pin can manage to do, quite well.
Note regarding added schematic showing 16 LEDs in two series strings:
A relatively minor problem with your schematic is that, in worst case bad luck, those 8 LEDs could add up to anywhere from \$22.4\: \textrm{V}\$ to \$28.8\: \textrm{V}\$. Unlikely in practice. But there's no guaranteed headroom here if all you use is \$28\: \textrm{V}\$ for the supply rail.
But that's the minor problem. The major problem comes from the possible worst case \$\Delta V=28.8\: \textrm{V}-22.4\: \textrm{V}=6.4\: \textrm{V}\$.
If you want to limit, let's say, current variation to \$\Delta I=20\:\textrm{mA}\$ over that range, then your resistor would need to be \$\frac{\Delta V}{\Delta I}=\frac{6.4\: \textrm{V}}{20\:\textrm{mA}}\approx 330 \:\Omega\$. But at a nominal current of \$120\:\textrm{mA}\$ in a series string, that resistor would drop close to \$40\:\textrm{V}\$, by itself. I'm sure that's not acceptable.
On the flip side, suppose you decided that you wanted to use a \$30\:\textrm{V}\$ rail. Then the dropping resistor would need to be \$\frac{30\:\textrm{V}-28.8\:\textrm{V}}{120\:\textrm{mA}}=10\:\Omega\$. But now what happens when you are unlucky enough to require only \$22.4\: \textrm{V}\$ for the series string? You'd get \$760\:\textrm{mA}\$. Of course, in practice that wouldn't happen because the voltage drops would increase as the current increased. (I don't have a model for these LEDs to make this answer quantitative about what probably would actually happen.) But the upshot is that your current would be "out of control." It's enough to know that.
So this means you can either increase your voltage rail to rather extreme heights in order to get some current control through the resistor, or else you can take a huge risk about current variations. Which would put a lot of pressure on you binning your LEDs, then.
You may really need to consider serious current control, instead.
I can't really offer a specific direction without knowing more about what you are willing to do. For example, are you willing to bin the LEDs before using them? Are you willing to buy them pre-binned? Are you committed to 8 LEDs in series? Or are you just floating random ideas, here and there, hoping "something works?" Are their ANY boundaries here?
You need to make some decisions, stick to them, and then figure out the implications for the circuit. Things are way too open still. You have some thoughts, though. And perhaps, you can now see why engineers are willingly paid money for thinking through all these issues and helping clients explore and then refine their options to a few workable ones (or to close off all the choices and stop the project, entirely.) Even for something as relatively simple as driving LEDs! (I'm just a hobbyist with zero electronics training. So I'm not pushing my own agenda here. I just recognize the value of experienced engineers.)
The last circuit (the insane one) I provided could be used to operate using any rail voltage you liked at or above perhaps \$30\:\textrm{V}\$ and you could do it still from your \$3.3\:\textrm{V}\$ I/O pin, just as I said before. And you would not need to bin the LEDs. However, you would probably need to replace the pair of PNP BJTs with a single, higher power dissipating one or else add another few to the pile there. The potential dissipation (worst case) could get to a watt, or even more depending on the rail you choose and the actual luck you get with a series string of LEDs, and that additional dissipation becomes a new concern, then.
|
H: How to charge this battery?
I bought this new battery really cheap (it is really small and i needed a small 12v battery) but i am not sure of some things.
First of all, it says it is 1.3Ah/20HR. Does that mean that it can deliever 1.3Ah for 20 hours? Like, i could power a 12v 1A light bulb (estimately...) for 20+ hours from it?
Second of all, is this a deep cycle battery? ( i do not speak polish, so i do not understand the label). If i fully discharge the battery (9-10 volts) will it lose its capacity to store charge, or there is no problem?
What is its optimal voltage? I used some rough google translate and it turns out that the "standby voltage" is 13.6-13.8 volts and the "usage" voltage is 14.5-14.9 volts. Isn't that too much for a 12v battery? Right now it is at 12.6V. Is it undercharged?
Also, what is the voltage needed to charge it and is it a bad idea to charge it with a stepped up 5v power supply? (Phone charger, stepped up to the battery voltage required for charging)
AI: How to charge this (SLA) battery?
Ideally:
CC using C/4 rate = 1.3A /4 = 325mA max whenever Vbat drops below 70% SoC or ~2.1V/cell or 12.6V in your case.
two-stage CV, if outdoors, apply a -4mV/˚C/Cell temp compensation for Vmax charge voltage above room temp. This is to charge the absorptive layer capacitance which has a much longer ESR*C time constant.
Use pulse float charge followed by measurement of no load decay rate in 1hr.
it is not a deep cell voltage battery. Sealed lead acid battery manufacturers do not recommend deep discharge, as this damages the battery (greatly reducing its life)
Absorption Charge Voltage 1
V OUT1 ‡ 14.2 14.4 14.6 V (min typ max)
Absorption Charge Voltage 2 & Float Charge Voltage
V OUT2 ‡ 13.5 13.65 13.8 V (min typ max)
Battery Capacity Threshold Voltage V TH 12.9 V After 2 mins
|
H: Detecting the failure of LED
I am using a 12V LED for blinking purpose. Whenever it gets a signal from source(indicating the emission of rays), it blinks. The signal voltage out of the source is 5V. The supply to the source is 24V. I am using a relay in between the source and the LED.
Whenever the source is triggered, the signal from the source triggers the relay and in turn LED blinks.The challenge i am facing right now is:
If the LED fails, the source should not emit the rays itself. Basically it should check whether the led is working or not and then signal should come out from the source. If the led is not working even though the source is triggered, the source should not emit the rays. How can i achieve it? Is it possible with a relay or a led with feedback circuit or any other? Thanks in advance.
AI: The "12 V LED" is likely an LED in series with a resistor. You'll need to get access to the intermediate node between the LED and the resistor. Or else get rid of your "12 V LED" and use a separate LED and resistor of your choosing.
Now, what you'll do is apply voltage to the LED-resistor combo first. And monitor the voltage at the intermediate node with a couple of comparators. If that voltage is less than maybe 1 V, it means the LED has failed short. If the voltage is greater than 2 or 3 V (depending on the LED color) it means the LED has failed open. Two comparators can check these two conditions. If you use open-drain output comparators, you can make a wired-AND connection at their outputs, and connect this to your control circuit. Only if both comparators give the expected output, you turn on your ray gun.
simulate this circuit – Schematic created using CircuitLab
The common name for this circuit is a window comparator.
None of this will work if the failure mode of the LED is, for example, somebody spilled paint on it.
|
H: Common anode optocouplers protection
I build simple RPM meter (works fine), but i wish to try use it in harsh environment, so the question is how to properly protect optocouplers input from overvoltage/ESD? In the circuit two optoisolators with a common anode are used, and the cathodes are connected to the collectors of the output transistors of the sensors. In the circuit two optoisolators with a common anode are used, and the cathodes are connected to the collectors of the output transistors of the sensors. I do not have information about the protection applied in the sensors (Parker speed sensors).
Would it then be sufficient to apply "classic" scheme with one TVS between the anode and the cathode of each input (for suppressing overvoltages between the anode and cathode and additional protection against reverse polarity)?
Or it would be better to suppress both the anode and cathode lines (relative to ground) with two TVS'es to GND?
Sorry for bad English...
AI: Something like this:
simulate this circuit – Schematic created using CircuitLab
EDIT:
This circuit is a wide input control voltage. But what you have asked is an ESD protection for optocoupler. IMO you don't need it, the optos are tough devices.
EDIT2:
I am in PLC business for more than 15yrs. I had never seen a PLC with opto isolated input having TVS protection. The only failure I have seen was due wrong connection: 230VAC instead of 24VDC. 5m meter long wires are very short in automation world.
A more probable failure that has to be expected is due to some contactor/relay kickback voltage, that is not equipped with freewheeling diode or MOV. In such case a negative spike will travel along your power supply. The reverse diode on the optocoupler is a must, or alternatively you can install an opto with bidirectional LED. It can provide you additional feature, if you want to use positive (PNP) or negative (NPN) logic.
EDIT3:
Your schematics is too complex. too many components. Here is a simpler one:
simulate this circuit
High speed with addition bleeding resistor, If LED = approx. 10mA:
simulate this circuit
|
H: FSK demodulation using DSP
Especifically talking, I need to demodulate a low frequency FSK signal( betwen 120 and 140 kHz ). I already have a circuit of antenna that receive the signal and I already can sample it, but I still have a doubt of how could be the best way, faster and reliable, to process the signal.
Basically, I'm using a comparator with interruption to count the number of cicles of the carrier, and a timer to measure the time between a pre-determined number of cicles. Depending on the time to count the pre-determined number of cicles it is decoded as being zero or one.
This is not working very well, it works, but it miss a lot too, so I was wondering an alternative way.
For those who may want to know, I'm using a dsPIC33EP64MC202.
Here is two figures that ilustrate my situation:
Please, if some one has any Idea, I would appreciate very much!
With my bests regards,
Daniel.
AI: A very simple but elegant approach to demodulate FSK is a delay and multiply. (Followed by a simple low pass filter). This is a non-coherent FM detector using the principal that the output of a multiplier is proportional to the phase of the two inputs. An XOR gate can be used as a such a multiplier. On its own it, a multiplier or XOR gate is a phase detector, given what I described, but if both inputs come from the same source, while one is passed through a fixed delay relative to the other, the result will be a phase that is proportional to input frequency and therefore the combination is a frequency discriminator!
This may be easier to see / understand with my pictures below.
First a multiplier followed by a low pass filter is a phase detector. If you multiply two signals, the output will be the sum and difference of the phase and frequency of the two inputs. After the low pass filter, only the difference results. If the two inputs are at the same frequency then the output will be dependent on the phase difference of the input. For a multiplier (mixer) the function is \$V_{out} = \cos(\phi)\$ so forms a linear phase detector at the 90° crossing. With an XOR gate this function is a ramp so is linear over the range from 0 to \$\pi\$ in that case. The use of an XOR gate as such is really "analog" so for a complete digital implementation I would stick with the concept of simply multiplying the two signals.
Next to use this phase detector as a frequency discriminator we introduce a fixed delay. A fixed delay has a linearly increasing negative phase versus frequency, and thus as shown it converts frequency to phase, prior to applying the same signal to the multiplier.
Note that the output varies sinusoidally versus frequency so an ideal midpoint is the zero crossing where the curve is most linear and sensitive to frequency variation. This can be linearized with an inverse cosine computation or more simply by overdriving the mixer (in the analog) or hard limiting the inputs in digital or analog domain (such as using an XOR gate as a linear phase detector).
For the case of FSK, an optimum delay value is that which results in the two FSK symbols F1 and F2 being positioned as I show in the diagram above, so the values that would correspond to a 0° and 180° phase shift for the carrier frequency in use at the input to the demodulator.
Note this is simple (and often done due to its simplicity) but will have worst SNR to coherent demodulation approaches such as the PLL approach previously answered (no more than 3 dB worst). It is clear how this is the case since the noise at both inputs to the multiplier will be uncorrelated due to the delay (above a corner equal to 1/T where T is the delay) and will therefore add relative to the signal.
I have also seen analog equivalents to this demodulator where the delay element is formed by a parallel LC tank to ground followed by a small capacitor (to introduce 90° shift to center the discriminator). The tank has 0 degree phase at resonance but a high phase vs frequency slope corresponding to the delay desired. This delayed signal is multiplied with the original signal, the result low pass filtered to be the FM demodulated signal.
|
H: How does resistive feedback affect noise figure?
I am working on a design with cascode CS amplifier with resistors in the feedback. What are the advantages and disadvantages of such topology? How the resistors in the feedback affects noise figure? It will be great there's a book or paper that I can reference to.
AI: Consider this
simulate this circuit – Schematic created using CircuitLab
Here is a 2-opamp circuit, Rnoise OA1=60 ohms, Rnoise OA2=6,000 ohms. Yet the RTI noise contributions are equal.
How is this done? We simply scale up the Rnoise and the 2 gain-set resistors of OA#2, by Gain^2 of the prior stage. Thus RG1=66ohm, RF1=594ohm; RG2=6Kohm, Rf2=56Kohm. (not exactly 100:1 scaleup, between stages, I know)
The final low-pass is needed to ensure the final opamp does not contribute more noise than the first opamp. That final opamp has nothing filtering its noise contributions, whereas the first opamp is "filtered" by the finite frequency response of 2nd stage.
|
H: Want to know what the +1 in this finite state machine circuit diagram is
Can someone tell me what the +1 that goes into the right side J and K is?
AI: It's a signal that's always a logical "1".
|
H: Adjustable Power Supply Design
I am designing an adjustable power supply. Input voltage is 12V from adapter, and the output should be ranging from 0.5V to 12V.
I'm planning to use LM2575, but apparently its minimum output voltage is 1.23 based on datasheet. My concept is instead of using potentiometer to adjust feedback voltage from the LM2575, I use DAC MAX522 to create feedback-like voltage (this is possible right?).
Here is my current schematic
The question is:
is there any recommendation about the DC-DC step down regulator with minimum output 0.5V?
To avoid wasting resource, will this schematic works?
Thanks in advance
AI: First, it should be noted that there's a comparator inside the LM2575 and its purpose is to compare a portion of output voltage (the voltage on FB pin) to a reference voltage (1.23V for LM2575) and generate a signal for the control circuitry. So, what the LM2575 does is to keep the voltage on FB pin at 1.23V. That's why minimum output voltage is given as 1.23V.
Consider the following schematic:
simulate this circuit – Schematic created using CircuitLab
The key point here is the current into/out of the resistors connected to FB pin. And we have 3 equations:
1) \$I_{R2}\$ is constant: \$I_{R2} = I_{R3} + I_{R1} = V_{ref}/R2\$.
2) \$I_{R3}\$ varies with DAC output voltage, \$V_{DAC}\$: \$I_{R3} = (V_{DAC} - V_{ref})/R3\$.
3) And finally, \$V_o = V_{R1} + 1.23V\$, where \$V_{R1} = I_{R1} \cdot R1 = (I_{R2} - I_{R3})\cdot R1\$. If we make \$I_{R1}\$ negative then we can get output voltages lower than 1.23V.
But selecting resistors needs a two-unknown equation to be solved.
For your needs: \$V_{o-min} = 0.5VDC\$ and \$V_{o-max} = 12VDC\$
Let's select R2 = 1k2.
\$I_{R2} = 1mA\$
For \$V_{DAC} = 0V\$ (zero code);
\$I_{R3} = (0 - 1.23)/R3 = -1.23/R3\$
\$I_{R1} = I_{R2} - I_{R3} = 1 - (-1.23/R3) = 1 + 1.23/R3\$
\$V_o = 1.23 + I_{R1}\cdot R1 = 12V \Rightarrow R1 = \frac{10.8}{1+\frac{1.2}{R3}}\$
For \$V_{DAC} = 5V\$ (full-scale code);
\$I_{R3} = (5 - 1.23)/R3 = 3.77/R3\$
\$I_{R1} = I_{R2} - I_{R3} = 1 - (3.77/R3)\$
\$V_o = 1.23 + I_{R1}\cdot R1 = 0.5V \Rightarrow R1 = \frac{0.73}{\frac{3.8}{R3} - 1}\$
From \$R1=\frac{10.8}{1+\frac{1.2}{R3}} = \frac{0.73}{\frac{3.8}{R3} - 1}\$, you'll get R3 = 3k5 and R1 = 8k.
If you crosscheck, you'll see that the minimum output voltage (with full-scale DAC output) will be 0.51V and maximum output voltage (with zero-scale DAC output) will be 11.94V.
With this method, any output voltage range can be obtained.
|
H: Control 12v lock switcher with Arduino Nano
I have 12v poser supply for electronic lock. It has 3 valuable pins: +12V, GND and PUSH. So, when I want to unlock the lock, i need to push PUSH pin to GND. How can I push 12v line to ground with Arduino Nano?
AI: A definite answer isn't possible without more information about the lock. You likely want something like this:
simulate this circuit – Schematic created using CircuitLab
Drive IOPIN HIGH to ground the PUSH pin.
Many other parts could be used in place of the IRLML2502. It's convenient for driving directly from an IO pin. Whether you need the flyback diode D1 depends on the lock.
|
H: How to approximate the behavior of a phototransistor in the circuit editor?
While phototransistors are often used in this common turbidity sensor application (at least in part) because of their gain, their response is not linear since the gain will depend on the intensity of the light.
I'd like to learn to model circuits here with CircuitLab, and while this one is a little challenging for a beginner, it's has everything I'd like to understand. My first problem is that I don't find a phototransistor in the library.
So I would like to ask if there is a way I could approximate the response of a phototransistor by connecting a photodiode to the base in order to inject a photocurrent. I understand it would not be correct, but at least it gets me started on my way.
Also I've assumed that there is a way to "shine" the LED into the photodiode with some fraction, like 1E-03 or 1E-06 of the light producing a photocurrent, but haven't figured out exactly how to do that. If it's not possible, should I just connect a variable current source to the base in place of the photodiode? (In that case I might leave the LED in place for more advanced tests like low-quality voltage regulation, ripple, etc.)
simulate this circuit – Schematic created using CircuitLab
AI: Try a current-controlled current source (CCCS) going to the base of the transistor. The current in the LED controls the current going to the base. Typical photo efficiency of an efficient device is about 1%, so the base current will be 0.01 times the LED current.
I don't know anything about CircuitLab, but I assume it has a CCCS.
Since this is a sensor, just simulate with different CCCS gains such as you have suggested.
|
H: Is it safe to repeat reflow soldering?
I have a board that is partially reflow soldered with a QFN and a couple of 0603 capacitors and resistors. I wanted to test functionality with this stage before I go ahead and place the other components whose working depends on this stage working right. Since adding components will mean repeating the reflow process, I was wondering if its safe to re-reflow the existing components on the board?
AI: There is no generic answer, it all depends on the components involved, let me add a few things to watch out for, and collect for the convenience a few more from the comments.
First of all, read the datasheets of all involved components, what they say about reflow in general and a second reflow possibly.
A lot of things will not be specified in the datasheets though and need to be tested, things to watch out for:
If time passes between the reflows, moisture could be trapped and cause popcorning
Some plastic connectors seem to start decompositing after a second reflow, usually this is not mentioned anywhere and needs to be tried out
Wet electrolytic capacitors may be designed to lose a bit of their electrolyte and vent it during reflow. They would use more than designed for.
Other kinds of caps change values when heated and cooled again, they may go out of spec if heated a second time. Same for other kinds of parts, maybe crystals too.
thermal stress during heating (while the part is still held by solid solder) might be too much, especially for MEMS parts and maybe crystals too.
Parts might be held in place by the solder, so watch out for upside down. Also the glue used for holding upside down parts may not be designed for a second heating.
It doesn't seem to make much sense for a manufacturer to specify exactly if a second reflow is possible. In my experience it usually doesn't hurt much, especially if you keep the temperature profile exact.
In the datasheet watch out for any preconditions you might have violated, e.g. if it states the storage temperature prior to reflowing should not exceed 85°C then this might raise an eyebrow about why and if reflowing the first time should maybe count as being store above that temperature.
|
H: 3.3V pullups in a 5V signaling system
I have an old design, since 1999 approximately, with an old FPGA XCS30XL and old MCU6840 MCU. They are connected together via a parallel bus peripheral and both utilise and power off 5V. But there is an oddity which is that some of the control lines between the two (IRQs, CSs, R,W,etc) are pulled to 3.3V instead of 5V (Address/data are a mix pulled to 5V or no pullups). All other pullups in the system are generally 5V,
What could the reason/benefits be for pulling a 5V signaling system (at 16Mhz or so) to 3.3V instead of 5V in push/pull logic when the chips actually use 5V signaling?
AI: XL is 3.3 V-supply version of the chip, and it may be wise to pull its outputs up to this power rail rather than to 5 V one. Datasheet explicitly says that 3.3 V outputs can drive 5 V TTL inputs without problems.
However it may require special consideration in order not to create bridges of excessive current between outputs and inputs of devices connected to different power supplies. Check this one.
|
H: Making a 4 way switch, multiple options
Refactoring the question as requested:
I'm doing a small home automation project. The circuit I'm trying to control using an ESP8166 is this:
LOAD: 220VAC / 1A
To be able to control the circuit using the ESP and the mechanic switches, I need to plug a 4-way switch in the middle.
Something like this:
My idea is to use a latching DPDT relay with crossover NO/NC, like this:
So, in the end, I'll have something like this: (minimal schematic, missing protection circuits, external source for relay, relay in's, ..)
simulate this circuit – Schematic created using CircuitLab
My main question is: Is this correct ?
My second question is: Is it possible/better to use a mosfet+bridge rectifier instead of the relay since 1. a mosfet switches faster, 2. the relay wears-off faster
AI: Decent sealed relays are typically guaranteed to withstand something like 100K cycles with a resistive load, which means they can switch on and off every hour and still have a 10+ years lifetime. Unless you need to switch your load repeatedly each minute or more often, I'd advise you to stick with relays.
You also say that MOSFETs switch faster than relays, which is true. However, I'm having a hard time picturing a load for which a delay of 50ms or less would be problematic.
Finally, MOSFETs + bridge rectifier will work with an incandescent lamp, but more sophisticated loads may require proper AC waveform to function correctly. Commutation of a sinusoidal signal with MOSFETs will be much more complicated than with relays (you'll probably end up rectifying AC to DC, doing commutation in DC and install inverters at each load which needs AC).
|
H: ERROR:Xst:827, Signal next_states1 cannot be synthesized, bad synchronous description
it shows
ERROR:Xst:827 - "C:/Users/namec/Desktop/Class/VHDL/Traffic_Light/Traffic_light.vhd" line 46: Signal next_states1 cannot be synthesized, bad synchronous description. The description style you are using to describe a synchronous element (register, memory, etc.) is not supported in the current software release.
Highway: process(CLk)
variable counter: integer := 0;
begin
case traffic_states1 is
when H0 =>
if (Input='0' and rising_edge(clk)) then
next_states1 <= H0;
counter := counter + 1;
elsif (counter <=20) and rising_edge(clk) then
next_states1 <= H0;
counter := counter + 1;
elsif Input='1' and rising_edge(clk) and (counter >20) then
next_states1 <= H1;
counter := 0;
-- else next_states1 <= traffic_states1;
end if;
when H1 =>
if counter = 3 and rising_edge(clk) then
next_states1 <= H2;
counter := 0;
else
next_states1 <= H1;
counter := counter + 1;
end if;
when H2 =>
if rising_edge(clk) and counter = 9 then
next_states1 <= H0;
counter := 0;
else
next_states1 <= H2;
counter := counter + 1;
end if;
when others =>
null;
AI: I think it would be good for you to do a course in or tutorial on VHDL...
But anyhow: the clock edge detection should not be inside the case statement this way.
Highway: process(CLk)
variable counter: integer := 0;
begin
if rising_edge(clk) then
case traffic_states1 is
when H0 =>
if (Input='0') then
next_states1 <= H0;
counter := counter + 1;
elsif (counter <=20) then
next_states1 <= H0;
counter := counter + 1;
elsif (Input='1' and counter >20) then
next_states1 <= H1;
counter := 0;
-- else next_states1 <= traffic_states1;
end if;
when H1 =>
if (counter = 3) then
next_states1 <= H2;
counter := 0;
else
next_states1 <= H1;
counter := counter + 1;
end if;
when H2 =>
if (counter = 9) then
next_states1 <= H0;
counter := 0;
else
next_states1 <= H2;
counter := counter + 1;
end if;
when others =>
null;
|
H: ST Microelectronics I2C Interrupt HAL Library question
I am trying to get I2C (with interrupts) on an F411RE to work. I dived into the HAL library code and found this tid bit...
static HAL_StatusTypeDef I2C_SlaveTransmit_TXE(I2C_HandleTypeDef *hi2c)
{
/* Declaration of temporary variables to prevent undefined behavior of volatile usage */
uint32_t CurrentState = hi2c->State;
if(hi2c->XferCount != 0U)
{
/* Write data to DR */
hi2c->Instance->DR = (*hi2c->pBuffPtr++);
hi2c->XferCount--;
if((hi2c->XferCount == 0U) && (CurrentState == HAL_I2C_STATE_BUSY_TX_LISTEN))
{
/* Last Byte is received, disable Interrupt */
__HAL_I2C_DISABLE_IT(hi2c, I2C_IT_BUF);
/* Set state at HAL_I2C_STATE_LISTEN */
hi2c->PreviousState = I2C_STATE_SLAVE_BUSY_TX;
hi2c->State = HAL_I2C_STATE_LISTEN;
/* Call the Tx complete callback to inform upper layer of the end of receive process */
HAL_I2C_SlaveTxCpltCallback(hi2c);
}
}
return HAL_OK;
I am little confused. I was expecting to see while loop go through the transfer count. Instead, it is if statements. So, my question is, am I understanding this correctly? The way that HAL treats a slave transmits on interrupt is that it relies on an interrupt to be generated for each byte of the transfer instead of one interrupt for transferring all the bytes at once?
AI: Yes I think you understood that correctly.
And if you think about it, that's the whole point of interrupts. You don't need interrupts when you simply loop over the array and wait for each byte.
The interrupts allow your program to do stuff while the I²C transaction is ongoing.
The other thing with only one interrupt would be using DMA to feed the data to the I²C peripheral.
From the implementation work I've done on an own HAL for the F401, I'd recommend you to use the interrupt capability only for the bulk transmission or reception. I encountered strange interrupts with no source (no bits set in the registers) while trying to implement a purely interrupt driven approach for the I²C.
|
H: Periodic waking up from deep sleep
what are the main used ways of how to handle deep sleep of some microcontroller (atmega or a cortex m0/m0+) with waking up periodically?
Right now, I'm building a Sigfox GPS tracker that should send GPS position every ~10 minutes and this interval should be configurable.
I solved this problem in previous projects either by using external RTC IC (temperature compensated for great precision) or counting of 8sec intervals (let's see https://github.com/rocketscream/Low-Power). What are the other ways and their advantages?
My plan is to either stick to the Arduino ecosystem or switch to the STM32 world (maybe with a bit of help of mbed platform).
I really appreciate all your feedback.
AI: Generally an RTC interrupt is the best way to go for a long period in deep sleep. If you can use the RTC built into the micro this will generally give you a simpler implementation but may not be the absolute lowest power possible or most accurate.
If you do go the mbed route then this library will probably be of use. However take care, some of the boards are not really well designed for lower power, while the processor will go into deep sleep on just about all of them some of the boards can't shut the rest of the circuits into low power modes and so the total system deep sleep power draw can be far higher that you'd hope for. Other boards are better able to cope with this and can get down to tiny power consumptions.
|
H: Realize if(0) condition in analog circuit ?
I have a question that I think is really noob-like and I'm dead sure there's a pretty simple answer, but I couldn't figure it out myself and didn't really know what to put into google, so here we go.
I have a RC Circuit that has a square wave input voltage going from 0 to e.g. 3 Volt. I need to pass the voltage across the capacitor to another circuit ONLY IF the input voltage currently is zero.
So basically, what I need is:
if (V_in==0) passVoltage();
in analogue hardware.
My thoughts so far:
- Comparator: Compare input_voltage to ground? but then, if this gives me a "true" statement, what to do? I can't use it to like, flip a switch, can I ?
- P-Mosfet: Don't really think this is what I'm looking for as it alters the signal, doesnt it?
Maybe a combination of comparator and mosfet?
AI: Comparator: Compare input_voltage to ground? but then, if this gives me a "true" statement, what to do?
One thing you need to realize is that with analog values, the voltage is never zero. There is external noise, if you put an oscilloscope between two traces (like the signal you want to measure and ground) you will see noise, you can attenuate noise (in the frequency range you desire) with filters but it will never go away completely.
This being said, lets suppose for a minute that you did have a magic box with two analog inputs that could find out when the two signals were equal to each other and output 1V if the signals were equal, and 0V if they were not. If both the inputs have noise (lets say 100uV of noise riding on top of the DC signal, which would be low for a beginner circuit), then you would never see 1V on the output of the box. If you did it would only output 1V for a very short time and then go back to zero. Equal to does not work for analog.
You need to compare the voltages, lets say you set a threshold and found the voltage only when it dips below a certain value. So if you have a 3.3V square wave with 1mV of noise, when the wave dips down near zero there is still noise, so you set a threshold at 10mV (right above zero, but not quite). You still find the values of when it is near zero. You can also get 'glitches' if you don't set the threshold high enough or have too much noise as shown below, so size the threshold high enough.
A comparator is what you need, it 'compares' any two voltages. If you make a resistor divider that can set the threshold for one of the comparing voltage, and the square wave input for the other.
|
H: My IC keeps blowing up - PAC1720 current sense IC
I am using a PAC1720 current measuring IC to measure the current/voltage/power being delivered to a lead acid motorcycle battery that is being charged.
Here is a newer datasheet and an older datasheet (with different info in them!)
Everything seems to work okay until I remove the power supply to the PAC1720 chip. When Vdd to the PAC1720 is removed (i.e. my PCB power supply is off), it appears that the chip begins conducting current from its sense pins to the Vdd or GND pin (or both, not sure), which ultimately fries the chip.
This is a critical flaw because it means that if someone hooks up a battery to my product without having the power supply turned on (highly likely to happen), the product will destroy itself.
Here is a schematic of how the product is laid out:
simulate this circuit – Schematic created using CircuitLab
I'm guessing it has something to do with the internal ESD strucutre of the PAC1720.
One datasheet for the PAC1720 shows a typical layout like this:
The phrases at the bottom of that picture disturb me. It says:
Note
1: The device MUST be biased PRIOR to applying VSOURCE. Failure
to do so will result in damage.
2: The unpowered bias on VDD must be
greater than VDD, if VDD will be removed prior to VSOURCE.
I don't understand what they mean by "biasing the device"... sounds like they are talking about biasing the internal clamping diodes?
The second note doesn't make grammatical sense does it? I don't understand what they are trying to convey in the second note.
Now, an older datasheet shows the internal ESD structure of the PAC1720:
This isn't very helpful since it just shows a generic box labelled "Edge-Triggered ESD absorbtion circuit" between the upper clamping diode on Sense1 +/- and GND.
So, my main question is: what is happening when I disconnect Vsupply while a battery/charger is connected and the PAC1720 starts smoking?
Any way that I can solve this problem now that the product is in production?
AI: It appears the chip needs a VDD applied before the SENSE pins are connected to the battery.
Your only option is thus to power it from the battery side, using a resistor and zener as shown in the schematics you posted, or even a voltage regulator.
Since its IOs are open collector (or open drain) it can be powered while the rest of the circuit (SMBUS side) is unpowered. It will not send voltage to your unpowered micro.
Now, when the microcontroller is powered but there is no battery, the SMBUS pullups will let some current enter the inputs of the unpowered chip. I don't know if this would be a problem.
When in doubt... My solution would be to use a Diode-OR from both the battery and your 3V3 supply.
simulate this circuit – Schematic created using CircuitLab
|
H: Can multi-project wafer service merge projects with different number of layers?
I would like to ask some help to better understand limitations of multi-project wafer services (MPW).
In nutshell, i found about the service, that it merges many projects on wafer, so one project only have to pay for a share of its surface. While it is easy to understand, that i pay only for 100 mm2 of an area of 70000 mm2 so it costs less, i nowhere found to mention, that asic projects may have different amount of layers for their design. Number of layers could be anywhere from 6 to 35 and even more. If i need for example 30 layers for my design, and there are only projects with demand of 15..20 layers, how an MPW service can merge my project with cost effectivity? Can it do that at all?
I dont know, if my question involves any industrial secret or not, tell me if i was that careless.
I will be happy with any reference to internet blogs, e-docs, books or anything about the question.
AI: I highly doubt you're making something more complicated than the Alpha 21064 CPU, and so I highly doubt you really need more than the 3 metal interconnect layers that was used by that CPU.
It sounds like you think that every chip designer arbitrarily uses however many layers they feel like using this week, and then later the fab does whatever it takes to make that happen.
In theory, yes -- a fab could theoretically accept a chip design that requires 9 metal interconnect layers plus a few chip designs that requires fewer layers, and the fab could more-or-less automatically insert vias and metal to pass signals through the "skipped" layers of the simpler chips up to the top bonding pad layer, and fabricate all those designs on the same wafer.
In practice, what happens is that the chip designer (like a PCB designer) asks the fab what their capabilities and for the design rules for that process.
Typically a fab has a few different processes, each one with its own dedicated production line.
One process is least expensive and simple with few layers and large, slow transistors.
Another process is most expensive with more layers (but still far fewer layers than AMD's fab) and smaller linewidths that can be used to fabricate faster transistors.
Often there is no one "best" process -- there's one high-speed process that can't handle high voltages; there's a separate high-voltage process that's really slow; etc.
The production line has already been set up with a certain number of layers of a specific kind.
If you want more or different layers, you have to go to a different production line.
If a chip needs to be high-speed and high-voltage and high-density, even if each one is within the capabilities of one or another of the fab's production lines, we still risk not being able to fab your chip at all because none of the available lines can handle that specific combination.
The chip designer (like a PCB designer) picks a process before even starting to lay out the chip and tries very hard to keep the design within the capabilities and design rules of that process.
If the chip designer finds the chip doesn't really need all the capabilities of that process, then the chip designer manually adds vias and metal to pass signals through the "skipped" layers.
(And meanwhile seriously considers switching to a lower-cost process).
It would be nice if you could simply download that capability information from the fab's website.
But in practice the chip designer needs to sign a confidentiality agreement (CDA) and work with some university professor who already knows how to shepherd student chip designers through the process.
So, for example,
Europractice requires signing a non-disclosure agreement (NDA), filling out an application and fax it back (!), etc., etc.
So, for example, the I3T80 Process available through MOSIS page describes how to get the capabilities and design rules for that process -- get an account with MOSIS; sign a confidentiality agreement, etc., etc.
That process is one of the standard foundry processes at On Semicondustor who publishes the I3T80: 0.35 um Process Technology datasheet.
Information for the New MOSIS User
"VLSI Implementation Services: From MPC79 to MOSIS and Beyond"
"multi-project wafer service"
"USC'S free chips-for-students program"
Some of the universities that have a STC MOSIS liason
Oklahoma State University System on Chip (SoC) Design Flows for use with ... MOSIS
|
H: Diode stops conducting. Conducts again after applying higher voltage. What happened there?
I have the following circuit for providing regulated 5V from a 12V power supply:
I have several hundreds of PCB with this circuit, and they work fine. However recently I have had a few of these PCBs stop functioning. I have tracked the problem to diode D1.
When applying 12V to the input I have measured 1.8V on the cathode of the diode, and no appreciable input current (the power supply shows 0.000W output power), so I have discarded a short-circuit down the line as a possibility.
Now comes the interesting part. I tried slowly increasing the voltage to see if there would be any change on the output current. To my surprise, the diode started conducting at around 16V, and when I measured the voltage drop across the diode it was back to its normal 0.7v to 0.8V. After this the PCB was functioning normally again, and I was not able to reproduce the behavior. As matter of fact, now when applying a 12V input, it works as intended.
I have seen this behavior on at least 3 or 4 PCBs out several hundreds identical PCBs.
I am assuming this is a defective diode, but it is the first time I observe this mode of failure and I would like to get more information about it.
EDIT: I would like to add that I made sure that the connector and cable were not at fault here. Also the measurements are on the pins of the diode itself.
Furthermore, when increasing the voltage on the power supply, I made sure I was not touching any of the cables or PCB because I suspected that could be one of the problems, but it is not apparently.
AI: I suspect it has something to do with the initial forward voltage when you first apply power, which, because of the caps, will be the full supply voltage.
Although the S1D-13-F should be able to handle the full supply forward voltage and inrush current to the caps, "should" is the operative word here though.
You stated "I have had a few of these PCBs stop functioning" which suggests they were working for some time and then failed. That suggests something is getting stressed, and the peak forward voltage and current would be by prime suspect. If it IS overstressing it, then failure mode could be weird.
Moving the diode to the right of C1 would solve that issue. Easy enough rework to the cap connection too.. Though it does leave the cap open to being reversed, it at least limits the threat.
Ultimately, if it is a real and present danger of reverse connection, a better method is to use a different technique, such as a up diode between ground and 12V and a polyfuse. That method gets rid of that unnecessary diode voltage drop in the line too.
BTW. I would have wired that connector with the centre ground and 12V on both pins 1 and 3. That way it will not matter if it gets plugged in backwards.
|
H: Rated current vs peak current in connector
I'm looking at panel connectors and I'm not sure about the current capacity. One connector is rated at 25A continuous, which is above what I expect my device to be driving, but during startup, peak current gets to 30.8A. The specifications on the connector say nothing about peak current so how do I know if I can use this connector?
AI: That would depend on how long peak current is applied.
If you are starting some large load and it takes a minute or two to wind up, you probably need a bigger connector or to double up pins.
If it's a few milliseconds, you will be good to go.
Anywhere in the middle... is a grey area.
Definitely do not use the connector if it is a HOT connect though. I mean do not expect it to survive long as a switch.
|
H: VHDL that can damage FPGA
I read somewhere that bad VHDL code can lead to FPGA damage.
Is it even possible to damage a FPGA with VHDL code?
What kind of conditions would cause this and what are the worst case scenarios?
AI: Adding to @Anonymous's answer, there are designs you can build which can damage the fabric of an FPGA.
For starters if you build a very large design consisting of huge quantities of registers (e.g. 70% of the FPGA) all clocked at nearing the FPGAs maximum frequency, it is possible to heat the silicon considerably. Without sufficient cooling this can cause physical damage. We lost a $13k FPGA because it overheated due to the dev-kit having a terrible cooling system.
Another simpler case can be combinational loops. For example if you instantiate three not gates chained together in a ring, and disable or ignore the synthesizers warnings about such a structure, you can form something which is very bad for an FPGA. In this example you'd make a multi-GHz oscillator which could produce a lot of heat in a very small area, probably damaging the ALM and surrounding logic.
|
H: Dual SPI master control
I'm looking at a dual master spi interface, it needs to run at 20MHz which means push-pull for me.
My main concern is the output current of microprocessors, I could easily exceed the absolute maximum current rating if a software engineer decided to set one output high and the other one low on the microprocessor if they were set up as push-pull.
Open drain isn't going to work because of the 20MHz requirement and the amount of capacitance I have on my GPIO's. So my question is what circuit do I use to select between two dual masters?
simulate this circuit – Schematic created using CircuitLab
AI: A 4-way unidirectional digital multiplexer would do the trick. You can use a 74244 to produce this function (74HCT244 for 5 V logic, 74LVC244 for 3.3 V). It contains two tristate 4-bit buffers (see below).
(Sorry, unable to draw a schematic at present.)
Each master can have a 4-bit channel. Each master's SCK, MOSI and /CS drive the 1A or 2A buffer inputs with MISO taken a 1Y or 2Y buffer output. The other side of the channel buffers are connected to your SPI slave. Don't forget to put a 10 K pull-up on the slave's /CS. The slave's SCK also needs a 10 K pull-up or pull-down to pull it to its idle state, depending on your SPI mode used.
Connect /1OE to a select signal and /2OE to the inverse of the select signal. You can then switch between the two masters using select.
|
H: Clap Lamp debounce
I am having problems with code for my clap LED.
It switches on and off when I clap, but it bounces, and I cannot find/figure a way to fix this. I think I do know why it is happening. Sound signal is spiky, and it detects more spikes from single clap. I am using Interrupts with Arduino, because if the code is in loop, clap is too short and misses read. How to solve this?
Pictures of schematic and code are attached and digital (yellow) is moved to pin 2 for interrupts.
AI: No need for interrupts here.
First remove the digitalWrite from your void loop(){}.
Now, put this in your void loop(){}:
if (digitalRead(trigger)==1) {
state = !state;
digitalWrite(LED,state);
delay(1000);
}
See what I did? The void loop is now super fast, until a sound is detected. At that time, the LED is toggled, followed by a 1s delay to ensure the sound level decays well below the trigger level.
You can experiment to get the delay timing to your liking.
|
H: 50 (or more) channels picoscope/oscilloscope
I need to debug communication protocol over 50 digital channels cable and 2MS/s sample rate. What kind of tool would be best suited to do that task? What other aspects should I consider?
AI: The reason you can't find a scope with enough channels is because you're looking for the wrong tool. Scopes are best for analog stuff, and ones with more than 4 full-featured channels are rare. Each channel on a scope has a relatively complicated, and thus expensive, high-bandwidth low-noise amplifier, so a scope with 50+ channels would be extremely expensive.
For a digital signal, you don't need the analog front-end, you just need a comparator for each channel. A scope-like instrument with lots of digital inputs is called a logic analyser. 32 channels is pretty common, and 50+ channel versions aren't too hard to find. As a bonus logic analysers are usually better than scopes at decoding the signals and displaying higher-level protocol-dependent information.
One thing to watch out for is that the logic analyser can't tell you as much about a signal which is wrong. It can't tell the difference between a signal which is sent wrong, and one which has been messed up by interference. So you still need the scope. Use the logic analyser to identify which signal(s) is/are not what they should be, then look with the scope to see if the problem lies in the digital logic or in the signal integrity.
|
H: Bolting a steel ring terminal to a steel tab on IGBT?
This is a similar question to one answered here: what are the best practices for bolting a ring terminal to a steel panel?
However, the main difference is that I am not attaching a ring terminal to a chassis. I am attaching it to the steel tab on an IGBT.
Should I still use a serrated washer? What is the best bolt material? Steel as well?
Should it be brazed to ensure the highest conductivity? (Serviceability is not much of an issue)
I just want to make sure this is done correctly. Thank you!
Datasheet for CM600DY-12NF IGBT http://www.pwrx.com/pwrx/docs/cm600dy_12nf.pdf
AI: The tabs are usually tin plated copper as these need to be solder to the substrate.
I would not use a star washer. These are great for earth bonding points to break the insulative oxide layers (lower contact resistance), they will not offer that great of a contact surface area and thus your current density will be higher and overall resistance higher.
I would personally advocate using copper washer with the designated tightening torque
|
H: What determines the maximum discharge rate of a battery and how can I create a high current power supply from batteries?
I am looking for ways to make a mobile power supply for 10 units of MG996R servo motors, each of which can draw up to around 800 mA to 1 A and operate between 4.8 V to 7.2 V.
I have 12 Eneloop AA batteries (BK-3MCCA8BA), and from Panasonic Eneloop BK-3MCC (4th gen) - where I can find maximum discharge current?, I gathered that each of my Eneloop AA battery can discharge up to 6 A, which means that I should be able to power up to 6 MG996R's with a 4 or 6 AA battery pack.
This appears to agree with my setup where I am trying to control the 10 servo motors using the Adafruit 16-channel 12-bit PWM driver with a 1000 uF capacitor.
Once I begin to control over 5 servo motors, I get jitters, which I assume is due to the insufficient current.
However, I also read at How do I determine the maximum amp output of a battery pack? that I can model the batteries as a Thevenin-equivalent circuit, where the current is V_Th/R_Th. If I had 4 1.2 V AA batteries in series and assumed an individual internal resistance of 100 mOhms, I should be getting 4.8 V/ 0.4 ohms= 12 A.
This current should be sufficient for 10 of my servo motors? However, this is not the case.
What am I missing here? Also, could I put 2 packs of 6 AA battery holders in parallel to provide sufficient current?
AI: 12A with 0.4ohm series resistance would use up all the battery voltage leaving nothing for the motors. 12A * 0.4 = 4.8V.
To determine the maximum current you can take out of the batteries you first need to know what minimum voltage you need for the load.
For example if the minimum voltage you need to drive the servos is 4V that allows 0.8V drop across the internal resistance.
0.8V across 0.4 ohm is 2Amps.
Yes, you can put strings in parallel to increase the current. From the previous calculation each string would give 2A. To get 10A you would need 5 strings in parallel.
You can't some extra headroom by adding an additional series cell.
For example if you had 5 series cells in each string you could take 5A before the voltage dropped from the 6V @ no-load to the 4V minimum voltage.
With this in mind you could get 10A peak with just 2 strings of 5 cells or 10 cells total. The lifetime would be less as the capacity would only be for two batteries in parallel.
Be aware that the voltage of the cells is not constant. When fresh the cells are probably about 1.5V then drops as the batteries are used. Cells are normally reckoned to have no usable energy when they have dropped to about 0.9V.
|
H: Where does the extra voltage come from?
I am reading Practical Electronics For Inventors 4th edition and on page 384 there is a figure that shows basic power supply with single diode,I think its called half bridge.
There is picture that shows transformer that steps down wall plug ac down to 10 volts.There is written "10 volt AC rms",then it shows single diode,a 1 milliFarad capacitor and its all finally connected to 100 ohm resistor that represents load.
Its kind of a thing where author of the book ask you to calculate and find average dc output. The author says the correct answer is 12.92 V,I absolutely dont understand why its so high.
I calculate voltage like this, average voltage of sine wave is the rms, a 10 V rms AC average voltage is same like 10 V dc average voltage. The picture clearly shows the bottom half of the sine wave completely blocked by diode, only positive peaks are there,now if the sinewave was 10 V rms before it got rectified,then after half of it is chopped away,it must be 5 V rms or 50%! Yet instead of decrease by half the author says its 12.92 or almost 13 V.
With 10 V rms AC, you completely block half of it and then you suddenly have 12.92 V dc?
My question is: Where does the extra voltage come from?
AI: You need to look up RMS value and see how it relates to peak to peak...
10VRMS is 28.28V peak-to-peak.
Half wave rectify that gets you back to 14.14V
Drop the diode voltage gets you to about 13.3V
Average out the ripple on the cap from the 100Ohm resistor
You end up down @ 12.92V
|
H: Op Amp Not Working
I am trying to amplify the signal from an electret condenser microphone with an LM741 op amp. I don't care about preserving the negative half of my input signal, so I am powering the IC with a single 9V battery. Here is the schematic of my design:
The microphone outputs about 20mV peak-peak and I can see the correct waveform at the junction of C1 and R1. However, the op amp outputs a steady 9v when I measure its output. I have tried two different LM741s and still have the same problem.
What is causing the output to behave like this?
AI: R1 biases the noninverting input at 0 V.
But the negative supply of the 741 is also at 0 V, and the common mode input range of the 741 only goes down to 2 or 3 V above the negative supply.
You can avoid this problem if you use the + and - 15 V supplies the 741 is designed to work with. Or if you use an op-amp with rail-to-rail input and output capability (and not too bad of saturation behavior) instead of the 741.
Second problem is that 100x is likely more gain than you're going to be able to get out of a single op-amp stage, but if your bandwidth requirement is very small, maybe you'll get away with it.
|
H: Is my Kirchoff's rules solution with mixed current and voltage source correct?
Problem:
Find \$I_{1}, I_{2}, I_{4}, I_{6}\$ using Kirchoff's rule
simulate this circuit – Schematic created using CircuitLab
\$E\$ is the voltage source of 8 Volts and \$I_{general}\$ is the current source of 3 Amps.
My steps:
This is what I got:
I think there are 5 branches and 3 nodes and also 3 independent loops.
So the number of needed equations = \$3-1 = 2\$
Using this I got equations:
For node 1: \$-I_{6}+I_{1}+I_{general}\$
For node 3: \$-I_{4}-I_{1}+I_{2}+I_{6}\$
Also I think there are 2 loops needed for equations: the bottom rectangle and the left one:
Loop1: \$1-3-1\$
Loop2: \$3-2-3\$
So we heave 2 more equations:
1) \$I_{1}R_{1}+I_{6}R_{6}=0\$
2) \$I_{2}R_{2}+I_{4}R_{4}+I_{2}R_{3}=E\$
So we got system of equations to solve:
\begin{cases}
-I_{6}+I_{1}+I_{general}=0 \\
-I_{4}-I_{1}+I_{2}+I_{6}=0 \\
I_{1}R_{1}+I_{6}R_{6}=0 \\
I_{2}R_{2}+I_{4}R_{4}+I_{2}R_{3}=E
\end{cases}
Solving which, gives this result:
$$I_{1}=-2.571\\ I_{2}=-1.244\\ I_{4}=1.755\\ I_{6}=0.42$$
Question:
Is there anything that I did right? I can get 0 in product of sum of I's but for that I need to change some signs a bit. Did I solve this correctly or there is something wrong in it or completely wrong?
AI: Assuming your bottom node is assigned the value of \$0\:\textrm{V}\$ and assigning \$V_1\$ to your "1" node and \$V_2\$ to your "2" node, I get:
$$\begin{align*}
\frac{V_1}{R_1} + \frac{V_1}{R_6} + 3 = 0\;\;\;\therefore V_1&=-3\cdot\left(R_1\vert\vert R_6\right)\\&= -25\frac{5}{7}\:\textrm{V}\\\\
\frac{V_2}{R_2+R_3} + \frac{V_2}{R_4} = 3 + \frac{8\:\textrm{V}}{R_2+R_3}\;\;\;\therefore V_2&=\left(3 + \frac{8\:\textrm{V}}{R_2+R_3}\right)\cdot\left(R_4\vert\vert \left[R_2+R_3\right]\right)\\&= 70.\overline{2}\:\textrm{V}
\end{align*}$$
So I get:
$$\begin{align*}
I_4=\frac{V_2}{R_4}&= 1.7\overline{5}\:\textrm{A}\\\\
I_1=\frac{V_1}{R_1}&= -2\frac{4}{7}\:\textrm{A}\\\\
I_2=\frac{8\:\textrm{V}-V_2}{R_2+R_3}&=-1.2\overline{4}\:\textrm{A}\\\\
I_6=\frac{-V_1}{R_6}&=\frac{3}{7}\:\textrm{A}
\end{align*}$$
In short, I think you did just fine.
|
H: VHDL simulation shows 'u' by read the input
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
entity TestRun01 is
Port ( Clk : in STD_LOGIC;
Din : in STD_LOGIC;
Dout : out STD_LOGIC_vector(11 downto 0));
end TestRun01;
architecture Behavioral of TestRun01 is
signal regr : std_logic_vector(11 downto 0) :="000000000010";
signal reg : std_logic;
begin
process(Clk,reg)
begin
if falling_edge(CLK) then
if Din ='1' then
reg <='1';
elsif Din='0' then
reg <='0';
else
reg <= reg;
end if;
regr<=regr(10 downto 0) & '0';
regr(0)<=reg;
end if;
end process;
Dout<=regr;
end Behavioral;
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
ENTITY Test1 IS
END Test1;
ARCHITECTURE behavior OF Test1 IS
COMPONENT TestRun01
PORT(
Clk : IN std_logic;
Din : IN std_logic;
Dout : OUT std_logic_vector(11 downto 0)
);
END COMPONENT;
signal Clk : std_logic := '0';
signal Din : std_logic := '0';
signal Dout : std_logic_vector(11 downto 0);
-- Clock period definitions
constant Clk_period : time := 10 ns;
BEGIN
-- Instantiate the Unit Under Test (UUT)
uut: TestRun01 PORT MAP (
Clk => Clk,
Din => Din,
Dout => Dout
);
-- Clock process definitions
Clk_process :process
begin
Clk <= '0';
wait for Clk_period/2;
Clk <= '1';
wait for Clk_period/2;
end process;
-- Stimulus process
stim_proc: process
begin
-- wait for 1 ns;
Din <= '1';
wait for Clk_period/2;
Din <= '0';
wait for Clk_period/2;
Din <= '0';
wait for Clk_period/2;
Din <= '1';
wait for Clk_period/2;
end process;
END;
Why there's a U?
And how can I get rid of it?
AI: 'U' means uninitialized. You have to give an initial value for reg signal like for regr in line signal reg : std_logic := '0'; or signal reg : std_logic := '1'; depends on your intention
|
H: Effect on current draw and voltage when splitting a signal to many places
I have tried to Google answers to this already, but every search I make comes up with answers to other questions. That said, I'm happy to just be given links if there are already legit answers out there.
So I'm still quite new to electronics. And I have a part of a project in mind that will involve sending an AC audio signals from. An output jack to a great many input jacks. All unbalanced and working between +/- 5V range. If it helps clarify the situation, I'm talking about inputs and outputs on modular synth systems. I wish to preserve the voltage as best I can, and I obviously don't want to blow anything up. So my questions are as follows:
What kind of voltage drop (if any) am I likely to experience per split (or more importantly, how many splits could I get away with before the voltage dropped significantly).
Will each extra input that I send the signal to cause extra current to flow through the output, or will the current just split between each input?
Are there any other things I'll need to consider to avoid any catastrophes?
Cheers in advance for any advice, pete
Sorry for the crap tags, not sure what specifically to tag this with.
AI: What kind of voltage drop (if any) am I likely to experience per split
That depends on the input impedance of each individual input, and the output impedance of the output.
If the output impedance is low and all the input impedances are high, you will not see significant voltage drop.
(or more importantly, how many splits could I get away with before the voltage dropped significantly).
The lower the output impedance, the more splits you can get away with. The higher the combined input impedances, the more splits you can get away with.
Will each extra input that I send the signal to cause extra current to flow through the output, or will the current just split between each input?
Yes and yes. Strike the "or".
Are there any other things I'll need to consider to avoid any catastrophes?
Don't draw too much current, in other words make sure the input impedances are high enough for the output.
Google Ohm's law and Kirchhoff's laws. Memorize the former. Understand the latter.
Get acquainted with electronics and safety. Electricity can kill or start fires, so make sure to inform yourself, so that you're able to make judgements on whether a certain circuit is potentially dangerous or not, how to stay safe, and how to design stuff that is safe.
|
H: I'm looking for a resistor which can withstand high power and has a low capacitance and inductance
I'm looking for a resistor about 25 Ohm at 13.56 MHz (this is our operating frequency). The resistor must withstand at least 50 W (100 W is better!) at ~ 1 kV voltage amplitude. As I will use this for compensating the phase difference between the measured voltage and current from our voltage probe and a current transformer, It also must have a low capacitance and inductance. I originally thought a wirewound type resistor would be a good choice due to its strength for high power and high voltage, but I immediately realized that it might have bad inductance and, possbily, capacitance. What type of resistor is the best choice for me?
AI: TGHLV25R0JE
Resistor, 25 ohm, 200W, non inductive, RF, SOT-227
http://www.digikey.com/product-detail/en/ohmite/TGHLV25R0JE/TGHLV25R0JE-ND/1124819
This resistor is made to be used with a heat-sink. In order to size the heat-sink you need to know how much wattage you need to eliminate and how much the temperature is allowed to rise across the heat sink.
Lets assume that you are working in a lab with ambient temperature Ta = 25C. The resistor datasheet also says the maximum allowed junction temperature of Tj_max = 155C. Therefore your maximum allowed temperature rise is...
dt = (155C - 25C) = 130C
Your post says that you have a maximum dissipation of W_max = 50W max. In that case the maximum allowed Junction to Ambient Thermal resistance R-ja-max is...
R_ja_max = dt / W_max = 130C / 50W = 2.6C/W
The resistor datasheet says that it has a thermal resistance of Rth_resistor = 0.35 Kelvin/Watt between the resistor baseplate and the heat-sink. R_ja_max includes all the thermal resistances along the whole thermal path. In a simple case this is Rth_resistor + Rth_heat_sink. Therefore the maximum thermal resistance of your heat-sink must be...
Rth_heat_sink = R-ja-max - Rth_resistor = 2.6C/W - 0.35C/W = 2.25C/W
You can pick any heat-sink that has less than 2.25C/W thermal resistance, so long as it fits mechanically. Alternatively if you have any large metal cabinets that are part of your equipment you can bolt the resistor to the frame (which will almost certainly have very low thermal resistance).
|
H: Capacitive proximity sensor size?
I want to design a capacitive proximity sensor to detect human presence at a distance of 10-15 cm.
Now I made my research on this type of sensor but everything that i found doesn't tell me about the size of such sensor, Can anyone help on how to calculate the size of the sensor?
The sensor Shape is circulaire and there is no constraint on it's size but the smaller the better.
I'm using a capacitive sensor because the system that i'm working on isn't fixed in one place, it is portable, so i don't need it to detect any object i only want it to detect human presence and the best option that i found is capacitive sensor which doesn't detect any object but only grounded objects, but if there is any better option that would be great.
AI: The range is directly related to the size of the sensor. The bigger the sensor, the bigger the range.
We've been making capacitive sensors at work, directly on PCBs. In my experience, you can sense presence at a distance of 75% of the sensor diameter. So if you want to sense presence at 10cm to 15cm, I'd start with a sensor diameter of at least 20cm.
The range in which a probe is useful is a function of the size of the sensing area. The greater the area, the larger the range. The driver electronics are designed for a certain amount of capacitance at the probe. Therefore, a smaller probe must be considerably closer to the target to achieve the desired amount of capacitance. The electronics are adjustable during calibration but there is a limit to the range of adjustment.
In general, the maximum gap at which a probe is useful is approximately 40% of the sensing area diameter. Standard calibrations usually keep the gap considerably less than that.
http://www.lionprecision.com/tech-library/technotes/cap-0020-sensor-theory.html
|
H: attenuators volts to micorvolts
I am a software engineer and have limited knowledge of electronics. I am using a Raspberry PI to control a AD5360 ADC eval board (http://www.analog.com/en/products/digital-to-analog-converters/da-converters/ad5360.html#product-overview).
I need to attenuate +-5 volt output form the DAC to +-50 Microvolts on 16 independent channels.
I am thinking that I need an on chip attenuator. I am still prototyping so and part needs to be used on a bread board or with pins that can be soldered to a solder board. I need a fast response time because I change voltage on each of the 16 channels between 256 to 2048 time each second, and a high level of precision. If required I could build them, however because I need 16 I would prefer to buy them. I have tried to use a simple voltage divider however, this introduces too much variance at the microvolt range.
I am open to other ideas if they can solve the problem more efficiently or are more cost effective.
AI: I'd still go with voltage dividers, just use 1% (or even 0.1%) precision resistors. Note that "typical" resistors in hobbyist kits are usually 5% precision. And then buffer each voltage divider output with precision op-amp, because if you take the output straight from voltage divider to load then your voltage will definitely jump all over the place. So build 16 of 10MΩ/100Ω voltage dividers, and connect simple op-amp followers to them. Input resistance of the op-amp is very high, so it will not affect the output voltage of the divider, and then output resistance of the op-amp is quite low, giving enough current for your load.
As for op-amp selection, look for "precision op-amps": TI, Linear, others. "2048 time each second" is not quite fast. It's in the middle of sound spectrum, so any op-amp should be capable of working at that frequency.
|
H: How to remove the negative component of a sine wave?
The following is the schematics of a simple circuit I'm working on, It filters and amplifies an electret condenser microphone's signal to get an output ranging from 0 to 9V (to drive an equalizer like leds not a speaker):
simulate this circuit – Schematic created using CircuitLab
The mic signal passes first through a low pass filter with a cutoff frequency of around 20Khz, then gets coupled with a 47nF capacitor, then gets offset by 1/2 VCC by a voltage divider, then amplified 1000 times using 3 noninverting amplifiers with a gain of 10 each.
Now the next stage I want to clamp the negative part of the signal, to do that I put a reverse biased diode after a coupling capacitor. But after testing the signal appears to pass through unchanged. Why is it not getting clamped?
Update:
If I disconnect the non-inverting input of the last opamp from the diode and measure the voltage at the junction between C6 and D1 I get a nice clampped singal between -0.6V and 3V (I had to increase C6 to 100uF though).
AI: The LM358 OpAmp you're using has an Input Bias Current spec (from table 6.5 on pg.5 of the DS) of typically 45nA.
If you refer to the internal schematic diagram in Fig.16 on pg.13:
you can see where this current comes from.
The current from the 6uA source is split between the 2 input legs and even though the majority of it will flow to ground through the input transistors, some of it still needs to flow out of the input pins in order to bias those transistors.
When you use the opamp in a circuit, you must provide a path for this input bias current.
In your circuit, all of the opamps inverting (-) inputs have a feedback resistor which does this job, and the first 3 have their non-inverting (+) inputs are either dc-coupled to each other or fed by a resistor voltage-divider.
But your 4th opamp is AC-coupled by C6 and has no DC path for the bias current being sourced by the non-inverting input.
The easiest way to fix this in your circuit would be to put a resistor in parallel with D1.
To calculate the value of this resistor ou need to take the value of the bias current and decide for yourself what the maximum permissible offset voltage you can tolerate at that point is. Ohm's law will then produce a value for you.
You'll also need to be aware that this will form a high-pass filter with C6.
|
H: Advantage of series vs parallel battery in handheld product
There are many handheld product like laptop or an Handheld measurement equipment that all parts would works fine with 3.3V or lower VCC. However these devices still comes with a 11.1ٰV battery or higher voltage.
My question is, doesn't it more efficient to use 3 cell in parallel instead of series in order to reduce power dissipation on voltage regulator?
As an example in fanless laptop (like Asus UX305), 5v seems to be sufficient for most parts, so probably 2 cell 7.4v battery suits better than 3 cell 11.1V.
Where am I going wrong?
AI: The decision to use a particular voltage input is not necessarily made on the major supply voltage used in an appliance.
Consider your question around the ASUS laptop:
Its input is 19 V; a fairly standard laptop supply voltage, but not likely used for anything internally compute or peripheral related.
@19 V and 45 W you can expect about 2.3 A maximum line current.
@12 V, that would rise to about 3.75 A.
@5 V ... 9 A.
@3.7 V (1 cell voltage) ... 12 A.
Voltage loss would become more critical in the wires and connectors at lower voltages making overall design much more challenging. It's also much more challenging to design an internal battery charger since you now have to separate input/battery at the same voltage with FETs to allow a SM charger to operate.
Internally they may not even charge the batteries at full current when the laptop is on at the same time to control both the power dissipation within the shell and current magnitude in the input supply line. You can see from the specs that the compute/display side of the laptop is only 5 -7 W depending on display usage (resolution/brightness).
The battery in the ASUS is likely a 4 cell 14.8 V battery with active capacity management but no cell balancing. I don't see it specified, but would assume about 1 - 2 hours maximum charge time for the battery at say 2C.
Most of Intel's reference designs are based around a 12 V supply (Core level compute elements). To abandon the reference design (which is fully debugged) and design a new way to do it would be a risky undertaking. You rarely see OEMs such as ASUS, Apple or Microsoft stray far from the reference platform in anything other than peripheral devices.
So back to your question ...could the laptop be powered by a single cell paralleled battery pack ....sure, but it would be significantly harder to design the appliance.
|
H: VHDL read bit from input problem
entity TestRun01 is
Port ( Clk : in STD_LOGIC;
Din : in STD_LOGIC;
Dout : out STD_LOGIC_vector(11 downto 0));
end TestRun01;
architecture Behavioral of TestRun01 is
signal regr : std_logic_vector(11 downto 0) :="000000000010";
signal reg : std_logic;
begin
process(Clk,reg)
begin
if falling_edge(CLK) then
if Din ='1' then
reg <='1';
elsif Din='0' then
reg <='0';
else
reg <= reg;
end if;
regr(0)<=reg;
regr<=regr(10 downto 0) & '0';
end if;
end process;
Dout<=regr;
end Behavioral;
why only shift '0' to the shift register?
if I change the code from
regr(0)<=reg;
regr<=regr(10 downto 0) & '0';
to
regr<=regr(10 downto 0) & '0';
regr(0)<=reg;
the bench mark shows
AI: Looking at the following two lines of code:
regr(0)<=reg;
regr<=regr(10 downto 0) & '0';
Since regr has a width of 12 bits, the second line assigns every bit in this signal. Since the last assignment to a particular signal takes priority, your initial assignment to regr(0) is effectively ignored.
In the second example with the two lines swapped, the last assignment to regr(0)<=reg; takes priority over the assignment to '0' on the previous line.
The more readable version would look like this:
regr <= regr(10 downto 0) & reg;
thus performing the whole assignment in one line without potential for confusion.
In your second example, you are seeing 'U' being shifted through, because your signal reg is not initialised. You could initialise your signal to '0' using:
signal reg : std_logic := '0'
|
H: Instrument(s) for measuring (and recording) temperature, voltage and current
I'm about to embark on a series of experiments regarding thermoelectricity. I am pretty new to instrumentation etc - though I played with electronics as a hobby, when I was a boy.
I am starting to acquire a set of tools for this exercise.
Which device(s) can I use (multimeter perhaps?) to measures:
Temperature (up to say 700 degrees Celsius)
Voltage (from a few millivolts to a few volts)
Current (from a few milliamps to a few amps)
Last but not the least, I would like to record the generated data (voltage, current and temperature) using an arduino Uno.
Can anyone suggest a circuit I can use to capture and record the data?
AI: You want a digital multimeter (DMM) with a thermocouple setting. And a thermocouple sensor that works with it.
If you're spending enough to get the thermocouple function, you can likely get a DMM that does its own recording at no additional charge, so no Arduino or other device would be needed to achieve that function.
If you want to avoid spending a few hundred dollars on a known-accurate DMM, you can investigate making your own cold junction circuit to allow reading the thermocouple with any voltage meter (or the ADC function that's probably included in your Arduino) you like.
|
H: Is this a good inverse parallel SCR drive circuit?
I have a design for a dimmer circuit, but I am unsure of its correctness or if there are issues with it.
It's meant to be controlled by a 50% duty cycle PWM signal - the dimming responds to the phase angle between the PWM wave and mains AC:
simulate this circuit – Schematic created using CircuitLab
EDIT: An earlier version of the schematic had had frankly ridiculous resistor values on the voltage divider, but they should be correct now.
I'm also not sure if there even are half-bridge optocoupler ICs like that. I could just use individual optocouplers but if anyone knows of a specific part that would be helpful.
The main motivation for this design is to reduce the number of output transitions the MC will need to make to control the device.
The device would be controlled with a waveform like this to adjust the dimming level:
Note that I've included what I'd have to output to control a regular triac at 50% for comparison.
Would this design work? Is it a good design? How can I improve this design?
AI: Your circuit won't work. I know of no opto-coupler that will withstand the voltages you'll have.
Try something like this for driving SCR's:
simulate this circuit – Schematic created using CircuitLab
Is there an overriding reason not to use a Triac as the main switch?
|
H: filament led bulb inrush current
I'm tring to choose a relay for my circuit which has a Filament LED bulb as load.
The bulb is 230VAC / 60W 6W.
The nominal current should be about 0.03A which is not an issue for a regular relay. The inrush current can go from 10 to 15 times that value, from what I understand. So it can go up to 3A0.4A.
So I just need a relay that can handle a max switch current of 3A 0.4A?
How can I control the inrush current before it goes to the relay? If I add another bulb to the circuit, I'll have to get another relay that can handle twice the current. And this is not a good idea in the long-term.
UPDATE 23/03
The bulb's power is 6W, not 60W as @Misunderstood pointed out.
I was able to probe the bulb in an osciloscope and the inrush current max was about 2A. The average value was about 1.5A. These values may not be much accurate because the probe used was for high current values and it has low sensitivity to low current values. The real inrush current is probably below these values but since it's not much and it doesn't require a special/expensive relay, I'm not too worried.
Conclusion: Since I'm not thinking of using more than 3 bulbs, I'll get a relay rated at >= 6A peak. I'll probably add a relay socket as suggested by @Harper and put everything inside a junction box. I'll add the full schematics (with the relay controller and the other switches) later, in a new post, so I can get some feedback.
UPDATE-EDIT:
I have used triacs, in the past, to control the brightness of a bulb but it wasn't a LED bulb. I was told triacs dont like LED bulbs and may not be suitable to be used as dimmers. What are my options here?
Thanks everyone for your help. Feel free to comment if my conclusion is wrong of if there's something I'm missing.
EDIT: Added schematic.
simulate this circuit – Schematic created using CircuitLab
AI: Look at the listed amp rating of your bulb
You need to look at your bulb's documentation/data sheet for its listed draw in amps. If it provides a VA rating, you can compute amps from VA/volts. If it provides actual watts and power factor, you can compute Watts/Volts/PF. LED bulbs are often marketed as "Same brightness as a 60 watt incandescent bulb", that is a meaningless number.
Look at the rating of your relay
Inrush current is a big current surge on initial startup, but no particular reactivity when interrupted. (contrast with an inductive load which has a huge kick when interrupted, and the kick can leap across contacts). The inrush current on your consumer LED-based lamp product is lesser than that on an incandescent bulb. Look at the rating on the relay. Relays are listed at different power ratings for
resistive (usually the highest number)
motor (huge inductive kick)
ballast (meaning magnetic ballasts, also a big inductive kick)
Tungsten (meaning incandescent bulb, meaning inrush current)
If it lists a tungsten amp rating, then you can use that figure straight-up; they already compensated for inrush current and UL/CSA/TUV etc. listed it as such. You don't need to.
Comply with Code - use the right relays
Since you are switching mains voltage, you must also comply with your local electrical codes. They will require that you use not random components, but assemblies listed for mains use. Contrast:
The first is a bare component, you'd need to solder wires to it and then what? Wrap it in electrical tape and leave it to flop around in a junction box? Unacceptable with mains.
The second one is designed to mount on a standard junction box fitting. Note how this puts the mains wiring inside the junction box, and the low-voltage wiring outside. This satisfies separation requirements of high voltage and low voltage wiring. Once outside the high-voltage "envelope" you are subject to the much more liberal low-voltage wiring rules, same as telephone; or doorbell or thermostat in countries where that is low-voltage.
Relay the relays
There are many relays like the second one. Some may be 5V coil. But other voltages will be much more readily available, e.g. 24V is popular in North America. This may not be a problem: some have a built-in transformer that matches their coil. These devices supply you 2 wires - if you short them, the relay picks up. Simple as that. You can do that with the 5V relay of your choice.
Even better, 24V travels well. That means you can switch the mains voltage in the location that makes sense, i.e. down at the service panel/mains supply or somewhere it's easy to access an electrical box to mount it... keep the 5V near your PC... and let the intermediate coil voltage do the traveling.
|
H: Calculating the annual energy consumption for a fridge
I'm looking at a spec sheet for a fridge that I'm interested in buying:http://aegelectrolux.co.za/doc/S53420CNX2/SpecificationSheet.pdf and http://aegelectrolux.co.za/cooling/bottom-freezer-fridges/s53420cnx2-stainless-steel-bmf.html.
I was wondering how they calculate the annual energy consumption of 243kWh?
According to the spec sheet and the website , the watt / connected load is 120. If I calculate the annual energy consumption, I get:
(120W * 24 hours) * 365 days / 1000 = 1051.2kWh.
Am I doing something wrong? Quite new to doing these types of calculations so I might have missed something.
AI: That 120W is the power while the fridge is actively working. Most of the time, the fridge isn't working - after all, it is a thermally isolated box and won't get warm by itself overly fast.
Hence, aside from marketing, the way they come up with that number is probably based on an assumption of how often the fridge needs to turn on its compressor to keep a given temperature on the inside, given a specific temperature (curve, even, maybe) on the outside.
The EU has mandatory power efficiency rating labels, the European Union energy label, which defines a calculation standard for such things. You can read its text here. I didn't do that for you, because it's not clear to me whether the method therein applies to a fridge spec sheet for the Australian market at all.
|
H: Spectrum analyser
Why do we use ramp generator (sawtooth generator) with local oscillator in a spectrum analyser?
I have searched in Google and I didn't find any answer that made me understand the concept.
Thanks !
AI: See Spectrum Analyzer Basics App Note 150 from Keysight or Agilent AN 150 page 9 for the classic spectrum analyzer block diagram with a ramp. As others have commented, this is no longer the preferred implementation of a Spectrum Analyzer, but the concept is the same. Some analyzers still feed a sweep ramp out of the rear panel corresponding to what this voltage would be, if it were done that way.
The ramp is fed into a Voltage Controlled Oscillator. The swept voltage is converted into a swept frequency.
I don't speak for Keysight, even though I work there.
|
H: How to detect the fundamental frequency of a human singing voice signal
I want to make a digital hardware chip that can input a human voice, (singing simple wordless long notes) and output a square wave that is the same frequency as the fundamental frequency of the voice. I want it to work in real time.
I would like to put the chip on my own PCB eventually. But I could start out by testing the concept on some kind of development environment that has the same chip that I would be using.
Can anyone tell me the best way to approach this problem? For example what type of algorithm would be best, and what chip would be good to use.
I read that autocorrelation and FFT are both used for this kind of thing, but I don't know which would be best.
I was thinking of using the STM32F427, because it seems to be very popular and is available in all sorts of hobby related development environments.
I don't expect anyone to tell me exactly how to do it in every detail. I just need pointing in the right direction.
AI: This might fit far better on signals.stackexchange.com, if you rephrased it as signal processing question
Anyway, don't start with "I want to make a dedicated chip". Start with, I want to understand how something like that can be done, and then I will pick the tools, and pick implementations.
However, the question "how to best detect pitch of human singing is a very complicated one and far from easy to answer – even on a purely music-theoretical point of view, voice doesn't have one fundamental frequency, unless sung for the effect of producing the perfect tone.
You can, of course, try to detect the dominant tone in a song – and that's a pretty common question on signals.stackexchange.com, so I can only encourage you to search that – but it's still a pretty good question whether what your algorithm detects as dominant represents what a human might perceive as the tone of singing – humans are far from uniform, and that doesn't stop at the perception of music.
A small Cortex-M4F like the STM microcontroller you mention might be suitable for many of the algorithms that you will have to take into consideration, but many other's won't work.
So, one of the important rules of engineering applies: First understand your problem, then pick the tools. That applies to things like the FFT just as much as to the compute platform you'll be running this on.
Any reasonable approach for this will consist of first designing the the DSP on a PC-style computer, trying it against recorded digital signals (thus, audio files), refining it, then porting it to whatever platform you chose to put on your PCB.
That's one of the strengths of DSP: it's really just math. You can do it on a PC just as well as you can do it on a microcontroller, as long as the math you do does the same.
|
H: What is cause my pantry LEDs to turn on slowly, and how can I mitigate it?
Recently I put an switched outlet in my pantry with a door jamb switch. A set of LEDs is plugged into that outlet.
When the LED set is plugged in, and I turn on an inline switch on the LED, the lights turn on instantly.
When I use the door jamb switch (with the inline switch on the LEDs turn on) the lights take a few seconds to turn on. This behavior can also be seen when just plugging and unplugging the power plug from a non switched outlet.
I'm thinking this tells me the power plug is what's causing the delay. It converts the standard 120 into 12v 1000 mA. Is there anything I can do (maybe replace the power plug?) to speed up it's response time?
AI: The power supply probably takes a little while to wind up.
If you can, break into the inline switch of the LEDS then:
Completely disconnect the door jamb switch from your current outlet wiring. The outlet should be rewired so it is always on.
Break into the LED wiring and run the wires from the door jamb switch to connect in parallel to the inline-switch.
Switching the DC is A LOT SAFER than switching the mains anyway.
|
H: What are the effects of trimming the diameter of a wire down to half its gauge?
I have a three-phase, 4 AWG 259/28 stranded power transmission cable (3 conductors total) running ~200m into a slip ring. The only way to connect to the slip ring is by using its 8 AWG pig tails. These pig tails are rated 600V and 40A, which is sufficient for our needs.
I would like to trim down each of the 4 AWG conductors so they can fit into an 8 AWG butt connector or c compression clamp to splice to the pig tails. As far as I can tell, when trimming a conductor down you are simply changing the resistance/length of the cable in that area and its rated amps.
When trimming the conductor from 4 AWG to 8 AWG, would the mΩ/m of the trimmed section shift from 0.8152 to 2.061, as shown in wikipedia's table on wire gauges, or is there more going on here than I think?
Since the diameter of the 4 AWG conductors will suddenly change, will there be power transfer or heat issues that I am unaware of?
AI: If you simply cut strands from the 4 AWG wire, you will have an unpredictable resistance between those strands and the remaining strands. If you don't use all of the strands for the majority remaining length of the full wire size, the voltage drop will be the voltage drop will be somewhere between the voltage drop of 8 AWG and 4 AWG for that length.
Depending on the method of supporting the wire, vibration or just the weight of the heavier wire could put excessive strain on the short length of reduced-size wire.
I would attach ring lugs for 8 AWG on the leads form the slip rings and lugs rated for 4 AWG on that wire. Then, in a junction box, connect each phase of 8 AWG to 4 AWG using short bolts through the ring lugs. Tape up the lugs with appropriate electrical tape.
|
H: Ground pour under ESP8266 12-E
I want to pour ground under a ESP8266 12-E just for thermal reasons but I don't know if this can affect it somehow or if it's safe to do. The PCB is all under 5V, it's only 2 layers and it would have some signal traces, all on top. I have noted that with ground pour I get some more free space because I don't need GND traces (and would have several of them).
So I have three questions:
1) Does the ground pour affect ESP12-E?
2) Is it safe to have a ground pour with signal traces on it?
3) If it's safe to do 1 and 2, I should pour ground on bottom too, right?
AI: You should not pour ground under the antenna area, leave both layers free from pours and traces in the area immediately below the antenna; you do not want bits of copper coupling to the antenna. A ground pour under the non-antenna portion of the ESP-12E is fine, although I would avoid pouring on the top layer, as there is a (very slight) possibility of a short if both masks (on your board and the ESP) were to become damaged in the same spot and make contact. However, this chance is very slight, and if you want to pour under the ESP on top, it's probably fine.
1) Does the ground pour affect ESP12-E?
Yes, when it's under the antenna.
2) Is it safe to have ground pour with signal traces on it?
Sure, most ground pours have traces in them.
3) If it's safe to do 1 and 2, I should pour ground on bottom too, right?
Yes, just not under the antenna.
You should also not route traces under the antenna, and again, if it were me, I wouldn't route traces on the top directly under the device, as they would be very close to the ESP's traces (only separated by two layers of soldermask) and could be interfered with.
|
H: Reason for USB power bank LED to be always on?
I hope this is somewhat on topic.
I received a free 2200 mAh USB power bank today and noticed that inside its casing it has a blue LED that is always on, even when not giving charge or being charged.
Are there any common design reasons for such behavior in a device of this kind? To me it just seemed peculiar for a device meant to retain energy.
(I don't have much experience in electronics)
AI: Leakage current. Older simpler designs leak current through the boost inductor and diodes. Ten bucks says that the led is dim when not in use and brighter when in use? That's because it's tied directly to VUSB instead of a dedicated control IC like newer designs. Since the battery is not disconnected, it leaks and powers the led. When the current kicks up, the voltage of the boost circuit will rise to the 5V it is set for, and the led gets a higher voltage and hence brightness.
Basic Switching Circuit:
simulate this circuit – Schematic created using CircuitLab
When the switching circuit is off, the battery's 3.7V still leaks through L1 and D1. The battery typically has a protection circuit (DW01 IC) + mosfets that will disconnect it when the voltage hits the Over Voltage and Under Voltage thresholds, but in normal voltage ranges, are not affected. The battery is never disconnected.
It's not a minimum load for regulation, as that only matters when the current to a load is significant. While leaking it will be a milliamp or less. It is actually discharging the battery unnecessarily, just very slowly. It's a bug in the design.
|
H: How to convert maxwell equations to voltage and current equations?
How to convert maxwell equations to voltage and current equations?
Or how to connect maxwell equations to voltage and current equations?
I find that curl B or E is using a function of time and B has 3 components B1(t), B2(t) and B3(t) if using curl to represent . This is what I confused about how plot this magnetic in maple or apply in circuit by set voltage and current to control magnetic and electric field. How to make this circuit ? Is there a diagram?
AI: Current already appears in Maxwell's equations, in the \$\vec{J}\$ term that is a source of magnetic fields.
Voltage, in the lumped-circuit approximation, is defined in relation to the electric field, by
$$V_{ba}=-\int_a^b \vec{E}\cdot{}{\rm d}\vec\ell.$$
|
H: Simpler way to enable/disable voltage regulator using DC jack shunt as a switch?
I am wanting to know if there is a simpler way to enable/disable a switching voltage regulator I'm using. The voltage regulator's datasheet says to pull the EN pin to GND to turn it off, and let it float to turn it on.
The DC jack is being used as the on/off switch in this product. The middle pin is the shunt, and is normally contacting the sleeve/GND when the charger isn't plugged in. When the charger is plugged into the jack, the shunt disconnects from the sleeve, and the NPN transistor base is pulled high through a resistor and turns on, turning off the voltage regulator.
When the charger is unplugged, the shunt pin connects back to GND, pulling the NPN's base to GND and turning the voltage regulator on.
I feel like I've overlooked something and there is a more simple way? Thank you for your help.
The product, charger, and jack are center pin positive.
VCC is a 12V battery.
Schematic:
AI: Simpler than what you have? Without changing the regulator? No. A NPN plus resistor is as simple as you can get. The other option would be a voltage comparator, and a diode as a reverse protection and isolating node when the charger is connected. Which your battery may not like.
|
H: STM32F103 ARM - Modifying Clock At Runtime - FLASH Latency
I am having b it of confusion regarding changing the clock tree of an STM32F103 Cortex M3 at runtime and I am hoping someone can help me with it.
I am using a development board which has a 8Mhz HSE on board. As per the defaylt configuration of STM SPL stm32f10x_system.c file, PLL (derived from HSE) is selected as the SYSCLK source on boot.
I would like to use PLL as the source (derived from HSI). From what I have understood, the main steps are
Enable HSI. Wait for it to be ready
Set HSI as SYSCLK source. Set HCLK, PCLK1 & PCLK2 accordingly
Disable PLL. Change it's source to HSI and set multiplier
Enable PLL. Wait for PLL to be ready
Set PLL as SYSCLK source. set HCLK, PCLK1 & PCLK2 accordingly
As per above I wrote my routine called when main() starts
//TURN ON HSI AND SET IT AS SYSCLK SRC
RCC_HSICmd(ENABLE);
while(RCC_GetFlagStatus(RCC_FLAG_HSIRDY) == RESET){};
//SET HSI AS SYSCLK SRC. CONFIGURE HCLK, PCLK1 & PCLK2
RCC_SYSCLKConfig(RCC_SYSCLKSource_HSI);
RCC_HCLKConfig(RCC_SYSCLK_Div1);
RCC_PCLK1Config(RCC_HCLK_Div1);
RCC_PCLK2Config(RCC_HCLK_Div1);
//DISABLE PLL
RCC_PLLCmd(DISABLE);
//CHANGE PLL SRC AND MULTIPLIER
RCC_PLLConfig(RCC_PLLSource_HSI_Div2, RCC_PLLMul_16);
//ENABLE PLL
//WAIT FOR IT TO BE READY
//SET SYSCLK SRC AS PLLCLK
RCC_PLLCmd(ENABLE);
while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET){};
RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);
//SET HCLK = SYSCLK = 64MHZ
RCC_HCLKConfig(RCC_SYSCLK_Div1);
//SET PCLK2 = HCLK = 64MHZ
RCC_PCLK2Config(RCC_HCLK_Div1);
//SET PCLK1 = HCLK/2 = 32MHZ
RCC_PCLK1Config(RCC_HCLK_Div2);
This works just fine. Then I realized that I would need to change the FLASH latency as well as per my clock
So I did this
//SETUP THE SYSTEM CLOCK AS BELOW
//CLOCK SRC = 8MHZ HSI + PLL
//SYSCLK = 64MHZ
//HCLK = SYSCLK = 64MHZ
//PCLK2 = HCLK = 64MHZ
//PCLK1 = HCLK = 32MHZ
//TURN ON HSI AND SET IT AS SYSCLK SRC
RCC_HSICmd(ENABLE);
while(RCC_GetFlagStatus(RCC_FLAG_HSIRDY) == RESET){};
//SET HSI AS SYSCLK SRC. CONFIGURE HCLK, PCLK1 & PCLK2
RCC_SYSCLKConfig(RCC_SYSCLKSource_HSI);
RCC_HCLKConfig(RCC_SYSCLK_Div1);
RCC_PCLK1Config(RCC_HCLK_Div1);
RCC_PCLK2Config(RCC_HCLK_Div1);
//SET THE FLASH LATENCY AS PER OUR CLOCK
//FASTER THE CLOCK, MORE LATENCY THE FLASH NEEDS
//000 Zero wait state, if 0 MHz < SYSCLK <= 24 MHz
//001 One wait state, if 24 MHz < SYSCLK <= 48 MHz
//010 Two wait states, if 48 MHz < SYSCLK <= 72 MHz */
FLASH_SetLatency(FLASH_Latency_0);
//DISABLE PLL
RCC_PLLCmd(DISABLE);
//CHANGE PLL SRC AND MULTIPLIER
RCC_PLLConfig(RCC_PLLSource_HSI_Div2, RCC_PLLMul_16);
//ENABLE PLL
//WAIT FOR IT TO BE READY
//SET SYSCLK SRC AS PLLCLK
RCC_PLLCmd(ENABLE);
while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET){};
RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);
FLASH_SetLatency(FLASH_Latency_2);
//SET HCLK = SYSCLK = 64MHZ
RCC_HCLKConfig(RCC_SYSCLK_Div1);
//SET PCLK2 = HCLK = 64MHZ
RCC_PCLK2Config(RCC_HCLK_Div1);
//SET PCLK1 = HCLK/2 = 32MHZ
RCC_PCLK1Config(RCC_HCLK_Div2);
This also works. So my questions are
Is setting flash latency optional? since in my case it worked even without it.
When exactly do you call the FLASH_SetLatency function with the new wait state? Before setting the new clock or right after?
AI: Is setting flash latency optional? since in my case it worked even without it.
No. If you do not set the flash latency correctly, your program may sometimes read incorrect data from flash memory.
When exactly do you call the FLASH_SetLatency function with the new wait state? Before setting the new clock or right after?
Before increasing the system clock frequency, or after decreasing it.
Having the latency too high for the system clock is mostly harmless -- it will slow the system down slightly, but that's it -- but having the latency set too low may cause malfunctions.
|
H: Divide Sequencial Parameter Step in Spice
I've been designing a (very) simple MOSFET op-amp for school, and one of the things I need to do is determine the CMRR from my simulations. For the assignment, I'm just going to use the value at 1kHz, which should fulfill the assignment requirements. However, thinking about it made me wonder if there is a way to make LTSpice (or any other version of Spice) plot the CMRR over multiple frequencies?
I won't show the circuit, as this question is relevant to differential amplifiers in general, but here are the directives I'm using to run my current simulation:
.ac dec 100 1 100Meg
.step param vi list 0 1
vi is an AC voltage parameter for the non-inverting input, and the inverting input has a fixed value of AC 1.
Here is the result, measured at the output:
The black line (vi=0) shows the open loop frequency response with a differential input and the blue line shows the response with a common-mode input. In other words, it simulates these two circuits:
simulate this circuit – Schematic created using CircuitLab
I am wondering if there is a way to divide two instances of the same parameter. In other words, I want to divide the output voltages corresponding to the differential and common-mode gains so that I can do something like this:
$$ CMRR = \frac{v_o|_{v_i=0}}{v_o|_{v_i=1}} $$
AI: Yes there is:
1) Plot a signal
2) Right click on the signal name in the plot
3) The Expression editor pops up, you can now feel free to enter in a math expression, make sure if you include nodes you specify if you want a voltage with V(node) or current with I(node)
Here is an example of dividing one voltage node (named vout1 and vout2) by another with this expression V(vout1)/V(vout2)
Info on LT Spice algebraic expressions
Note: Alt-click on components which will generate a temperature plot, this also creates an expression.
Another cool trick is to use V(vout1)/I(r1) to plot the impedance of a node
|
H: Preventing Stack overflows in PIC MCU using C language MPLAB X
I am writing a C language code for PIC16f877a for an Alarm clock. In short, the alarm clock shows Time, Set alarm and a temperature & humidity reading on an LCD.
I have written interrupts for updating the time, for setting the alarm on and off and few others I plan to write.
The issue is, I am at half point of my code and the Stack overflow problem has risen in the proteus simulation. I have identified the part of code causing the problem. But I can't seem to understand how should I change it to prevent stack overflow.
Can someone help me debug this code? And please note down bad practices in C microcontroller programming which cause similar bugs? I can't seem to find such list of bad practices on the internet.
Here is the code I have written for setting the alarm/time on the clock. The overflow starts happening once I select the option of setting time. Then keeps happening until PIC crashes even when I come out of the setTime routine.
#define UP RD0 // Push buttons active high
#define DOWN RD1
#define SELECT RD2
#define BACK RD3
#define SNOOZE RD4
void UpdateSetTimeScreen() {
if (ptr > 1)
LCD_cursor(ptr + 1, 1);
else
LCD_cursor(ptr, 1);
if (set[ptr] == 0)
LCD_puts("_");
else
LCD_display_value(set[ptr]);
}
void SetTime() {
LCD_clear();
LCD_puts("Set Time");
LCD_cursor(0, 1);
LCD_puts("__:__");
LCD_cursor(0, 1);
set[0] = 0;
set[1] = 0;
set[2] = 0;
set[3] = 0;
ptr = 0;
unsigned int i =1;
while (i) {
if (UP == 1) {
while (UP);
switch (ptr) {
case 0:
{
if (set[ptr] < 2) {
set[ptr]++;
UpdateSetTimeScreen();
}
break;
}
case 1:
{
if (set[ptr] < 3) {
set[ptr]++;
UpdateSetTimeScreen();
}
break;
}
case 2:
{
if (set[ptr] < 5) {
set[ptr]++;
UpdateSetTimeScreen();
}
break;
}
case 3:
{
if (set[ptr] < 9) {
set[ptr]++;
UpdateSetTimeScreen();
}
break;
}
}
}
if (DOWN == 1) {
while (DOWN);
if (set[ptr] > 0) {
set[ptr]--;
UpdateSetTimeScreen();
}
} else if (BACK == 1) {
while (BACK);
ptr--;
} else if (SELECT == 1) {
while (SELECT);
if (ptr == 3)
i=0;
else
ptr++;
}
}
hour = (set[0]*10) + set[1];
minute = (set[2]*10) + set[3];
}
void SetAlarm() {
LCD_clear();
LCD_puts("Set Alarm Time");
LCD_cursor(0, 1);
LCD_puts("__:__");
LCD_cursor(0, 1);
set[0] = 0;
set[1] = 0;
set[2] = 0;
set[3] = 0;
ptr = 0;
unsigned int j = 1;
while (j) {
if (UP == 1) {
while (UP);
switch (ptr) {
case 0:
{
if (set[ptr] < 2) {
set[ptr]++;
UpdateSetTimeScreen();
}
break;
}
case 1:
{
if (set[ptr] < 3) {
set[ptr]++;
UpdateSetTimeScreen();
}
break;
}
case 2:
{
if (set[ptr] < 5) {
set[ptr]++;
UpdateSetTimeScreen();
}
break;
}
case 3:
{
if (set[ptr] < 9) {
set[ptr]++;
UpdateSetTimeScreen();
}
break;
}
}
}
if (DOWN == 1) {
while (DOWN);
if (set[ptr] > 0) {
set[ptr]--;
UpdateSetTimeScreen(ptr);
}
} else if (BACK == 1) {
while (BACK);
if(ptr > 0)
ptr--;
} else if (SELECT == 1) {
while (SELECT);
if (ptr == 3)
j=0;
else
ptr++;
}
}
AlarmHr = (set[0]*10) + set[1];
AlarmMin = (set[2]*10) + set[3];
}
void SetTemp() {
}
void print_configuration_screen() {
LCD_clear();
switch (scr) {
case 1:
{
LCD_puts("* Set Time");
LCD_cursor(0, 1);
LCD_puts(" Set Alarm");
break;
}
case 2:
{
LCD_puts(" Set Time");
LCD_cursor(0, 1);
LCD_puts("* Set Alarm");
break;
}
case 3:
{
LCD_puts(" Set Alarm");
LCD_cursor(0, 1);
LCD_puts("* Temp Mode");
break;
}
case 4:
{
LCD_puts("* Set Alarm");
LCD_cursor(0, 1);
LCD_puts(" Temp Mode");
break;
}
}
}
void ConfigurationMode() {
scr = 1;
print_configuration_screen();
while (mode == 2) {
if (BACK == 1) {
while (BACK);
mode = 1;
} else if (UP == 1) {
while (UP);
if (scr > 1) {
if (scr == 3)
scr = 4;
else if (scr == 4)
scr = 1;
else
scr--;
}
print_configuration_screen();
} else if (DOWN == 1) {
while (DOWN);
if (scr == 4)
scr == 3;
else if (scr < 3)
scr++;
print_configuration_screen();
} else if (SELECT == 1) {
while (SELECT);
switch (scr) {
case 1: SetTime(); // Set time
break;
case 2:
{
SetAlarm(); // Set Alarm
mode = 1;
break;
}
case 3: SetTemp();
break;
case 4:
{
SetAlarm();
mode = 1;
break;
}
}
scr = 1;
print_configuration_screen();
}
}
}
I am attaching screenshots to better help you guys understand the point when issue arises:
Everything is fine until I go inside the SetTime or SetAlarm routine.
As I press UP/DOWN to set time, on each press, a few 7-8 stack overflows occur.
After I come out of the ConfigurationMode() using BACK, the MCU goes haywire and stack overflows start happening in thousands until it crashes.
AI: You can try, in the ConfigurationMode(), combining case 2 and case 4 and instead of calling SetAlarm cut the code and paste it into case 2/4.
Same for case 3 if SetTemp is going to have some code code it into case 3 rather than calling SetTemp(). For now you can remove SetTemp() from case 3.
The same for case 1 move the setTime()
If ConfigurationMode() is called from only one place, move the code where it is called.
The rule being, do not call procedures unless there is a justifiable reason.
|
H: Danger of high voltage in electroadhesion
I am currently doing my master internship to get a degree in mechatronics. For an experiment I would like to conduct, I am interested in using electroadhesion.
For those who don't know about it, the principle is easy. Get two electrodes (side to side or interlaced), put them on a flat surface and apply a high DC voltage across the electrodes. The forces are developed on a molecular level, so I won't go into details.
The electrodes are usually well separated (by a gap) and embedded in a dielectric material (silicone or overlaid in tape for the cheapest versions).
When I say high voltage, it is around 2-6kV DC, more might cause air ionization between the electrodes.
I know this process was used in old HP plotters to hold the sheet of paper while the tracing pen moves on the paper, and I remembered touching the surface of one and feeling some kind of buzzing in my fingers.
In my experiment, there might be contact between humans and the electroadhesive surface, and I am concerned about safety. The HV DC-DC converters used usually provide several kV at less than 1mA of max output current (Emco produces the C50 that gives 5kV at 0.2mA). I know a DC current around 1mA can give a slight sensation.
The question is: Provided the electrodes are covered by dielectric, will there be this buzzing feeling when touching the surface? If yes, is there any danger?
Provided there are holes or imperfections (due to time damage) in the dielectric, is there a danger, if the person touches both electrodes at the same time (with a finger crossing both electrodes for example)? If yes, what kind? Simply a shock similar to when you rub a balloon and get shocked, or something nastier?
Thanks a lot for your answers!
Sebastien
AI: This is a 'best guess' answer based on lots of general experience but not specifically with shocking HP plotters. (I've used them long ago but they did not shock me).
The energy delivered and the current capability are what (probably) matters. In a static adhesion system with good insulation you can use a series resistor that limits supply fed current to whatever level suits.
The energy delivered short term depends on the capacitance of the electrode structure on the load side of the protective series resistor. This obviously depends on electrode areas, inter-electrode separation, dielectric constant of the insulating layer and Murphy. At an off the cuff non calculated guesstimate capacitance figures in the 10-1000 pF range.
At 1 nF and 5000V the energy (0.5 x C x V^2) would be about 10 milliJoule = about 10 gram centimetre of potential energy. I'd expect that be enough to be felt quite well as it's delivered rapidly so the power is high for a very brief period. As the period is very small, even a large short period current will not be "cardiac dangerous" and 10 mJ should not otherwise be a threat.
Data point: Static charge accumulated on a human body on a suitably enthusiastic carpet can convey an unpleasant shock but otherwise unimportant to both parties if contact is made with another person.
|
H: Opamp Voltage Follower
I am testing a buffer circuit. I came across a problem which i am not able to figure out why it is happening. Please help me out.
Problem:
In a buffer circuit the input voltage is measured across a 120k resistor. The opamp used is ADA4522-2.
Case 1:- When a single DMM is used to measure the input voltage, a particular value specific to the current flowing is obtained. When the same DMM is used to measure the output voltage a difference of 20mV from the input voltage is obtained.
Case 2 :- When i use 2 multimeters simultaneously for the measuring the input voltage and the output voltage with their respective negative probes connected to ground, the difference in the multimeter readings has been drastically reduced to less than 0.1mV. In fact when both of them are placed simultaneously, the output voltage(which had a 20mV difference is getting automatically reduced to the same value as the input)
What may be the reason behind this? Why was the buffer giving a difference in input and output at the first case? How can the difference between the buffer input and output voltage be nullified?
Thanks in advance.
AI: You measure a voltage across a 120k resistor, therefore your source impedance is 120k.
If the multimeter input impedance is 10 MOhms, which is now drawing current from your 120k source impedance, then it will cause about 1.2% error.
When you use two multimeters, the one at the input introduces an error, which is faithfully transmitter through your buffer, and measured by the one at the output.
No problem at all.
|
H: amplification,how to amplify 50HZ, 300uV signal
i have to amplify 50hz frequency 300 micro volt signal, so please suggest any opamp that amplify low frequency signal and i have to amplify 300 micro volt to 3.3 volt hence, i need 10000 gain opamp hence which opamp is meet this criteria orany other modules are available?
AI: ln general Operation amplifiers act as a Low-pass filter which should allow 50Hz frequencies to be amplified fine by most Op-Amps (Unless you design a specific filter circuit with it). For the gain you should take note of the OL gain (which acts as the max gain) and the rain voltage (in other words you have to provide external voltage bigger than 4.7~ volts (which is 3.3+1.4 or so)
So I recommend checking some generic Op-Amps and seeing if they fit that critiria. I am pretty sure most of the OPAMPS should be fine.
Also note that the theoritical OL gain is at least 10^6 which is higher than your situation. Note that you should be using an Inverting/Non-Inverting Circuit for your OPAMP for the best results (and to control the output voltage)
Edit: A quick check shows that nearly all (if not all) Op Amps should work at low frequencies as they also work with AC. So Unless the OPAMP you choose has a problem with low frequencies or you construct a filter circuit nearly any OpAmp should be fine.
As suggections from the comments a low-offset voltage opamp would be best, Examples:
http://www.st.com/en/amplifiers-and-comparators/low-offset-voltage-op-amps-lt1-mv.html?querycriteria=productId=LN1589
|
H: Why are the ADC and DMM readings different?
While doing an experiment we reached a conclusion which we wrote down as the DMM and the ADC reading being different.
Now after doing some research It does confuse me as a DMM does contain an ADC of it's own. Can someone explain the reason of such?
Our ADC is very simple : An attenuator (voltage divider) connected to an ADC chip.
One of the reasons I can assume is having some inaccuracies in the attenuator but when I asked our prof he told me that there are TWO reasons in fact. Can someone kindly clarify?
AI: The main reason, assuming you hooked up everything correctly and all the equipment was working correctly, is the difference in input impedance between the DMM and your A/D circuit.
The input impedance of the DMM should be clearly listed in its manual. It may even be written write on the unit. A common value is 10 MΩ.
The input impedance of the voltage divider is the sum of the two resistances. The input impedance of a typical CMOS A/D is probably much higher than your divider resistances, so you can ignore its contribution.
Unless you have a very unusual A/D, the sum of your two divider resistors is much less than the input impedance of the DMM. Therefore consider what the voltage source you were measuring does with a 10 MΩ load, and a few kΩ load that your A/D circuit presented.
Of course the dividers add some error too. Look up the accuracy of the resistors and compute the overall accuracy of the divider. Most likely, the accuracy of the DMM is higher than even your bare A/D. Even without circuit loading issues, the DMM is likely significantly more accurate than your A/D circuit. Then the A/D has quantization error too. If it's a 10 bit A/D, for example, then you get about ±0.05% error just from quantization. Likely the resistors swamp that error, though.
|
H: Can you call verilog code from a c program running on a soft processor on an FPGA
I have a soft NIOS II processor instantiated on an Altera FPGA. I have 4 JTAG pins connected from the FPGA to a FTDI chip (lets call them A1, A2, A3, A4). I have the JTAG pins from 2 MCUs connected to the FPGA also (lets call them B1, B2, B3, B4 and C1, C2, C3, C4).
In software running on the NIOS I want to be able to select which two sets of pins I want to connect (i.e. A to B or A to C).
You have to do pins assignments in verilog though. Is there a way to call a block of verilog code from a c program running on the NIOS?
AI: No. You can't call Verilog (which is hardware) from C.
(Well, you can in a simulator, but that's another story).
But you can write data to a memory address in C.
In Verilog, you can map that memory address to a register, and connect that register's outputs to the control inputs of a multiplexer, to select between different signals. That's a simple piece of hardware design.
Now, by writing to that address in your C program, you can select different signals.
|
H: Working out the resistance for a circuit involving diodes
How do I get to 139 Ohms? A worked solution would be appreciated.
AI: My take is that there are unstated assumptions that have to be made. Going back through your course notes may help reveal those assumptions.
To get 2.4V at the output we need 0.8V accross each diode and 7.6V accross the resistors. The question then becomes what current do we need?
We need to get 0.8 volts across the diodes. To do that we need a current flow of more than 1 ma, but how much more?
The shokley diode equation is.
$$I=I_\mathrm{S} \left( e^\frac{V_\text{D}}{n V_\text{T}} - 1 \right)$$
At these voltages we can ignore the -1 term as negligable.
$$I=I_\mathrm{S} e^\frac{V_\text{D}}{n V_\text{T}} $$
Lets plug in the values we have for 1 ma.
$$10^{-3}=I_\mathrm{S} e^\frac{0.7}{n V_\text{T}} $$
And now the value we are trying to calculate
$$I_{0.8\mathrm{V}}=I_\mathrm{S} e^\frac{0.8}{n V_\text{T}} $$
Now to make use of some power-maniupulation rules and substitution.
$$I_{0.8\mathrm{V}}=I_\mathrm{S} e^\frac{0.8}{n V_\text{T}}=I_\mathrm{S} e^\frac{0.7}{n V_\text{T}}e^\frac{0.1}{n V_\text{T}} =10^{-3}e^\frac{0.1}{n V_\text{T}} $$
We need some values for the idealaty factor \$n\$ and the "thermal voltage" \$V_\text{T}\$. Lets try taking the ideality factor as 1 and the thermal voltage as 0.02585 V (wikipedias value for "room temperature")
$$I_{0.8\mathrm{V}}=47.87*10^{-3}=0.04787$$
Now we also need to assume there is no load on the circuit and therefore that the diode current equals the resistor current.
$$ R = V/I = 7.6 / (0.04787) = 158.7 $$
Which is in the same ballpark as your teacher's answer, I suspect they made slightly different assumptions about the thermal voltage or ideality factor.
|
H: Cable joins on wiring LEDS in parallel
So I am a newbie.
I want to wire up a bunch of LEDS in parallel, and I have it all working fine on a bread board.
I can find loads of nice drawing of the schematics
But what I cant find a good example of is how to attach LED/Resistors to the wires.
I have seen wire nuts and people just removing the insulation on the wire and soldering on to the bare wire, and then not covering it up. All these just smell bad.
What would is considered best practice.
The project is about a square meter in size.
AI: What you can do is solder the LED to the resistor with the bare wire obviously as you mentioned but cover it up with heat-shrink tubing insulation material. This is the best way to avoid short circuit connections. Note that it may be time consuming to actually have to do this for a meter square of LED connections. Here is an example below of what I am talking about:
You would have to place the heat-shrinking element before you solder your LED to your resistor and when the solder connection is done, move the heat-shrink tube down over the solder joint. Using a solder iron or a lighter, you can shrink the tubing material very easily and make it stick to the solder joint. That way your circuit will be protected from potential short circuits and no LED will go bad.
Be careful to not place the solder iron or the lighter over the same place for too long since it might cause the solder joint to melt and detach itself.
|
H: The equivalen reactance of an inductor and a capacitor
In my text book, I came across a problem where I needed to determine the equivalent reactance of a capacitor and an inductor (its ohmic resistance is negligible). To solve my problem I started to determine the equivalent reactance of both of them and to neglect the ohmic resistance of the inductor, and I thought of doing this:
Z = √Xl²−Xc². (Where: Z is the impedance, Xl is the inductive reactance and Xc is the capacitive reactance.)
But in the problem statement, Xc is 3Xl.
So, putting them in the above equation is like:
Z =√Xl²-9Xl²
=√-8Xl²
Which has no sense because of the negative sign.
So my question is: What would be the equivalent reactance of an inductive and capacitive reactance? Is my approach correct but missing something, or it is wrong?
AI: Basically the magnitude of the net impedance is the difference between the two impedances and you can ignore the sign if it becomes negative. Taking the square root of the difference of the squares is fundamentally wrong because capacitive and inductive reactances share the same axis: -
The above picture shows an inductor (reactance 300 ohms) in series with a resistor of 400 ohms. If you were trying to calculate the net impedance of R and XL then square rooting the sum of the squares is appropriate.
If the reactance (vertical axis) becomes negative then this is due to the dominant impedance being capacitive rather than inductive. An inductor in series with a capacitor produces an impedance somewhere on the vertical axis and, when the two impedances have identical magnitudes they cancel to zero. this is called series resonance. You might have heard of it.
|
H: Strange symbol on PSU label
I have a PSU (wall wart) with a symbol on the label that I don't recognise. I'm curious as to what it means. It's probably some safety symbol of some form, but not one I have ever seen before. I'm sure it's obvious though:
It's printed on the label with all the other safety symbols, ratings, etc.
Underneath it, I don't know if it's related to the symbol or not, is an ambient temperature rating of ta=40°C and an IP rating of IP20.
If you're interested, here's the entire label, so you can see it in context (and yes, I know those current ratings are completely wrong - 0.5A in, 0.5A out?!?!):
Any clues?
AI: This is an SMPS symbol from the IEC 60417 standard. It identifies an
electronic device incorporating transformer(s) and electronic circuitry(ies), that converts electrical power into single or multiple power outputs.
There's also a similar symbol for a linear PSU:
The PSU must have an internal operating frequency below 500 Hz to be considered linear by the standard.
|
H: AVR. How to configure as output just one pin?
In AVR C code, if you want to declare some port as ouput, you just have to to do this:
DDRB = 0xFF;
But how can I do if I want to declare as ouput just one pin. For example, I want to declare has output Arduino's pin 13, which corresponds to PB5.
I know I can declare that in binary format:
DDRB = b11111111;
But, I don't know which bit position corresponds to PB5.
Thanks in advance, I could not find this answer in Google.
AI: PB5 is the 6th bit.
Just remember that the numbering is zero-based and starts with the least-significant-bit on the right, so the value you're looking for in this case is 0b00100000.
When you're setting this bit, you'll probably want to use a logical OR operation instead of a simple assignment, so:
DDRB |= 0b00100000;
instead of
DDRB = 0b00100000;
That way you won't inadvertently clear any of the other bits which might already be set.
|
H: Battery drain with higher volume
I was wondering if a Device connected to a speaker via Bluetooth drains more energy while sending high volume compared to the same sound on low volume. This might not be the perfect question for this forum as there might be a more computational aspect.
AI: No. Bluetooth is a digital data connection, and it's power does not vary based on the raw amplitude of the audio signal being digitized and transmitted. What would change the battery life is how much data is being sent, and a volume difference is not that. Additionally, Bluetooth audio allows for volume control outside of the raw audio signal, and that also doesn't increase power usage.
Any given audio stream will use the same amount of power as the next really. Bluetooth is not a very power hungry spec.
|
H: From transfer function to frequency response
In this question I asked about the difference between transfer function and frequency response. One user replied that "the frequency response is the transfer function where the transients are assumed to be completely dissipated". He showed an example, to prove his statement. It was like this:
Take, as an example, a sinusoid, \$\small \sin(\omega t)
\rightarrow \dfrac{\omega}{s^2+\omega^2}\$, applied to a simple first order lag,
\$\small G(s)=\dfrac{1}{1+s}\$. The response is: \$\small
> R(s)=\dfrac{\omega}{(s^2+\omega^2)(1+s)}\$, and this can be expressed
in partial fractions:
$$\small
\frac{\omega}{(s^2+\omega^2)(1+s)}=\frac{A+Bs}{(s^2+\omega^2)}+\frac{C}{(1+s)}$$
Inverse LT gives:$$\small r(t)=\frac{A}{\omega}\sin(\omega t)+
B\cos(\omega t)+Ce^{-t/\tau}$$
The exponential term decays to zero, leaving the steady-state response
as:
$$\small \frac{A}{\omega}\sin(\omega t)+B\cos(\omega t)= X\sin(\omega t+\phi)$$
Solving for \$\small X\$ and \$\small\phi\$ gives \$
\frac{1}{\sqrt{1+\omega^2}}\$, and \$\small \arctan{(-\omega)}\$,
respectively, as is obtained using \$\small s\rightarrow j\omega\$ in
the Laplace TF.
I don't quite understand the last part.
How does he calculate \$\small X\$ and \$\small\phi\$ and what does he deduce by plugging \$\small s\rightarrow j\omega\$ into the transfer function? How is his original statement verified?
AI: This is just answering one part of your question:
I don't quite understand the last part. How does he calculate X and ϕ
This is just applying the trigonometric identity
$$\sin\left(\alpha + \beta\right)=\sin\alpha\cos\beta + \cos\alpha\sin\beta$$
with \$\alpha=\omega{}t\$ and \$\beta=\phi\$.
Using this identity on the r.h.s. gives
$$X\sin\left(\omega{}t+\phi\right)=X\left(\sin{}\omega{}t\cos\phi+\cos\omega{}t\sin\phi\right)$$
so our equation becomes
$$\frac{A}{\omega}\sin\left(\omega{}t\right)+B\cos\left(\omega{}t\right)=X\left(\sin{}\omega{}t\cos\phi+\cos\omega{}t\sin\phi\right)$$
Which we can break into two parts,
$$\frac{A}{\omega}\sin\left(\omega{}t\right)=X\cos\phi\sin{}\omega{}t$$
and
$$B\cos\left(\omega{}t\right)=X\sin\phi\cos\omega{}t$$
So,
$$\frac{A}{\omega} = X\cos\phi$$
and
$$B=X\sin\phi$$
From there you should be able to get the conclusions from your source.
|
H: Tantalum Cap Code Explained
I need to replace the following cap:
It was placed at the input of a device that runs off 24Vdc, like the following schematic.
simulate this circuit – Schematic created using CircuitLab
I'm repairing the unit after an explotion due to a maintenance where the board was fed 220Vac instead of 24Vdc...
Bottom line, while repairing the unit i found this Cap (C1) shorted and i need to replace it, but i've never seen a tantalum cap with this markings.
Of course, it's a 47uF cap, but the rest of the data i ignore.
I assumed that K is for tolerance (10%), and 20 for 20V, but this makes no sense in a circuit that runs on 24Vdc, so i need to find out the voltage rating of this cap (sure, i could simply replace it with a 40V and be safe, but i want to leave things as original as possible, and also want to learn to read this codes, it will become usefull in the future...)
So, could you fill the next list and perhaps explain how this code is selected?
R+: ?
476: 47uF
20K: ?
633: ?
AI: Here is what I found after doing a quick search online:
Furthermore, you can look at the following link to find more information about their device marking and the R+ at the top of the Capacitor.
Kemet Capacitor Marking
Initially, what threw me off was the date code located at the bottom. I thought this would represent the ESR (Equivalent series resistance) of the capacitor.
In the end, it seems like the capacitor is rated for 20V which makes very little sense for the application you have at hand. Therefore, it would probably be a good idea to review the design and possibly thinking about adding some Galvanic isolation to prevent further damage to the system due to ESD.
|
H: Do CMSIS libraries also handle GPIO registers?
I'm currently exploring embedded programming with ARM processors. My embedded systems class has us programming on an Atmel SAMD20 (Cortex M0+). Our lab manual explains in detail how to utilize an Atmel library to access the registers on the processor to control GPIO pins.
What I've been trying to learn on my spare time is how to get up and running on my own with a different microcontroller, knowing that the code will be somewhat different. I read about CMSIS which seems like a convenient way to start programming on new microcontrollers using the same ARM core. However, different silicon vendors will have a different number of GPIO ports/peripherals connected to the microcontroller. How can CMSIS keep consistency between these GPIO ports when they are different between different chips? Or does CMSIS not handle GPIO ports and only things pertaining to the ARM Core?
If the latter is the case, does this mean I must look at vendor datasheets to understand how to code a specific microcontroller? I am looking at STM32 microcontrollers at the moment and am having trouble locating anything that documents their header files. I am a little lost and overwhelmed at the moment, so any advice and direction would be appreciated.
AI: As @Arsenal says, the CMSIS only handles core ARM functionality. The GPIO is implemented by the specific microcontroller vendors.
The STM32 microcontrollers have pretty good documentation. ST gives a few options for device header files, CMSIS headers, abstraction layers, and so on.
I recommend downloading ST's Standard Peripheral Libraries. The SPL for the STM32F10x, for example, can be found here. It includes a large, Doxygen-created, linked document covering their header files, and also many pieces of example code.
I should explain that the SPL is the "old way" of doing this. It is pretty lightweight, and only performs basic functions to use the hardware.
Recently, ST is nudging users towards their STM32Cube firmware development package instead of the SPL. Not only does it have header files and basic functions, but it also includes USB support, graphics modules, etc. It creates lot of code for you.
Some people love it; some stubbornly keep using the SPL. (I'm one of the stubborn ones). If you want it, you can find STM32Cube (for the STM32F1's) here.
|
H: start a LTSpice simulation using code in MacOS
Help me please, I'm looking for the solution how to automate spice simulation with python on MacOS, currently, I'm thinking to use LTspice. However, I'm open to any proposal.
I want to make approximately <1000 simulations and extract data from simulation (e.g. value of the output voltage at the particular time) and after start a new simulation with another input parameters for the circuit.
I have checked a big number of pages, however, haven't find something which would give me a python + spice setup.
AI: With spice, you'll have to roll your own code but there are ways to get data in and out of LT Spice and run it from a scripting language.
This works on other oses, having never run LT spice on a mac I don't know if the command line works on a mac.
If you run LT spice in command line mode, from a windows command line:
Run in batch mode. E.g. "scad3.exe –b deck.cir" will leave the data in
file deck.raw
"scad3.exe –b deck.cir"
Or you'd probably want a .txt file which you could then import back into a scripting language
'ltsputil.exe -ca example.raw dete.txt'
Test this and see if you can run LT spice from the command line, here is some info on running exe's from a command line on a mac:
Running command line exe's from a mac
You can run shell commands from python also
So generate a python script to generate raw files then use the utility to generate text files. (which you can then import back into python). You can edit the .cir file directly from python and change things (like add components or change values, its just text file and spice netlist after all).
So if you wanted to change a step command, all you would have to to is find the line of text in the .cir file change it, then rerun the simulation and look at the output.
Keep in mind that LT Spice is very powerful if you know how to use it:
B-sources can do some crazy math with nodes (like simulate bit
quantization of ADC's and DAC's or laplace transforms
There are monte carlo simulations that randomize values.
.step commands with parameters can run multiple simulations
You can set resistors and other components to the value of a voltage node to create variable resistances\component values.
PWL files to change the voltage and current sources from a file.
If these don't work then run script a simulation.
|
H: Winding mutiple axis coil
Wire coils can be used to 'pick up' alternating magnetic fields as described by Faraday's law. I want to do this in multiple axes around a single core. How could I do this in practice at a reasonable cost? I have seen 'transponder coils' that do this in a small package (e.g. Premo, Neosid, Coilcraft, Murata):
I realized that placing the core on a simple coil winding machine will not work after the first axis if the winding axis has to go through the bobbin:
Therefore, I am considering either making a rotatable "end cap" that the end of a simple coil winder can be pressed against, or possibly winding each axis on a single-axis bobbin and then transplanting to the multi-axial bobbin. However, in the latter case I am skeptical that dimensions would match up well and that the coil would stay together. (Assume 1000 turns of 32 AWG wire.)
AI: You could put holes into the bobbin into which 'forks' would be inserted to straddle the previous coil(s) and provide an axis of rotation, either from one side or from both. Eg.
|
H: LEDs with built-in resistors vs 12v leds
I've been researching this and cannot find any comprehensive guides. I'm looking to replace some incandescent bulbs soldered to pcb's inside my cars console. I've found some through-hole clear LEDs that have built-in resistors and they work but does that make them actually 12v? When I put a volt meter across the connections it reads the same output voltage as input voltage so I don't see the resistance happening. I've also looked for SMD leds with built-in resistors or 12v version but I don't think they exist. I don't really have room for resistors and looking for options.
AI: AFAIK there is no, or at least no common, led diode that is typically 12V forward voltage by it self. 12V led are modules that consist of some combination of diodes and resistors to make them suitable for 12V power applications without needing extra current limiting. This may be a single led with resistor, or multiple LEDs with resistor, or maybe a constant current IC. Some may have extra features like reverse protection or any direction input.
But they are not bare diodes.
|
H: Protecting microcontroller from drastic changes in load on power source
Is it necessary to protect the VIN pin of a microcontroller (currently arduino micro) when another device on the same power source is switching between 90W and 0W? Specifically, 300 LEDs are strobing, drawing ~18A from li-ion 18650s when on. Might the batteries continue to "push" that much current for a brief period in a way that could damage the microcontroller?
AI: That all depends on your circuitry.
However, as a general rule you would NOT put your load on the same circuit as the logic of your controller. Driving 18A through your power and ground traces shared by the controller can induce significant problems for the micro including shutting it down or resetting it.
The logic section should have it's own connection from the battery through whatever regulator you are using. If you are not using a regulator, then at least a small in-line inductor and decent bulk capacitance should feed the logic.
The LEDS should NOT be powered from the regulator, they should be direct from the battery and driven with simple constant current drivers if need be.
Similarly, the return ground should be separate and connected together as close to the battery as possible, if not at the battery itself.
BTW: The only way you could get a PUSH effect is if there is a sizeable amount of inductance in the power path from the battery to your power line. Since you have not indicated what you are using for power conditioning, it is impossible to comment if that will indeed be a factor here.
|
H: Unipolar transistor's transconductance/admittance
Unipolar transistor basic variable transconductance is commonly marked by:
It is commonly used in calculations where we need drain current, Ugs, rds(on), and similar.
I have also seen many equations for calculating upper variables but here mostly used variable is known as "conduction parameter" (unit: mA/V square).
It says (in the pdf file) that "K" should be given by manufacturer. But none datasheet till now had any value like this one.
Question: Do these two (transconductance & conduction parameter) have something in common? Can one replaced with another (probably not)? Are these equations with conduction parameter even used in practice?
AI: The relation between transconductance (\$g_m\$) and the conduction parameter (\$K_n\$) may be found from the definition of \$g_m\$:
$$
g_m = \frac{\partial i_D}{\partial v_{GS}} = 2K_n\left(v_{GS}-V_{TN}\right) \\
\implies K_n=g_m/\left(2\left(v_{GS}-V_{TN}\right)\right)
$$
In other words, the conduction parameter may be found from the transconductance when given the overdrive voltage at which \$g_m\$ was measured.
It is also possible to find \$K_n\$ from \$g_m\$ when given the drain current at which \$g_m\$ was measured:
$$
g_m = 2K_n\left(v_{GS}-V_{TN}\right) = 2\sqrt{K_n}\sqrt{K_n\left(v_{GS}-V_{TN}\right)^2} = 2\sqrt{K_ni_D} \\
\implies K_n=g_m^2/\left(4i_D\right)
$$
In practice, the conduction parameter may be useful for back-of-the-envelope, or approximate, calculations.
Reference: https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-012-microelectronic-devices-and-circuits-fall-2005/lecture-notes/lec11.pdf. See slide 11-6 and apply definition \$K_n = W\mu_nC_{ox}/\left(2L\right)\$.
|
H: Pre-biased Bipolar Transistor (BJT) Tradeoffs
If you go to the Discrete Semiconductor category on Mouser.com, there is a section for "Bipolar Transistors - Pre-Biased".
Is this as simple as including a resistor in series with the base?
Are there other nuances about this type of package?
AI: Pre-biased (also "resistor-equipped" or "digital") transistors indeed have a plain resistor in front of the base. Most also have a second resistor between base and emitter. Both resistors are used in exactly the same way and for the same purposes as external, discrete resistors.
Creating resistors on a silion die is harder, so they have looser tolerances, often ± 30 %.
(For digital switching, where all you care about is that the transistor is saturated, this does not matter.)
Otherwise, there is no difference.
|
H: Are DC-DC converters designed with fixed output or fixed output/input ratio?
When I was learning DC-DC converters, I think they are a "DC version" of transformer (which is for AC-AC). So when I was designing a 100-30V flyback converter, my suggestion is: if a user inputs a DC 100V source, he gets a 30V output; if he inputs a DC 50V source, he gets a 15V. Just like how transformers act with AC, which have a fixed output/input ratio.
And someone then told me: no. If he inputs a 100V he gets 30V output; if he inputs a 50V, he should still get a 30V; even if he inputs a 15V, he still have to get a 30V. (We were talking about flyback converter. I'm not sure what about buck/boost converter. ) This is like a DC power supply (or it is), with which you want a fixed output.
So I'm curious and a little confused now about the actual situation. Do manufacturers always make DC-DC converters with fixed output voltage? Or with fixed output/input ratio? Or both are possible? In this case, is one of them are more often to use then the other?
The "someone" was like "How dumb are you! How can you even don't know this! " while telling me the story. I think it's more possible what he said makes more sense, because I'm really stupid. But what confused me is: if the actual situation is we never design DC-DC converters, like buck or boost or flyback or any other DC-DC converters, with a fixed output/input ratio, then how do I do if I want a "DC transformer" which give me output = f(input) = input * 3? Or, I don't know, maybe we will never want a DC transformer like this?
AI: The search term for what you are describing is "proportional dc-dc converter". For example, you can buy high-voltage DC-DC converters, where you put in 5-12V and get 1000 times the voltage out (5K to 12K volts). But for most DC-DC converter uses, the purpose is to get a fixed output voltage even if the input varies.
|
H: How to supply auxiliary power?
I just ordered an electronics hobbyist kit. It comes with a breadboard and a bunch of other components. Looking forward to work on my first project.
In my setup, an external device is connected to the PC via USB. One of the pins on the USB provides +5V to the device.
I need to keep the external device alive even when the PC is not on. Essentially, I need a battery backup circuit that kicks in as soon as the PC power is turned off.
Note that the external device can even take +1V to be kept alive. Ideally, I would like to send minimum current in order to keep the battery alive for a longer time.
Wondering if you can point me in the right direction. Is there even a name for such a circuit? Regards.
AI: Construct a simple circuit with your added source. I will edit an explanation of how it works later today
Edit: As suggested by colin shottky diodes would be very useful as there is less voltage drop.
|
H: PWM Control vs Variable Voltage Control - Calculating Duty Cycle
I have a strange problem. We have an actuator which was controlled using varying voltage. For example, to achieve setting 1 we measured that the resistance of the coil is 32 Ohms and 2.09 V is supplied. That should see a current of 65.33mA and power of 0.136 W. Now we have to change it to a PWM control with constant 4.5 v supply. But how to calculate the duty cycle. The resistance remains the same. We need the same power. Is there any formula which can be used to calculate the effective current which is needed to drive in this case 0.136W?
AI: If your frequency is high enough (like period 20 times shorter that actuator's time constant), you can consider your voltage just average: V = Vbus * D. So duty cycle would be D = V / Vbus.
This is based on the fact your actuator is a solenoid with inductance and resistance, making up time constant.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.