texts: Verilog and break statements is there a possible alternative?

texts:
So I am currently facing an issue where break; statements aren't allowed in verilog? Is there an alternative to this? I've tried disable block_to_disable, but that did not solve anything. Is there possibly an easy fix or is Verilog unable to do this? I only ask since Verilog is a derivation of C. Thank you for your time and help.

module prj2(input [2:0] usr, input button, output reg [6:0] stage);

//input button

reg currentState = 0;
reg tracker = 0;
reg stage_0 = 0;
reg stage_1 = 1;
reg stage_2 = 2;
reg stage_3 = 3;
reg stage_4 = 4;
reg winner = 5;

/*stage is read in binary
  stage 0  = 1
  stage 1 = 2
  stage 2 = 4
  stage 3 = 8
  stage 4 = 16
  stage win[5] = 32  NO STAGE WIN
*/

/*r/p/s is read in binary
0: rock = 1
1: scissors = 2
2: paper = 4
*/

always @ (button) //start of the action section
begin
case(currentState)//draw and loss are the same
/*=======================================================================================*/
  0://using scissors
    if(usr == 1)
        begin //beat scissors so use rock
      tracker <=  stage_1;
      currentState <= stage_1; //moved to state 1
      stage <= 2; //stage_1
        //disable block_to_disable;
    end
    else begin//don't move
        tracker <=  stage_0;
        currentState <= stage_0; //stay in same state
        stage <= 1; //stage_0
        //disable block_to_disable;
    end
/*=======================================================================================*/
  1://using rock
    if(usr == 4) begin//beat rock so use paper
        tracker <= stage_2;
        currentState <= stage_2; //moved to state 2
        stage <= 4; //stage_2
            //disable block_to_disable;
    end
    else begin //move back to state 1
         tracker <=  stage_0;
        currentState <= stage_0; //go back to previous state
        stage <= 1; //stage_0
            //disable block_to_disable;
    end
    //break;
/*=======================================================================================*/
     endcase //end case
  end //end begin that comes after always()
endmodule //end the actual module


texts: What are the recommended trace width and clearance on homemade PCB's?

texts:
I know that there are multiple processes and lots of variables regarding homemade PCB manufacturing. Using the right tools it is possible to achieve professional levels.

I'm concerned for students their make themselves their first board. What could be a safe recommendation to reduce problems?

Edit: On regarding the process they'll probably use termal transfer (laser printing) and ferric chloride on the etching process.


texts: Is it allowed to use a USB-C connector to a USB 2 host?

texts:
I am working on a product that is intended for at least the european market and possibly the US market as well.
I am not at all acquainted with the USB specifications, and currently I do not intend to become that if not necessary. I just want something that works, and that will not get me in some legal trouble :)
TLDR
Can I get in legal trouble for not following the USB-C specification? (fixed 5 V without current negotiation and only D+ D- routed)
So, my project contains a USB 2.0 host (a linux module). I want to route this to a good old USB Type A Female connector, but it is way too big for this application. The USB-C connector is a better fit, and I like that it feels sturdy and is symmetrical, so I am thinking of using this.
I don't intend to support anything more than necessary. In my mind that includes the following:

Routing the D+ and D- to the Linux module
Routing the power to my PSU (no possibility to negotiate the current)
Routing the USB-C connector symmetrically to support a flipped usb cable.
(Maybe necessary to pull down CC1 and CC2 to ground with 5.1k resistor?)

Then I suppose I can use an off-the-shelf "USB-C OTG" adapter to connect my good old USB-A peripheral. The supported peripherals for my product will be very limited, probably to only a known USB-modem.

Native USB-C devices are not (necessarily) intended to work with this product.
From what I could find, I can violate the USB specification to my hearts content as long as I don't put the USB logo on my product.
Is this the case, or can I get in legal trouble for not fully supporting USB?


texts: Everyone knows this thevenin equivalent, but is it the same as this?

texts: My question is, in the picture on the right can we switch the voltage source and the resistor and everything will still be the same? the circuit would look like b-Rth-Vth-A. Will everything still be the same from the point of view of A and B?


texts:
I bought several LED's bulbs last years and several failed because crappy drivers.

I plan to combine 4 of these modules together and make a single custom DIY LED lamp.

Here is a photo of the modules and a aluminium base to fix the modules and serve as heatsink:

It's two 4 W modules and two 3 W modules. The typical specs for this LED is 300 mA current and 3.3 V forward voltage.

Each of these modules, the LEDs are arranged in serial.

I tested using a 12 V, 2 A HDD power adapter and all these modules are working, but I know is to much A and have risk to burn the modules.

Need help how to make a circuit to use this in single DC source, like 12 V DC driver/PSU.


texts: Why do some wire gauge ampacity charts state vastly different current ratings?

texts:
This is a question that I've had for a while but have somehow managed to go without asking. Looking at all the wire gauge ampacity charts online, some of them appear to provide vastly different ratings for the same wire gauge. I understand this may be due to different standards, temperature, conductor types, strand count, etc.

However, lets looking for the current rating associated with 10AWG copper conductor at a low operating temperature (60c):

Chart 1: 15 amps

Chart 2: 30 amps

I've only cited two sources, however, I've come across many other charts that provide this 15 to 30 amp difference. What gives?


texts: DC offset before signal being fed into an instrumentation amplifier from a bio potential source

texts:
I am trying to design an instrumentation amplifier, having 2 bio-potential sources as its differential inputs, each having peaks in the order of 10's of uV and a frequency band of 3-50 Hz. One of the main characteristics of the input signals, however, is a DC offset and depending on different conditions, it is about 600-800 mV.
This limits the gain of the amplifier, as it will also shift the output signal up about (Gain * DC-offset) and this in turn, will limit the gain and for a small signal, this means a noisy output (from different sources). One obvious solution is to put a DC blocking capacitor prior to the positive input into the InAmp. This, to me seems not to be a problem, but I am not really familiar with noise sources in capacitors (like Johnson noise in resistors), but i know that some ceramic caps experience that microphone effect, and most of the surface mount caps I have on hand are SMD MLCCs.
Would this be a good solution, or would it cause strange behaviour?


texts: How can an induction motor be "self starting"

texts:
I read that all you need to start an induction motor is to apply the AC voltage, and with time the slippage decreases.  How does this happen magnetically?

If a rotor, connected to a moderate sized mass, is stationary at t=0, and you apply a quickly rotating magnetic field, then the stator will spend half of its AC cycle with its magnetic vector ahead of the rotor, and the other half it will be behind.  To me that means it rotates the rotor in the +ve direction for 1/2 of the 1/60 cycle (assuming 60Hz), but it rotates it backwards for the other half.

What am I missing?


texts: I have 5 Ni-Cd battery(1.2V 2200mAh). They connected in series. I have a 19 V 3.42 A adapter. Will it make a problem when I charge Ni-Cd batteries with my 19 V adapter? Is 19 V dangerous for charge Ni-Cd batteries?


texts: Current limiting solution for pocketqube satellite

texts:
A project I am working on requires a reliable current limiting solution for a pocketqube picosatellite.

Currently a Texas TPS2553 is being employed which will cut power once the limit is hit. We are concerned that this could enter the power supply into a never ending reset loop due to damage from radiation.

The maximum expected current, during a signal transmission is 135mA. The sleep current is 7uA.

We have come across depletion mode p-channel MOSFETS such as the Infineion BSS126 (application notes) which shows:

1) Is there a more reliable solution than the MOSFET Current limiter shown above?

2) Do these depletion mode p-ch devices have particularly high or low resistance to cosmic radiation?


texts: Relation between drift velocity & conductivity of a doped semiconductor

texts:
Here is the problem, and I am stuck.

  When an electric field with strength \$1 \times 10^3 \text{V/cm}\$ is
  applied to a p-type uncompensated Si sample at room temperature, the
  electron drift velocity, \$v_d\$ is \$ 1 \times 10^6 \text{cm/s}\$.

  Calculate the conductivity of this sample. (\$ q = 1.6 \times 10^{-19} \text{C}\$, \$ m_0 = 9.11 \times 10^{-31} \text{kg}\$, \$ m_{n,\text{Si}}^{*} = 0.26 m_0\$, \$n_{i, \text{Si}} = 1.5 \times 10^{10} \text{cm}^{-3}\$. The graph was from Solid State Electronic Devices, 6th Ed., by B. G. Streetman & S. K. Banerjee.)

I used the following equations : \$\sigma = q n \mu_n\$, \$\mu_n = - \dfrac{\langle v_x \rangle}{\mathcal{E}_x}\$.

I can find \$ \mu_n = \dfrac{1 \times 10^6 \text{cm/s}}{1 \times 10^3 \text{V/cm}} = 1 \times 10^3 \text{cm}^2/\text{V s} \$.
Using the graph, \$ n \approx 1 \times 10^{17} \text{cm}^{-3} \$.
Therefore, \$\sigma = q n \mu_n\ = 1.6 \times 10^{-19} \text{C} \times 1 \times 10^{17} \text{cm}^{-3} \times 1 \times 10^3 \text{cm}^2/\text{V s} \\ = 16 \text{C} / \text{cm V s} \\ = 16 \text{A s} / \text{cm A } \Omega \text{ s} \\ = 16 \text{cm}^{-1}\Omega^{-1}.\$

However, I don't know where the condition "p-type" should be used.
It is also strange that \$ n \gg n_i \$ even though it is p-type.
I thought the impurity concentration from \$ \mu_n \$ leads to the \$n\$ since it is not \$\mu_p\$, but is it wrong?
Or is my answer correct?
How to solve this problem correctly?


texts: Millman's Theorem 3-Phase, 3-Wire, Star (Y) Unbalanced Load

texts:
So I missed the lecture we had on Millman's theorem and I have tried to do a bit of research on it but I find several different versions of it. I have tutorial papers to do but they work on the basis of you knowing how to do them already basically practise papers. In the examples we have a generator connected to a 3-phase, 3-wire star unbalanced load with a line voltage of 400V. we are given the impedance values for the three phases in rectangular form. The question asks to find the voltage drops between the neutral points of the generator and load. My process to solving it is as below hoping someone can verify it.

Convert impedances from rectangular to polar form.
Work out admittance for each phase by:
$$
Y = \frac{1}{Z}
$$
Calculate phase voltage for each phase by:

$$
VP = \frac{VL}{\sqrt3}
= 230.94V
$$

And because no phase is given as a reference nominate a phase as a reference and set it's phase angle as zero and the subsequent phases 120 degrees apart.
 $$VA = 230.94V\angle0^\circ$$
 $$VB = 230.94V\angle-120^\circ$$
 $$VC = 230.94V\angle120^\circ$$

Now this is where I'm not 100% sure I seem to have two different versions on Millman's formula I suspect its the one below in which case I would just plug in the numbers in the correct polar/rectangular form.

$$VO' = \frac{(VAO \cdot YAO) + (VBO \cdot YBO) + (VCO \cdot YCO)}{(YAO + YBO + YCO)}$$

