texts: Relays and mains voltage (Europe 220V+US 120V)

texts:
I initially used a DPST relay to switch both the live and neutral inputs of a computer, but someone told me it was a bad idea and that I should only switch the live input.
I live in Europe and here we have power strips with DPST switches. It is mandatory in some countries to install two pole switches in bathrooms. Plus RCD (EU equivalent to GFCI) is present on every plug (if the electrical installation was updated within the last 20 years that is).
But it's technically possible to plug your device into a socket that is not connected to earth (non polarized plugs)...
I know that the US system is completely different. So here's my question:
If I want to design a universal system with a relay that switches on/off mains power (ie 120V US AND 220/240V EU), what kind of relay is safest to use? 1 Form A (SPST) or 1 Form C (SPDT), 2 Form A (DPST) or 2 Form C (DPDT)?
Thanks!


texts: How do I model a charge source in SPICE?

texts: I would like to model a force sensor based on a piezoelectric crystal that generates 10pC/N and has a static capacitance of 20pF in LTSpice for simulation purposes. How can I do this?


texts:
I am using SSM3J334R P channel MOSFET for switching high voltage which has following specs

Drain-Source voltage (VDSS) -30 V
Gate-Source voltage  (VGSS) ±20 V

There are two ways to protect the Gate of the MOSFET from excessive voltage or exceeding the Vgs.

One is voltage divider which is cheapest method to drop the voltage, but it has one disadvantage i.e with the increase in voltage the gate voltage will increase accordingly and at some point it may be exceed the rated voltage of Vgs of MOSFET.

Other is having zener diode in parallel with resistor

In both the circuits the Diode at drain is stop reverse flow of the current as the electronic connected to the output has two power source one is this MOSFET and one is direct 12V which share common ground with this circuit, reverse current turn on the circuit as it receives 12v and 5v is generated and MCU is ON which is undesirable.

Which method is more reliable to protect the gate? The nominal voltage for switching will be 12V most of the times, but it may go upto 24V sometimes as well.
Is 1K pull up enough to turn off the MOSFET when Transistor is off.
Is there any chance the MOSFET gets damaged from high voltage and high voltage flow through transistor base and to MCU GPIO. If yes, how to avoid that ?
What should be the ideal value of Zener Diode, the Vgs(max) of MOSFET is 20V.