I can also appreciate that different notes/textbooks and articles I have found use different notation I'm trying to stick to the convention from which the note I do have.

So is this the way to work it out and is the Millman's formula I have correct?


texts:
Lets consider the following code, I want to make the b x for #2 whenever a changes
module test();
reg [3:0] a;
initial
begin
    $vcdpluson();
    a <=0;
    #5
    a <= 1;
    #5
    a <= 2;
    #1
    a <= 3;
    #4
    a <= 5;
end
reg [3:0] b;
always @(a)
begin
    b = 3'bx;
    b = #2 a;
end
endmodule

I am getting the following waveform from simulation

When a changes from 1->2 and 2->3, I expect the always block to get triggered(since the sensitivity list has only a). after #2 from 2->3 transition b should have become 3. But looks like after #1 b has become 3, it means the always @(a) loop didn't get triggered for the 2->3 transition of a. How to enable that ?


texts: Netduino Interrupts Affected By PWM - Diagnosis of Issue

texts:
I've got a funny problem with interrupts and PWM signals that's causing false interrupts to trigger. What exactly is happening is that I'm using a hardware debounced quadrature rotary encoder. The pulses from the encoder are connected to interrupts which then I can determine the direction of rotation. Pretty standard routine. This works fine on it's own.

Now, I introduce a PWM output into my project. In this case, lets say I am dimming an LED. I load my program and the led works fine. When I rotate the encoder one "click", It appears that  there are multiple interrupts that are triggered on the encoder..on the order of about 16 times the amount expected.

I've simplified the code all the way down and I've tried different different combinations of PWM and Interrupt pins and the response is always the same. The one bizarre thing I notice is that if I disconnect the jumper wire from the PWM pin to the LED, the problem goes away and the encoder starts behaving like it should. I'm baffled and can't figure out what's going on here?

How can I debug or test this? What's with the PWM jumper unplug and interrupts working properly? What does this sound like?

Also, I've asked this question on the Netduino and GHI electronics forums and haven't received any solutions.

simulate this circuit – Schematic created using CircuitLab

Actual Circuit:

Update: Based on the help in the comments, I've uncovered that there is some type of noise induced in the PWM jumper wires which affect the jumper wires connected to the rotary encoder. When the PWM jumper wires are near the encoder jumper wires, the problem condition exists. How to I eliminate this noise, other than keeping the jumper wires apart from each other. Furthermore, how do you eliminate this noise in the case of PCB traces?


texts:
New to conformal coating and would like some recommendations.

From what I've read, it seems like parylene would be a good bet since it is chemically stable, makes an excellent barrier material, has excellent thermal endurance, as well as excellent mechanical properties & high tensile strength. Does anyone personally have any experience with using parylene coating?


texts: Choosing usb-c earphones that are lossless?

texts:
I know the USB-C audio standard support multiple compression standards, some lossy, some lossless.

Can i control this in software or hardware ? how can i choose earphones that will guarantee lossless audio ?


texts: LTspice: when I turn a schematic into a subcircuit it behaves differently. Why?

texts:
I'm trying to model a low frequency LED flasher based on a BEAM Pummer (basically a pair of CMOS inverters wired as an oscillator, plus a charge pump) in LTspice. I have the base flasher circuit attached to a voltage source and LED output, and it seems to be working correctly, producing ~40mA current spikes through the LED every ~2s or so.

But when I try to make a .subckt definition with the flasher part only, and include that in a test circuit, it doesn't work correctly: I get a noisy µA-level output through the led wired to the output pins for a few ns, then the oscillator locks up.

The SPICE error log reports Singular matrix: Check node d:u1:6#int1 Iteration No. 19 which doesn't show up with the standalone version. I'm not sure how to find node d:u1:6#int1.
My initial guess was that a GND connection wasn't being made properly, but I tried to pass a ground reference through an external pin several different ways and it didn't made any difference.
There's a quirk in that I need to use a PULSE voltage supply with 100% duty cycle rather than a steady DC voltage in the standalone version, or the oscillator won't start. Could this be related? Setting the test circuit's voltage to PULSE didn't seem to make any difference.

What else might I be doing wrong? I've triple checked the .subckt netlist pin order against the order defined in the symbol file, and I'm pretty sure it's correct. The docs tell me that GND should already be globally connected. Is it a startup thing? Two inverters are wired in a chain to make the oscillator, do I need to explicitly set the input of one to 5V and the other to 0V at startup?

For reference, there's a zip file here containing the test schematic and the .sub and .asy definitions, as well as the standalone version of the flasher subcircuit to prove that it does actually work.

Any help greatly appreciated!


texts:
I recently explained to someone why USB before 3.0 must use polling as opposed to interrupts here. Basically, from my understanding of I2C, USB is also a master slave architecture sharing a cheap 1 bit, half-duplex bus, so the devices can't initiate  communication or else there will be collisions.

But then, I saw a diagram showing how USB devices are connected on a star shaped network. That seems to imply that the network is switched, meaning the connections aren't hard wired like a bus. This makes sense since loading a bus with 127 devices would make it incredibly slow.

But if it's switched?  that means they can avoid collisions by buffering packets. So why not let devices send interrupts?


texts:
Please excuse my inexperience in this matter.

I have purchased some new pick ups for my guitar but it appears the manufacturer of the guitar has opted for a proprietary method of connection rather than simple solder. With that in mind I have to add to the new pick ups I purchased a five pin molex plug and the female pins that sit inside the plug. How do I crimp the female pins to the new pick up wire? I have found crimping videos and am happy with that. It is the required tool I am in search of.

This is the pin I've purchased: http://www.molex.com/molex/products/datasheet.jsp?part=active/0500798100_CRIMP_TERMINALS.xml&channel=Products&Lang=en-US

I know there is a special molex tool I can buy that would be much quicker and easier to use but at $300 it's more than I paid for my guitar and it's likely I'll use it only once (for ten wires). If you can point me in the direction of a more generic tool or tell me what characteristics a tool should have (after all, I don't expect you to shop around for me) I'd greatly appreciate your help.


texts: How do I lower the amps without tampering with the voltage?

texts:
I have old speakers and decided to make them useful again by making then battery powered but I am new to this so I'm not 100% sure on what to do. In the speakers there is a small transformer which converts the 230 volts to 12 volts and 1.2 amps but I have two 12 volt 4.5 amp batteries which I am going to use in parrellel so that I get a longer battery life. This means I will have 9 amps coming from the batteries but I don't know how to reduce the amps without interfering with the voltage.
Thank you in advance.


texts: Science Fair Project: Weak Current Improves Seed Germination & Growth

texts:
My 5th grade son is doing a science project to show that a weak electrical current applied to a lima bean will help it grow faster than a lima bean grown with no current.  Following an experiment outlined on the web, he has two Styrofoam cups with garden soil and three lima beans each.  One cup has two 12" 18 gauge copper wires connected on one end to a 9 volt battery with alligator clips and the other ends are inserted in the soil.  He is supposed to water twice a day, connect to the battery for five minutes per day, and keep track of all inputs.  Hopefully the beans sprout in ten days and grow for six before the results are due.

The first time he connected to a new alkaline battery for three minutes and the battery got very warm.  Since then the battery has been connected as instructed but no longer gets warm.

I'm no electrical engineer, and the whole thing is just making me ask questions.  Any comments or insights would be most appreciated.

Does current automatically flow just by attaching two copper wires to the battery terminals?  The copper wires are not supposed to touch in the soil according to the instructions -- what if they did?  Does it matter if the soil is moist?  Can the amount of current that flows be measured without expensive equipment?  Can it be theoretically calculated with any reasonable degree of certainty?  How quickly will the battery be drained?

Sorry these are all rough newbie questions -- you can tell I'm out of my league!

Note added 2/18:  Thank you for all the wonderful comments, really helping me to understand what's going on.  Yes, the battery leads were touching, I'm sure that's what caused the battery to heat, fortunately no lasting harm done, lesson learned, and the battery still tests good on my battery tester.  I'm going to try to get a digital multimeter as suggested in several responses to answer the question about soil resistance and find out roughly how much current is flowing past those beans.


texts: Trouble understanding output impedance of common collector

texts:
I'm self-studying electronics. I'm currently following "The Art of Electronics" (p. 84, 2.2.5 Emitter follower biasing), helping myself with additional videos and tutorials as I go.
I'm stuck trying to wrap my head around the output impedance of the following circuit:

The input impedance looks really simple: It's just the resistance that the AC signal feels when getting into the circuit. I just have to follow the orange path in the following image to understand that it's going to be a parallel circuit made of \$R1\$, \$R2\$ and \$\beta\cdot Re\$ (because that's the impedance of a common emitter).
I have come across many sources that agree with this result.
Continuing with that idea, I would imagine that the output impedance is the resistance between the output and \$Vcc\$, because that's what limits the current that can be feed into the output. I have drawn this path in blue.

However, I see that in my book, it is stated that the output impedance would be \$Z_{out}=R_e||(\frac{Z_{in}||R_1||R_2)}{\beta})\$. I have not found sources on the internet that could clarify exactly how or why this result shows up. I have had trouble even finding articles about calculating $Z_{out}$ in this kind of circuit.

The question:
What is the intuition behind this result and how can I get there on my own?
\$Z_{out}=R_e||(\frac{Z_{in}||R_1||R_2)}{\beta})\$
EDIT: fixed equation transcription error as noted in comments.


texts:
I'm experimenting with the Colpitts oscillator, configured in the common base topology. Here is a picture:

In my own circuit, the coil is approximately 20 microhenry, and I've experimented with several values of capacitors ranging from around 10pF to 1nF.

I understand that the coil and the capacitors form a resonant circuit which has the output fed to an amplifier (here a common base amplifier). I also understand how common base amplifier works.

From oscilloscope measurements I've noticed that changing the resistor between the emitter of the transistor and ground (R1 in the picture) to a smaller value dramatically increases the amplitude of the oscillation. But I can't understand the reason for this!

Even though I understand resonant circuits and transistor amplifiers separately, I somehow fail to see exactly how the resistor affects the amplitude of the oscillation. In the common base configuration, the emitter is the input and the collector is the output. If we lower the emitter resistor resistance, more current would (according to my reasoning) somehow bypass the second capacitor.. And higher the voltage across the resistor, higher the input to the amplifier and therefore higher amplified output. But how does this all work? This could be a very simple thing but I've been trying to make sense of this all day but I still don't really understand why lowering the emitter resistor increases the output amplitude. I've also looked at the common base amplifier gain formulae but they all just show a collector resistor (which is not even present at this circuit).


texts: libmodbus trouble with reading from slave

texts:
I have the following code for connection to a temperature sensor as my slave using the libmodbus library in C,

#include <stdio.h>
#include <stdlib.h>
#include <modbus.h>
#include <errno.h>
int main()
{
  struct timeval old_response_timeout;
  struct timeval response_timeout;
  modbus_t *ctx = NULL;
  int rc = 0;
  uint16_t tab_reg[64];
  int i = 0;
  int slave = 0;
  int connected = 0;
  int serial = 0;
  ctx = modbus_new_rtu("/dev/ttyS1", 9600, 'E', 8, 1);
  if (ctx == NULL) {
    fprintf(stderr, "Unable to create the libmodbus context\n");
    return -1;
  }
  modbus_set_debug(ctx, 1);
  modbus_get_response_timeout(ctx, &old_response_timeout);
  response_timeout.tv_sec = 10;
  response_timeout.tv_usec = 0;
  modbus_set_response_timeout(ctx, &response_timeout);
  modbus_set_byte_timeout(ctx, &response_timeout);

  slave = modbus_set_slave(ctx,247);

  if(slave == -1)
    printf("Didn't connect to slave/n");

  connected = modbus_connect(ctx);

  if(connected == -1)
    printf("Connection failed\n");
  if(connected == 0)
    printf("connected\n");
  //serial = modbus_rtu_set_serial_mode(ctx, MODBUS_RTU_RS485);
  //if(serial == -1)
  //  printf("Didn't set serial mode/n:%s\n",modbus_strerror(errno));
  rc = modbus_read_registers(ctx,0x27,2,tab_reg);

  if (rc == -1) {
  fprintf(stderr, "%s\n", modbus_strerror(errno));
  return -1;
  }

  for(i=0;i<rc;i++)
    printf("degrees %d\n", tab_reg[i]);

  return 0;
}

It fails in the following section of code,

  rc = modbus_read_registers(ctx,0x27,2,tab_reg);

  if (rc == -1) {
  fprintf(stderr, "%s\n", modbus_strerror(errno));
  return -1;
  }

with a connection timeout. could this be due to me setting up the connection to the modbus device the wrong way, or are there any libmodbus library problems anyone knows of that could be causing this? I am using this device http://www.epluse.com/en/products/humidity-instruments/humidity-measuring-modules/ee071/ on Redhat Linux 6.5.


texts: MAT12 matched pair transistor substrate connection

texts: On Analog Devices' MAT12 data sheet, there is a note (see on the top right, note #2) saying that the substrate, which is connected to the case, is usually connected to the most negative circuit potential. Since there is no pin connected to the substrate (or to the case), how do I connect the substrate to the most negative circuit potential?


texts: how do you remove heat from a ceramic heat exchange heatsink

texts:
I have a ceramic heat exchange chip(10m x 10m).  I know you are suppose to lay this on the chip, and lay a heatsink on top of that.

What is the best medium for connecting the heat exchange to the chip and to the heatsink?

I would guess thermal paste.

further explanation:
I need a heatsink on a Motor driver chip. the chip is 5mm x 5mm.  The more heat I pull off of it the more current I can drive.  so I'm transferring the heat to a 10mm x 10mm heat exchange and then applying a heat sink


texts: No output voltage from TI DAC chip, with stm32F7

texts:
I am using DAC60508 with my STM32F7, 60508 is 12 bits precision, and with 24 bits command-length, SPI interface. After initialize the SPI, I send 3 bytes separately, and I use a oscilloscope to check the wave of SCL, SDI, CS, it seems right, but I can’t detect any output votage.
This SPI2 code demonstrated working with another thermal chip.

        static void MX_SPI2_Init(void)
         {
          LL_SPI_InitTypeDef SPI_InitStruct;

          LL_GPIO_InitTypeDef GPIO_InitStruct;

          /* Peripheral clock enable */
          LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_SPI2);

          /**SPI2 GPIO Configuration
          PC2   ------> SPI2_MISO
          PC3   ------> SPI2_MOSI
          PB10   ------> SPI2_SCK
          */
          GPIO_InitStruct.Pin = LL_GPIO_PIN_2;
          GPIO_InitStruct.Mode = LL_GPIO_MODE_ALTERNATE;
          GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_HIGH;
          GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL;
          GPIO_InitStruct.Pull = LL_GPIO_PULL_NO;
          GPIO_InitStruct.Alternate = LL_GPIO_AF_5;
          LL_GPIO_Init(GPIOC, &GPIO_InitStruct);

          GPIO_InitStruct.Pin = LL_GPIO_PIN_3;
          GPIO_InitStruct.Mode = LL_GPIO_MODE_ALTERNATE;
          GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_HIGH;
          GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL;
          GPIO_InitStruct.Pull = LL_GPIO_PULL_NO;
          GPIO_InitStruct.Alternate = LL_GPIO_AF_5;
          LL_GPIO_Init(GPIOC, &GPIO_InitStruct);

          GPIO_InitStruct.Pin = LL_GPIO_PIN_10;
          GPIO_InitStruct.Mode = LL_GPIO_MODE_ALTERNATE;
          GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_HIGH;
          GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL;
          GPIO_InitStruct.Pull = LL_GPIO_PULL_NO;
          GPIO_InitStruct.Alternate = LL_GPIO_AF_5;
          LL_GPIO_Init(GPIOB, &GPIO_InitStruct);

          /* SPI2 parameter configuration*/
          SPI_InitStruct.TransferDirection = LL_SPI_FULL_DUPLEX;
          SPI_InitStruct.Mode = LL_SPI_MODE_MASTER;
          SPI_InitStruct.DataWidth = LL_SPI_DATAWIDTH_8BIT;
          SPI_InitStruct.ClockPolarity = LL_SPI_POLARITY_LOW;
          SPI_InitStruct.ClockPhase = LL_SPI_PHASE_2EDGE;
          SPI_InitStruct.NSS = LL_SPI_NSS_SOFT;
          SPI_InitStruct.BaudRate = LL_SPI_BAUDRATEPRESCALER_DIV256;
          SPI_InitStruct.BitOrder = LL_SPI_MSB_FIRST;
          SPI_InitStruct.CRCCalculation = LL_SPI_CRCCALCULATION_DISABLE;
          SPI_InitStruct.CRCPoly = 7;
          LL_SPI_Init(SPI2, &SPI_InitStruct);

        //  LL_SPI_SetStandard(SPI2, LL_SPI_PROTOCOL_MOTOROLA);

        //  LL_SPI_EnableNSSPulseMgt(SPI2);

        }

        LL_SPI_SetRxFIFOThreshold(SPI2, LL_SPI_RX_FIFO_TH_QUARTER );
         while(1)
         {
              LL_GPIO_ResetOutputPin(SPI2_NSS_GPIO_Port,SPI2_NSS_Pin); //CS
             SPI_SendByte(0x08);    //Output 0 Address
             SPI_SendByte(0xff);    //Data MSB 8 bits
             SPI_SendByte(0xf0);    //Data LSB 4 bits
             delay_us(120);
             LL_GPIO_SetOutputPin(SPI2_NSS_GPIO_Port,SPI2_NSS_Pin);  // CS
             delay_ms(50);
         }

        unsigned char SPI_SendByte(unsigned char byte)
        {
            while(LL_SPI_IsActiveFlag_TXE(SPI2)==RESET);
          LL_SPI_TransmitData8(SPI2,byte);

        //  while(! (LL_SPI_IsActiveFlag_RXNE(SPI2)));
        //  return LL_SPI_ReceiveData8(SPI2);
        }

DAC60508 Datasheet


texts: RF: what are some sources that are transmitting few hundred of watts signal power?

texts:
I am looking for some source (TV broadcasting station, or cellular tower,etc)  that transmit a few hundred watts of power. (Just typically please).