texts:
I am trying to build 5-10W amplifier.  The minimum voltage for LM1875 is 16v but 12v is not far from it.  Where I am getting lost is whether I am going to get at least 5W when the amplifiers are bridged together.  I am trying to run it from a 12v battery so there is only +12v and 0v (ground)
Schematic for not bridged amp:
(most of them need +V and -V with ground.. so I'm not sure whether this would work either (+12 and 0v))

Power output/voltage:

DATASHEET:
http://www.ti.com/lit/ds/snas524a/snas524a.pdf


texts: I am working on this battery charging IC MP26029, it has OTP Funtion (One Time Programmable). But i do not know how to program this IC, as there are no Uart or I2C pins available. Does any one know how to program it. Thanks


texts: How to setup SAM3x8e IRQ handler for USART?

texts:
I'm making UART support for SAM3x8e based Arduino Due board.
I would like to clarify questions I can't resolve by searching the web.

Is it only one IRQ handler per MCU component like USART?
This means that I should use status register of component to find out what event exactly occurred?
Is it just enough to define function with predefined name like

void USART0_Handler(void) {}

for USART0 component and USART1_Handler for USART1 and etc.?

The MCU has UART, USART0, USART1, USART2, USART3 devices (components) on board. I looked into arduino source code, exactly

arduino-1.5.7/hardware/arduino/sam/variants/arduino_due_x/variant.cpp

and see that for serial0 UART component is used, for serial1 USART0 is used, for serial2 - USART1 and for serail3 - USART3. The USART2 is not even mentioned. The question why is this done that way? What does the UART, USART0, USART1, USART2, USART3 mean? I would like to know what names should I use to properly communicate through board's pins like TX0/RX0, TX1/RX1 and etc.

Thanx in advance.


texts: Voltage/Current waves on N port networks

texts:
I have a doubt about the sign convention for waves in an N port network. Consider for instance the following 2-port network:

How should I fix the directions of voltage and current to calculate powers?

For instance imagine to put a voltage source at port 1: is the power entering the network Pi = 1/2 Re{V1 I1*}, or maybe Pi = 1/2 Re{V1 (-I1*)}?

Is the output power at port 2 equal to Po = 1/2 Re{V2 I2*}, or Po = 1/2 Re{V1 (-I1*)}?


texts: How can I implement a K-Map with negative feedback?

texts: How do you describe a boolean function using a K-Map in such a way that the boolean function depends on the previous value of this function?


texts: In general, why do capacitors have a higher tolerance than resistors? Capacitors have a tolerance of around 10%-40% while resistors have smaller tolerances generally. Why is that?


texts:
I built circuit shown bellow (NPN BJT):

simulate this circuit – Schematic created using CircuitLab

Everything worked normal as it should (except of unwanted distortion). There is that one strange thing I'm seeing lately when I connect oscilloscope's probe between emitter and ground. It is the amplitude of the signal measured - when the amplitude of F.G. is some mV, the emitter amplitude more or less follows the input amplitude measured between base and ground; things change when the input voltage is increased for few 10mV, where the emitter's amplitude looks like this:

Eventually proceeding to more sharp shape of peak.

Even stranger thing is that, after those triangular waves are shaped, the voltage simply stops at this point as the input voltage is increased.

Does this behavior has to do anything with almost constant Vbe which is approx. 0.7V?
Or is this another unwanted distortion produced by transistor?


texts: How to use op-amp circuit as a threshold trigger

texts:
I recently built the following circuit:

In case you can't tell, it has 23 volts on the power rail and VEE is connected to ground. I don't have any feedback on the output. I have a simple voltage divider on the inverting input. The resistors are chosen so that when the input voltage, Vin, is above the threshold set by the divider (about 1 volt), the output should swing up to VCC, 23 volts. However, in practice, it doesn't seem to be doing anything when I switch Vin between 0 and 5. The output remains low. I haven't used op-amps much at all, so I figure I'm doing something wrong. I know of Schmitt Triggers, however those at first seemed more complicated than what I wanted, and I also didn't want the signal to invert. I digress...is this totally wrong, or should I suspect the problem elsewhere?
Here is the op amp:
https://www.mouser.com/datasheet/2/348/lm358f-e-1873592.pdf


texts: How to bias a class C amplifier with negative voltage?

texts:
In some class C amplifiers in order to decrease conduction angle, transistor is biased with a negative voltage.

Is it possible to create this negative voltage(-VBB) with positive supply? How?


texts:
I need to make a circuit that generates a PWM signal for a motor. The motor has 2 inputs - P and Q. They are the inverse of each other. Now, both signals aren't allowed to be high at the same time. That's why there needs to be a programmable Dead Time - the time between the signal that is high to go low and the low signal to go high.

Now I know how to easily make a PWM signal. It's allowed to have a fixed signal width and fixed period - because it's for educational purposes. To generate this, I just have a comparator with on one input a 8-bit-counter continuously counting, and a constant on the other.

Now, I need to somehow check whether the signal toggles upwards or downwards. If it goes upwards, it can go straight through, but else it has to load a loadable 8-bit counter with certain value and wait for it to overflow before the new high output gets outputted.

For the loadable counter part I should have enough knowledge, but I don't know how to detect the edges (preferably asynchronous stuff should be avoided)


texts: I am currently designing a little circuit to amplify a weak signal with two sequential op amps. To reduce the noise at the output of the two amplifiers, what would be the best order to place these amlifiers in? Should the amplifier with the highest gain be the first amplifier or the other way around?


texts:
I have been told that -3dB is when you get half the power or equivalently the original voltage divided by the square root of 2.

Nonetheless, doing the calculations I get 3.01029dB.

I figure this is because the 3dB value is just the aproximated value of what I have gotten but maybe I am mistaken somewhere, so is the 3dB just an approximation or am I mistaken?


texts: ADC sampling rate to MCU clock speed relationship

texts:
How can I determine the clock speed requirements of a mCU to manage a given ADC input?

This application is very simple - I just want to take an SPI stream from an ADC into a mCU and spit it out the mCU.  No major DSP happening or anything like that on board.  [added] The mCU is ultimately there to push the video out a USB port.

In this scenario I have a 40,000 kSPS (40 MSPS) 10bit ADC that I need to push through a 16 bit micro.  Do I use a 40MHz micro?  Can I use a slower micro?


texts: What would happen if I plugged a power adapter into two different sockets

texts:
So I just purchased a multi way power strip from Costco US (by Cyberpower). The placement of the sockets are in such a way that every socket is the exact distance of each hole so that if you put a plug in it you could get it in the socket or accidentally end up straddling the socket beside it.

What would happen if you plugged a device and accidentally straddled two socket?


texts: How to connect two current sensors together?

texts:
I have two ACS712 current sensor modules, sensing different things, connected to a PIC 12F683.  I'd like the PIC to do something if either of them senses a current.  Individually, the sensors work fine and the PIC responds correctly.  However, if I connect two of them to the same pin on the PIC, both stop working.  Scoping the combined output, it looks almost flat, almost as if they cancel each other out??
Is there a simple way to solve this and have them work together on the same PIC pin?
(Yes, I could put them on different pins, but that would involve using a bigger PIC as I'm already using all the I/O pins on this one, so I'm trying to figure out if there's an easier way to make this work.)


texts: Lenz's law to determine the direction of induced current

texts:
I came across this MCQ in my text book, it says:

To determine the direction of current induced in AC generators, we use....
(i) Lenz's law (ii) Fleming's right hand rule (iii) both of them

Frequently, I use Fleming's right hand rule to determine the direction of current, but lenz's law refers to the principle that the current will be in opposite direction to the change in the flux, and that's the principle upon which the generator works.  So, this multiple-choice question made me confused, and I thought choice (iii) might be the correct answer, so could anyone help me?


texts:
For my Verilog code, I am trying to define a 64 bit array, like this

input signed [63:0] var_name

This array is broken up such that it is 8 bytes, each with a width of 8 bits.

I am wondering how Verilog handles mathematics in this case.  If I want to sum up all the different "bytes" of var_name, I try to do it like this:

module sum(var_name, sum);
input signed [63:0] var_name;
output reg signed [9:0] sum;

always @ * begin
sum = 0;
for(i = 0; i<8; i = i+1)
   begin
   sum = sum + var_name[8*(i+1)-1 -:8];
   end
end
endmodule

(note, this code may not be proper, it is just an illustration).

Does Verilog treat each 8-bit word as a signed integer? Or does Verilog only consider the entire word var_name as a signed word?

Thanks a lot for reading.  I hope my question is clear enough! If not, please ask questions about it. :)


texts: One of the answers to this question advised I used a reset signal for my fpga design. I agree, it's good advice and I'm adding it. Is there any way for me to ensure that this signal gets asserted on startup though withoug adding additional hardware? This is on a spartan-3an evaluation board.... I can't find anything in the documentation anywhere


texts: What is the purpose of transformers on the output side of a DC power suppply?

texts:
I have a PSU that plugs into 220-240V AC mains (L&N, no ground) and outputs 9V DC to a single barrel plug.
On the barrel plug side, just about 10cm before it, there's a little box on the cable that I opened and it reveals a small board with 2 toroidal transformers in series with a 1:1 ratio each. The +9V connects to the primary of the first transformer, directly into the second transformer and then to the +9V lead of the barrel plug. The ground lead is connected analogous to that on the secondaries.
My knowledge is pretty basic I'm afraid.
It seems like these transformers are connected in a way that I would think they are two inductors. Okay, that should be an impedance to possible AC but the PSU is rectified and has a cap on the other end already. And why two in series? This is a bit puzzling to me.
So what exactly happens here? Can anyone please clarify?
Thank you!
Edit: Photos as requested; I labelled the joints and colored those that weren’t gooped according to the winding colors.

I checked with a multimeter for continuity and it is as it seems, A-E-F-B and C-G-H-D are connected, nothing between those groups.
Unloaded, Any of AEFB measured against any CGHD is 9.42VDC
Edit:
I took some time to carefully crack the housing of the wall wart part to take pictures of that side as well. It is a switching PSU, yes.


texts: Schottky diodes as full bridge rectifier

texts:
I need to make a 75-100VDC high current power supply. I do not have any high current diodes or bridge rectifier ICs but I do have a load of scrap switching power supplies.
Could I take 4 of the (lack of better terms) Schottky diode modules that have 2 diodes pointing into each other, such as this one, and arrange them in the full bridge rectifier layout? That datasheet is not the one I will use, I just added it as an example. However will the high reverse leakage current of Schottky diodes present a problem here?
Here is how I would use them. Note the blue resistor is the load. Also the power supply I am building is high current. One of the diode modules is pictured at top left. And the diodes in the picture are obviously meant to be Schottky diodes. Could I get more current by paralleling both diodes?

The diodes I have that I think might work are a bunch of byv72e.
I also got a bunch of DSEI 3006A


texts: Why is it dangerous use a coiled extension cord

texts:
What aspect using a coiled extension cord makes it more dangerous than using an unrolled power cord.

Many fire safety websites reference that an extension cord should not be used while coiled.

Is this due to the cord acting as an air core inductor (I can't really see why this should cause fires). If this is the case, if every second loop is in the opposite direction is it safe.

My theory is that if the cord is getting heated from high current draw, when coiled all of this heat is in a much more condensed location, causing a greater temperature rise than if the cable was unrolled.

Is it dangerous, if so what is the cause. Am I missing anything, do parameters like loop size, loop direction etc make any appreciable difference.


texts:
I have built the following circuit to reset an AtTiny1614 (the mega tiny 1 series). They don't have a reset switch and I thought with this circuit I could (hard-)reset the chip by doing a power cycle.

I've built the circuit (with the help of cheap Chinese pcb manufacture) and I measure around 1.7-3.6v between VDD and GND while pressing the button.

My questions:

Is the ATtiny receiving some kind of "parasitic" ground (sorry, I don't know the correct expression) from other pins that are pulled to ground?
Would the schematic work, if I would switch the misfet to a p-channel and use it on VDD? Or would there be some kind of "parasitic" 5V?
Any other suggestion on how I can power cycle the chip?


texts: Whats the standard for denoting the orientation of an LED on a PCB?

texts: Whats the standard for denoting the orientation of an LED (or diode in general) when printing a PCB? I'm drawing up a design for students to use in a course and want to make sure I'm not misleading them.


texts: Distance required between two wires to avoid EMI

texts: I am running 3 cables cables from a solar heater down to my apartment (around 12 meters), one to power an electric heater and water pump (around 2000 watts in total), one to control a 12V solenoid and a temperature sensor. These 3 wires are wrapped around all the way down. The problem is I get massive fluctuations in my temperature reading +-5 degrees when I turn on the heater. Are these fluctuations due to EMI between from the power cable to the sensor cable? If yes, is it possible to calculate the distance to separate the wires in order to avoid any EMI?


texts:
I was experimenting with a simple voltage level shifter to convert a signal from  5v to 3.3v.

Then i went to simulate my circuit in orcad pspice, and i need help understanding what is causing the voltage spikes. I'm using a pulse generator to pulse a 1kHz signal in to the gate.

Is it the rise and fall times of the pulses that is causing the spikes?


texts: What are the kinds of drill bits can I get for this?

texts:
I have this PCB drill bit I bought during my college years and lucky enough, it still works! But I was hoping that there are other kinds of bits that I can use this other than drilling holes. I was wondering if there is a bit with a small circular saw that I can attach to make small cuts to shape a casing for a pcb?

I tried googling micro drill bit but I am not sure if I am getting it correct, and I can't find a bit with a circular saw. If someone could point me to an ebay (preferred) or Amazon site, I could use that as reference to find other bits that will work on this drill.


texts: Common reference/ground Raspberry Pi, usb charger and AC main

texts:
Ultimately I would like to try to detect ac voltage on a 220V AC line using capacitive coupling.  I don't want to have to hold the device, I just want it to sit there and monitor if the line is active or not.

To do this I think I need to tie the Raspberry Pi GND pin to be tied to the the AC GND of the house wiring.

It's been a while since I did any AC power work, but it seems like I should be fine to just tie the gnd pin from the gpio bus of the Pi to ac gnd via a wire to the center screw of an ac outlet (assume it is properly grounded) and then just make sure everything uses that common ground bus as a reference.

Same would apply if I wanted to power the sense circuit from a separate supply, say a second usb charger.  Tie the "gnd" pin output of the usb charger to the same gnd bus as the PI and the ac main, then I could use the 5v as power for the sense circuit.

This seems pretty strait forward,  but I wonder if I am missing anything?


texts: What is the importance of the \$50\Omega\$ resistors in this RF op-amp circuit?

texts:
From the TI application note RF and IF amplifiers with op amps:

The source says "The 39-pF capacitor provides peaking to compensate for some high-frequency roll-off, but better IP3 performance can be achieved by removing it and living with the roll-off." Let's just consider it left off.

What function do the resistors between the two op-amp stages serve? The choice of \$50\Omega\$ makes me think of transmission lines, but this amplifier has a usable bandwidth up to around 300 MHz, so wavelength is on the order of 1 meter, significantly more than the distance between the stages (it is a dual-op-amp package), so any reflections here would be fast enough to be negligible.

Additionally, the input and the output are each terminated with \$50\Omega\$ resistors. Here's it's reasonable to assume the attached cable is long enough to be considered a transmission line, and these resistors are providing termination for that line. But, why terminate at both ends? Assuming other circuits are doing the same thing, (terminating input and output), won't this serve to cut the voltage in half? This seems to be rather counterproductive for an amplifier; what's the advantage?


texts:
I'm using the STM32 VCP firmware and I want to transmit data to my PC from STM32F4 discovery board.
The configuration of the virtual COM port is fine, the properties are the following in device manager:

In english: 9600 bit/s, 8 data bit, no parity, 1 stop bit, no hardware flow control.
I'm trying to receive characters in Realterm with these parameters, but I don't get them, it looks like following:

What could I do wrong?

EDIT:

The MCU sends with the following code snippet:

int main(void)
{
  HAL_Init();
  SystemClock_Config();
  MX_GPIO_Init();
  MX_USB_DEVICE_Init();
  uint8_t Buf[] = "test";
  HAL_Delay(1000);
  while (1)
  {
      CDC_Transmit_FS(Buf, 4);
      HAL_Delay(1000);
  }
}


texts: How to drive three 3W LEDs from a USB power supply (5V/1A)?

texts:
So I'm currently trying out a project using a USB power source to drive an Arduino Nano board and several 3W LEDs.

Specific conditions the project needs to fulfill are:

The power supply's standard output is restricted to 5V/1A.
The LEDs and arduino need to be powered in parallel
Prefer to keep the overall size of the end product small (perhaps around the size of a flashlight).

So far I've managed to rule out powering the arduino with the on-board USB input and instead use a power supply only USB cable.

I currently plan to use at least one of these DC-DC boost converter modules to boost the 5V/1A output to at least 12V/1A before futzing with anything else.

The questions I have are:

Is it possible to place a couple of these boosters in a series to increase the voltage still further?
What would I need to add to supply 1A of current to all of the LEDs off of the single output?

And if there's anything I'm missing, can someone point out the errors?


texts: Trigger led with both Arduino and tactile button

texts:
I want to trigger a LED with both an Arduino and a hardware switch without coding any button logic in the Arduino.

simulate this circuit – Schematic created using CircuitLab

When the button is pressed there is a direct connection between the 5V power supply and Arduino pin 17. Can this do any harm? Is there a better solution?


texts: Inverting the input and output of a UART

texts:
I'm talking to a sensor using RS232 and the UART of an mbed. However I've noticed that the bits sent to and from the sensor are the exact complement of what they should be. What my mbed sees as a 1, the sensor sees as a 0, and vice versa.
I cannot change the sensor, nor to I want to change any of the hardware. How can I invert the input and output of the mbed's UART?
The mbed uses a Cortex M3 processor.

EDIT: sorry for any confusion. The whole line is inverted. That means that the start and stop bits are inverted as well. The first bit in the message is luckily a 0 (read as a 1), and the processor interprets that as my start bit. This causes everything to be frame shifted by one bit. Luckily the processor is ignoring framing errors.


texts:
I'm trying to control a universal motor run from a 240V power supply using a micro-controller. There is a existing PCB that uses a potentiometer to vary the speed that I am trying to replace. I've identified the triac but the rest of the parts are covered, I've assumed it is something like this:

I've been looking into IC solutions, BJTs, MOSFETs, etc to replace the potentiometer but am struggling to find a solution that I can fully understand and that will simulate. The micro controller will be an Arduino. The motor power is up to around 750 W.

Any help pointing me in the right direction would be much appreciated as I've spent so much time reading around the subject but am not confident with any of the solutions.


texts: Designing a circuit with a bi-colored LED for indicating power vs. system ready

texts:
I am working on a headless Raspberry Pi project. Being headless, I can't visually tell when the system is fully booted and ready to accept tasks. While a Pi doesn't take an inordinate about of time too boot, I am still looking at 30-seconds or so.

What I would like to do is have a bi-colored LED (red-green) that would light up red when when power is applied to the system, but, when the system is ready, my task will pull a pin either high or low, as needed, to switch the LED to green. I do not have any components yet for this part of the project, so I am flexible if it is a two-lead red/green LED or a three-lead red/green LED.

The coding part, I have down. What I could use help with is the circuit.


texts:
This might be a too silly a question to ask, but I am working with the volt-free probes for the first time.

I have a probe TL2 probe that has 4 wires. The user manual states that,

  For ‘TL2’ variant, the RED and BLUE cores are the volt free pair. The
  loop-back is across the BLACK and YELLOW cores. These connections
  are not otherwise polarity sensitive.

I have a board that has a 2-pin connector, one of them is Digital Ground and the other one is GPIO to a microcontroller. FWI, one of the two volt-free pair has to be connected to the GPIO so that it can be used as an interrupt.

Should one of the other probe be connected to the Digital Ground, or the other two wires that are not volt-free?


texts: STM32 enabling clock for port C sets IDR bit 1

texts:
Why does enabling the clock for port C set the IDR bit 1?
It's the configuration for a Nucleo-F767ZI.


texts: Why discharging static to laptop's VGA ground is more disruptive over a pencil then directly?

texts:
When I touch a laptop's corner, USB or VGA port ground with finger, the resulting spark seems not to affect anything.

However I've just tried touching the VGA port's outer ground with a pencil instead of directly with a finger, and laptop's LCD screen "blinked" for a moment at the same time the spark ran between pencil's tip and the ground.

Why can this happen? I expected the pencil will make static discharge more gradual and "soft"...


texts: Best microphone picking up sound within a small room?

texts:
I've tried several Electret Condenser Microphones as input to a generic USB audio sound card:
MO064202-4
MO064402-4
MO064402-5

All mics work great at close range (about 1 or 2 inches). However, none of them would pick up any sound at ranges further than that.

I tried two different pre-amp circuits, they actually made the problem worse.

I suspect, I'm using the wrong type of microphone to pick up sound from across the room.  What should I search for at DigiKey/Mouser/Arrow?

Thank you!

Additional info:
This is for a custom wall mounted all-in-one computer. So a separate boundary microphone is not ideal.  The microphone is only used for short spoken communication, whispers would be nice, but normal conversational level is sufficient. Not for music, not for voice recognition.

The pre-amp I tried uses LM358 op-amp chip. Powered with 9V PSU.


texts: Are most GPIOs on common MCU's merely 'sourcing' or also 'blocking'?

texts:
Granted most MCU's are configured such that to 'activate' a device on a logic high (take the simple case of an LED, or a relay or transistor for something higher power) the MCU is sourcing VCC and the other end of the component is pinned to ground completing my circuit.

My question is what would happen instead if the circuit was say, configured another way ? For example, a complete circuit from an external VCC, running through an output GPIO pin, back out of that pin and then to the load and from there to ground of the external VCC. If a logic low output were asserted on the pin would it act as a 'switch' breaking the circuit ? Or would ext VCC simply overload and override the low logic level keeping the short.

Asked, I guess in another way, can GPIO on most MCU be used as a 'switch' in this inverted way ? Presume external VCC is of the same domain as VCC of the MCU.


texts: Does the magnitude of an impedance have a physical meaning?

texts: An electrical impedance can be expressed as a voltage/current ratio and in an AC scenario its value falls within the complex plane for which we have a real and an imaginary component (resistance and reactance). I was wondering if the magnitude of this complex value has any physical meaning?


texts: power supply management IC switching transistor - flyback converter

texts:
I have a very simple question : is it better to have the switch (transistor) of the flyback converter, Inside the power supply management IC or outside it? or it depend on the application?

Thank you for answering my question.


texts: Rectifier Design with Regulators Surge/In-Rush Currents

texts:
I'm attempting to design my own rectifier circuit to output a positive and negative voltage as shown in the circuit below. I'm running into some concerns regarding the smoothing capacitor choice and how it affects the surge current and the voltage regulator output.

simulate this circuit – Schematic created using CircuitLab

I have my primary side wired to the same voltage input, and the secondary side gets rectified down to \$20  V_{RMS}\$. Smoothing capacitors C1 and C2 along with resistors R1 and R2 maintain the rectified voltages which go into voltage regulators to get the desired output voltage. According to the datasheet, the regulators are rated for at least 1 A, so I picked my test loads to see if each supply can deliver 1 A each. The issue I'm facing is with my choice of capacitors for C1 and C2. Larger capacitors seem to guarantee a stable voltage at the test loads, but doing so results in a larger initial surge current (which in my simulation with the values below is 2.11 A), and I'm concerned that the surge current might be more than what the transformer is rated for. Smaller values result in smaller surge currents, but the voltage is not maintained at the outputs. What is an appropriate trade off between capacitance value with regards to surge current and voltage regulator outputs given  heavy loads?

EDIT: Perhaps my understanding of in-rush currents is missing something. From my textbook, I'm calculating my surge current using the following formula, assuming no initial charge on the capacitor:

\$\ I_{SC} = \omega \cdot V_{Pk-Secondary} \cdot C\$

where \$\ \omega=2\cdot \pi\cdot f \$ and f = 60 Hz

Taking the peak of the secondary to be \$ 20 \cdot \sqrt{2}\$ volts, the resulting current results in a value of 2.13 A. Since the transformer is rated for 2.4 A in parallel, this seems okay in order to not burn it out. Is my understanding correct?


texts: Would replacing a resistor by another one of identical value but higher power rating affect the working of a circuit?

texts:
The schematic recommends using 20 Ω 1W as collector resistance.
What I have at hand are two 10 Ω rated for 10W. I'm guessing the change should be acceptable ...

What difference would it make if i were to use these two instead of that whose rating is specified?


texts: Why does a dielectric liquid need to immerse the parallel plates in a conductivity cell?

texts: For a parallel plate conductivity cell with a liquid dielectric in between, after filling the liquid to the point where it is just enough to fill the space between the two electrodes, does the liquid need to immerse the plates any more above that level? If so, why, considering the surrounding atmosphere is an inert nitrogen gas? One paper i read said its to limit partial discharges, but I don't really understand how these would be caused if its not immersed more than that level while the atmosphere is inert. Thanks.


texts: How to double my clock's frequency using digital design

texts:
I am trying to double my clock's frequency using only gates, flip flops or whatever but unfortunately I get a signal of which the duty cycle is far from 50%. Unfortunately I have to develop my system using FPGA but the chip I work with, does not support a PLL so before trying to work with another board I want to be sure that I cannot get the double frequency of my input clock. The input frequency of my system is 10 MHz and I want to make a signal of 20 MHz. I have done it using the attached circuit and I have also measured it but the duty cycle of it is not satisfying at all. Please I would appreciate if could someone suggest something that could be helpful.

Here is the circuit I have used.


texts:
I a voltage source converter, in order to control the DC-Bus voltage a PI controller can be used. The control method is illustrated in the figure below:

I would like to ask why the input of the PI controller is divided by Vdc_ref?(Vdc_ref is the reference value of the DC bus voltage). If we divide the input by Vdc_Ref the controller will handle smaller values of the voltage error. Does it make the performance of the controller better or there is another explanation?


texts:
I'm having an issue erasing pages or blocks of  STM32F769 flash. Reference manuel says that  The Flash memory erase operation can be performed at sector level, at bank level or on the whole Flash memory.
And as you know if we update any flash address , we have to erase all sector.
In my project, I need to update and  save IP , Gateway and NetMask address(12 byte data) of my device. I am using single bank and the sector number is from 0 through 11.
I need to use three flash address of same sector, For example sector 11.
flashAdd1 = 0x81C0010 //sector11
flashAdd2 = 0x81C0020 //sector11
flashAdd3 = 0x81C0030.//sector11
Or use three different sector and flash address, sector 9 10 and 11.
flashAdd1 = 0x81C0010 //sector11
flashAdd2 = 0x8180010 //sector10
flashAdd3 = 0x8140010.//sector 9
Which one is useful ?
My write function first unlocks flash then erases sector, then program flash  and locks flash . And it works.
When I use the same sector ,  program saves only my last change  because of erasing all sector in every
change. for example when I update Ip address, gateway and subnetmask value are erased.
When I tried using different sector address, it does not work
each time effectively(because of erasing sector time ) I send data to device with an opcode by packet sender terminal.   Program size is about 44 kbytes.
Could you advise me anything.
Thanks.


texts: How to protect a 1A 120V circuit breaker from direct short?

texts:
I am currently working on a test fixture that functionally tests a PCB by applying 120VAC to it's Line and Neutral input. The device under test consumes about 600mA @ 120VAC and should never go above 1A. I have a 1A 240VAC thermal circuit breaker in series on the line input. To test the breaker I created a direct short across the power terminals that apply power to the DUT and got the breaker to pop. However, resetting the breaker does not work. It got pretty warm and I believe it melted internally. This happened with two breakers.

I understand that a direct short pulls an infinite amount of current through that breaker faster than the mechanicals can switch - causing a bunch of heat. So would an inrush current limiter with a steady state value just above that of the circuit breaker (say 1.5-2A) be an adequate solution to this problem?

How can I effectively protect my circuit and circuit protection in this case?


texts: Why output of Op-amp 741 is not high when i used in compared mode.?

texts:
I am using Pic18f452. I have to compare two reading of voltage. i used the op-amp 741 in such a configuration. I am obtaining the feedback voltage form boost converter output capacitor.
The schematic is attached here. I am using this in hardware. just suppose the voltage 4.5v and 4.1V that will be compared to the Boost capacitor output voltage which varies form 0v to 5v.

Now the problem is that when the Boost capacitor output voltage goes just above
to 4.1V the output of op-amp 2 goes to 0v which is right  . similarly , when the boost capacitor output voltage goes above to 4.5v OPAMP1 is turn on. Boost PWM is turn off bu PIc18f452 and the converter start in buck mode.
the output voltage of boost capacitor goes down but now the PIC didnt start the boost when the op-amp agian goes to zero.. it must have to start the Boost PWM.
can you tell me what will the problem with PIC or Op-amp in compared mode.


texts: How to avoid negative resistance of current source in LTspice

texts: I'm trying to implement simple behavioural model of LMx34 devices. Circuit below tends to have negative resistance if supplied voltage drops below current source drop. How to avoid this? I prefer pure B-source solution for some reason.


texts: 4 variable boolean algebra: Converting sum of maxterms to product of minterms

texts:
I am struggling to convert the sum of maxterms:

((¬b ∧ ¬d) ∨ ((b ∧ (¬c ∧ d)) ∨ (¬a ∧ (b ∧ d))))

into a product of minterms.

I use Morgan and get this:

((¬b ∨ ¬d) ∧ ((b ∨ (¬c ∨ d)) ∧ (¬a ∨ (b ∨ d))))

which doesn't have an equivalent truth table.
(btw, this is a very handy site that is helping me
 http://web.stanford.edu/class/cs103/tools/truth-table-tool/ )

I know drawing Karnaugh's make it easier to visualize, but I wanted to learn how to do the conversion algebrically, just using Morgan and distribution laws. Any good soul to enlight me on this puzzle?

thank you really much and sorry for the dumb question!

Martin


texts: I am working on a project that is using an ATtiny861A and this only has one SPI. If I want to hook up a radio and an external memory to the same SPI, will there be an issue sending data from the external memory to the radio? I know I can hook up the external memory and the radio to the same SPI but I am not sure if the radio will be able to send the data saved on the external memory.


texts:
I simulated three phase rectifier using a thyristor like so:

I get the expected result. But if I change the thyristors to IGBTs as shown below, it does not work.

Why do these two circuits behave differently?


texts: Maglev Modelling and Control System Design

texts:
Im trying to model a Maglev system (schematic seen below) the system paramentres are below aswell.

Im aiming to try and get a state space represetation for the system. This is what i have done by hand so far, please excuse my handwriting. Could someone possibly correct me if im wrong or a mistake is made.
States of the system are


texts:
For this circuit I need to find \$V_C(0)\$, \$V_C(\infty)\$, \$i_L(0)\$, \$i_L(\infty)\$, \$V_C(t)\$ when \$t>0\$ and \$I_C(t)\$ when \$t>0\$.

simulate this circuit – Schematic created using CircuitLab

So far, I have

\$V_C(0) = 30\mathrm{V}\$
\$V_C(\infty) = 30\mathrm{V}\$
\$i_L(0) = 10\mathrm{A}\$
\$i_L(\infty) = 0\mathrm{A}\$

To find \$V_C(t)\$, I used
$$
Vc(t) = V_o\cdot e^{-\tfrac{t}{RC}} = 30 e^{-\tfrac{t}{1.5}}.
$$
(I don't think this is the right equation, but I don't know what other equation to use).

To find \$i_L(t)\$, I first found that \$a= R/2L = 3/2\$ and \$W_o = 1/\sqrt{LC} = 1/\sqrt{1/2} = \sqrt{2}\$.

Since \$a > Wo\$, the circuit is overdamped, so I'm using the
$$
i_L(t)= A_1e^{s_1\cdot t} + A_2e^{s_2\cdot t}.
$$

To find $s$ values I used \$-a \pm \sqrt{a^2-W_o^2}\$, obtaining \$s_1 = -1\$ and \$s_2 = -2\$.

Plugging that in, I now have \$i_L(t) = A_1e^{-t} + A_2e^{-2t}\$.

To start solving for \$A_1\$ and \$A_2\$ I set \$t=0\$ so I have \$10 = A_1 + A_2\$.

I don't know how to get another equation relating \$A_1\$ and \$A_2\$ so I'm stuck here.

I thought I was understanding \$RLC\$ circuits, but I got stuck and now I'm not sure that I have any of this right. Could someone please look through my work and see where I went wrong?


texts: Safe voltage for hydrolysis of water - teacher demo

texts:
I am a science teacher and looking to perform an experiment with my students.

I do not have much background in electricity.

My students will be performing hydrolysis of water using a 9v battery.

The separation of oxygen and hydrogen is very slow using a 9v battery and great for a student inquiry lab.

After the lab, I wanted to do a teacher demo with a greater voltage that is “safe” so I could separate more hydrogen and oxygen atoms.

I will be placing the live wires in a beaker and collecting the gasses in test tubes.

What would be a cheap transformer that has a higher voltage, but still safe for me to place the wires in a beaker of water?  Links or product names would be appreciated.


texts: How to wire up a RT314F12 latching relay?

texts:
I want to automate the lights in my house. To do this, I want to use a latching relay, so it will only use current when switching. I found a quite cheap latching relay RT314F12 but I do not know how to wire it up to for example an Arduino. Can any one please give a wiring example?

Thanks


texts:
I have a 5 pin push button in my laptop, that doesn't work.

I have to replace that button, but in my town I don't have any in stock and I can't wait for the delivery from China.

How can I replace this button by wiring the pins? I just need to boot the laptop once.

I will unsolder this button now. This is a video with the same issue

There is a photo of the button:
Thank you.


texts: Anything special to consider when running a 12v "Bus" throughout my house?

texts:
I've recently begun playing a lot with tiny programmable computers/controllers (like the Raspberry Pi and the Arduino), and I'm planning to distribute several throughout my house as various sensors.  So far as I have been tinkering with them I've been using a wall-wart transformer with a USB plug to provide them with 5v (like the one I use to charge my cellphone every night).  The problem with doing this throughout my house is that I do not have an AC plug wherever I would need a device.

I've been thinking about running a 12v "bus" throughout my attic, which would allow me to branch off power for devices wherever I need it.  This way I would just need a 5v regulator to pair with each of the devices.  (The only reason I would run 12v and not straight 5v is because I already have a large 15-amp 12v switching power supply which I could use)

Is there anything special I should consider with this solution?  I feel much safer running 12v around in my attic than I would running my own mains power lines.  Seems like a no-brainer on the surface, but I may be overlooking something.


texts:
EDIT:
Okay so I'm changing the LED I'm using. Now I'm using a 6 Watt LED. There's more info on the link, its a EcoSmart MR16 6-Watt (20W Equivalent) LED Flood Light Bulb (16 WW FL). I know I'm going to have to redo my circuit a bit. But can you help me now? Thanks.

I'm trying to power a 6 Watt LED using 3 NiCad batteries (3.6 volts). But the LED spec sheet says its a 12V LED. Should I use a booster? I don't really have much experience in electronics.

EDIT:
(I deleted some of the old stuff)

I also designed a circuit:

Now the problem seems to be that there's not enough voltage from the battery or enough current in the circuit to power the battery for a long period of time.
I'm powering the circuit through this generator. The generator only provides 8.2 - 9 V and 17 mA. I'm not really experienced in this so can someone help me figure out if a better generator (such as this one) will help me? - btw when I tested how much the output from the motor was, it came to a max of 16V when I was cranking it really quickly.

Another problem with using 3 AA NiCad Batteries seems to be that they won't power the LED for a long enough period of time. Will using capacitors eradicate this problem? And if so which capacitors?

To clarify: The generator is hand cranked and through some testing its max output is about 16 V (cranking it really fast). This charges up the batteries and the batteries then power the 6W LED. I know I need diodes, resistors and capacitors in the circuit, but I've never really worked with this before so any help is much appreciated.


texts:
I am attempting to create an output that goes on for a certain amount of time an then goes low for a certain amount of time and my out simply won't simulate.

Attached is my code, test bench, and simulation.


texts: What is the relation between the power dissipation in resistor and the temperature rise

texts:
Which relation we use to calculate the temperature rise in resistor using the power dissipation.     If we take P=R*I^2 from resistor, how much the resistor heats in this case ?  I know that in transsitor the relation between the power dissipation and the temperature is given by: Pd = (Tj-Ta)/theta(ja), I try to find the relation of the resistor dissipation but i didn't find anything helpful!
Thank you for your help.


texts: What logic function is implemented with these logic gates, how to complete truth table

texts:
I have the following logic gates.

To figure out what logic function is implemented, I try to develop the truth table.

A | B | out (I guess, not sure)
--|---|--------
1 | 1 |    1
1 | 0 |    ?
0 | 1 |    ?
0 | 0 |    1

I feel like when A=1 and B=1 thenout=1. Also, when A=0 and B=0 then `out=1'. However, I'm not sure about other cases. I wonder if anybody can help.

UPDATE:

When A=1 and B=0 (or when A=0 and B=1), then the output of each block of logic gates might be as shown below.

Therefore the truth table might be like this:

A | B | out (I guess, not sure)
--|---|--------
1 | 1 |    1
1 | 0 |    0
0 | 1 |    0
0 | 0 |    1

If my calculations are correct, the logic gates are implementing something like NXOR (or XNOR?). I'm not sure.


texts: Need to understand how LC-filter works, help please

texts:
I am getting confused with LC-filters (also with emi-filters). Capacitors eliminate noise from signals. It bypass it to ground or noise source.
The inductor does not allow high frequency to pass and also reduce current noise and I think it is correct but not sure??

Inductor reactance are linearly promotional to frequency and it is opposite for capacitive reactance. I am also familiar with frequency resonance in RLC ...
I studied first order RC-filters one time. I know how they work.

When I think of LC filters first it comes to my mind is that capacitor limit frequency but not sure what the inductor does?? Signals are DC square waves!!

Could you please tell me which one limit frequency and which one eliminate noises ??

:(


texts:
I'm trying to use the reset pin as GPIO.

This is what I made.

My schematic is this:

So I wrote a very simple code to make that led blink.
This is my code:

#define F_CPU 8000000L

#include <avr/io.h>
#include <util/delay.h>

int main(void)
{
    DDRB = 0xFF;
    PORTB = 0;

    while(1)
    {
        PORTB = 0b00100000;
        _delay_ms(600);
        PORTB = 0b00000000;
        _delay_ms(600);
    }

    return 0;
}

And after this, I disabled the reset enabling the RSTDISBL fuse.
I just programmed the High fuse to: 0xFE

But the led does not blink.

What am I doing wrong?

Thanks for your help guys.


texts: Is a safe 110/120VAC benchtop power tap possible?

texts:
I have a benchtop power supply that provides +3.3, +5, and +/-12VDC. I've started cannibalizing small appliances for parts, and I'd like to have similar power taps for 110/120VAC. Does such a thing already exist? If not, is it possible to build one?

Ideally (for me) it would have some kind of quick-release terminals, though I'd be fine with screw terminals if it comes to that. A dedicated power switch (so I don't have to keep unplugging it from the wall), internal short protection (so I don't have to make repeated trips to the breaker box), and a visual "this is live, don't touch exposed metal" indicator would be nice.

Most of my experience to date has been with low voltage DC; I've worked with mains-voltage AC enough to respect it thoroughly and to not mess with Things I Do Not Fully Understand.

EDIT: Thanks to another question here, I found Wago, which makes terminal blocks that I think will work. The other parts of the question remain open.


texts: Setting D+ D- ports to set 12V From Qualcomm QC Chargers

texts: I have a Qualcomm charger that I would like to output a constant 12V/ 20V. I know phones and tablets that support QC protocols set D+ and D- for different voltages (as in picture below). I'm wondering if the attached below picture will allow me to get say +12V from the charger safely and is it a electrically sound idea? Or should I just regulate from the VBUS itself?


texts:
I'm trying to make a low inductance measurement using CC Clapp oscillator.

I calculate things, I get strange results.

Would someone please write me the formula solving for Lx?

And how do I calculate the total capacitance here, are they all in series?
I applied to this formula \$\frac{1}{6.28f}^2 C\$.


texts: What is the easiest way to add noise to a circuit?

texts: I'd like to have a sinousid wave with some noise. Then use that signal as input for an arduino, visualize that signal in Matlab and use a simple filter (moving average, for example) to remove the noise. To create the sinusoid I'm using a little DSO Nano v3 but I don't know a simple way to add noise (real noise, I don't want to add noise through Matlab).


texts: How to connect decoupling capacitor when VCC/GND pins aren't close

texts:
I'm making a board which will host an ATmega 162 microcontroller in PDIP package. Unfortunately, VCC and GND pins are diagonally arranged. From what I've read, the capacitors should be as close to the pins as possible for maximum effect.

Right now, I can see 3 ways to connect the capacitors. Run wires to the capacitors so that they are at equal distance from both pins, place capacitors near ground and run wire to VCC or place capacitors near VCC and run wire to ground. There's always the "none of the above" option too.

How do I make right decision in this case? Or is is irrelevant?


texts:
I have couple of questions:

A square signal goes through a low pass filter and in the output of a circuit we get a sine. What happens there? Give a scheme?
This is really weird, because, from what I have studied so far, only sine inputs are sine outputs from an LPF filter. I am reading it here. According to my source, it should be a triangular output, how comes it is sine?

Suppose that we have an AM DSB-SSB signal, with modulation index μ = 1. We degrade the carrier by 20dB and we also cut the one sideband. We send the result of this to an amplifier of +20dB gain. So at the output, we receive power that equals to 200W. How much was the original power of the carrier?
SSB has only one sideband to begin with, so only carrier is left after the sideband is cut. We degrade carrier by -20 and then we amplify it by +20, so I believe that original power of carrier is also 200W. But it looks so extremely simple, anyone could shed some light here?


texts:
How do I select the correct transformer (voltage) to drive a series of LED's.

Note: I have seen other Questions about this, but not like this here.

The voltage for a series of ordinary LED's are simple:

Example: Using 10 pcs. @ 1.6 Volt requires 10 x 1.6 Volt = 16 Volt (and at a voltage source above, using voltage divider/regulator).

But transformers, have:

a non-load voltage factor, and;
a the peak voltage on the AC sinus.

So take a 16 Volt transformer, then the sinus peak voltage is 16/0.707 =  22.3 Volt

Note: it is presumed the AC is already rectified to DC-sinus with diodes (bridge).

Problem is:

If I go for the 16 Volt (the transformer RMS) in the LED calc, then the
LED'S are overloaded from their 16 Volt max. to the sinus peak at
22.3 Volt. Considering the fraction of time they are, may still not be a healthy solution.
If I go for the 22.3 Volt (and use 14 diodes x 1.6V = 22.4V), then
they are underpowered most of the time (only full at the sinus 22.3
Volt peak). A capacitor could help, but considered as the "bulky" solution.
The I could use one of those famous L78xx/LM317 regulators. But this
poses another problem: To get the most from the DC sinus, I need the
lowest sinus part AKA not the small top to get most efficiency. That
means regulating a higher voltage down (chopping off the small sinus
top). A capacitor could also help. Either both burns off energy
as heat in the regulator.

Are there any suggestions (here answers) for the best compromise to make such LED power source?


texts:
I'm wondering if anyone would be willing to help me with the basics here. I'd like to create a circuit, as small and simple as possible, with off-the-shelf components, that will allow me to turn on an LED when the temperature of this particular thermistor (MA100BF103A) exceeds 37 degrees C.

The resistance vs. temperature values for this thermistor are online here.

Is this even possible without something like an arduino? What parts would I need, besides the thermistor and an LED? How would I wire them together?

I'm a complete novice. Thanks!


texts: How can I connect BeagleBone to 2 slaves with 1 "Chip Select" pin?

texts: I have a BeagleBone white and I want to use it as a master which is connected to 2 slaves via an SPI connection, besides SCLK, DIN, and DOUT there is one pin of chip select "CS" "just one" and I need 2 because I have 2 slaves, what I already knew is that I can use any GPIO pin as chip select, but when I saw the "CS" pin I get confused, can I use any GPIO pin as a chip select ? if yes, why there is a pin with the name of chip select ?


texts:
I am using a MEANWELL 35-B power supply to power the circuit(Datasheet).
It says in Datasheet that the ripple and noise are about 80mV p-p for the 5v o/p.

I have Powered a strain gauge type pressure sensor using the 5v output of power supply. I am using an HX711 ADC to get digital values but the ADC output shows fluctuations and are unstable. I am guessing that the fluctuations arise from powersupply as i am powering ADC unit as well as sensor using the supply . I dont have (and dont know how to use)the DSO to check the ripples and noise.

Questions :
1)Can i reduce noise ?

2)Can i add capacitors (i havent used any yet) to reduce noise ? How can i determine the value of capacitors ? is there a way to calculate cap .value using the noise specs of powersupply ?

3)Any other ways i can try to reduce analog noise like series resistors on sense rails?


texts:
I am using TM4C1230C3PMI controller from Texas instrument in one of my project. It has 32KB of internal flash, which is not sufficient for my application. Higher flash sized micro-controller are available in the market which can be used but I want to go with this micro-controller only. As per my knowledge external EEPROM can be used to increase the total flash size (Program memory).

Is my thinking is correct?

If not please suggest how can I increase the total flash memory size of the controller?


texts: Sound through the earphone is also sent to the amplifier when using a jack splitter after a audio mixer

texts:
I implemented the following audio mixer circuit with just 2 input audio sources:

http://www.theorycircuit.com/audio-mixer-circuit/

Both sounds got mixed properly.

Then, at the end of that audio mixer I connected an audio splitter like the one below:

which provides me two female connectors.

Then:

on one female I connected an amplifier with a speaker
on the other female I connected a headphones (without microphone)

(for more details, please, check the image below)

My problem is: If I speak through the earphones of the headphones, then I can hear that on the speaker and I don't want that to happens. I just want to listen what's comes up from the mixer but nothing else.

Any idea on how to avoid this to happen? (which is actually weird, I could not expect that to happen).

Thanks in advance!


texts: I'm a student(don't know much on Eagle) working on a project where I need a way of multi-touch finger tracking on flexible material. Will flex pcbs work?


texts:
I found the following statement on Richard Dawkins book The Selfish Gene (1989):

"... there are some ten thousand million neurones in the human brain: you could pack only a few hundred transistors into a skull."

Is this statement still true today? Thanks.


texts: SPI using STM32's DMA sends one word too much

texts:
On an STM32F103 I configure SPI in 16bit wide mode and set up a DMA transfer to transmit one byte:

SPI2->CR1 &= ~SPI_CR1_SPE;
SPI2->CR2 = 0;
SPI2->CR1 =
    SPI_CR1_SSM |
    SPI_CR1_SSI |
    SPI_CR1_DFF |
    SPI_CR1_SPE |
    /* Some baud rate flags */ |
    SPI_CR1_MSTR;

/* Set up DMA transfers */
DMA1_Channel4->CMAR = (uint32_t) /* some buffer */;
DMA1_Channel4->CPAR = (uint32_t) &SPI2->DR;
DMA1_Channel4->CNDTR = 1;
DMA1_Channel4->CCR = DMA_CCR4_MINC | DMA_CCR4_EN;

uint16_t dummy = 0xFFFF;
DMA1_Channel5->CMAR = (uint32_t) &dummy;
DMA1_Channel5->CPAR = (uint32_t) &SPI2->DR;
DMA1_Channel5->CNDTR = 1;
DMA1_Channel5->CCR = DMA_CCR5_DIR | DMA_CCR5_EN;

/* Transfer */
SPI2->CR1 |= SPI_CR1_SPE;
DMA1->IFCR = DMA_IFCR_CTCIF5 | DMA_IFCR_CTCIF4;
SPI2->CR2 |= SPI_CR2_TXDMAEN | SPI_CR2_RXDMAEN;
SPI2->CR1 |= SPI_CR1_SPE;

I connected a counter to the SPI's clock line and the above code produces 32 clocks. No interrupts are enabled or whatsoever; the behaviour can constantly be observed. If the DMA is set up to transmit zero bytes, no clocks are generated.

Why does it clock out 32 bits?


texts:
In the physical layer of USB 3.0 there is an 8b/10b encoder.

Wikipedia says that this eliminated DC offset, while the tutorial I am reading says

  it is a common encoding scheme in high-speed serial designs

What is the purpose of this encoding in the context of USB? Additionally, what other applications and benefits does this encoding provide in other types of devices?


texts:
I have the Arduino Mega 2560 R3. I know that it has a recommended Voltage of 7-12v with limits of 6-20v but is this over all pins or per pin.. ??

The data sheet mentions that DC Current per I/O Pin is 40 mA but the analog pins are inputs.. Aren't they..??

I'm using the Analalog pins as I'm reading temperatures from multiple rooms and then analyzing this via a vb program.

Lastly each room has 2 feeds. Ground & 4-10v Dc. Can each probe use as single Analog pin but they all share 1 of the 2 Ground pins..??

Sorry.. New to this world...


texts:
I'm an intern who was tasked with finding a way to switch on a motor and solenoid from either 120 or 240 VAC. The circuit on which my supervisor suggested I base my design can be seen below.

My question I guess is this, I've been doing a lot of research in order to find the proper way to limit current into the triacs gate but I continuously see examples which more closely resemble the next image, which removes the resistor going to the AC Neutral line. What are the benefits of doing it one way over the other? (I'm kind of a beginner, not to mention an underling at my company so I don't want to suggest an alternative design unless I know why I'm suggesting it...)

Also, while this isn't part of my original question I'd appreciate a little sanity check on it just so I can be sure. Going off the second topology (without the resistor to AC Neutral), I found an application note which said that the on current going into the triacs gate should be 10 times the gate trigger current Igt, which for my triac is 50 mA, so with a 120 VAC supply I have selected a 240 ohm resistor for half an amp of gate current, and using (I^2)*R that would give me around .6 W of power dissipated across the resistor. Would it be reasonable to use a 1 W rated resistor for this type of power dissipation? I feel like I did the calculations right but it seems like every time I say that I end up blowing something up...

Thanks in advance for any help!


texts: LTSPICE Logic Buffer: What does the extra pin do?

texts:
I give up... what is the extra pin for?

LTSpice Documentation is horrible....


texts: How does this mosquito zapper circuit work?

texts:
For the purpose of learning, I have tear down a small mosquito zapper racket.

I am now trying to understand how the circuit is working  (which goal is to produce high voltage).

(yellow = resistor, black = transistor, red = led, gray = diode, blue = capacitor, brown = switch or wire) Battery is on the left, high voltage output on the right.

How I think it works : the transistor generate pulse (square wave?) which is fed into the transformer. The transformer multiply voltage, then voltage is rectified trough the diodes, and finally stored in the big capacitor. Can anybody confirm this ?

Also some other things are still unclear to me :

How does the 6 pins transformer works ? I already saw 5 pin transformers (http://en.wikipedia.org/wiki/Center_tap) but never that one.
How does the transistor generate the pulses. I have seen some led blinking circuits but they always involve a transistor and a capacitor.
What is the purpose of the two resistors in parallel with big capacitor? (to limit voltage, for safety ?) and also why do we need the small blue one ?

EDIT1 :
I tried to reverse-engineer the circuit. Here is the result. I'm no sure about transistor configuration (eg : if base, collector and emitter are correctly set) and same about transformer.

EDIT2 :
I open racket again. I found transformer pin-out by measuring it with multimeter (as jippie suggested). I also found transistor configuration by reading number information on it and checking datasheet. It seems what Spehro Pefhany suggested was right.

simulate this circuit – Schematic created using CircuitLab


texts: Setting prescaler for 8MHz external oscillator in Atmega2560

texts:
I am relatively new in Atmega MCU's (too used with graphical interfaces). I am using an external clock with 8MHz in my Atmega2560. My problem is that I cannot use UART communication with PIC18->Atmega2560 and STM32F4->Atmega2560 (no acknowledgements).
I thought that it is my baud rate that is not right, maybe the Atmgea2560 is using prescaler div by 8 in default (not familiar with Atmega). So, I forcely changed the prescaler to div by 1 using this little code:
void setup() {

  noInterrupts();
  CLKPR = 0x80; /*Enabling the clock prescaler function*/
  CLKPR = 0x00; /*Setting the prescaler to div by 1*/
  interrupts();
}

I also use this one in the bootloading/programming:
2560.menu.clock.8MHz_external=External 8 MHz
2560.menu.clock.8MHz_external.upload.speed=57600
2560.menu.clock.8MHz_external.bootloader.low_fuses=0xf7
2560.menu.clock.8MHz_external.build.clkpr=
2560.menu.clock.8MHz_external.build.clock_speed={build.f_cpu}
2560.menu.clock.8MHz_external.build.f_cpu=8000000L

Now, when setting the Atmega2560 Serial, Serial1, Serial2, and Serial3 to 9600 baud rate and PIC18/STM32F4 to 9600 baud rate, can my problem in UART be vanished (ack's will receive)? -theoretically
I cannot verify it now since it is weekend, things are in the office.
To those who are expert in these things, your help is much appreciated.
Regards,
Tim


texts: Arduino solar panel watt meter values reading 0's

texts:
I've been building a Arduino Watt meter for the past few weeks for a solar panel, and have successfully measured voltage and current separately. However I need to know both to calculate watts but can't seem to get the circuit I have working. I've attached the circuit I've attempted to build as well as a picture of the schematic I've followed. I only get 0's coming from this setup, which isn't helpful. If someone can see what is wrong with my circuit setup or schematic and point me in the right direction, I would be ecstatic.

The only difference between my setup and the schematic is the voltage divider, where I divide the voltage by a factor of 5 to keep the Arduino from frying. I'm also using the acs712 instead of the acs715.

The red wire going out of the picture goes to the positive end of the solar panel, the white wire with black tape going off screen goes to the negative end of the solar panel.

//#include SoftwareSerial.h
float sensorVals[] = {0};

void setup() {
  Serial.begin(9600);
}

void loop() {
  float sensorVolt = analogRead(A0);
  float sensorVolt2 = analogRead(A1);
  float sensorCurrent = analogRead(A5);

  float amp = sensorCurrent * (5.0 / 1023.0);
  float voltage = sensorVolt * (5.0 / 1023.0);

  sensorVals[0] = voltage;
  sensorVals[1] = amp - 2.51;

  // print out the value you read:
  Serial.print(sensorVals[0]);
  Serial.print(", ");
  Serial.println(sensorVals[1]);

  delay(1000);
}


texts:
I am making an RS485 master device. The prototype is able to successfully transmit and receive from a Modbus slave, using 2-wire (half duplex) mode. Full duplex operation is planned, haven't tried it yet.

Does the MAX489 require any pull up/down biasing resistors? I can find no mention in their docs about this, nor specifics about 'fail safe' biasing.

Edit - actually it does sort of mention, there is a pull up for an open network condition. Does this suffice or is a pull-down also needed?

Thanks.


texts: Clamping diode between supply and output of an opamp

texts:
I am trying to create a test board for Apex MP38. I am following their own evaluation kit design and noticed there are 2 clamping diodes between the OpAmp's output and the positive and negative rails:

My question is, why they have put this divides? what will they do? what is the effect of their presence in the overall output of the opamp? Because in the datasheet the typical application DOES NOT have these diodes:

Further more, the evaluation kit does not list the part number of these diodes. Judging from their size, I think they are DOA201AD...something like 1n5408 maybe? Silicon or Schotkey? any ideas?


texts:
I'm trying to code the DACs in the Teensy 3.6 to a synthesizer.
The problem is that when I write in any of the registers to control the DAC module, the Teensy just stops responding!
Does anyone know if it is needed to initialize something before accessing the registers?
The basic code is below:
void setDACPos(byte pos){
   DAC0_C2 = (pos << 4 )| 15 ;
}
generateDacBuffer();
void setup() {

  DAC0_DAT0L = 0;
  Serial.println("asdasd");
  generateDacBuffer();
  setDACPos(0);
  DAC0_C1 = 1 | 1 <<6;
  DAC0_C0 = 1<<6 | 1 << 5 |  1 << 4;
}

int counter = 0;

void loop() {

  setDACPos(counter); // selects the value to output from the buffer at counter
       position
  counter++;
  if(counter == 16){
    counter = 0;
  }

  delay (1000);
}

 void generateDacBuffer(){

  short deltaValue = 100;
  short startValue= 200;

  short* regs =(short*) 0x400CC000; // adress to the first buffer register =
    DAC0_DAT0L
  // also craches if i use variable  DAC0_DAT0L

  short value = startValue;
  for(int i = 0; i < 16; i++){

    // crashes below
    *regs = holder;// also craches if i use variable  DAC0_DAT0L

    value += deltaValue;
    regs++;
  }

}


texts:
I am building an electrical load, capable of "sinking" 0 - 3A on a maximum of 60VDC. I want to control the load with a microcontrollers ADC (0-3V). On the internet you find hundereds of circuit propositions, that build around bipolar transistors or FET. I chose a design with a NMOS FET as actual sink.
The circuits principally work - but a FET is a capacitive load. So the circuit I built (following an article on design ideas (google "Power-MOSFET-is-core-of-regulated-dc-electronic-load") is oscillating.
I need my design to be as failsafe as possible. Merging all information I have I ended with this  around a PowerFET and a PI control loop.
I started by a simulation with TINA-TI. But I have some doubts about the results:

Why do I have this huge Peak in the beginning of a transient analysis (Zero initial values)?
The current sense IC INA168 should provide a linear output tension - why do I have 72mA flowing after a step response of 500mV, 3.4A after 3V and nothing useful after 50mV?
Is it normal that the OP Amps are staying at -VCC with 0V input? shouldnt the have 0V at the output aswell?
Does this transient analyses make sense at all? Which other analysis should I perform?

Unfortunately stackexchange doesn't let me post more than 2 links, so I cannot post the other simulation results.


texts:
I tried to repeat the scheme for DS and general recommendations for the design of step-down regulators.

My scheme:

My PCB:

It seems everything is designed correctly. But the TPS output gives 0V. (Pin EN floating)

What could I have done wrong?


texts: ARM Cortex (M3-M4): manufacturer and development IDE

texts:
I would like to do some MCU programming this summer and I've already had some unfortunate experiences with the STM32F4 DISCOVERY board, particularly the fact that it came without any (free) software which would allow unlimited use (more than the 16KB or 32KB from both Keil and IAR).

Currently I'm also planning on buying a few ATTiny and ATMegas for smaller projets, as well as an ISP programmer and a JTAG debugger. That would point me towards Atmel as far as costs & IDE are concerned.

I read a piece of this other discussion: ARM Cortex-M3 development tools? and I've seen that I tried something that had been pointed out there.

I used the CodeSourcery toolchain as well. Under GNU/Linux the only library that worked (for me) was Chibios. I setup Eclipse with the gnuarm plugin. Maybe I just didn't do it the right way (or maybe I didn't understand correctly what it is for). Also uploading the code (4KB) took like 5 minutes. It wasn't that bad, but debugging was very far from stable (lots of error messages that I should analyze as soon as I have time: for now that's a secondary problem).

I'd liked to try out Coocox but it didn't let me upload the code (I needed the hardware interface I suppose, their chap JTAG interface).

The question is therefore: is there any manufacturer that actually supply a software free to use without limitations on lines of code or size of code ? For now I only found Atmel which now includes support for both ARM and AVR in their Atmel Studio 6 based on Visual Studio 2010. ST and NXP don't seem to offer any. TI seem to offer their CCStudio[Code Composer Studio]  but it also has a limitations on the maximal size of code that can be produced.

I'd have no problem in doing it in GNU/Linux (in fact I'd prefer to), but I would like it to be well supported under it.

I'm wondering if the other manufacters offer something more: the ARM architecture in itself (Cortex M3/M4 or others) should be pretty much standard. What differentiate one MCU from another are the peripherals around it, if I understood correctly (and I'm hoping some manufacter other than Atmel is actually providing some software along, which is not code-size limited)? I'd be particularly interested in high speed ADCs (and MCU's frequency as well), but I've seen on some catalogues that it doesn't change that much from one manufacturer to another.

Just a curiosity: if I want to send data from MCU to PC using serial communication (for instance, USB), does the MCU have to be VERY fast if I want to transfer data a full speed (say 480Mbit/s for instance needs what: 480MHz ?) ?

I'm open to suggestions. Thank you very much in advance.


texts: The following schematic shows a PNP BJT driven by the output of a logic gate. When the logic gate output is high the transistor must be off and only be activated when the logic goes low.The problem is while the cap is charging the base voltage exceeds the reverse Vbe breakdown which is around 5v. Is there any solution?


texts:
When we say capacitance is important in serial communication, whether we think of parasitic capacitance? So the lower parasitic capacitance in cable, less is voltage drop and the longer distance we can pass over? Or we are talking about some other capacitance?

I assumed that because we have two parallel conductors close together and air between them, so it acts like capacitor, am I right?


texts: Circuit not working: Differential impedance, or skew, or a different problem responsible?

texts:
For a hobby project, I am designing a circuit that converts displayport to APIX2, which is a serializer protocol used in cars' infotainment systems, mostly BMW. This is done by an INAP375T IC, APIX is basically LVDS.

I am using a FR4 four layer pcb, which according to the manufacturer constists of:

layer1     35µm copper
separator1 181µm
separator2 181µm
layer2     35µm copper
separator3 710µm
layer3     35µm copper
separator4 181µm
separator5 181µm
layer4     35µm copper

I don't know what the inner layers are called, I used the term separator; total thickness is 1.6mm. My traces are 0.3mm wide and 0.3mm apart, which results in 109 ohm Z_diff and 70 ohm Z_o, according to saturn pcb toolkit, when using layer2 as ground layer.

The manufacturer of the APIX2 ICs (INAP375T, inova semiconductor) states these rules:

-constant distance between the diff. traces
-pairs equal in length to avoid skew
-designed for 100 ohm impedance
-no vias, stay on top layer
-100nF 0402 or 0603 caps, ac-coupled signals

The QFP 100 IC is located on the left side. In between the diff traces theres a decoupling cap in 0603. The traces go to the right side, and just before they enter the connector there's an esd protection diode array with the ground tap in the middle (according to the manufacturer#s suggestion). After this diode array, the traces continue at 0.2 width and 0.3mm distance.
The lengths are (top to bottom): 34.06mm, 34.00mm (that's the transmitter pair), 30.62mm, 30.97mm (receiving pair).

The transmitting pair is running at max 3Gbit/s, although I slowed it down to 1GBit/s for the sake of debugging and testing, receiving is done at 62MBit/s.

I got the pcb and assembled the parts by hand. I programmed the microcontroller to interface with the INAP375, and set up a configuration which I know is working on a development board from inova.

But, I do not get a link between the transmitter and the display. ANd now I am lost, where to search for the error. My main question is:

Is it possible that the impedance mismatch is responsible for the failure, or the almost non-existing skew?

The config I programmed into the INAP375 works perfectly on said development board. Transfering it to my own pcb results in instant connection loss, which makes it very hard to search for an issue within the configuration. But I somehow doubt that a length skew with this little difference has an impact on the performance. Which leaaes the impedance mismatch, but I wonder how to improve the design. I could go back to 0.3mm after the esd diodes, but does it really affect the transmission by this much? Apart from that, I don't know what else to do.


texts: Adjust a 868MHz PCB monopole antenna to work better at 915MHz

texts:
I am designing a PCB monopole antenna to work with a transceiver (C110L) operating at 915MHz.  The manufacturer provided a reference design, however the reference design appears to be have been designed for 868MHz.  It also states that this design should also work for 915MHz (due to the large bandwidth of the antenna design), however, I'd like to further tweak this antenna to make it work better at 915MHz.

I got a PCB fabricated that made an exact copy of the reference design, and got almost the same results as shown in the reference design.  During my bandwidth measurement testing, the center frequency hovered around 870MHz.  However, I'd like to see if I can adjust the design such that that center frequency is closer to 915MHz.

In theory, it appears that I should slightly shorten the total length of the PCB antenna trace.

If I wanted to adjust the dimensions of this antenna (i.e. total length), what is the best way of going about this to ensure I won't mess anything else up?  From my calculations, I should shorten the total length of the PCB antenna trace by about 5% (870/915 = 0.95).  However, I could go about doing this multiple ways:

Reduce the length of L4 only, such that the total length of the entire trace is 5% smaller.
Reduce all lenghts of all segments of the trace by 5% (including L4, L3, L2, L1).

I do not believe I need to change W, as changing that might change the impedance.

Is my understanding correct?  Can I simply alter some of the dimensions of this reference design in an attempt to get the center frequency closer to 915MHz?  What is the best way of going about this?


texts: How do you get rid of faded component designators after copying and pasting components in Altium?

texts:
When copying and pasting a component that already has a designator in an Altium schematic document and assigning it a new designator, the designator from the original part still shows up as a ghost, as shown in the picture.

How do I get rid of this?


texts: Calculation of active power and apparent power through sampling

texts:
I'm currently working on a power meter device based on simultaneous sampling of current and voltage values, I intend to use this system to measure the active, reactive and apparent power on a non-linear load.
I am currently able to sample the current and voltage values periodicaly and to estimate the RMS value of the those by calculating the power of 2 of each sample, averaging them out and taking the square root afterwards. However I don't know how to estimate the active power value.

How can I estimate the active power value on my system? Please cite a paper for reference if possible, I have to put this in my monography.

Thanks to whoever answers.
Tchau


texts:
I am working on PIC18F4550.

I have configured PORTA Pin0-Pin3 as inputs using following code

PORTA=0X00;
LATA=0X00;
ADCON1=0x0F;
CMCON = 0x07;
TRISA =0XCF;

and PORTE as outputs using following code

TRISEbits.TRISE0=0
TRISEbits.TRISE1=0;
TRISEbits.TRISE2=0;

I have connected a passive keypad to this pins and I am just scanning inputs by making outputs 1 at a time.

But I am getting very erratic values in PORTA register. I even tried debugging using pickit3. I set a break point just after making output 1 and before I scan for inputs. PORTA register is changing in whimsical manner even when I haven't pressed any key. Please suggest what I might be doing wrong.


texts: Frequency Compensation Necessary for a Buck Converter?

texts:
I've been tinkering with switch mode power supplies recently and it seems there are various types of buck controller IC's some with a 'COMP' pin for frequency compensation and some without, and I was wondering what the major trade offs are to having or not having this input? I know that well designed frequency compensation can control your feedback gain and stability so does that mean that the chips without that pin are inherently unstable?

For example two chips I am looking at are the TPS54531 from TI and the MC34063A. The MC34063 is appealing because it's cheap and a buck converter design with an external switch for high amperage seems fairly straight forward. The TPS54531 requires frequency compensation which is a bit more complicated and the chip appears to be much more expensive.

Are there chips that are cheap that allow for frequency compensation or is it something that I don't even need to worry about?

Edit: I also found this application note for the MC34063A useful: https://www.ti.com/lit/an/slva252b/slva252b.pdf


texts: Looking to find out how to power 2x 12v, 0.2amp, 3pin computer fans through an arduino uno

texts:
I'm fairly new to using Arduino boards. I'm trying to make a fan controller for two 3-pin fans that run on 12V at 0.2 amp. I read that all I need is a power supply that will run at 12V and #of_fans * the amp of each of them, so in this case 0.4 amp. I'm having trouble finding a power supply that would work in this case and I'm confused how I would use it. Would I be running the power supply through the arduino, or would that damage the board?

Thank you.


texts: How do manufacturers limit bandwidth in oscilloscopes?

texts:
I would like to know how do manufacturers limit the bandwidth through software options in oscilloscopes? If i have a MSO with 1GS/s, but e.g. just have 70Mhz out of possible 200Mhz (via software option), do the digital channels sample at 1GS/s or are they as well slowed down? I always read of bandwidth upgrades, but the sample rate seems not to be affected. Is this correct? And how do manufacturers limit the bandwidth? Just by not enabling the necessary horizontal scale or how does it work?

Thank you!


texts: Using 120 VAC 60 Hz battery charger with 50 Hz AC

texts:
I live in Australia (220-240 VAC, 50 Hz mains). On a recent trip to the United States (110-120 VAC, 60 Hz mains), I purchased some battery-powered tools that came with a charger. The charger has this printed on it:

I have a transformer for converting Australian mains to 110 VAC:

It is just a transformer, not a frequency converter.

Is there any reason to be concerned about putting 50 Hz AC into my new charger? My thinking is that there is not, because the charger is converts the AC current to DC anyway, before feeding it into the battery.

Problems with AC frequency have to do mainly with induction motors, I think. I found this question, and some others, that seem to confirm that.

I can open up the charger to see what circuitry is in there, but I'd rather not if I don't have to.


texts: Can anyone identify this 2-pin connector (male & female)?

texts:
I'm trying to find the type of connector in order to build an extension cable, that's used to connect to a speaker.  The top clicks in and one of the pins has a angle to its housing to ensure correct connections.

I've looked on various electronics ordering sites, but haven't been able to find the name of the connector.


texts: How can I repair a ps2 ribbon cable's connector?

texts: Recently I tried to fix my old ps2 slim that didn't read disks anymore. When I removed the lid I noticed that the problem was that a ribbon cable connector was broken. Can it be repaired? If that's the case how can I reattach the connector and make sure it has a good electric connection?


texts: Demodulation of direct sequence spread spectrum technique

texts: I can't intuitively believe that a signal could be demodulated whose voltage is below the noise floor. Can some one explain me how this demodulation of direct sequence spread spectrum happens without mathematics ?


texts: BJT Topologies - Design Principles at RF

texts:
Here are some rules of thumb I've learned when designing single-transistor BJT amplifiers:

High input impedance is good
Low output impedance is good
Biasing resistors should draw ~10% of the collector current
Base terminal is ideally at >2VDC (for temperature stability)
Degenerate slightly to provide better linearity

How would these design principles change when working with HF, VHF, or even UHF frequencies?

I imagine that #1 and #2 above would no longer work, because we need to match all input/output impedances to 50Ω (or whatever characteristic impedance is being used).  I also expect that degeneration would be a lot more important, to avoid miller capacitance.  Is there anything else major I am missing?


texts:
I am trying to control a relay from an Arduino compatible board. When I try to activate the relay from the Arduino it takes at least a second to switch closed and sometimes does not switch closed at all.

I am using this relay board. Here is the circuit diagram:

Digital pin 2 of the Arduino is connected to IN0 of this circuit (bottom left). I set it low to switch on the relay. VCC and ground on the low-voltage side are connected to ground and 5V pins of the Arduino. The high-voltage side (JD-VCC) is connected to a 5V 1A power adapter which also powers the Arduino. The jumper on the top left of the circuit connecting the high-voltage and low-voltage sides has been removed.

A photo of the assembled circuit is here.

Could someone please help me with the possible reasons why the relay switches with a delay?

One reason I suspected is that I have connected the power supply to the relay coils by thin jumper wires. But the specification says that the relay draws a current of 80 mA. So I was hoping that the wires would be good enough.


texts: STM32 H743 HRTIM with multiple PWM outputs

texts:
my question got closed on the programming forums, and was told to post here.
I have a project with an STM32 H743 on which I am generating 6 PWM channels to control a brushless motor. Everything is working fine, however I am trying to increase my PWM duty resolution.
I am currently using TIM1 for this, a 120MHz clock for and a 4999 ARR, which gives me a 24KHz PWM frequency.
Going through the H743 datasheet, HRTIM has max clock of 480MHz. It is also capable of multiple PWM channels (10). So I thought I would research how to set it up but sadly there aren't many guides out here.

Here's how I set it up on TIM1 through cubeMX:

overall, that was really straight forward. However, when it comes to the HRTIM the configuration is really different and I'm a bit lost.
I first setup Timer A through C with both output active:

Then on the Basic/Advanced configuration, I chose basic with allows for PWM configuration, and repeated this for all 3 channels:

This is where I am getting lost. What I want is, like with the center aligned mode I had setup with TIM1, to have both a high/low for each channel, so I am tempted to set change the polarity and idle levels here, so that in this example, TA2 is the inverse of TA1 (like CH1N is for CH1 on TIM1).
here is my one question (if there is a single rule question here):

on TIM1, selecting center align mode 3, all 3 channels are sync'ed up. Again, this is not the case with HRTIM, how do I go about syncing these 3 channels?

if more allowed, then I'd like to ask what register is used to apply a duty cycle. The main reason I am considering switching to the HRTIM from TIM1 is to increase the resolution, by hopefully a factor of 4.
Cheers


texts:
When does the NMOS form the channel? VGS > VTH or VGB > VTH?
I see that textbook talks about VGS > VTH, channel formed,  but the capacitor is formed between the gate and the body, so i think it should be VGB >VTH?


texts: How to set two timers running at the same time in atmega328p?

texts:
I want to set up two timers running two ISR-s with different resolutions.
One timer for counting milliseconds for clock time, another for counting microseconds when requested.
I've set up Timer1 and Timer2 in CTC mode, but timer with microseconds(Timer2) gets higher priority and timer with milliseconds is ignored(Timer1). Whereas they work separately well.

The setup:

void timer1CtcInit(void)
{

  TCCR1B = 0;
  TCCR1A = 0;

  //set CTC mode
  TCCR1B |= (1 << WGM12);
  // enable compare match interrupt
  TIMSK1 |= (1 << OCIE1A);

  // set OCR0A value for 100 msec
  OCR1A = 0x0619;
  //set 1024 prescaler
  TCCR1B |= (( 1 << CS10) | (1 << CS12));
}
void timer2CtcInit(void)
{

  //Timer 2 interrupt service routine CTC settings, 1 uS:
  TCCR2A = 0;
  TCCR2B = 0;
  //set CTC mode
  TCCR2A |= (1 << WGM21);
  //prescaler 1 for timer2
  TCCR2B |= (1 << CS20);

  // value for 1 usec
  OCR2A = 0x0f;

  //set compare match for register OCRA
  TIMSK2 |= (1 << OCIE2A);
}

ISRs:

ISR(TIMER2_COMPA_vect){
  if (timerFlag){
    tmr2Count++;
  }
}

ISR(TIMER1_COMPA_vect){
  tmr1Count++;
}


texts:
Is there an internal component in usb-c that helps hold the connection tight?

I have 2 usb cables by 2 different manufacturers.
One I bought last year by some random company named 'SUNGUY' on amazon.
And more recently splurged for fancy Anker ones.

The Anker ones don't stay in as well as the SUNGUY one.
There's a subtle click of sorts for both, but much much more pronounced for the SUNGUY one.
I can dangle my phone by the cable with the SUNGUY one for example, but it'd fallout for the anker one.

I measured both connectors with a decent caliper and both came out to 2.41mm x 8.31mm +/- 0.02mm.
So I don't think it's the external part that's making the difference in the security of the connection.

I have tried other cables since, all behave like the Anker one.
Which is unfortunate because I want more like the SUNGUY one.
https://www.amazon.com/gp/product/B07Z4BMRXG
is the SUNGUY cable. Nothing there seems to suggest it's special in anyway?


texts: Transmission Line open and short analysis

texts:
I have a transmission line with the following given parameters:
Characteristic impedance at 50 ohms, phase as measured using VNA or PNA and frequency. (I can get S parameters as well) Other information such as physical length are available as well.
The components that were measured were a transmission line very similar to a short coax, and a line very similar to an open coax.

How can I derive the Capacitance from the open circuit line and the inductance of the short circuit line? How is phase shift related to these values.


texts: corroded battery cover no longer makes connection

texts:
I have a battery cover that is supposed to make contact between two batteries. Some batteries were left in too long and now there is corrosion on the metal flange.

The corrosion is beyond repair (IE: I cannot file it down to new metal). What can I do to make contact again? I thought of using tinfoil, but that will eventually tear. I also thought of using a whole pile of solder, but I'm not sure how effective that will be.

What is the best way to re-connect the batteries when the cover is corroded? I don't think I can get a new cover from the manufacturer.

Sorry for the delay, here's the image


texts: AC current measurement - input protection circuit

texts:
Hi  there

I am developing a AC current measurement device based on Current  transformer.
I was taking a look to many questions related with this subject  but in this case I would need some help
regarding the microcontroller chip input circuitry. As you can see from the attached schematics Fig.1 and fig. 2 were taken from other questions, so these ones inspired me partially to implement the input protection for my circuit. As reference I am using a SOC chip MCU,  precisely PSoC 5LP from Cypress.
As  CT, I am using 2000:1-  30 A/15 ma  -  R burden :10 ohm.
The following link is the data sheet for the CT.
  (https://dlnmh9ip6v2uc.cloudfront.net/datasheets/Sensors/Current/ECS1030-L72-SPEC.pdf )

In fig 3 ( dash lines are a issue I have with the editor), I'm showing  a resistor divider 560k / 560k and  a couple of capacitors for decoupling the central point of the voltage divider.

My question is regarding the value that should have the resistor R_4 that limit the current after the burden resistor_3.

Looking at the PSoC 5LP data sheet regarding the absolute maximum ratings for a input pin, in this case is the OP-AmP_1 input,  the min current should be -30 ma  and max  should be  41 ma.
The maximum input voltage for the pin should be  3.3 V + 0.5 V.  I'm using one of two option 3.3v or 5V as VDD.
I would like some hint about how calculate that  resistor value.

My other question is if 1N4148 can protect  the input , I am not sure . Should I use Shottky diodes?

Thank you very much for some  help.


texts:
I dont know if this is unrelevant here but i wish if someone could help me .

  The number of point to point links required in a fully connected network for 50 entities is

  (a) 1250
  (b) 1225
  (c) 2500
  (d) 50

My answer is 1225 but its 2500 every where in internet .
As per i know the mathematics is n(n-1)/2 but every where its 2500 , I dont know what is the concept i am missing .

Thanks in advance


texts: Confused figuring out the parameter indicating whether a MOSFET is logic

texts:
For example this MOSFET in the first page mentioned that it is a logic MOSFET.

But is this transistor a logic MOSFET as well? It says VGS(th) is between 2V and 4V. In some forums they claim this is not a logic MOSFET. Im kind of confused what parameter indicates being logic MOSFET.

EDIT:

I simulated the following circuit swept the gate voltage from zero to 10V:

And I got the following plots for Vg(blue plot) and the power(green plot):

And here is Ids versus Vg:

Doesn't the power plot indicate as long as the Vgs is over 4V we can use this as a switch?


texts:
I have a 4 slot battery holder with 2 wires coming out of it, best I can describe it. I'm planning to get a 14.8V Li-ion PCB charger (of course this will be used with 3.7V Li-ion batteries).
One thing I don't understand to do is the connection, as in do I just connect one wire to the positive end and the other to the negative end? Or should I instead get a separate 4 slot battery holder and make the connections like this? https://gyazo.com/fa6e1f7c2dd25f4c580b62b9053dde22


texts: I’m hacking a toy and would like to fire a spring loaded sponge missile.  I’m having trouble googling for some sort of PCB mounted mechanical latch.  Or any type of tiny mechanical mechanism that I can trigger from a microcontroller.  The solenoids that I saw required too much current.  I’m hoping for something with a peak draw of a milliamp or less because this will be running on a watch battery.   Any ideas on how I can achieve this?  I’m open to any type of electronically activated mechanical release mechanism that would release a spring which is compressed by the user (but the latch needs to fit in about a cubic centimeter or less).


texts: how to keep mutual exclusive between interrupt and task in ucos-III

texts: I am running ucos-III on a board which has stm32 cpu and a gyroscope sensor. now I make a interrupt in response to receiving data from gyroscope, and than save data into one buffer. on the other side I start one task with OSTaskCreate() used to read data from the buffer and parse/analysize them for calculating degree. now I want to know how to keep mutual exclusive operation between the interrupt function and task function when visit the shared buffer. Before that I have tried to use enable/disable interrupt with ENTER_CRITICAL_SECTION macro. but some one told me that's not exactly the best way to do that, because when you disable interrupt you also close the door to let os make response to other interrupt source. so can you tell me what's the best way to do that? are there some other communication frame more suitable for this situation?


texts: Smart tires idea: How to measure electrical output of piezo arrays?

texts:
I had an idea where you take piezoelectric material and insert it into/on tires (or tire sleeve), suspension components, bushings etc of automobiles and then store the electric energy generated to help make the battery last longer.

Let’s say we put 40 rows of piezoelectric discs on each of the tires. In each row on the tire there are 10 piezoelectric discs for a total of 400 per tire. If each piezoelectric disc generates 1mW then altogether one row would generate 10mW per tire. Let’s also assume the rows are lined up and when the tire turns all the piezo discs generate electricity at same time on a row and synced with the other tires. So every time the vehicle moves 2cm the tire would fall on center of any row of piezos. For reference: The piezos would be 1cm diameter and each row spaced 1cm apart from next row.

So if starting on center of a row of piezos on all tires synced together, if every time the vehicle rolls 2cm the greatest amount of weight is on any given row’s center and would generate 40mW of electricity.

How to best quantify this energy? The more distance you go the more power generated. The faster you go the same distance the faster the power is generated. Output is directly related to time and frequency.

I did some math and figured every time the car moves a mile it would generate 3,218.688 watts if it stored the energy generated in capacitors and without any losses.

1 mile = 5280 feet
5280 feet = 160934.4 centimeters

Since every 2cm you generate 40mW from piezo array then divide mile by 2cm which equals 80,467.2 which would be the frequency of output per mile.

Output frequency of 80,467.2 * .040 watts equals 3,218.688 watts.

So if going 60mph you would reach that amount in one minute.

Is there a way to translate this into joules? Is that a better representation of this energy? Or is wattage better? Is my math correct?


texts: Why both boost convertor and boost controller are required here?

texts:
I was looking at the T1 reference design http://www.ti.com/tool/pmp8921#descriptionArea which is a 12V@4A Sync Boost Converter Operating from Single or Dual Li-Ion Batteries .
I am unable to understand why have we used a boost convertor(TPS63061) as well a boost controller(TPS43061 ). Won't one of them say the boost converter(TPS63061) do the job here ?

Thanks,
Ankit


texts: What is the switching/amplifier component in a 2.4 GHz wifi microwave transmitter

texts: I know that it is hard for the transistors that i know to switch at high frequency but the latest microprocessors and microwave transmitting chips use GHz frequency, what is the gain element there (like a transistor, spark gap etc)


texts: How do I implement accurate distance measuring (to ground) on a plane-like UAV for heights over 10m?

texts:
How do I implement drone-to-ground distance-measuring for autopilot landings for heights over 10m? I found ultrasonic to be too inacurate, let alone GPS. Maximum height is 1000m, Vmax is 100 km/h, Vaverage is 72 km/h. The drone is plane-like, no *copter or so.

Thank you for any input!


texts: Are opamps as a voltage regulator effcient?

texts:
If I setup an opamp in a non-inverting configuration as follows:

Vrail+ is 7.5V, Vrail- is GND (0 V)

Vin is 2.5V,
Vout = 3.3V (in other words, the gain, aka, 1+R2/R1 is 1.32 [V/V])

Iout = 100mA (connected to some load)

What are the source of my losses? How efficient are these types of configurations? Do I only take the quiescent current as the only loss?


texts: How to find the current value in this circuit?

texts:
Here is the question i am getting how to proceed after finding the voltage

My attempt :

Next part of solution:


texts: Using a resistor to drop voltage for LED

texts:
Hoping someone can help me to understand what I am seeing.

I have the following:

A 5V DC power supply derived from a USB power supply
A LED (LINK) with a Forward Voltage requirement of 3.2V (Maximum Forward Voltage of 3.5V DC), and Continuous Forward Current   of 20mA (Peak Forward Current   of 100mA).
A 91 ohm 1/2 watt flameproof resistor

I used the popular LED Calculator to design this ultra simple circuit.

However, before connecting the LED I figured I'd use my multimeter to confirm that the resistor was properly dropping the voltage to 3.2V.

I tested this by placing the resistor first at the +5V side, and then at the GND side, of the appropriate multimeter leads -- but I am still seeing 5V on the meter.

I then place two of the same resistors in series, at both polarities, and I am still seeing the 5V on the meter.

Is there a simple reason I am still seeing 5V? Even without a load, I would have expected to see a voltage in the realm of 3.2V.

Thanks in advance.


texts:
Does anybody know what kind of connectors these are?

The size of the holes on the right picture is about 5 mm
The inner size of the holes on the left picture is about 3 mm