Please give me some idea to get me started so I can do a little bit research on my own. (Actual, TV broadcasting station doesn't count because it typically transmitting megawatts, MW).


texts: Answering landline calls with an Arduino

texts:
How can I connect an Arduino to a phone line such that, when a call rings, the Arduino will 'answer' and be able to respond with (touch) tones and, if possible, 'hear' touch tones as well for 2-way communication? Is it possible to only answer on double rings?
I saw this page on a similar topic, but that does not describe answering with an Arduino.


texts:
I'm working on a little circuit to place on a vehicle, the expected functionality is to add a kill switch that when pushed it will stop voltage to my load, in the schematic i represent it with a bulb. For it to work again the vehicle should have to ignition off and on again. the following schematic works ok with the following exception. if I do not press the kill switch my load will also stop having voltage once my ignition is off(this is only desired when the switch is pressed, the ignition on is the event where it resets back to on).

simulate this circuit – Schematic created using CircuitLab


texts:
I am designing a system that uses a large amount of power.  The MOSFET will be to turn off the batteries when mains is in use.  The FET will therefore be on or off.  No pulsing.
The voltage will be between 34.5V and 20V with about 30A max of current draw.

Can someone please explain what I need to look at when choosing the correct FET or if there is a better solution.  The driver IC I am planning to use is the LTC4414.  Any help or recommendations are more than welcome.  I know that I need a P-channel MOSFET But I am unsure of what specs I need to actually choose one.

simulate this circuit – Schematic created using CircuitLab


texts: I am working with a zinc air battery (emf 1.3 V). I have plugged a resistance of 100 ohm to this battery and I have recorded the voltage at the battery. When the circuit is opened, the voltage is 0. When I have closed the circuit, U(battery)=-U(resistance)=Ri=emf-ri so i=emf/(R+r) and U(resistance)=R*emf/(R+r). According to the last formula, the current should have a constant value but on my experimental graph, the current is slightly decreasing (as you can see on the graph)... could you explain this phenomenon ?


texts: Identify Symbols on Circuit Diagrams for VHF Radio Build

texts:
I found these circuit diagrams for VHF transceiver online, and am having trouble recognizing a number of the symbols. Would you please help me identify the boxed symbols?

Here's what I've got so far:

Drawing #1 (original image link):

The red box with CLK should refer to clock, but I don't know which type or if it even matters. Completely clueless on the blue box with L12.

Drawing #2:

I think that the red boxes labeled CuAg and CuL are likely wire coils of copper/silver and enameled copper wire respectively. The blue box appears to be a transistor of some kind but I don't know which and googling the label (looks like 25k1904) has gotten me nowhere. The yellow boxes should be inductors with a ferrite core but I don't understand the VK200 labelling. The purple box I'm thinking is a trimming potentiometer? The brown boxes are diodes but not sure if the 12V is referring to a specific type or just that they are connected to the 12V GND. And the green box is a switch ('preklop' translates to 'switch' from Slovenian) but RX izhad and +VRX are throwing me off there.

Drawing #3:

The pink, red, yellow, and orange boxes look like relays, but I have no idea wha kind. The blue box is a straight up mystery as is the green.

Lastly, was going to use Amazon & a local RadioShack to track down most of the items, but if y'all have any sourcing tips for small electrical components, they are all welcome.

Thanks in advance for any and all help!


texts: What is the usefulness of Internal Stability?

texts: In the analysis of a feedback control system is it important that a sub-network be itself stable.  i.e. if I were to break apart the main complex system and just study a single feedback loop, is it significant that that sub-network be stable itself or does one just consider the whole larger network?.


texts: How to increase memory on the FPGA board?

texts:
Situation

I'm running a driver code driver.cc on the FPGA board (PYNQ-Z1) but it gives an error in the middle of the code where the code calls to cma_alloc(size, cached) function, which returns a NULL pointer after a few runs. I believe this is because the board doesn't have enough memory because the board has only 512 MB of DDR3.

To be more specific about the environment:

The driver.cc is running on the processing system (PS) of the board, which is an ARM Cortex-A9 processor.
The OS Linux is booted from a microSD card (8 GB) loaded with image from this GitHub repository.

Question

What are some possible ways to solve this problem, or to increase the memory?

Note: I have read a similar question before but the answers weren't quite clear to me. Also, to be more specific and to answer duskwuff's comment in the previous question, I have includeed information about the PS/PL and the OS setup environment.


texts:
UPDATE:

If your MOSFET (or other chip) does not behave well AND you bought from not-really-known seller (even if his/her positive feedback ratio is over 99%) for a very competitive price, MAYBE you got a "factory FAKE" item (means: intentionally produced as FAKE in factory).

This realization took about 3-4 nights to me, because I just started using MOSFETs.... very VERY VERY big eye opening experience.

Original question:

I checked "MOSFET does not turn off", or even "does not turn of totally" related topics.
There the solution was usually or other (parasitic way of power), or MOSFET driving problem.

I thought I understand MOSFET (voltage driven and which voltage counts), however I faced the same problem with 2 different simple circuits, so likely  I missed something regarding MOSFET basics.

What I wanted to achieve: driving a 12V LED strip (draws about 2A).

1st I used P channel MOSFET - as switch.
It was working, BUT very often the LED strip lightly dimmed and vibrated (MOSFET ON was OK, OFF was not perfect).
I read somewhere P channel MOSFET gate needs little higher voltage than source to surely turn off..

In both circuits I created them in simulator (drawings came from there), so V1 (dataIN pin) is coming from a 3.3V microcontroller (which I realized only in 2nd circuit).

So I discarded that circuit and made a simpler one with N channel MOSFET:
(after taking apart, I checked the P channel MOSFET and .... just now I saw a Youtube video regarding real and false MOSFETs: Youtube regarding REAL and FALSE MOSFETs )

BUT
This 2nd circuit does exactly the same.
I moved the pin to a PWM capable pin, so now I can dim the LED strip nicely, I can switch on the LED strip as well, but when I switch it off it "starts" to dim very lightly and "blinks" randomly. Again, I can make steady 5%-100% LED power and works nicely, but with 0-1% (I am interested in 0%) it does not switch off firmly.

In 2nd N channel MOSFET circuit I also checked the voltages:

logic high = 3 V (MOSFET gate), MOSFET DS = 0,2V - works as expected (however MOSFET datasheet states 2-4V is needed to turn on fully).
Logic low = 0,2V (MOSFET gate), MOSFET DS = 5V (7V drops in LED). I shorted R3 (150 Ohms) to make things even simpler. When LED strip started "very dim blinking", I even shorted gate to source (with multimeter) - blink continued and I measured about 1mA <- THIS when I decided to ask help, because this ruined everything I imagined.

I have to admit, that my power source is far from perfect, 2A drain in 12V made it 11,5V, but obviously does not make few volts spikes etc.

Very rarely I achieved the "total off" state (without modifying everything), but within few mins - few hours I got back the low light & blinking LED strip. I was thinking to make some capacitor to eliminate any ripple (if any).

The dataIN is about 50 cm wire, LED strip is 2-2,5 meters, wire to LED strip is about 1 meter. Again, I shorted (in 2nd circuit during logical low dataIN) gate and source - without reaching the desired TOTAL OFF.

P channel MOSFET is: IRF9540N
N channel MOSFET is: IRFZ44N

I know both has a diode between source and drain (connected as reverse bias), but as I heard it is a byproduct of the MOSFET production and should not make any trouble here.

If anybody could help me:

Why MOSFETS does not turn totally off in the above 2 circuits.
How can I modify them (currently I have the lower circuit only, but I can recreate the 1st circuit if the solution is there).
I added this question finally (after realizing that very likely I inserted a fake MOSFET from China to my circuit) - could be this my problem is? Therefore my 2nd circuit should not able to turn ON a real MOSFET or at least it is very borderline (as stated in datasheet).


texts: Can I use Minecraft redstone to teach digital circuits?

texts:
I'm sorry if this question is off-topic. If it is, I would be thankful to know at which StackExchange site I should ask this question.

Let me say first, I never played Minecraft myself. But I heard you have something in this game called 'Redstone', with which you can implement logic gates like AND & OR. I read you make this quite complex, making full adders and ALUs. To me, it seems like a fun way to teach (the basics of) digital circuits.

My question is, do they behave similar to real logic circuits, or at least of ideal version of real logic circuits? Are there any important difference in functionality I have to know? And are there other people that use this game for this purpose?

I'm really intereseted in the answers. Thanks in advance.


texts:
I'm working on a project that uses a Atmega329 with a 2 digit lcd 7 segment display. It needs to keep track of days, using a small coin cell battery.

I originally planned on using the on board clock, as the accuracy doesn't have to be great, I'm fine with a couple hours each month off.

Doing some testing, I noticed that it is off by up to a few seconds every minute (this is used in varying temperatures). So I need an external clock source.

Should I use a higher frequency crystal and clock it down internally? Example: 16Mhz crystal, using a clock speed of 8 or 4 mhz to save battery life. Or should I use a 8Mhz crystal and keep it at that speed?

Would a ceramic oscillator have enough accuracy and temperature stability to use? I'll be going from 0c to 25c

Thanks


texts: What frequencies blow out the speaker most?

texts:
If you were to put - 5W speaker to 10-15W amplifier which - bass or treble will most likely damage it first?
  From what I've heard and learned - boosted bass makes speaker move back and forth and if that moving energy is too big for the speaker to handle it may rip.
  On the other side, boosted high frequencies generate more heat in the tweeter and it may overheat*.

One more interesting thing I found, is that it is generally better to put a 5W speaker to 10W amp instead of 5W speaker with 5W amplifier which is starting to clip because square sound waveforms (distortions) put much stress into a speaker and it starts generating heat if the clipping is too much. It may even catch on fire! While 10 clean watts give 'natural frequencies which don't put as much stress (peaks) and is easier on the speaker even though it's louder.

I think this is an interesting topic to know about.


texts: Does fibre optic cable bandwidth stack over the length of the cable?

texts:
If the maximum data bandwidth is sent down a fibre optic cable, constantly, maxing out the cable's capacity, how much data is in transit over any given distance?

Perhaps I have an incorrect understanding of how this works, but I assume that the data packets are sent one after the other, in a line down the wire, not one at a time, so if a wire has a 1000GB/second bandwidth, it can have many of these terabyte 'seconds' going down the same wire at the same time.

Is this understanding in any way correct? If so, how much data can a fibre optic cable have in transit over x distance if sending maximum capacity throughout the length of the wire?


texts:
My question is indicated in the title: What is the relation between delay of a digital FIR filter and step response of it?

Is the delay equal to the stablization time of the step response of the FIR?


texts: How to make a passive linear circuit to generate high voltage spikes from 10V peaktopeak square wave with a source res. of 50Ω, with f less than 5MHz

texts:
How to implement a passive linear cırcuıt to generate high voltage spikes from 10 volt peak to peak square wave with a source resistance of 50Ω with some f (freq) less than 5MHz.
Peak value, Vp, of the voltage spikes must be 20 Volt ≤ Vpeak ≤ 25 Volt . Full width at half maximum must be less than 100 nanoseconds (∆t < 100ns).
There is no necesseary of spikes to be shaped like square. We can assume rise and fall times of square wave are 10 nano seconds
Important:spike duration should be much shorther than input period
How can implement such a circuit (I'll do in LTspice) ?


texts: Relay from door sensor to laptop usb port?

texts:
I want the opening of the front door to launch a script on my laptop.  I looked around on the internet and only found relays that allow you to send commands to external devices such as alarms and thermostats via usb, but not the other way around.
Can anyone point me in the right direction?  If not, what about making my own pcb with input from the door sensor and a micro-usb port connected to whatever processor I would use.  Could take me weeks since i have zero idea what I'm doing but it might be a useful skill.  Even better would be some hardware that would do this for me ....  I'm thinking any system event resulting from input to the usb port that could be made to happen would launch my script assuming the script could detect/sniff it.


texts: How can I create a long (10 second) pulse from a short active pulse?

texts:
So let's say I have an incoming signal: 1 clock cycle from a ~1-100 MHz (50 MHz for this example) clock domain. And I want to drive an output that must be active high for 10 seconds for each time the incoming signal is active high.

There is no check needed for multiple pulse from the input.

My only two ideas is to use multiply clock dividers that will stretch the input pulse.

so x ns active high turns to 2x ns active high, 4x ns, 8x ns....
It will take tons of DFF and inverters.

My second idea, is just toggle the output high, count 10 seconds, and de-assert low. If I have a few 16-bit counters, this should take around 120 DFFs. (50 MHz => 20 ns period)
So the incoming active high pulse will trigger the output high and start the counter until it hits >10 seconds (does not have to be accurate).

Which one would be a better implementation (in terms of least DFF used)?


texts: Convert square pulse with 24-volt amplitude to square 5-volt amplitude

texts:
Can anyone help me to make a circuit to Convert square pulse with 24-volt amplitude and has an variable offset voltage to square 5-volt amplitude and offset = 0 ?
I need to take a 24-volt amplitude square pulse with offset sometimes from 0 levels and I need to convert it to a 5-volt without any offset to able to enter it into Microcontroller.
Offset will be vary from 0 to 3 Volt on the signal.
frequency range will be from 0 to 10 Mhz
Thanks,


texts:
I have an old system board for a pinball machine that I'm fixing up.  One of the ROMs is failing post.  The reason is because the 27S256 EPROM never had the sticker applied to the window, and due to a series of circumstances the EPROM wasn't touched for several years so it became altered via incidental lighting.

My question:
Is it safe to replace this part with a CMOS part of the same Pinout and type?  Is it safe to mix Schottky and CMOS?

Please correct any factual errors in the above.  A little new to this.

EDIT:  it's not a 27S256, it's a HN27256G-25.  I couldn't read correctly.  According to some googling it is an NMOS part.  Can I mix NMOS and CMOS


texts: Suggestions for dropping resistor on LM78 regulator

texts:
I’m trying to repair a magnetic stirplate (see http://staff.washington.edu/wbeaty/chem_stir.html). I found that in one part of the circuit it fails to deliver 12V. I’ve draw part of the circuit below:

The bridge rectifier outputs ~43V (left part of the circuit). The zener diode is probably a BZX84-C33, which is 33V and rated at 300 mW (as I could read the marking WT6). The voltage regulator is a LM7812 with quite a heatsink on the back of the PCB capable of delivering 500 mA at 12 V output (Vo), with a maximum input of 35V (Vi).
The problem is that I cannot read the etched markings on the dropping resistor (R1) anymore, with a multimeter it currently gives 20k Ohm, which seems not to fit (it looks a bit burned, so it could be part of why the circuit is not working, I'm also replacing the Zener and the LM78).
I calculated 1.1 kOhm for R1 and wanted to understand whether this is correct?
$$ I_{max, Zener D1} =  \frac{P_{max, ZenerD1}}{Vz} = \frac{0.30 [W]}{33 [V]} = 9.1 [mA] $$
$$ R_{min,R1} = \frac{Vsource-Vz}{I_{max, Zener D1}} = \frac{43[V]-33[V]}{9.1[mA]} = 1.1 [k\Omega ] $$
edit1:
I’ve added an annotated photo of the board front and back showing the place of R1, which seems to be a 1206 package type. On the back you can see the ‘heatsink’ of the LM78 (which is shared by another voltage regulator). The D1 and C2 are soldered off and I replaced C3.

Edit2:
From the answers I realised, I interpreted the Zener diode wrong as regulator instead of protection of over voltage.
I also understand from @glen_geek the R1 needs to be chosen such that the Vin on the LM78 is > 14V but also lower than <35V (max rating). And this depends on the load behind the LM78.  So I calculated for various current through the LM78, at a set of given R1 (RSeries) from 20 to 140 Ohm what the Vin on the LM78 would be.

In green it shows the acceptable bounds 14<Vin<35 [V].
Regarding the load behind the LM78. I haven’t followed all the traces, but it seems to be powering 4 small ICs and the ability to power an external temperature probe (but a 1K ohm is in series, so max 12 mA from that part).


texts: Is it right to initialize a reg in verilog and apply condition with initial value of reg in Verilog?

texts:
I have the little doubt related to initializing condition in Verilog.
Like in given statement:

module rf(out1,ack,en,a,f,c,d,e,clka);
  input [7:0] a,f,c,d,e;
  input clka, en;
  output reg [7:0] out1;
  output reg ack;
  reg[7:0] b[1:5];
  reg [1:0] first=0; reg [2:0] k;

initial begin
  for (k = 1; k <6; k = k + 1) begin
    b[k] = 0;
  end
end

always @(negedge clka) begin
  if (en==1) begin
    if (first==0) begin
      first<=1;
    end
    if (first==1) begin
      first<=2;
      b[1]<=a;
      b[2]<=f;
      b[3]<=c;
      b[4]<=d;
      b[5]<=e;
    end
  end
end
endmodule

I initialized reg first =0 ; Is it right ? As it is giving right result after simulation but is there any problem when we will synthesize it? I used the first condition because I wanted to execute statements written within (first == 1 ) execute after one clock pulse.
Is it the right way? If not then what should I do if I want to execute few statements after one or two clock pulse ?
Hope I explained my confusion clearly.
P.S :

module median_five_sh(out1,ack,reset,a,f,c,d,e,clka);
input [7:0] a,f,c,d,e;
input clka,reset;
output reg [7:0] out1;
output reg ack;
reg en0,en1,en2,en3,en4,en5,en6,en7,en8,en9;
reg[7:0] b[1:5],tmp;
reg first;
reg [3:0] i1,i2,n1,k;

initial begin
            for (k = 1; k <6; k = k + 1) begin
            b[k] = 0;
            end
end

always @( posedge reset) begin
en0<=0;en1<=0;en2<=0;en3<=0;en4<=0;en5<=0;en6<=0;en7<=0;en8<=0;en9<=0;
first<=0;
i1<=0;i2<=0;n1<=0;k<=0;
tmp=0;
end

always @(negedge clka) begin
if (reset==1) begin
statement;
en0<=1;
en1<=1;
.
.
end
end
endmodule

The above code is simulating and giving correct output but it is giving the error after synthesis.
**Error:  Signal en0 in unit .... is connected to following multiple drivers:
* I wanted to execute statements written in  always @( posedge reset) only once while initially. Basically its initialization of variables used in later statment.


texts: Measure AC power consumed by a loudspeaker

texts:
I'm interested in measuring the efficiency of a loudspeaker.  I have tools to measure the SPL in dB.  However, the electrical efficiency has me a little puzzled.

The speaker has a voltage applied:  \$V_{spk}\$.  It also has a resistance:  \$R_{spk} = 8 \Omega\$.  However, it should also have an inductance, giving it a complex impedance.

What is a simple way to measure the electrical power consumption?  Do I need to measure the inductance and compute the current?  Won't putting a resistor in series to measure current with an oscilloscope probing the resistor cause both grounding problems and change the overall impedance and power consumption?

This must be done in industry all the time... shouldn't there be an easy way?


texts: Can I solder a wire to a PCB without a soldering iron?

texts:
I have a jbl clip 2 here which is not charging. I opened it up and saw that these 2 wires were poorly soldered and the red one was not even touching. So in the end I was left with these two unconnected wires, i don't have a solder I was wondering if I could glue them to their place?  I tried heating screwdriver and tried to heat the old solder but it didn't work.

EDIT: How can I solder such a tiny piece then?


texts: In a non-inverting op-amp, why is it R1/(R1+R2) instead of R2/(R1+R2) in this circuit?

texts: So, why is r1 used in the above formula instead of R2?


texts: How does a zener diode and a resistor regulate voltage?

texts:
I'm having trouble understanding the simple voltage regulator that can be built using a zener diode (from section 2.04 in the Art of Electronics).  I know that it would be better to use amplifiers, et cetera, but I'm just trying to understand how this circuit works.

I don't really understand how the circuit works, but I am guessing that when a load is applied to the output, it drains current from the source (Vin) and thus causes the voltage to drop?  How does the zener diode help to maintain the voltage and thus make this circuit act as a regulator?


texts: Parallel MOSFETs to get more current (40A adjustable current source)

texts:
In my previous question about an adjustable constant current source, I was advised to use an Op-Amp and a MOSFET to generate a current source that I could adjust with a variable input voltage.

The goal is to test some fuses (normal operating current and time/current to fuse). To do this I would need some 50A (at least).

Here is the original suggested circuit:

(Image source: Learning about Electronics)

The resistor would be replaced by a much lower value (in mOhm to handle to high current). To avoid thermal problems, I'd like to parallel MOSFETs (4 devices). Shall I use one Op-Amp per MOSFET (replicate the whole circuit four times) or shall I use only one Op-Amp?

I think I understand how the single MOSFET circuit works, but I'd need some help to scale it up and avoid me toasting my poor single MOSFET with 40A DC !!

The idea would be to use a car battery as main power source. Vdd around 12V and plenty of amps!


texts:
This is a Dark Detecting LED light schematic I found here

Few Questions(As I'm new to electronics),

Can I use this circuit with a 6v input ?
When there is light on the LDR(Photo-resistor) curent will flow
through R2 and PH1 (LDR) right ? So when there is light power will
be wasted ? If so, how many Ma(Mili-amperes)?
What to change if I want to use a 5v led(70ma @ 5v while input is 6v as stated in question No.1. It's 4Leds removed from a torchlight) ? (The resistor values)

Edit : I edited the questions after "Peter Bennett" answered.

Edit: I (Peter Bennett) edited my answer after the OP's edit.


texts: Interfacing a piezoelectric pressure sensor with a microcontroller

texts:
I'm working on monitoring injection molding process pressure inside the mold. The pressure range is expected to be between 1500 - 3000 bar. The mold temperature is expected to be around 100C while the melt (plastic) temperature can go up to 300C. While looking for sensors that can operate under these conditions I found piezoelectric pressure sensors like this one that can operate under these conditions.
However, since these sensors are piezoelectric, I understand they require a charge amplifier to convert the small amount of charge output from the sensor into a voltage that is readable by a microcontroller. I found a charge amplifier like this one on digikey though it is not stocked. These charge amplifiers seem extremely expensive. Would using these expensive charge amplifiers be the only way to read a piezoelectric pressure sensor? Would designing a charge amplifier circuit using op-amps be a feasible option?
I have looked at some piezoelectric pressure sensors which have an inbuilt charge amplifier circuit, but since they have the electronics in them their operating temperature drops below the requirement.
It would help a lot if someone could guide me down the right path or point me to some resources I could look at. Are piezoelectric pressure sensors the right choice for injection molding applications or am I looking at the wrong type of sensors?


texts: RPI with power supply alternating between Li-ion battery pack and DC 5V

texts:
I have a Raspberry Pi model B+ and I've been trying to design a solution so that I can switch power supply without having to shutdown.

The idea is this:
I have 2 li-ion 18650 batteries with protection board(DW01+) which disconnects the batteries when they reach a lower threshold of 2.4V and an upper threshold of 4.3V. I want to connect those in parallel to a step-up power converter (mt3608) which will give a steady output of 5V to power the Raspberry Pi.

I also have a charger circuit TP4056 which can supply up to a maximum of 1 Amp that I want to connect to the battery pack. The Pi requires around 0.56 A and 5V with a few peripherals connected but I want to supply extra power for whenever it might need it.

When I have access to an electric outlet I want the battery pack to be disconnected and the Pi powered with a 5V 2.1 Amp DC adapter. I want it to power the Pi and at the same time charge the battery pack and if I disconnect the DC adapter it should switch back to running of the battery pack again without the need to shutdown first. The reason for this is that I want to use the full capacity of the charging circuit to charge the batteries and because I haven't found a suitable charger that can supply a higher current than 1 Amp.

Is it possible to do this with mosfet transistors to switch on and off the inputs?
I thought of using a relay to switch between the power supplies but that's too slow and would require a big capacitor as I understand it. Every solution I can think of seems to require a diode but that would lower the voltage below the threshold for what the Raspberry Pi accepts. I should also add that my knowledge of electronics is a bit limited.

Edit:
This schematic is far from pretty but maybe it helps to show how I want to connect things. I put two transistors in the schematic but part of the problem is that I don't know where I should connect the gates.

Edit 2: Added clarification about the batteries, the power converter and about my goal.


texts:
I have a system comprised of a wireless sensor which transmits temperature readings to a main base.

The wireless sensor system is made up of:

12F683 pic to take the temperature reading (manchester encoded)
RF Solutions AM-RT4-433 transmitter to transmit the data
Currently on a small bread board (proto board) with a 1/4 wavelength wire acting as an antenna

The manchester encoding is:
0 = 10 and 1 = 01 for a total time of 416 micro seconds (each low and high is 208 micro seconds)

The receiver base is made up of (all on bread board again)

RF Solutions HRR30 receiver with a 1/4 wavelength wire for the antenna
mbed microcontroller which decodes the data from the receiver and looks for a short sync pattern and then receives the data packet (sync patter is 15 1s followed by a 0 and then the data begins)

This all works fine when transmitting from one side of my desk to the other (1-2m) but once I move the transmitter to another room it becomes very unreliable. The remote system currently takes a sensor reading, then powers up the transmitter to send the data and then powers down the transmitter once transmitted - I can get some transmission at increased distances by increasing the number of times the data packet is transmitted from 1 to 5 with a short delay between them.

This sort of works but it is still not very reliable. Both boards are running from 5V.

Any suggestions on where to look for issues would be great. I assume that using bread board and whip antennas is not great but I would have expected the range to be more than 2 meters - maybe I'm wrong?

I know that other frequencies than 433 MHz might serve me better and I have used the RFM12B transceivers but I would like to stick to these components for now.


texts: I've been looking at getting some 3.5 mm audio jacks for a project I'm working on and these seem to be the best: http://www.switchcraft.com/productsummary.aspx?Parent=529  The problem I'm having is that I don't know which is better for my application.  I'm looking at 35RASMT2BHNTRX which is a dual open jack v.s. 35RASMT4BHNTRX which is a dual closed jack.  If I use the dual closed jack can I use those switches to detect that an audio cable is present?


texts:
The general and simplified view of my circuit is something like that:

Using a microcontroller I want to select between two sound signal sources (S1 or S2). S1 is a signal that comes from a microphone (low voltage), S2 comes from an Arduino microcontroller (0-5v). When connected, the signals are aplified and transduced to sound waves by means of a speaker.

I've tried to use a conventional Relay but when switching it creates a spike that is amplified and can be heard. I want a silent switch.

The signals S1 and S2 are never simultaneoulsy "on", so another possibility would be something like that:

Where a device (triac) blocks (opens or closes the circuit), the triac could also be controlled by 5v from the microcontroller. A diode could be placed to block the signal and protect S2.

Looking to a device that could achieve that I found the Solid-State relays and the TRIACs. After trying to understand the differences between them and which could be the most suitable for this application I still have some doubts.

Which scheme and device would you use?


texts:
I'm trying to create a device that will control a few independent RS485 lines using single USB port.

My first idea was to use GL850G usb hub controller (4 downstream ports), 4x FT232R, 4x MAX485. I had to provide 12MHz clock source for both hub controller and FT232R.

Should all those devices use single clock source? Why? Why not?

I started my design with common universal clock generator (sg-51 at 12MHz), but FT232R requires 5V level on clock input while GL850G requires 3.3V

So maybe there is a way to shift 5V clock source to 3.3V?
If not - should I:

use crystal for GL850G and common clock generator for FT232R
use five independent crystal oscilators
use crystal for GL850G and internal oscilator for FT232R

What are disadvantages of using internal oscilator?

If stability not cost is the key - how should I do it?


texts:
I am trying to identify an IC which is marked as follows:

20071
B1400

It is a 10 pin IC. It is a photoflash capacitor charging IC. It likely has an IGBT driver integrated as well. I've had no luck with google (I have in the past) and I don't know where else to search with this limited information. The IC measures 2.5mm x 2.0mm (~.080"x.100").

EDIT:

I have found that this particular part is used in many cameras according to this site. Seems it is quite common...


texts:
Most articles I am able to find which are essentially "I2C for dummies on XXX microcontroller" suggests blocking CPU while waiting for confirmation events. For example, (comments and description are in Russian, but that actually doesn't matter). Here is the example of "blocking" I am talking about:

I2C_GenerateSTART(HMC5883L_I2C, ENABLE);
/* wait for confirmation */
while (!I2C_CheckEvent(HMC5883L_I2C, I2C_EVENT_MASTER_MODE_SELECT));

These while loops are there after each operation, essentially. Finally, my question is - how to implement I2C without "hanging" MCU with these while loops? On a very high level I do understand I have to use interrupts instead of whiles, but I can't come up with any code example. Can you please help me with that?


texts: What's the best way to debounce a slider switch?

texts:
I'm really struggling with a VHDL implementation of a debouncing circuit for 2-position slider switches.I had initially planned to use an SR latch to do this but couldn't figure out how to make it work. (I'm using a Basys 3 board with Artix-7 FPGA).
I believe the problem is the way that the switches are connected to the FPGA. I found this video to be very helpful in explaining the SR latch, but he has an active low SPDT switch with two outputs. My switches appear to be connected the opposite way round, as shown in the image below which is from the Basys 3 datasheet.

One switch position is powered, and the other is grounded. Then there's a single output to the FPGA. Firstly, if this kind of switch has a particular name, can someone tell me what that is? I assumed these were SPDT switches but this configuration makes me think they're not, and I also don't know what the arrows on the switches indicate? Does it mean that the default position is grounded?
Either way, since the switch doesn't have 2 outputs to the FPGA, using an SR latch doesn't seem viable as it requires two inputs - one for each NAND gate.
Can anyone provide some info on these switches so I can research some more, since I don't seem to be able to find any info about this configuration, and the datasheet doesn't provide any info except this image.
And if possible, can you suggest a method to debounce a switch like this, either in VHDL or hardware(a circuit at the switch output, not a change to the existing hardware)?
Edit: one method I've tried is using a counter which allows 10ms for the input to settle. If the input changes due to switch bounce, it will restart this counter. This works, but it means that there's a delay which I'm worried will cause timing issues. As you can see in the simulation below (which has simulated bounces for 10ms), the debounced output is unbounded until about 20ms, because it has counted 10ms after the final rising edge of the bounces. I'd prefer a method which works more like the SR latch, where it latches the input straight away. Is this possible?


texts: Piezo transducer preamp and AGC/compressor

texts:
I've been suggested this circuit as a good low-noise high gain piezoelectric transducer preamp (used to pick up really faint sounds in water).

It is nice because it includes a high pass filter (yet no AGC or a compressor, which would be useful for long recordings with equipment left in the field and later retrieved).

How would you add either AGC or a compressor?

It uses two 12V batteries. Could I use just one yet be able to give both + and - voltages?

Gain is set with R2 and R3. Could I replace both of them with a potentiometer to have variable gain?

The high pass frequency is set with R3 and C1. Could I replace the R3 with a potentiometer and add a switch to disable the filter when it isn't needed?

Since I would probably be building just one, I'd like to pick up the best IC for this use so that I can't later think about "I'd have implemented that other IC".

Both AD743 and AD797 are suggested in the diagram. AD743 lists a 2.9 nV/√Hz at 10 kHz while AD797 lists 0.9 nV/√Hz at 1 kHz.
Since I'd be using this in the 3-45 kHz range, does this mean that the AD743 has less signal distortion at upper frequencies (hence the reference to 10 kHz instead of 1 kHz), or are they equivalent?

Thank you

Allison


texts: Power LED with integrated charging for li-ion cell

texts: I'm currently designing a BMS from scratch. I want to power a High Power LED with one single li-ion cell and through mains connection. The LED should shine when plugged in into the mains connection and simultaneously charge the li-ion battery (integrated charging). When plugged out from the mains connection the LED should shine uninterrupted and be powered by the li-ion cell. The li-ion cell should be removable. Does anyone know how I could realize it? I don't search for a circuit diagram, but just a general schematic.


texts: Is it possible to use half of a LM13600 instead of a CA3080?

texts: I'm in need of a replacement for the CA3080 for my VCO that I would like to build. I have come across the LM13600 and was wondering if anyone knew if I could just use half of it and operate it without connecting to the buffer pins (9,10).


texts:
I've designed a PCB in Eagle to host a GPS Receiver module and a GPS patch antenna. The RF input to the module is specified as a 50Ω unbalanced (coaxial) RF input. I used this calculator to calculate the required width and spacing for a co-planar wave-guide transmission line, and as you can see I got pretty close to 50Ω characteristic impedance using parameters from here. I ended up with a 32 mil trace width and 6 mil separation. Does that seem reasonable?

Here is a screen capture of what my board looks like:

Both the area fills (top and bottom) are GND, and I stitched vias approximately every 75 mil intervals between the top and bottom ground planes all around where the patch antenna is placed and along side the antenna feed to the GPS module. I didn't have any guidance on how to do this properly, so I just kind of eyeballed it. Perhaps it's overkill? I also stopped the top-side ground plane short of the chip to follow guidance that there should be no traces or solder mask under the GPS module.

The inner solid line square is 25mm and represents the actual patch antenna footprint. The dashed line around the patch antenna is a 27mm square that represents the required ground plane under the antenna, as I read it's datasheet. The feed length is about an inch (which is much less than the wavelength at 1575.42MHz) so I don't think path loss is of any concern here. I rounded the feed path it to "avoid sharp corners." I reckon that doesn't really matter too much, but I figured I may as well. Finally I used a 0.9mm drill size for the antenna pin, which I intend to solder on the back side. Does that all seem sound?

If I haven't given adequate background information in some regard, please let me know in a comment and I am happy to add information as necessary if I can. Just looking for an objective review as these are topics that I don't consider myself an expert in, and I can't think of a much better place than here to find knowledgeable and helpful colleagues.

UPDATE

I added a bunch of "random" vias within the ground stitching region under the patch antenna per @Dave's suggestion. Here's an updated board screenshot:


texts: Help explain op-amp description by Forrest Mims

texts:
The following description is from the book Op-Amp IC Circuits by Forrest Mims (2nd edition 1994):

As a newbie, the entire paragraph is counter-intuitive to me.  If amplitude is reduced, why is there a reference to a gain?

Also, if there exists a better textbook on the subject, I would appreciate that information as well.


texts: My First Circuit Diagram - How to improve it

texts:
I started taking more of an interest in micro-controllers and electronics last year, I started to design a circuit (which I hoped to have created as a custom PCB - Though I don't know how to go about this and the online choices are baffling to newbies).

Anyway since I have now got a spare hour most days, I'd like to continue where I left off...

So I created the attached circuit diagram and would like to ask the experienced people to please help me iron out issues in my design.

Not having a background in electronics, I'm sure my design is missing bits and pieces, So please help me by pointing the issues out so that I can amend my diagram before starting to look at custom PCB design.

I'm still learning too so please be gentle.

Thank You.

Diagram

UPDATE

Sorry, I have been notified that I am asking opinions?
What I mean to ask is if the circuit diagram when created in hardware (soldered) will work or not.

Or If I am missing capacitors or resistors as per standard recommended design patterns.

Thank You

UPDATE II

This is the sample diagram from the propeller datasheet.

UPDATE III

Moved Caps around and added new one's where they were needed.

UPDATE IV


texts: How to observe powerline modulated signal?

texts: I was assigned to observe the modulated signal of a PLC modem, but I have not really started yet. How do I do this? Should I use an oscilloscope or spectrum analyzer? If so, do I just connect it to the power line where the PLC modem is connected?


texts:
Is there a style checker for VHDL?
I found style guidelines, but I didn't find anything like check style.
Thanks in advance!


texts: Why are the effects off Lenz law only seen when a load is applied to a circuit? And, does Lenz law apply in a closed circuit with no load, or resistance?


texts:
Taken from Practical Electronics for Inventors is the following diagram:

I’m little confused here. The pinout diagram shows pin 1 with \$\bar E_a\$. The functional diagram also shows a bubble with the corresponding pin with the inner label being \$E_a\$. So does that mean that we will have to supply inverted input, i.e., \$\bar E\$ to the pin?

Similar questions for the output pins.


texts: DC Power Supply Output Caps: Electrical Advantage to using many smaller capacitors instead of few large?

texts:
Question: What is the electrical advantage to paralleling smaller capacitors to reach a given capacitance, rather than using fewer smaller capacitors on the output of a DC power supply?

For example, using 10x10uF, instead of 1x100uF, 2x47uF, 3x33 uF...

I think it may be to lower overall ESR (see 1st point in 1st answer here). If that's all it is, fair enough, question closed.

The question comes from TI's webench tool; the few design requirements I've inputted spit out schematics like below, with 9x22uF caps instead of 2x100uF or similar. Note: the schematic combines a few output caps, but I've attached a grab of the BOM also to show its 9.

I'm not sure if they do this to optimize another side of the design; PCB space, cost, etc. The tool lets you optimize your design by cost, PCB space, and efficiency.

Schematic:

Bill of Materials:

Optimization Dial:


texts: Is there a standard way to put compiled code onto a processor embedded in an FPGA?

texts:
If you use a standalone microcontroller (ARM/Atmel/PIC etc), you typically (these days) use an in-circuit programmer. Then you can either use a debugger or "crash and burn" methods (probably with a terminal interface) to develop your code.

I can get that with the correct HDL code, you might integrate a microprocessor or controller with your FPGA hardware design.

But how do you then get your code onto it? and how do you debug it? do you also synthesise a way to load compiled code? or is the code somehow build into the bitstream that you load onto the FPGA? is there a standard method, or does it vary by platform?


texts: Comparator/NAND/NOR ADC not working properly

texts:
simulate this circuit – Schematic created using CircuitLab

I was trying to recreate the following ADC (using comparators or NAND/NOR logic elements) circuit to control a 74HC4514 with a 0-5V voltage, but for some reason it doesn't behave as it should.

http://zpostbox.ru/simple_adc.html

Looks like the outputs of the ADC aren't either ON or OFF, but transition between those states and messing up the stages on the 74HC4514.
I tried to do the ADC circuit with a 74HCT00, 74HCT02 and 74HCT04, but all with the same result. When using Op-amps as comparators, all outputs are either ON or OFF.

There must be something I'm missing in this simple circuit, any ideas?


texts: What is wrong with this SPI implementation

texts:
I designed a system with RaspberryPi and STM32F407's, communicating with each other via SPI interfaces.

For the last 3 months, tests were OK but yesterday a RaspberryPi and 2 of  STM32F407's SPI ports were burn out. I don't know why. Everything was working, I went to sleep, everything was burned out in the morning.

Here is the implementation sketch:

PCB's are 15 cm long. SPI lines are parallel. No chip-select lines are used. No termination resistance used. SPI frequency is 200 kHz. Power supplies are 5V 1A usb charger for RaspberryPi, LM2576 3.3V circuits (implemented by myself) converting 24V to 3.3V for MCU's.

I hot plugged my modules around 10 times with no problem (why hot plugging would be a problem with SPI?) although according to Wikipedia article, SPI is not hot pluggible.

So, what could possibly caused that damage? Standing waves? Hot plugging? Or maybe power supply? How can I find the root of this issue?
Do I need to use optic isolators (or cmos buffers?) for each of MCU unit?


texts: How to drop high voltage DC with resistors only

texts:
Last year I made an electronics device that would drop high voltages DC to 24VDC from 50VDC, 75VDC and, 120VDC.

These voltages drops were selected by using a 3 position, 12 terminal, no 0 position Cam Switch.

These voltage changes were made using resistors only (1 resistor per voltage change).

The reason I am asking for help is because, I suffer from a head injury while serving in the US Army that effects my memory. I have video of my electronics device working but I failed to make notes on how I wired my resistors. I used single resistors for my three voltage changes and somehow or another, it worked perfectly.

I have recently tried to duplicate my work from last year but, I am having no success. I wish you guys could see my one year old video so that you could figure out what made my device work. I thought that I wired my resistors in series with my load but, that doesn't seem to work now.


texts: Power Transformer with two Buchholz relays

texts: In my workplace we have a power transformer, on its conservator tank there is a device like a Buchholz relay and its named as Atmo-Seal. What is the purpose of this device?


texts: Why is signal on XTAL1 and XTAL2 a sine wave (not square)?

texts:
I have a basic implementation with a crystal feeding XTAL1 and XTAL2 on a processor (similar to below). When I look at the signal on XTAL1 and XTAL2 they are sine waves.

Shouldn't they be square waves?


texts:
I'm currently trying to create a converter 20V-26V to 5V with an 2.1A output. So I use the LM2489 chip (datasheet: here).

My circuit is the following:

I make this circuit but with I power up everything and I don't get 5V output, I only have 1.8V. I verified all my circuit but nothing is wrong. I made research on the internet but I don't find solutions. My questions are the following:

Is the LM3489 a good solution ?
Is my circuit right? If not, what I must change to get 5V output?
What can be the reason of the 1.85 output?

I want to add that when my input vary from 20V to 5V the output increase from 1.8V to 4.5V

Thanks in advance!


texts: How does the biasing work in a JFET based triangle to sinewave converter?

texts:
To those who haven't see this cool little circuit it employs the non-linearity and symmetry of the JEFET to clip a triangular signal to make it more sinusoidal

Can someone please explain to me how the biasing in this circuit works?


texts: How do I call a C function in another module from inline assembler in IAR EWARM?

texts:
I don't know if this is recommended or not but I am sure someone will give me a stern warning if not. I have posted a duplicate question in stackoverflow, however this may be just as appropriate here given that it's for an embedded platform and a number of embedded developers frequent this stackexchange. Not getting much traction over there either...

I have a bit of assembly in a hard fault handler. The assembly is basically meant to pass the current stack pointer as a parameter (in R0). It looks like so...

__asm("    mov     r0, sp\n"
  "    bl      SavePC\n"
  "    bx      lr");

This works fine when SavePC is in the same c file. However, when SavePC is placed in another c file I have no luck. I have tried to IMPORT the function like so...

__asm("IMPORT SavePC\n"
" mov r0, sp\n"
" bl SavePC\n"
" bx lr");

... but I must be doing something incorrect. The compiler reports the following...

Error[Og005]: Unknown symbol in inline assembly: "IMPORT"
Error[Og005]: Unknown symbol in inline assembly: "SavePC"
Error[Og006]: Syntax error in inline assembly: "Error[54]: Expression can not be forward"
Error[Og005]: Unknown symbol in inline assembly: "SavePC"
Error while running C/C++ Compiler

The c file with the assembly includes the header file with the SavePC prototype...

extern void SavePC(unsigned long);

Suggestions?


texts: Simple high-side current change to digital output

texts: I am trying to read OUTPUT 1 and OUTPUT 2 to digital pins with pull-down resistors on a micro controller but they will always read HIGH. How would you detect the change in current so that when SW1 is closed a digital HIGH or LOW could be read on OUTPUT 1?


texts:
I want to measure the current that goes into a noninverting opamp input. I've setup my experiment as follows:

I can't measure the voltage drop across the 10M (R1) resistor directly since my DMM has an input impedance in the megaohm range. So, i have to measure the voltage on the ouput of the opamp. R2 is a potentiometer, so the gain is not exactly 4, and V1 is 1.19V.

When I connect the input to voltage source of 1.19V, I get 4.04V on the opamp's output. When I connect the input via the 10M resistor (R1), I get 3.64V on the output.

Now, my gain is:

$$
4.04/1.19 = 3.39
$$

so, voltage that the opamp sees when connected via the 10M resistor is

$$
3.64/3.39 = 1.07V
$$

this means, I have a voltage drop across the resistor R1:

$$
1.19 - 1.07 = 0.12V
$$

so, the current into opamp's input is

$$
0.12V/10M = 12nA
$$

Am i doing it right?

Another question is: Could 12nA leakage current go thru a home made PCB that was vigorously cleaned from flux residue?

LMC6001 has a stated input current in femtoampere range, it might be that it was overheated while soldering and went kaput. But first, I want to be sure that I'm doing the measurements the right way.


texts:
I'm pretty inexperienced at electronics (but learning!) and recently had some PCBs manufactured for a project I'm working on. I had 40 PCBs made (PCB Assembly done by the manufacturer) and received them earlier today.

While my PCB does several things, I'm only concerned about one specific part here; the power system. I power this system with a 3.0-3.6V battery (Temperature/Current-dependent), and it is supposed to boost this to a steady 3.6V to power a Particle Electron with (using two wires with a JST-PH2 plug, connected at W1/W2).

Parts

U1: TPS610995DRVR
L1: 74404024022
C1/C2/C3: GRM188R60J106ME84D
W1/W2: JST-PH2 w/ wires (to be inserted directly into a Particle Electron)

I based my design off the TPS61099x datasheet and quite religiously followed everything in it (e.g. schematic, recommended parts). I thought it would work.

My issue:

For 10 of my PCBs, everything works fine. The Particle Electron is nicely powered up and everything runs as it should.
For the remaining 30 PCBs, as soon as I connect my Particle Electron (i.e. current is drawn) the output voltage immediately dips to ~0.9V.

I'm at a complete loss as how this happened. These PCBs were assembled by the manufacturer so I assume they should be identical/free of assembly errors. I also can't observe any visual differences that would hint at a wrong part, or part being placed incorrectly. The batteries can handle up to 2A, which is way more than a Particle Electron would possibly draw (max. 800mA). What could be a possible reason only some of my PCBs work? What should I look into first? I simply have no idea how to approach this issue and where to start with fixing it.

I can share my information if needed.


texts: Difference between hybrid and resistive RF power splitters, and Frequency Response?

texts:
I am new into RF measurements, and have got a couple of questions regarding power splitters (hopefully common for all the models that exist in the market).

What's the difference between resistive and hybrid RF power splitters?
Does resistive RF power splitter has 6 dB power loss?
And hybrid RF power splitter has 3 dB power loss?
Do they have a fairly broadband/wideband support? I mean how does there frequency response looks like?

ADDITIONAL QUESTION:
 5. Do Hybrid splitters have a better isolation between two unwanted paths compared to resistive splitter? (I think it's true, isn't it?)


texts: Is this hybrid pi model of a BJT unileteral or bileteral?

texts:
In introductory texts, the BJT is said to be a unilateral device. I think it means that the base current is only a function of Vbe; and Vbe is not function of Vce and Ic(?)
Is the following BJT model unileteral or bileteral?

In other words, according to the above model, is the base current or Vbe function of any output parameters like Vce or Ic?


texts:
I'm designing an application where a power logic level MOSFET is driven using a 5V PWM signal at 20kHz.
The drain current will be approx. 10A and the voltage of the load 12V.
I looked into the BUK954R8-60E.
Which is a good estimation of the power dissipated by the MOSFET?
I managed to calculate the conduction power losses (0,49W), but I do not really understand how to evaluate the switching power losses.


texts: Is there any sense in this technique for charging Li-Ion batteries?

texts:
This is a replication of this question on Android SE. I feel that it is in fact an electrical engineering question, since it covers batteries behavior in details.

Basically there's a claim that the following procedure will significantly (two times improvement claimed) improve the battery runtime (time a device can run on a single battery charge):

  Turn on your phone;
  Connect the charger and wait until the battery is full-charged (green indicator is on);
  Disconnect the charger;
  Wait until the green indicator is off and connect the charger back;
  When green indicator is on, turn off the phone.

  Now, continue with switched off phone.

  Disconnect the charger;
  Wait until the green indicator is off;
  Connect the charger, wait for green indicator and disconnect the charger again;
  Repeat the "3" step 10 times. Each iteration might take from 30 seconds to 30 minutes, usually that's about 1 minute.

The procedure description is taken from this article in Russian which I've read and the English translation is correct.

Here's how I understand what is going on. While the green indicator is on, the battery is being actively pumped energy into. At some point the charging circuit decides that the voltage is high enough to declare the charging complete (this requires some heuristic for customer convenience).

Then once the charger is disconnected the voltage on the battery gets lower, so when the charger is connected again the charging circuits sense voltage below the "stop charging" threshold and turn the green indicator on to show that it decided to charge the battery a bit more.

Since all this is happening while the battery is near the "stop charging" threshold the charging current is minimal and also when the green indicator is off it doesn't mean the battery is not being charged - it is just being charged much slower. So simply leaving the device connected to the charger for another hour would be just as efficient.

What is likely happening during the described procedure? Will it improve the battery runtime? Are my assumptions correct?


texts: IO standard for RGMII interface of ethernet

texts: I'm learning about the RGMII interface of ethernet. Can anybody please tell me What IO standard does the TX and RX line of RGMII interface support? Please help. I'm just a beginner


texts:
I am building a four channel constant current LED driver with PWM control. I have used the following circuit (replicated four times off a quad op amp). The circuit functions OK but as I wind the set point down the square output of the circuit becomes more and more resonant until it resembles a sine wave.
The power supply rail is damped by two 470 uF capacitors between the supply rails and close to the LED positive connection.
Any suggestions as to how to remove the oscillation without damping the frequency response of the circuit, as the minimum pulse width (1 bit) of the PWM output is approximately 2 microseconds at approximately 1kHz repetition rate?
The current in the LEDs is set to 700mA and the aim is to run it from 12 V but as the PSU is increased beyond about 11 V the drive current oscillations become large and the output becomes quite unstable. For info, there is a voltage droop of about 100mV on the supply rails during the on cycle of the MOSFET.

simulate this circuit – Schematic created using CircuitLab


texts: Differential amplifier and different ground

texts:
I am designing a circuit to measure the voltage across the output of buck converter. With different ground for the buck converter and the micro controller, with respect to which ground will the ADC measure?

For the circuit shown above, the ADC will measure the output with respect to which ground? Isn't the input to the ADC floating?
If the above circuit is not a good design practice or if it doesn't work, will the below circuit work provided the output voltage of the first op amp is within the voltage range of the second op amp?


texts: Reducing absolute value of signed number in VHDL

texts:
Related to this: Scaling an input in VHDL, but different enough that I feel it warrants a new question.

I feel this should be simpler that I'm making it.

I have a stream of signed 16 bit samples which I want to attenuate by about 0.5 dB, but let's just use nicer numbers for the sake of illustration. I need:

-32000 (almost -1.0) -> -25600
+32000 (almost +1.0) -> +25600

etc

Simple right? I'm stuck because the multiplication operator must take either signed or unsigned operands, not a mixture of both (that makes sense).

Here is what I initially tried:

variable scale_factor : std_logic_vector(15 downto 0) := x"EFFF";
attenuated_sample <= std_logic_vector(unsigned(sample) * unsigned(scale_factor));

This doesn't work; it makes positive samples smaller but negative samples more negative.

The only way I've managed to achieve what I want is by multiplying the signed sample by a signed scale factor, but I've had to make the scale factor have an extra few zeros at the front so that it is always positive. I.e.,

variable temp : std_logic_vector(39 downto 0);
variable scale_factor : std_logic_vector(19 downto 0) := x"0EFFF";

temp := std_logic_vector(resize(signed(sample), 20) * signed(scale_factor);
attenuated_sample <= temp(31 downto 16);

This appears to work, but I don't like it because it's ugly. What is the correct way to go about this?


texts: can i connect two (usb to serial eg. FTDI)?

texts:
Is it possible to connect/communicate in following manner?

(FPGA-1) to (USB to serial-1) to (USB cable) to (usb_to serial-2) to FPGA-2. So the FPGA-1 sends data from uart Tx..then (USB to serial-1) receives and converts to (USB signal) ..sends this via usb cable to (USB to serial-2)...then this is received by FPGA-2 using the uart Rx.

If not, is there something else i could use in this manner? thank you.


texts: Detecting battery degradation in voltage profile.

texts: I'm measuring the voltage of a battery and a capacitor over time. Both components are charged and discharged daily. I don't have a background in electronics. When the components eventually begin to degrade or fail would this be visible in the voltage profile? Thanks


texts: How to properly interface button switches meters away from the host

texts:
I plan to place some buttons at about 50 meters (roundtrip) away from the host and I'm not sure if I'm doing it correctly.
The I/O reading the signal will be from an MCP23S17 16bit GPIO expansion IC that will be connected to a MAX6818 octal switch debouncer which basically handles the debouncing of the mechanical switches and at the same time offers ESD protection. They will be powered by 3.3 volts. The wire will be stranded 14 gauge wire and I will also twist them to at least make it less susceptible to inteferences.
I have come up with two ways, but if you know a better way please do say.

The first one is to just straight up connect the wires to output of the doubouncer with a resistor. I'm not sure if the resistor is necessary, but I guess to help with the ESD strikes since a 50meter 14guage wire only has 0.016 ohms of resistance which some may consider already as a short.
The second one is from a article I read, with the use of optocouplers. Although I think this is a safer solution, I am not sure if the added optocoupler and another power supply can justify its benefits because what I think the optocoupler is used for is to prevent ESD strikes but the  MAX6168 already has a ESD protection built into it.
Please share to me you thoughts on which configuration should I take, or if you have a better configuration.


texts: Possible wifi interference with processor

texts:
I am building a device that consists of an ordinary WiFi router (WDR4300) as shown here:

Which works as a client and scans for networks OK when alone. The problems appear when I add another board to the case, which also contains a Texas Instruments AM3517/AM3505. The final design is shown below. The antennas are on the opposite side now and there is also a plastic case (not in the picture). But then WiFi performance gets very bad, it scans fewer networks with bigger noises and they appear weaker.

What do you think may be the problem?


texts: Distributed Computing not working in PowerWorld Simulator21

texts:
Not sure whether to post this here or in another part of Stack Exchange, PowerWorld itself is used widely in analyzing large scale power grids.
I am trying to run a contingency analysis in PowerWorld Simulator21, but when I try to set up distributed computing (parallel processing) I get the following error:
DistVerify ERROR: Machine localhost failed verification with error "No such interface supported".
Has anyone encountered something like this, and if so were you able to correct it? I am using Windows.


texts:
I can only obtain the magnetic flux density of an electromagnet coil as mT(milliTesla).

What else parameter do I need to calculate the inductance(L) of the coil in unit Henry?


texts: Why am I getting weird behavior when building 4-bit down counter?

texts:
I'm attempting to build a 4-bit modulo-10 down-counter (i.e 9,8,7...,1,0,9,8,7...0). Here is my code so far:

LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.NUMERIC_STD.ALL;

ENTITY downcounter is
PORT (
    enable  : in std_logic;
    reset   : in std_logic;
    clk     : in std_logic;
    count   : out std_logic_vector(3 downto 0));
END downcounter;

ARCHITECTURE Behavior OF downcounter IS

COMPONENT Tflipflop
PORT (
    clk   : in std_logic;
    T     : in std_logic;
    Q     : out std_logic);
ENDCOMPONENT;

SIGNAL Q0 : std_logic := '1';
SIGNAL Q1 : std_logic := '0';
SIGNAL Q2 : std_logic := '0';
SIGNAL Q3 : std_logic := '1';

SIGNAL TFF2IN : std_logic;
SIGNAL TFF3IN : std_logic;
SIGNAL TFF4IN : std_logic;

BEGIN

TFF1: Tflipflop PORT MAP (clk, enable, Q0);

TFF2IN <= (NOT Q0) AND enable;

TFF2: Tflipflop PORT MAP (clk, TFF2IN, Q1);

TFF3IN <= (NOT Q1) AND TFF2IN;

TFF3: Tflipflop PORT MAP (clk, TFF3IN, Q2);

TFF4IN <= (NOT Q2) AND TFF3IN;

TFF4: Tflipflop PORT MAP (clk, TFF4IN, Q3);

PROCESS (clk)
BEGIN
    IF FALLING_EDGE(clk) THEN
        IF reset = '0' OR (Q3='1' AND Q1='1') OR (Q3='1' AND Q2='1') THEN
            count <= "1001";
        ELSE
            count <= Q3 & Q2 & Q1 & Q0;
        END IF;
    END IF;
END PROCESS;

END Behavior;

I'm currently testing it in model-sim, but I'm getting this weird behavior:

The counter works from 9 to 0, but then when it reaches 9 again, it just stops there. Then after the same amount of time each time, it begins to work again!

I've tried my best to figure it out but I just can't. Any help is appreciated!

Edit: if a schematic helps, I'm basically doing this:

except the enable is connected and AND-ed with each input of each T Flip Flop.


texts: Will a voltage step-up circuit increase the power output of a motor?

texts:
If you attach a step-up circuit (like a boost converter) to a battery, and then run a brushed DC motor off of that higher voltage, will that motor have a higher mechanical power output than if you just hooked up the motor to the battery (without the circuit)?

In this post about how voltage and current relate to the torque and speed of a motor, the top answer states that:

  For the same motor, ideally if you apply double the voltage you'll
  double the no-load speed, double the torque, and quadruple the power.
  This is assuming of course the DC motor doesn't burn up, reach a state
  which violates this simplistic ideal motor model, etc.

If this method would not work, is there any way to force a motor to pull more current from the battery, increasing power draw (and the energy in the battery would just run out faster) but increasing the mechanical power output of that motor?

I have heard of electric cars using boost converters to power higher voltage motors with lower voltage battery packs.   If the answer to the above question is no, then why do these car manufacturers not just use motors that are the same voltage as their battery packs?

Finally, would stepping up the voltage of a battery to run a motor that would be rated for a higher voltage achieve more mechanical power?   This was touched on in the post I linked to but not fully explained.   Could this same increase in power be achieved with a different motor at the same lower voltage rating (the referenced user mentions stall current as another factor that affects motor electrical power draw and mechanical output)?   In short, would stepping up voltage from a battery to run a higher voltage motor ever be useful to increase mechanical power output (ignoring efficiency or battery life)?