texts: What happens if the base current goes out of the base of an NPN BJT?


texts:
Consider two different antennas with equal gain. Let's say one of them is a vivaldi antenna

and the other is a horn antenna

I want to learn how much of the incident power these antenna will be able to receive. As I have specified, their gain (in terms of dBi) are equal. But it makes no sense to me that an antenna like the vivaldi antenna would be able to receive the same amount of power as a horn antenna since it is so very thin.

However, Friis Transmission Formula does only cares about the antenna gains. Am I missing something, would the cross sectional area make no difference?


texts:
Several MOSFETs in TO220 package support continuous currents of 100 and up to 200 amps
For example, to handle currents of 50A, 6mm diameter cables are needed, how is it possible that such thick cables are attached to the pins of the MOSFET if these pins are 1mm wide?
I think that the temperature of the pins is dissipated by the same MOSFET and the respective heat sink, am I correct?


texts:
This is my first time posting but I have gained a lot of knowledge from this community over the past few months.

Here is the situation: I have an old Hobart OM-321 Tig welder which my tech has told me that the high frequency starter is not functioning and generating no arcs. The rest of the welder is fully functional. In attempt to debug things step by step I first checked all the capacitors, switches and fuses to the HF circuitry. No shorted or blown caps, switches were functional, and fuses were all good.

I began looking at the transformer, and here is where my knowledge is a bit shaky. I saw three wires, two attached to a smaller coil. A third wire was attached to the larger coil and a ground wire connected to the case. I'm used to seeing step down transformers which has one coil with multiple wires for the selection of voltage level. There is no spec sheet or data sheet and supplier is not responding. If there a method to debug this transformer to see if it's still functional?

effective resistance across the two leads to smaller coil is 7Ohmns
effective resistance across single lead from large coil to the ground connection is 2.7KOhms

That is all the information I currently have. The goal is to verify if this transformer still works. Currently have the assembly removed from the welder so if there is a way to debug without power, that's ideal. Otherwise instructions with power would be sufficient as well.


texts:
I have a hard time understanding the concept of frequency in square waves. With sine waves, it is straightforward. You increase the frequency and the signal appears more often in the same time interval. That can apply to square waves too. But I know that in order for a pulse to appear immediately (for example 0V to 5V in lim(time)->0) the frequency must be infinite.

So what's going on here?

On one hand we have the straight forward frequency that you increase it and you see more square waves over the same time.

On the other hand we have the frequency harmonics that are almost infinite.

What is true?

What would fourier analysis give us?


texts:
The opamp has an unity gain  of 1 MHz.So when the resistor in parallel acts a feedback to bias the opamp stable.So if not for the capacitor,the circuit would have been a inverting amplifier with gain 100 => bandwidth would be 10Khz (from GBP).

However, when i use a capacitor to implement a low pass filter ,the range of frequency over which it can integrate is set between 1/ 2pi(100 * 160p)  and
1/2pi(10k * 160p) ie; between 100Khz and 10Mhz respectively.

My question is will the Gain bandwidth product have any significant role in limiting the bandwidth down to 10Khz (if it does so).

Also,if thats the case then if i input the signal within (100KHz -10MHz) range in the hope of getting a integrated output ,will i get one?
Shouldn't the input be attenuated because of the opamp frequency limitation?

what will be the bandwidth ? is it 10K or 100kHz

ps: i have assumed a one pole model for the opamp (obvious simple case)


texts: Using LC filter instead of RC filter in mains powered circuits

texts:
Above is a dimmer circuit. In some of these circuits I see a toroid inductor together with a capacitor forming a low pass LC filter which is called choke filter.

My questions are:

Why is RL used instead of RC and is that something to do with the character of mains freq. and voltage? Inductors are expensive or big thats why we use caps around  opamps to obtain low pass filters right?
What is being choked by the LC toroid cap couple?


texts: Beginner: Issues wiring up a simple LED circuit

texts:
I'm a programmer, but a complete beginner in electronics. I've been following this guide where one of the first projects is to create a LED circuit using this circuit diagram. I've tried wiring up the simple LED circuit, but it doesn't work.

I'm guessing some of these parts have a significant change of failing due to poor production, so I swapped out the LED's, jumper wires, and resistors for identical parts.  Note: I am using a 220Ohm resistor

I also moved the position of where the jumper wires connect from the Arduino to the board, i.e. moved them up and down, and have done the same for the LED, resistor and other jumper wire. I have made sure that the LED cathode and anode are in the correct arrangement on the breadboard. I also made sure to push down on the components to make sure they made contact with the board.

When the GND and 5V aren't both connected to the breadboard at the same time, the "ON" led on the Arduino is solid red, and the "L" led is blinking. But when I connect both the jumper wires as below, those two led's stop emitting light. Is this normal behaviour?

I am a beginner so I probably messed up the wiring somehow. I would also very much appreciate any guidance on resources or methods on how to learn about electronics. If the wiring is fine, is it possible that the breadboard isn't working?


texts: My almost completed pcb design in KICAD requires a coil which needs to be accurate in dimension (coil is optimized using a optimization calculation algorithm developed in our lab which needs to be realized as is). If I draw using gui tools in KICAD, it is hard to make it accurate in terms of coordinates even with lowest possible grid size. I am looking for something similar to Allegro PCB editor where we can draw traces using instructions in KICAD. I believe it is possible since, I saw a python console in Pcbnew tool. Can somebody help with any information or tips that can at least draw lines with coordinates provided in instructions?


texts: KiCAD assign multiple footprints to one symbol

texts:
What would be the best way to connect multiple pads of a module (footprint) to a single pin (node) in the schematic in KiCAD?
Do I have to edit the module and set the same pin name for the pins I want to connect or is there a designated way to assign symbol pins to footprint pads?


texts: Mechanical Contactor for High Voltage DC - Substitute with Semiconductor

texts:
To switch 1kV DC at 5A, I usually use a mechanical contactor (<- Wikipedia) that switches both highside and lowside of a resistive load.

Any suggestions on a semiconductor (or non-mechanical part) to do the job? For me, especially the high side switch makes it difficult.

Both highside and lowside have to be switched to meet the guidelines.


texts: DIY Single phase transformer to split phase

texts:
I am not changing voltage, just splitting the phase. Would this work?

240V single phase to 240V split phase

21 windings on the primary
21 Windings on the secondary
Center tap the 11th for N

Primary

L-N 240

Secondary

L1-N-L2
L1-N 120
L2-N 120
L1-L2 240

5000-watt max input

Will this work with any odd number of windings 3 or more? Do there need to be hundreds of windings or can I simplify the transformer by using large gauge wire to work with fewer windings? Center tap the center winding for the new N?


texts: Powering a microcontroller with a small solar cell and a capacitor

texts:
I'd like to power a microcontroller with a small solar cell. The idea is for the solar cell to charge a capacitor, and when a given voltage is reached, do some clever things to discharge the capacitor through a voltage regulator, and power the microcontroller. When the microcontroller is finished with its task (updating an e-ink display with sensor data), it switch the power back off, and the capacitor is back to charging mode again.

I was thinking about a zener diode triggering some kind of transistor latch, and the microcontroller being able to reset that latch, but I need some guidance !


texts:
I'm trying to read a LF (low frequency) RFID transponder. The carrier frequency is 125kHz and the base band signal has a 20kHz bandwidth. The modulation is in load modulation, a kind of AM modulation.

I'm using the following approach to process the signal:

Downconversion by sampling
Low pass filtering
DC blocker filtering
Comparator with hysteresis

Below, there is a figure with the modulated signal in blue and my demodulation of this signal in red.

There is a delay, of course, between the received signal and the processed result in red. The processed result is only the symbols and are not decoded in bits yet. But the delay is not the problem, the problem is that there is an error that happens when a short-time simbol is received. The transponder sent the following information repeatedly:

Period of carrier cycle is 1/125kHz => 8us

16 cycles => 128 us
32 cycles => 256 us
48 cycles => 384 us
64 cycles => 512 us

But after processing, the intervals above were meassured different. Each step ( the 16, 64, 32...) was meassured as follwing:

16 => 176 us => difference of 48 us  =>  37%
32 => 288 us => difference of 32 us  =>  12.5%
48 => 353 us => difference of -31 us =>  -8%
64 => 465 us => difference of -47 us =>  -9%

So The problem is the 37% of error, until the 12.5 %, ok I can handle, but 37% I think is a big error. So, I was wondering if I'm doing something wrong, or, if there is a better approach. I will explain each processing step next.

1. Downconversion by samplig

The carrier frequency (Fc) is 125kHz, so I used 62.5 kHz sampling frequency, this is Fc/2. I used downconversion by sampling based on fact of replicas, in frequency domain, being generated by sampling. So, I will have a base band signal at DC frequency that I can filter with a low pass filter. This is good thing, because the lower sampling allows me to design a filter with a lower degree and I have processing time savings too.

2. Low pass filtering

I designed a low pass FIR filter using windowed sinc with window function being Kaiser-Bessel, -3dB frequency of 25kHz and 16 taps (coeficients). To determine the number of taps I relied on the Fred Harris formula:

$$
N = \frac{Attenuation}{22\times B_T}
$$
$$
B_T = \frac{F_{stop} - F_{pass}}{F_S}
$$

\$Attenuation = 60dB \$ ( Chosen arbitrarily )
\$F_{stop} = 35 kHz \$ ( Chosen arbitrarily )
\$F_{pass} = 25 kHz \$ ( Chosen because the base band has a 20 kHz band-width.)
\$ F_S = 62.5 kHz \$ ( Chosen to perform downconversion )

This gives me 17 taps, but I decided to use 16,because I already had the coefficients calculated, I think one tap less will not degrade so much.

3. DC blocker filtering

After the FIR low pass filter, there is a DC component present, so, I decided to use a Fixed-point dc blocking filter. The algorithm used was based on the following:

http://www.dspguru.com/dsp/tricks/fixed-point-dc-blocking-filter-with-noise-shaping

http://www.ingelec.uns.edu.ar/pds2803/Materiales/Articulos/04472252.pdf

I do not know yet, but I think that the time errors that I mentioned above were of the responsibility of this block, more than the others.

4. Comparator with hysteresis

I digitally implemented a comparator with hysteresis. It uses two level of comparison. If the level is above predetermined level, it recognizes as HIGH, and if it is below a second determined level, it is considered LOW. This way I translate the filter output to simbols and rebuild the modulating signal from transponder.
The problem that I see here is that this predetermined value is fixed, and the amplitude of modulation can vary.

So, what do you think ? The approach was pertinent ?Someone has some clue about the difference in time that is happening ?

With my best regards,

Daniel.


texts: Circuit to provide 0-5 V output proportional to 0-30 A from C.T?

texts: I want to design a circuit to protect oveload current of 30A.I have a controller board(PLC) which accepts the voltage range of 0-5 as an input and C.T with 1:7000 turns which can maesure 0.5 -60 A(RMS) value with burden resistance of 47 ohm(recommended).My question is how should i design a circuit which porvides 0-5 V output proportional to 0-30 A(RMS).


texts: What kind of information can be assumed from sensor accuracy graph

texts:
I'm using a MS5803-15BA (datasheet) to make pressure measurements. The datasheet contains this graph of pressure error vs. pressure at page 17.

The datasheet also specifies on page 1 that the accuracy when reading from 0 to 6 bar and operating from 0°C to +40°C is +- 20 mbar.

1) Does this means that if I'm using the sensor at 25°C, to read a pressure of around 4000 mbar, my reading will be something close to 10 mbar more than the real value? Or if I'm using the sensor to read a pressure around 12000 mbar also at 25°C, my reading should be corrected to 40 mbar more than observed pressure?

2) If this is the case, will it worth to make a script that uses the information in this graph to compensate the reading and yield a more accurate pressure measurement? Something like, if sensor is reading 2000 mbar at 25°C, subtract 5 bar to find a more accurate pressure measurement. Is there a way to obtain the data used to make this plot in order to code this script?

3) In case question 2 answer is also positive, how can I assess the accuracy of my reading after that compensation?


texts: How do we test a HF transformer to see if it steps up correctly?

texts:
i have a HF transformer that iv designed and built but i dont know how to test it. The primary resistance is about 0.05 Ohms across the primary and im putting in 12 V. The moment i connect this, the fuse in the Variac blows. What should i do?

Rpri = 0.05Ohms
Input voltage  = 12 V
turns ratio: 2:85


texts: Why is the plastic around my battery terminal melting?

texts: I am using 2 dry batteries for my backup UPS. For some reason the plastic around one of the terminals of a battery is melting and producing a lot of smell. Most of the times it works fine but at some odd days, whenever we put load on the batteries/UPS, it starts melting. I have replaced the whole wire/clip around that specific terminal but to no avail. I do not see any spark and all the connections seem fine. The wire also gets very hot but that's due to the heat obviously. How can I debug the issue?


texts: Bad synchronous description - simple vhdl program

texts:
I trying to make a simple VHDL program which consist of incrementing a std_logic_vector by one every time  button A is pressed. When button B is pressed the value should be reset.

My idea was to do it like this

entity simple is
    Port ( A : in std_logic;
           B : in std_logic;
           CLK : in std_logic;
           debug : out std_logic_vector (7 downto 0));
end simple;

architecture Behavioral of simple is
    signal state: std_logic_vector(7 downto 0) := "00000000";
begin

   increment: process(state, A, B)
    begin
        if (B'event and B = '1') then
            state <= "00000000";
        end if;
        if (A'event andA = '1') then
            state <= std_logic_vector(unsigned(state)+1);
         end if;
    end process;

    led_debug: process(CLK)
    begin
        debug <= state;
    end process;

end Behavioral;

The problem is though i am getting a error - Bad synchronous description, which i cannot understand.


texts: How to build a variable input Voltage Power supply

texts:
The following shows a simple regulated transformer supply

This unit needs 230 Volt Input to produce 5 Volt.

But I'd like to build a power supply that can handle both 120V and 230 Volt. Like this one here 5V Buck convert with variable input voltage. It accepts AC 85 ~ 265 v.  What do I need to add to make it accept different voltages?


texts: What is the function of this npn transistor?

texts:
I see that the R306 resistor is trying to limit current when the npn transistor is on. I am not sure what the resistance offered by the npn is but it looks like the current through the 47k resistor would depend on that. The collector voltage of the npn is then fed to the gate turning the MOSFET on.

How do I know that the voltage is sufficient to turn it on? I would need to know the voltage at the collector but for that I need to know the voltage at the base. But the base voltage depends on the MOSFET. How do I proceed finding the current and voltages in this circuit?

Overall what is this circuit trying to do?

The emitter of the npn is at ground.

The board is the NVIDIA jetson taden from https://developer.nvidia.com/embedded/buy/jetson-tx2

It is connected to the supply rails of the ic(VDD_MOD).


texts:
I think this website explains a Joule thief in a wrong way: http://buju357.blogspot.com.eg/2013/06/joule-thief-theory-of-opperation.html

The website says: "The increasing collector currentﬂowing through collector coil will induce a current in the base coil that opposes the currentﬂowing into base of transistor from the battery. This induced current will ﬂow back into the battery  and cancel out the current ﬂowing into base of transistor from the battery. This results in the transistor turning off".

I don't think so, I think the induced current in the base coil is complementary to the current flowing into the base of the transistor from the battery. Then, The transistor will reach the saturation mode faster. I Knew that from the small dots on the transformer symbol. I think this video supports my opinion:
https://youtu.be/0GVLnyTdqkg?t=2m42s

Here is why the transistor turns off:

When the transistor is fully on (at saturation mode), The collector-emitter junction has a very small resistance. Also, at saturation mode, There is no change in the current flowing through the collector coil, so there is no reactance and the resistance of the collector coil is very small.

Now, All the current of the circuit is flowing from the collector to the emitter through collector coil because that branch (path) has a very small resistance (relative to any other path).

The branch (path) from the battery to the base has about 1K resistance. So, current will not flow through it. As a result, There is a about zero voltage on the base of the transistor and the transistor will turn off.

Which opinion is correct?


texts:
I am using the LT3845 buck regulator to step down a voltage from 9 to approx 1.2V.Now, I see that the formula for configuring the Vout is as stated below -

This means I cannot go below 1.231 as Vout. Due to this I change my Vout to 1.3V, this makes my Vout equation as R2 = 0.054*R1.Now, R2 is the upper resistor(conected to the inductor of the buck) and R1 is the lower resistor.

Normally, the upper resistor is higher than the lower one. How is this possible or am I missing something in here please ?


texts: best practices in detecting relay contacts status

texts:
Currently i'm experimenting with 12VDC energy meters latching relays and at least for me the feature of detecting status of contacts ( required by some clients ) which is built in as in the diagram below is quite interesting. Now i need to interface it to a microcontroller safely. At the top of my head i may think of using an optocoupler but my understanding is i need to isolate the grounds ? thus making the design a bit pain in the kneck, is this the only feasible method or are there other approaches ?.

TL;DR pins 4 and 5 switch on / off depeding on status of relay, how do i sense/ measure status of the latch with those pins?


texts:
I am sending ADC results from an ATmega16 controller to a PC through CP2102. Baudrate: 0.5Mb/s, 8 data-bits, 1 stop bit, no parity. I've written a software to visualize received data. Here is an example of ADC results from sampling a sine wave signal:

At some point my PC was under heavy load and this is the result that I had:

In my previous question I assumed that these spikes were caused by the ADC itself. However it is clearly seen now that these spikes are caused by transmission errors.

As far as I understand this problem occurs due to the overflow of CP210 TX buffer. Is my assumption correct? And if so, what can be done to prevent this?

Besides these spikes I've also found another problem. I am sending two bytes consecutively (ADCL and ADCH). What I've noticed is that sometimes the received bytes are swapped (i.e. ADCH is received before ADCL).

I've dumped some data where the spikes occur (first byte is ADCH, second is ADCL and the number is the resulting integer value)

Example 1:

821 : 00000011, 00110101
803 : 00000011, 00100011
783 : 00000011, 00001111
1018 : 00000011, 11111010
740 : 00000010, 11100100
718 : 00000010, 11001110
694 : 00000010, 10110110

Example 2:

229 : 00000000, 11100101
237 : 00000000, 11101101
246 : 00000000, 11110110
255 : 00000000, 11111111
10 : 00000000, 00001010
276 : 00000001, 00010100
289 : 00000001, 00100001

Update: added usart initialization routine

#define F_CPU 16000000UL
#define USART_BAUDRATE 500000
#define BAUD_PRESCALE ((F_CPU / (USART_BAUDRATE * 16UL)) - 1)

void USARTInit() {
    UBRRH &= ~(1 << URSEL);
    UBRRH = (unsigned char) (BAUD_PRESCALE >> 8);
    UBRRL = (unsigned char) BAUD_PRESCALE;
    UCSRB = (1 << TXEN) | (1 << RXEN) | (1 << RXCIE);
    UCSRC = (1 << URSEL) | (1 << UCSZ1) | (1 << UCSZ0); // 1 stop bit, 8-bit data length
}

Update: added a simple test for usart

I've disabled ADC and replaced my main routine with a simple loop:

for (uint16_t i = 0; i < 1023; i++) {
    USARTSendByte(uint8_t(i));
    USARTSendByte(uint8_t(i >> 8));
}

When I start the terminal on my computer and put the system under heavy load (lots of background processes) I sometimes receive results like this:

...
252 : 00000000, 11111100
253 : 00000000, 11111101
254 : 00000000, 11111110
255 : 00000000, 11111111
0 : 00000000, 00000000
257 : 00000001, 00000001
513 : 00000001, 00000010
769 : 00000001, 00000011
260 : 00000001, 00000100
261 : 00000001, 00000101
...


texts: Signal path switching for effect circuits

texts:
I'm trying to build a method of switching signal order with three circuits in a rack unit.
I've been researching different methods, using relays, using CMOS etc but I'm getting a bit overwhelmed and lost. I don't have a lot of technical experience with electronics apart from building kits and using an Arduino every now and then.
Say circuits are A, B and C; I would like to order them ABC, CAB, BAC, ACB.
Could anyone point me in the right direction on this? Any recommended reading on CMOS or even a chip recommendation?
Thanks for reading!
Edit: Added a picture to make it clearer, all signals are analog (line-level).


texts: How to calculate the Timer Preload Properly on PIC32MX575F

texts:
I am trying to achieve 1 second on a timer in PIC32MX575F but somehow I am not reaching what I want.
Some people says I have to look into the the PLLDIV, some other people says I should look into the PLLMUL.
I have followed a couple of equations but none of them are reaching the 1 second interrupt.
I don't know what I am doing wrong so I want to know what is the best way to calculate.

Here is my code:

void initTIMER2(void) {
   T2CONbits.ON = 0;
   IFS0bits.T2IF = 0;
   T2CON = 0x0;
   TMR2 = 0;
   PR2=0x7A12;
   T2CONbits.TCKPS = 0b111;//1:256 prescale value
   T2CONbits.T32 = 0;//16 bit timer

   IPC2bits.T2IS = 0;
   IPC2bits.T2IP = 2;
   IEC0bits.T2IE = 1;

   T2CONbits.ON = 1;
}

This is the configs I have made:

#pragma config FNOSC = FRC //

#pragma config FPBDIV = DIV_1

T2CONbits.TCKPS = 0b111

EDITED:
After some investigation it seems the code is calling OSCConfig( OSC_FRC_PLL, OSC_PLL_MULT_20, OSC_PLL_POST_2, OSC_PB_DIV_1) somewhere. I already made calculations with these new values but without success.
So if OSC_FRC_PLL is declared as #define OSC_FRC_PLL     (1 << _OSCCON_NOSC_POSITION) it means by the datasheet "001 = Fast RC Oscillator with divide-by-N with PLL module (FRCDIV+PLL)".

Please take a look at the Diagram:


texts: How to connect a CR2012 coin cell battery with a PCB?

texts:
Im trying to build a flat, battery powered PCB assembly that fits into a small gap of approx. 2mm. I have found the CR2012 coin cell with a thickness of 1.2mm, which would be a good fit in terms of size and energy.

My problem is that I have no clue how to connect this battery with my electronics PCB. I searched for battery holders all over the web, but all I found was holders for CR2032 (3.2mm thick) batteries that also would work for CR2012 coin cells (e.g. this one).

What I seek for is either a proposal for a battery holder for CR2012 with approx. <1.5mm thickness or some general ideas how to connect such a battery (reliably) with a PCB electronic circuit without exceeding 2mm thickness constraint. (The PCB can be as thin as 0.5mm).


texts:
Maybe it's a stupid question but as the title says, in DC analysis how does the current from Vcc flows?
Where is the - and the + of the voltage source? And how does the current flows in AC analysis when we also have Vi involved?


texts: Why am I getting my result as a string of Zs in Quartus?

texts:
I am new to Quartus, and have been trying to test out my 32-bit ALU on Quartus 13.1. When I try the functional simulation, I get a string of Zs. The results for the individual components, like the fullAdder, display the results fine. What can I do to view the result(inout) in a hex representation?

Edit: There was an issue with the Quartus 13.1 edition. It works perfectly fine on the 16.1 edition.


texts: Why does the length of the wire matter to the value of the pull up resistors?

texts:
In this DHT-11 datasheet the following sentence was mentioned (on page 4)

A typical application circuit recommended cable length shorter than 20 meters with a 5.1K pull-up resistor when greater than 20 meters when the pull-up resistor to reduce the actual situation.

The sentence is not so obvious, and I don't understand it very well but what I get is that the length of the wire matters in choosing the value of the pull-up resistors.
Now:
Why does the value of the pull-up resistors depend on the length of the wire (I can guess that it has to do with the transmission line parasitic inductance and capacitance but I wasn't sure that it's a big deal on 20 meters or so).
Is my guess correct?
What are the reasons to need a pullup resistor on logic gates if it will draw very little current anyway and is there anything else other than that was mentioned?
How can I get this values of the resistors, does it have a formula of some kind?


texts: Figure out pin address on MCU eval board (TI MSP432 Launchpad)

texts:
I bought an MSP432 Launchpad from TI, and I'm surprised you can't search for "MSP432 Launchpad pin map" and get a table of the digital pins, their addresses, and their variable names in the standard library. There's a "blinking led" example that uses a variable P1OUT that apparently represents the onboard LED.  I am trying to modify the example to use pin 6.0 instead, but I can't figure out what address or variable to write to. Is this something I should find on Google, or is there some kind of convention that I'm unaware of? Thanks in advance.

EDIT: to be clear, I was expecting to have a resource somewhere like the following:

PIN    ADDRESS    VARIABLE
p1.0   0x0000AEF9 P1_0
p2.2   0x0000AEFA P2_2
p2.3   0x0000AEFB P2_3
... etc


texts: Altium Draftsman Error: Layer Stack Legend

texts: I'm having an issue on Altium Draftsman where I can't insert the Layer Stack Legend from the Layer Stack on the PCB. I'm getting the following error when I try to insert the stack into the template. I just wanted to know if anyone had any potential solutions to this.


texts:
I can't understand why the system depicted here:

where:

4 = permanent magnet

6 = ferromagnetic core with a coil around it

5 = ferromagnetic toothed wheel

has this magnetic circuit:

where

Rm= magnet reluctance

Rc = core reluctance

Rg = gap reluctance

Rt= target reluctance

In particular I can't understand why the MMF is written in that way. Please, consider that the parmanent magnet has a residual magnetization (and this is the reason for the subscript r in Br. Many thanks for your help!


texts: Purpose of 2nd order filter for processing temperature measurement

texts:
Please forgive me if this is a very basic or silly question but I would appreciate some help.
I'm working on someone else's code and have come across a few lines that have been described as a 2nd order filter. My background is not in electronics so I'm not really sure what a 2nd order filter is or what the code is trying to do. I'm wondering if someone can help explain the following code?

setpoint_error = temperature_setpoint * FILTER_TERM_A - high_resolution_temperature_setpoint;
filtered_setpoint_error = filtered_setpoint_error + (setpoint_error - filtered_setpoint_error) / FILTER_TERM_A;
high_resolution_temperature_setpoint = high_resolution_temperature_setpoint + filtered_setpoint_error / FILTER_TERM_B;

Many thanks for your help.

* UPDATED ON 2018-09-18 *

Below are some extra lines to help put the code above in context.

#define INITIAL_TEMPERATURE 80
#define TEMPERATURE_SCALE 100
#define FILTER_TERM_A 512
#define FILTER_TERM_B 1024

static int32_t high_resolution_temperature_setpoint = INITIAL_TEMPERATURE * TEMPERATURE_SCALE * FILTER_TERM_A;
static int32_t blown_air_temperature = 12 * TEMPERATURE_SCALE;
static int32_t blown_air_temperature_error = 0L;
static int32_t blown_air_kP = 2L;
static int32_t blown_air_kI = 100L;
static int32_t blown_air_PID_speed = 0L;

void temperature_100ms_task()
{
    static int32_t filtered_setpoint_error;
    static int32_t blown_air_integrator_value = 0L;
    int16_t temperature_setpoint = 100;
    int32_t setpoint_error;
    int32_t blown_air_extrapolation_offset = get_BA_extrap_offset();

    /* Code that I would appreciate help understanding */
    setpoint_error = temperature_setpoint * FILTER_TERM_A - high_resolution_temperature_setpoint;
    filtered_setpoint_error = filtered_setpoint_error + (setpoint_error - filtered_setpoint_error) / FILTER_TERM_A;
    high_resolution_temperature_setpoint = high_resolution_temperature_setpoint + filtered_setpoint_error / FILTER_TERM_B;

    /* PID control - using temperature to adjust fan speed */
    blown_air_temperature_error = blown_air_temperature + blown_air_extrapolation_offset - high_resolution_temperature_setpoint / FILTER_TERM_A;
    blown_air_integrator_value += blown_air_temperature_error * blown_air_kI;
    blown_air_PID_speed = blown_air_temperature_error * blown_air_kP + blown_air_integrator_value;
}

The code above has been extracted from a much larger file but hopefully enough has been included to put the first code block in context. Thanks again.


texts: USB to RS485: Can I connect A to Common Ground?

texts:
I bought a very cheap USB to RS485 dongle to connect to an experimental board of my own.

Specifications (may differ from the one I used but externally similar):
- Any baud rate from 1200 bps to 115 kbps
- Current: 100mA current at 5V DC taken from PC’s USB Port
- Modes: RS-485 Half Duplex (2-wire)
- Built in terminal resistor of 120R Ohm
- The USB-RS485 cable is a USB to RS485 levels serial UART converter cable incorporating FTDI’s FT232RQ USB to serial UART interface IC device which handles all the USB signalling and protocols. The cable provides a fast, simple way to connect devices with a RS485 interface to USB.

Any baud rate from 1200 bps to 115 kbps
Current: 100mA current at 5V DC taken from PC’s USB Port
Modes: RS-485 Half Duplex (2-wire)
Built in terminal resistor of 120R Ohm
Length of twisted pair cable maximum can be 1.2 Km (Kilometer) Maximum
Cable type for optimal range: Two core, Twisted Pair Shielded type, D+ and D- (actualy A and B) should be twisted with each other to get optimal range

This dongle had only A and B outputs. No GND pin. My experimental board has its data input connected to the input of a schmitt trigger. In order to read the data with the schmitt trigger, I connected output B from the dongle to the schmitt trigger input (B line) and output A to the ground of my board.
Between the USB-to-RS485 B output and the schmitt trigger BUF1, there is a 470 ohms resistor R1, a schottky diode D1 from ground to the B lime, a 5V zener z1 between ground to the B line and a second resistor of 140 ohms R2.

Bit "0" were at 3.2V and bit "1" at 0V. I added the schottky diode from ground to erase a very short negative voltage drop at each falling edge between a "0" and a "1".
The 5V zener diode is just elementary protection (just in case). The resistors help reduce noise, albeit not totally and increase protection.
There is a lot of noise on the B line, but it worked perfectly. ...Until after a few test, the dongle started to heat and stop responding. The plastic cover even thermo-deformed.
I transfered very short data, at the default baud rate of 19200. It wasn't used intensively.

Now I'm using a less cheap yet still quite cheap dongle which has a GND and a +5V pins on top of A and B.  It works very well too.
But I'm afraid it will be destroyed in the same way if I did a mistake.

I didn't try connecting USB ground to common ground because the voltage difference would not fit for detecting data with the schmitt trigger. On ouptu B, Bit "0" is at 5V relative to the USB ground and bit "1" is at 2.5V relative to USB ground. On output A Bit "0" is at 0V and bit "1" at 2.5V.

My question is: Did the very cheap dongle melt because it was very cheap or because I did a mistake in the circuit?


texts: A basic question about this nodal analysis

texts:
I have this circuit which I have to solve for Io using nodal analysis. Everything seems easy but I am confused about the nodal equation for V2 given below in the solution. They seemed to ignore the part of the node that goes from V2 to ground, through the 2 1-ohm resistors? In other words, shouldn't there be another term that looks like: $$\frac {V_2}{2}$$

Can you please clarify this? Thank you.


texts: I am trying to develop a state machine model for my current firmware design. I searched google, but the explanations are not related to embedded system. Can you please suggest some method to study state diagram development for embedded systems.


texts: Three questions about the use of a transformer in switching power-supply

texts:
In this document (an introduction to switching power supplies) a boost-mode switching power supply is presented: it has a simple inductor, diode, capacitor and load. Then (page 9) it is specified that this device can be used only for input voltages not greater than 42.5 V, because there is no physical isolation between the input voltage and the load.

1st question: why greater voltages would require an isolation? That is: why flyback converters are used instead of buck-boost converters in such cases?

The solution is to use a transformer instead of the inductor. Suppose that the input voltage \$ V_{in} \$ is the 220 V AC mains rectified, which could be a \$ \simeq 311 \ \mathrm{V} \$ DC voltage.

2nd question: if the input voltage is so high, why can the transformer in a switching power supply be smaller than that of a traditional (not switching) transformer (which first drops and then rectify the 220 V AC signal)?

The output of the switching power supply depends on the duty cycle of the switch, according to equation 1, page 6 of the forementioned document. I know (that means: I heard) that it would be difficult to obtain a precise duty cycle with a 311 V DC input (which would be the result of the 220 V AC rectified).

3rd question: why should be difficult to obtain such a precise duty cycle? Is this an importat reason to choose to insert a transformer which drops the voltage before the LC filter?


texts: Looking for test leads for individual PCB header pins or socket pins

texts:
While recently debugging a device that had a 7-pin male XLR plug, I was trying to connect to two of the pins in the plug, without touching any of the others, and I wondered if there are test leads that can be used for such debugging: essentially just slim metal cylinders that can be slipped over each pin, without touching surrounding pins, and wired to a lead. The same question arose when I was testing a 10-way header on a PCB: how to connect to, say, pins 3 and 7 only, without touching any of the others. In that case I had a 10-way socket, which I used for debugging, but it would have been very useful to have had two, slim cylindrical test leads, to slip over the two pins in question.
[Before anyone says so, I have looked on electronics supplier sites (we use oneCall, and I also checked RS): the trouble there is knowing how to phrase the online query correctly... so far I've drawn a blank.]


texts: I'm looking to create my own buck-boost converter but want to test it on a breadboard. I have done online searches but only surface mounted ICs show up. The Texas instruments TPS63061 looks ideal for me because I have an input between 2 and 10 voltas and need a 5 volt output, but this ic is surface mounted and very small. I am looking for a similar chip but that is through hole. Thank you for the help.


texts:
I’m currently having an issue with a SIM card that can’t be read by an LTE chip. It was deployed in a product outdoors where the temperature dropped to around -20C and the connection suddenly dropped and never reconnected (despite firmware attempting to do so). When troubleshooting at room temperature, the connection was only successful after removing and replacing the SIM card, which points to SIM card holder pins not making contact with the SIM card. A visual observation under a microscope showed no obvious signs of oxidation on the SIM card.
The system was power cycled prior to replacing the SIM card and the problem still existed therefore I ruled out the SIM card state as a possible cause of failure.
Is this a documented phenomenon? The temperature specs for the SIM card and holder are below -20C, but it seems plausible that the cold temperature caused the metal SIM card holder pins to contract enough to lose contact with the SIM card and oxidize, somehow never allowing the electrical connection to be reestablished. Any insight is much appreciated.


texts:
I am a student of electrical engineering and my previous term's project was implementing ddr2 SDRAM with Xilinx FPGA, but I am interested to know which device on the laptop control ddr4 on it?

and what is the method of controlling that in the computer?


texts:
I have purchased CT but don't know what his terminals means and how to identify primary and secondary coils terminals. I am software engineer but currently learning pic controller. as for I have read LM35 using pic16f877a and now working to measure load using Current transformer but no achievement until now. Can anyone tell me how to use current transformer to measure current with wiring diagram with explanation. any help would be help full as am trying google since more then 83 hours and have tried few circuits but no help. below are the provided pics of CT. Supplier didn't provided me any technical manual.

I want to measure load of AC current of three phase, which is provided from grid to our office.

If I pass load wire from primary coils which is center hole then I receive AC 1.08v on secondary coil terminals. how Can I connect this to adc of Pic16f877a?

am currently using this circuit to read value with adc of pic16f877a, if it's ok?

Update::

Currently am using provided code to take sampling but value varies from 485 to 535. while constant value without load is still 514. for load I have used iron and made 14 turns in CT as provided in picture. to connect CT I have used @Olin Lathrop provided circuit in one of the answer.   Peter Bennett has suggested to rectify signal is it a case?

set_adc_channel( 1 );
value = read_adc();//Read ADC Value

for(i=0;i<200;i++)
{
   value = read_adc();//Read ADC Value
   temp = value/1024;
   c = 0;
   if(temp > c)
   {
      c = temp;
   }
   delay_ms(2);
}
for(i=0;i<200;i++)
{
   value = read_adc();//Read ADC Value
   temp = value/1024;
   c = 0;
   if(temp > c)
   {
      c = temp;
   }
   delay_ms(2);
}
for(i=0;i<200;i++)
{
   value = read_adc();//Read ADC Value
   temp = value/1024;
   c = 0;
   if(temp > c)
   {
      c = temp;
   }
   delay_ms(2);
}
for(i=0;i<200;i++)
{
   value = read_adc();//Read ADC Value
   temp = value/1024;
   c = 0;
   if(temp > c)
   {
      c = temp;
   }
   delay_ms(2);
}
for(i=0;i<200;i++)
{
   value = read_adc();//Read ADC Value
   temp = value/1024;
   c = 0;
   if(temp > c)
   {
      c = temp;
   }
   delay_ms(2);
}
temp=c;

printf(lcd_putc,"=:%d=:%d=:%d=:%d=:%d:=\n:%f:", input(PIN_B0), input(PIN_B1), input(PIN_B2), input(PIN_B3), input(PIN_B4), value);
output_low(pin_B7);
delay_ms(2000);
}


texts: On referencing power planes and return current paths

texts:
I recently worked on a 16-layer board design that contained only 2 ground planes, at the outer layers of the board, and several power planes (+1V1, +1V8, +3V0, +5V0) in the middle:

Since there are only 2 ground planes, a majority of the signal traces are referenced to power planes, which is bad, because switching noise will be coupled to these planes.

Please look at the following image and suppose we have a switching signal on layer IN_5H:

Have I drawn the return currents correctly here? Am I correct in assuming that the only way the current induced on plane +5V0 can return to the source is through a stitching capacitor? It seems to me that the best position for this capacitor, to keep loop length short, is nearest the IC pin output. Is this correct?


texts: Converting a Mealy machine to a Moore machine, conflicting states

texts:
I need to convert the following Mealy machine to a Moore machine. (see picture).
The problem is state b. It has two conflicting states (1 pointing from a and c, 0 pointing from b itself). Since, when using a Moore-machine, each state can only have one output, what would the state of b be when converting to Moore?


texts: matrix multiply showing error in dimensions when i am using it for fm demodulation in simulink

texts:
I am doing FM modulation and demodulation of audio signal. i have successfully implemented the fm modulation but as i give the output of FM modulation to the matrix display at receiver end, it is showing following error.
Matrix multiply dimensions propagation error. Error occurred while setting output port of 'untitled/MatrixMultiply' to have the dimensions (width: 1, numDims: ?). A possible cause for this error is that these dimensions do not agree with the partial dimensions information present on other ports
The dimensions may be wrong but how to set them right?


texts:
I'm working on my first project with the STM32F103C8T6. The main purpose is to use its ADC on its resolution limits (signals about ~1mV). Many schematics on the internet put an LC filter between the main 3.3V (Vdd) and the analog power supply (VddA), just like that:

My power supply uses a DC/DC converter MP1584 module for better efficiency (required). Besides the inductor inside the module (module schematic) I'm using an LC filter with a zener at the output, as below (the MP1584 below is the module and not the IC).

The 3.3V label supplies both analog and digital circuits. The digital circuits includes high frequency (bad I know) such as SPI. I intend to route the LC fiter for the VddA as close as possible from the uC. But because of the oscillator crystal I was forced to put the inductors (L1, L2) right below the uC to save space.

So I have some questions:

Looking at my power supply circuit, the LC filter for the VddA is really required? It's going to make any effective difference? Or it's just to isolate analog and digital?
There's any problem to route the inductors below the uC? They're not suppose to switch at high frequencies, so it's OK for EMC?

EDIT: Just to add some more infos: the top layer is GND and the bottom is 3.3V.


texts: Is it possible to connect FT2232D's 3V3OUT pin to VCCIO for USB-JTAG programming?

texts:
I want to design a USB-JTAG Programmer with FT2232D. And I want to program Xilinx spartan3 FPGA with it, so I need 3.3 volt logic for VCCIO. Datasheet indicates that FT2232D has an internal regulator to convert 5v to 3.3v:

"It‟s prime purpose is to provide the internal 3.3V supply to the USB transceiver cell and the RSTOUT# pin. A small amount of current (<= 5mA) can be drawn from this pin to power external 3.3V logic if required."

I don't know wheather I can connect this pin to VCCIO, and how much current is required for this purpose (programming).


texts:
In a robotics application I have to install a 12V (30A) DC motor actuator in a vehicle. The typical setup indicated by the manufacturer is to directly connect it to the battery, because of inrush current surges from the DC motor.

However, the vehicle in question has 24V batteries. Our intention is to use a 24-12V DC converter and add a battery in parallel to handle the reverse current surges.

Are there any safety caveats with that solution?
What points should be taken in account when specifying the converter?
What kind of batteries (lead, LIPO, LIFE, etc) are more suitable for the operation?
Has anyone done a similar setup before?


texts: Can I drive a stepper motor like a brushless motor?

texts:
If I want to accelerate my stepper motor at maximum acceleration, can I drive it by watching the position of the rotor with an encoder and stepping the motor whenever it completes the previous step?

I believe that this is how BLDC's are driven.


texts: What other than capacitor rot could cause a capacitor to bulge and fail?

texts:
I've been teaching myself the fine art of monitor repair - replacing capacitors on a trio of lcd screens. Apparently they all had capacitors that had suffered from the plague - though a mild case of it since they bulged a tiny bit, as opposed to leaked all over the place., and replacing them has allowed two of them to be usable, least over the past week.

The third however has exhibited the same symptoms as it did before - one of the two capacitors i replaced seems to have bulged again, as did one of the ones i didn't (made by the same company that made the caps i replaced earlier). Since it was only on the board a few days, and ran for a total of maybe an hour i'm assuming its not capacitor rot.

Did i just get a bum capacitor, or could there be other issues? Is there anything i can test to try to work out the source of the problem?


texts: Getting Started with AVR On Breadboard, few questions

texts:
Ok I've been looking at a few tutorials and such, and i've done my reading on getting started with an AVR on a breadboard (flashing a few LEDS and such)
I know i'll need an AVR 8bit ATtiny
and a USB AVR programmer + Breadboard and whatever those wires are called for testing (I forget what they all called, they are like prestripped testing wires....)

Anyways....is there anything else I need? to just get started. I worry because I see these Arduino's and AVR prototype boards and they have TONS of extra stuff on them (that im not even sure what they are)

Am I missing something....Like do I need FLASH memory or anything additional to just do basic stuff?


texts:
There are a lot of questions asking what happens if you change the current, but keeping the same voltage. If more current is flowing to me it means you can damage the device. But what if it is the other way around? What happens if you increase the voltage, but have the same current?

Let's say I power on a device with an adapter that outputs 5 volts @ 2 amperes. If I would like to connect that same device to an adapter that outputs 20 volts @ 2 amperes, will I burn it? I think you burn a device by passing too much current, no? Could increasing the voltage also burn it if you are passing the same current?


texts: How is 1 circular mil ohm/foot = 1.66242611301 x 10-7 ohm centimeter dervied?

texts:
All,
Where does the constant: 1.66242611301 x 10-7 ohm centimeter come from?
How is it derived?
Also, why is the following true:
1 circular mil ohm/foot = 1.66242611301 x 10-7 ohm centimeter
Thanks,


texts: Alternative to battery powered isolated voltage source

texts:
For some nano-physics related measurements, a very clean low-noise bias current is required. People mostly use a battery powered isolated voltage source along with a big resistance similar to this.

Is there anyway, alternatively I can have a clean source using a regular voltage source, let's say a Keithley DC power supply, and an off-the shelf filter to clean it up?
Any recommendation for the filter?

Appreciate your responses.

Added notes:

I would like the noise to be in the order of 10 μVrms (1kHz bandwidth), similar to the device above.
By recommendation: I mean what to search for. Is there any technical term for these types of filters.


texts:
I can't find eagle library with "empty" smd/smt packages.

I found THT packages in ic-packages.lbr.

Where I can find SSOP, TQFP and other smd packages?


texts: Relay Continuous Current Ratings vs Size

texts:
This is my first post. I have been coming here for years though.
I am designing a relay board for my motorcycle to control power to various accessories - lights, heated gear, horn, GPS, etc. It's a pretty straightforward design... some terminals, fuses, and relays. Nothing really new except the goal is to make it small because my bike doesn't have much space and it's a good excuse to practice PCB layout.
Right now I have a few channels and relays that can be individually controlled by various switches. I figured the maximum current any channel will realistically see is 10-12A so I went on digikey and searched for 12VDC automotive relays rated for 20A and higher.
I ordered this little guy which is rated at 30A: https://www.digikey.com/en/products/detail/omron-electronics-inc-emc-div/G8N-1H-AS-DC12-BY-OMR1/6817243
When I got it in the mail I honestly don't believe this is rated for 30A. It's so tiny. Every other automotive relay I've dealt with is HUGE. I've also used 10A relays that are 3X this size.
Everything I'm reading says this is fine, and that if the switching current rating is 30A then the continuous current rating is probably even higher. I still don't believe it though, because it's so small. Even the power pins are small, they look equivalent to 20 or 22awg wire.
I kept looking around and found some other relays (similar form factor) that specifically say in the datasheet they're made for lights and heaters. The one linked above says it's used for window motors and such (things that get used for maybe 5-10 seconds at a time). But just looking at the numbers, there's nothing that says it can't be used continuously.
Am I missing something here? Would this thing be fine with a 30A resistive load running through it for 6 hours or would it just melt? Please enlighten me. There doesn't seem to be any link between size and current carrying capacity. And there also doesn't seem to be any reasoning for the datasheet numbers and the "typical applications" either.


texts: LTSpice - Capacitor Charging/Discharging Circuit not working right

texts:
I am trying to do a charging and a discharging Circuit. R8 is the load that Capacitor C1 needs to discharge into when P12V_IN is low.

My question is Why is Vsolenoid low in the interval shown on the waveform when P12V_IN is low? I am expecting that P-FET M2 is OFF during this time so the voltage/charge of C1 should discharge into R8 since NMOS M3 is ON.

I am sure I am screwing up somewhere silly.


texts:
I am reading a textbook that mentions that small loops with high dI/dt on a PCB tend to produce predominantly magnetic waves and stubs with high dV/dt tend to produce predominantly electric waves in the near field. In the far field, both radiators result in EM waves.

1) I don't understand how in both cases (loop or stub) the resulting wave is not an EM wave (with a predominantly E or M component depending on the case)?

2) I also don't understand how you determine how a specific structure will radiate (with respect to E field to M field proportion). Can someone please clarify?

3) Why do these fields become an EM field in the far field? Is this because the free-space impedance (377ohm) forces any field traveling through it to become an EM field?

4) Why don't magnetic fields (ie rare earth magnet) or electric fields (ie electrostatically charged glass rods) become EM fields?


texts:
I am having trouble figuring out how to reconnect this ribbon cable*. My dear removed it when he was trying to fix our projector and cannot figure out how it went in. There doesn’t seem to be a way for it to reconnect or I am clearly missing something. Any info would be appreciated.

(*) - Actually, it's a flexible flat cable.


texts: Induced dipole moment and 'electronic polarization'

texts:
Principles of Electronic Materials and Devices - Hasap, pg: 586, he says:

The induced dipole moment depends on the electric field causing it. We define a quantity called the polarizability a to relate the induced dipole moment \$p_{induced}\$ to the field E causing it,
$$p_{induced} = \alpha \cdot E$$
where \$\alpha\$ is a coefficient called the polarizability of the atom. It depends on the polarization mechanism. Since the polarization of a neutral atom involves the displacement of electrons, \$\alpha\$ is called electronic polarization and denoted as \$\alpha_e\$.

He has already defined dipole moment to be:
$$p = Q \cdot a $$
where \$a\$ is the distance vector from - to +

What is the difference between dipole moment and induced dipole moment?
He's saying that \$p_{induced}\$ is proportional to polarizability and \$E\$ so
\$p_{induced} = E \cdot \alpha\$. But dipole moment is also dependent on polarizability.

What's going on?


texts: I2C pull-up to multiple voltage question

texts:
Quick rundown of what's going on:
I am using two PIC32MX to both be masters of I2C.  They will be remotely controlled to determine who is the master at any given moment.  Due to redundancy purposes, they both have their own 3.3V regulator sourced by the same 5V.

My original design, I was pulling up the I2C lines to the local 5V.  Now I'm thinking I should pull up to 3.3V instead.  However, I'm not entirely sure what kind of consequence I might see if I pull up the lines to their respective 3.3V.  They are connected to the same I2C bus.

Questions:

Am I right to worry or is there actually nothing to worry about?
Should I only have one set of pull-ups because they'll act in parallel?
Am I better off just pulling up to local 5V.  The PIC I2C lines are 5V tolerant, but it's a 3.3V device.


texts: So I kinda shot myself in the foot by purchasing a two prong wall wart to power an audio preamplifier that I designed. I forgot to consider the fact that I should ground my chassis to the earth connection via a three prong AC plug. Does anyone know a way I can ground my chassis while still using the two prong wall wart? I was considering modifying the wall wart by adding an additional discrete prong on top of it that would plug into the earth connection of an outlet. If you think that I can get away with leaving my chassis floating, please let me know as well. Thanks.


texts: Handling power loss in a Microcontroller

texts:
I am trying to save the context of a microcontroller during a power loss. I already have a detection circuit which tells the microcontroller about the power loss. During a power failure, I needed some additional time for the microcontroller to perform the save operation, hence I have added a large capacitor (1000uF). Everything was working fine with this approach and I was getting more than the required time to complete my operations.
Now I needed to connect some other load to the same power supply (some relays) and this reduced the capacitor's discharge rate. As a solution I added a schottky diode (SOD-123) in my circuit before the capacitor and after the relay such that the capacitor charge wont flow back to the relays. Schematic shown below.

simulate this circuit – Schematic created using CircuitLab

However I don't see much improvement in the time. My setup works fine when the relays are turned off / removed. Is my schottky rating incorrect? or do I have a better or easy way to handle this ? I won't be able to change my power supply or add too many components due to size constraints.

Note - My brownout voltage is 2.1V and blackout voltage is 1.67V. The Mosfet controls the relay and the relay also has flyback diode (not shown in diagram)


texts: Question about battery internal resistance measurement

texts:
I have a 65 mAh thin Li-Po pouch cell. I tried measuring the internal resistance of the same using the foll. steps: (The battery was fully charged before this process)

Battery open circuit voltage measurement: 4.0662 V
Connect a 560 ohm resistor across the battery
Voltage measured across the resistor: 4.0562 ohm
Current through the circuit: 4.0562/560 = 0.00724 A
Voltage drop across battery's internal resistor: 0.01 V
Battery Internal Resistance: 0.01/0.00724 = 1.38 ohm

I repeated this process with 150 ohm and 47 ohm resistors and got the internal resistance to be 1.55 ohm and 2 ohm respectively.

From what I have read in the literature, battery internal resistance is generally in double-digit milliohms whereas the resistance of my battery is 2000 milliohms.

Is such high resistance possible?
Is this because I'm measuring the resistance at a fully charged
state?
I know the SoC affects the battery resistance, but would it
make the resistance so large?
If not what is the mistake I'm making in the resistance measurement process?


texts: Creating a balanced dipole from two monopole chip antennas for use on small PCBs

texts:
I'm trying to use a monopole chip antenna on a PCB much smaller than the one recommended in the datasheet. I am wondering if I can get away with a much smaller board by using two monopole antennas driven in a balanced dipole configuration as depicted below.

Is there any benefit to using chip antennas in this way or am I better off just using a single antenna and trying to tune it for the smaller board somehow?

This is the antenna in question: Yageo 433MHz chip antenna

Instead of the layout in the datasheet

I was thinking of using something more like this


texts: Is there a special diode or band pass filter that will only allow RF signal to go though a wire in one direction like a diode does with electricity?


texts: What is this symbol: semicircles facing each other?

texts:
What does this symbol represent?

It was found on the circuit diagram for a TDS973A a board for which this was the only information I was able to find online.


texts:
I am looking for a model I can use in LTspice for a a Lithium Ion battery.  It is a pulsed load and I want to see things like heat losses and discharge time. Is there an existing model I can utilize for this, how can a li-ion battery be simulated in lt spice?
I am using a Saft 7s2p battery.


texts: BJT Class A Amplifier - Help calculating resistor values \$R_C\$ and \$R_E\$

texts:
I'm having difficulty working out required values of resistors \$R_C\$ and \$R_E\$ in the circuit below. Can't seem to find any formulas on the web.

I know how to find \$R_1\$ and \$R_2\$:

$$R_1 = (\frac{R_2}{V_B} \times V_{CC})-R_2$$

$$R_2 = \frac{β_{DC} \times R_E}{10}$$

I'd appreciate any help you can give with this as I can't move forward with other calculations until I find values for \$R_C\$ and \$R_E\$.

Technical specs of circuit:

BJT BC108
Voltage divider bias used
\$I_{C(sat)} = 20mA\$
\$V_{CC} = 10V\$
10μF coupling capacitors for the input and output connections
100μF capacitor for the bypass capacitor
\$β_{DC} ≈ 200\$
Voltage gain without bypass capacitor = 1.5

I plotted a DC Load Line and the Q-point is at \$I_C = 10mA\$ and \$V_{CE} = 5V\$.


texts: Why do we "need" resistors (I understand what they do, just not why...)?

texts:
I have always had a basic understanding of electronics. I am now starting to learn a bit more, using an Arduino as a test platform, and I have a question about resistors that I can not seem to solve through research.

Why do we use them? I understand that they limit current. (In the case of an LED, too much current would heat it up and burn it.) But how is this measured/calculated/chosen? I am not specifically asking about an LED use case, or how to use an LED. I am trying to understand "why" resistors are needed on a physics level.

What happens to the rest of the current not used (because of the resistor)?
Does the LED then use ALL of the current available in the circuit? If not, where does the rest go? (Recycled back into power source?)
Why does an LED "drop voltage" by a certain amount? And what happens to the rest of the components in series, does the voltage drop for every component, up until there is nothing left? This would make sense, but an LED does not have internal resistance (so it is explained), so why does it drop voltage?
I recently watched a video, where the guy explaining resistors, drew a sketch showing 12 V → resistor → LED --- 0 V (Do you choose your resistor to the extent of "using up all the current/voltage" before it gets to the end of the circuit? YouTube video
Why does a battery go into a dead short if you connect the terminals directly, but if you add a light bulb (resistor), it does not?
I have done hours and hours of research, and I understand what a resistor does, but I do not understand why it is needed (to not dead short a battery? ... Does this mean it "eats" all of the power before it returns to the anode?)
Why do different light bulbs work on the same battery (different resistance, but no dead short?)

I know these questions are broad, and I am not specifically looking for answers to each of them individually. I am mentioning these multiple questions above to demonstrate that I do not have a firm grasp on the concept of why a circuit needs resistance. This would be the question to answer.


texts: How to implement 32-bit adder logic using two 16-bit adders?

texts:
I've been trying to implement a 32-bit adder by instantiating two 16-bit adders. The code is compiling but failing some test cases. I don't know what is going wrong in this.
verilog code
module top_module(
    input [0:31] a,
    input [0:31] b,
    output [0:31] sum);
    add16 adder2 (.sum(sum[16:31]), .a(a[16:31]), .b(b[16:31]));
    add16 adder1 (.sum(sum[0:15]), .a(a[0:15]), .b(b[0:15]));
endmodule

This is the top level figure of the circuit:

This is the output waveform:


texts: What is configuration image zero and one?

texts:
Currently, I am working in Broadwell-DE based module design.
In this circuit, There is an FPGA (p/n :10M02SCU169C8G )

Please see the configuration user guide added. ( ref page 14)
https://www.altera.com/content/dam/altera-www/global/en_US/pdfs/literature/hb/max-10/ug_m10_config.pdf

So there is pin for config_sel ( selecting the configuration image 0/1)

I have gone through the doc and unfortunately I could not get the concept of configuration image 0 and 1.

Please do advice if any one know the concept of config_sel and what should be the default connection?

Thanks
VT


texts: What is this round shaped component called?

texts: Not sure what this component is. Ive been given some components without any list, so now I am very confused what I can use them for.


texts: Design and Simulation Software for Logic Gates and Discretes

texts: I do not have a deep knowledge about Electronics, but I gained my basic knowledge from high-school and self taught after that. I need to know which software I can use to design electronic circuits with logic gates. Basically, I need to design a logic gate system (for a specific purpose) and convert that into a real circuit diagram adding electronic parts (transistors, IC, Resistors etc.) and do the simulation to see whether it works. After that I can assemble the real circuit. Is there any simple software that I can use for this? Any suggestion would be deeply appreciated.


texts: What is the orientation of the pins in this drawing of an L4940V5 TO-220?

texts:
I am a novice trying to build a circuit using a L4904v5 voltage regulator.  The datasheet has the following images:

This 2D pinout drawing gives me few clues about which side I am viewing it from.  I assume it was viewed from the side is "flat" and does not have the "side dimples" or the round hole since they are not shown in the pinout image.  There is also a lightly printed symbol on one of the pins that you can see in the actual picture.  I do not recognize the symbol though.

1) Is my interpretation correct?
2) If I am wrong, will connecting this regulator backwards, to a 7.5 volt source, damage it?
3) What does the symbol mean?


texts: Use of decoupling/bypass capacitors for LED controller

texts:
My current circuit diagram

The typical application schematic, Figure 17 (page 20), shows the usage of the 10uF and 0.1uF capacitors for the power circuitry. However Figure 16 (page 19), shows the usage of the 1uF and 0.1uF capacitors for the power circuitry.

Do I need the 1uF or 10uF per VDD/VSS pair, or just one for the package. I know I need the 0.1uF per pair.
If my voltage regulator output uses a 10uF, then do i need only the 0.1uF per VDD/VSS pair? Or should I also use a 1uF as my diagram currently has.
Does the use of excessive or extra decoupling/bypass capacitors cause any problems?

STP24DP05 Datasheet

Thanks.


texts:
I am building an experiment that consists of ten either stepper or DC motors. Ideally I want to just have a switch box with one switch per motor so I can just flip the switch for motor 1 and it will run at a set speed. I'd like to be able to operate up to 3 motors at one time. That is, I want to flip motor switches 1,2, and 3 and have them do their thing then when I'm done I can just flip the switches and shut them off. Seem easy right? I have no idea where to start. This is the motor I'd like to use. Or I will use a DC with equivalent power.

-What can I use as a power source?
-How can I connect all ten motors to the power source?
-Can all ten motors be run by one arduino?

I'm a noob so bear with me here.


texts:
I want to transmit CAN frames on a Kinetis KE06. When I send the frame its payload is total junk. I have confirmed the wrong data in loopback mode and with a logic analyzer (connected to tranceiver TX pin). The identifier (both standard and extended) is always correct and the length is always correct. Junk payload stays always the same, but differs across power cycles.

This is my transmit code:

static void can_transmit(uint32_t identifier, bool identifier_is_extended,
    const uint8_t *payload, uint8_t payload_length) {

uint8_t empty_buffer_mask = MSCAN->CANTFLG & MSCAN_CANTFLG_TXE_MASK;
if (!empty_buffer_mask) {
    debugf("TX busy, dropping frame");
    return;
}

//select transmit buffer
MSCAN->CANTBSEL = MSCAN_CANTBSEL_TX(empty_buffer_mask);
debugf("Buffers available %02X selected %02X, payload length %d", empty_buffer_mask, MSCAN->CANTBSEL, payload_length);

if (identifier_is_extended) {
    MSCAN->TEIDR0 = identifier >> 21;
    MSCAN->TEIDR1 = ((identifier >> (20/*source bit position*/- 7/*destination bit position*/))
            & MSCAN_TEIDR1_TEID20_TEID18_MASK)
                    | ((identifier >> (17 - 2)) & MSCAN_TEIDR1_TEID17_TEID15_MASK)
                    | MSCAN_TEIDR1_TEIDE_MASK;
    MSCAN->TEIDR2 = identifier >> 7;
    MSCAN->TEIDR3 = identifier << 1; //TODO: check the RTR flag
} else {
    MSCAN->TSIDR0 = (uint8_t) (identifier >> 3); //this register holds bits 10-3 of the ID
    MSCAN->TSIDR1 = (identifier & 0x7) << MSCAN_TSIDR1_TSID2_TSID0_SHIFT;
    MSCAN->TSIDR1 |= MSCAN_TSIDR1_TSRTR_MASK; //set remote transmit request flag
 // ^^^^^^^^^ THIS IS WRONG - see answer ^^^^^^^^^^^^
}

for (uint8_t i = 0; i < 8; i++){
    MSCAN->TEDSR[i] = i; //transmit fixed data
    debugf("TEDSR[%ld] = %02X", i, MSCAN->TEDSR[i]);
}

MSCAN->TDLR = 8;//payload_length;
MSCAN->TBPR = 0; //priority of this buffer

_rx_busy = false;

//enable transmission of this buffer
uint8_t transmit_flag = MSCAN->CANTBSEL & MSCAN_CANTFLG_TXE_MASK;
debugf("transmit flag = %02X", transmit_flag);
MSCAN->CANTFLG = transmit_flag;
}

It seems like the write to TEDSR does not take effect. What am I doing wrong?


texts: How do I control a seven segment display with a shift register and an Arduino?

texts: I recently purchased 4 seven segment displays from sure electronics. They came with their own shift register board which combines the 74HC595 IC with the ULN2003. I want to be able to tie into this board using the Arduino and after several hours of research and trial and error I have had no luck. The data sheet for the seven segment displays and the shift register board can be found here: http://www.sure-electronics.net/mcu,display/DE-DP005.pdf . I can't even figure out the functions or names of the pins on the shift register board at this point. Any help would be much appreciated.


texts: UART Overrun Error handling when transmitting data onto a terminal (lpc2138)

texts:
I am making a driver code for lpc2138. Currently I need to read the voltage on a potentiometer with the ADC and with the use of timer, print it onto a terminal in regular intervals. There are also other components but they are not of interest for this issue.

Now I'm having troubles sending it to UART to display it on the terminal. I used the simple (actually probably the most common) function for sending data to UART buffer:

void uart0_write(char reg_data)/*send one byte*/
{
        while(!(U0LSR & THRE)); /*wait for THRE in LSR 5th bit to be empty*/
            U0THR = (int) reg_data; /*write data into THR(transmit buffer, right?*/
}

void uart0_write_str(char *str)/*send a string*/
{
    /*
    Should something come here?
    */

    while(*str != 0x00) /*while not end of string*/
    {
        uart0_write(*str); /*send one char*/
        str++; /*move +1 char in the array*/
    }
}

And here is the U0 init code:

void uart0_init(void)
{
    PINSEL0 = 0x05; /*set pin P0.0 to TXD0 and P0.1 RxD0 (TXD0 - 01; RxD0 - 01; 0101 = 0x05)*/
    U0LCR = 0x83; /*set length for 8-bit word, set the stop bit, enable DLAB*/
    //U0IER = (1<<0) | (1<<1);/*Enable THRE interrupts; Do I need this ?*/
    U0FCR = 0xC7;*/ /*enable FIFO; reset Tx FIFO; set interrupt after 14 characters*/

    /*Baud rate configured to 9600 Baud*/
    U0DLL = 0x9D;
    U0DLM = 0x0;

    U0LCR = 0x03; /*disable DLAB*/
}

Timer setup:

void timer0_setup(void)
{
    T0CTCR = 0x00;/*select timer mode*/
    T0TCR = 0x02; /*reset and halt the timer*/
    T0PR = 25000 - 1; /*prescaler set to granularity with 1ms steps*/
    T0MR0 = 200 - 1; /*set match register to interrupt every 200ms*/
    T0MCR = 0x03; /*generate interrupt on each 3rd pulse of PCLK and reset the timer*/
}

Timer handler:

int t0flag; /*global int flag for starting the ADC conversion; used later in main*/

void timer0_handler(void)
{
    t0flag = 0;

    T0IR = (1<<0); /*reset the timer*/
    VICVectAddr = 0x00; /*reset the VIC address*/
}

The Problem
When I try to run it in a simulator, an overrun error pops up.

What could be the issue? normally if I'd write in main:

char *str = "Hello World";
extern int t0flag = 1;

while(1)
{
    if(t0flag == 0)
    {
        /*do what is necessary*/
        t0flag = 1;
    }
}

It should output the string, right? I have been reading the data sheets and all the information available on the web and cannot figure it out. Is my approach incorrect?

I'd be thankful for any hint!

Jacob


texts: Figuring out the AC equivalent circuit(re model) of a Pre-Amplifier and Tone Control Circuit

texts:
I need help figuring out the AC equivalent circuit of this preamplifier circuit. I'm quite familiar with all the simple BJT configurations but this is my first configuring such a relatively complicated circuit. How do I start? All I know is that all the capacitors would act as short circuits and the transistors would transform to its equivalent components.

simulate this circuit – Schematic created using CircuitLab


texts: Circuit component controlling charging current

texts: I wonder how the circuit of a typical 5V phone charger looks like. In the figure given below, I sketched how I imagine it. Using this setup, could I control the current drawn by the phone by selecting different resistors, or would it catch fire?


texts: Why one transistor switches on first than other

texts: In the circuit diagram given below we have two transistors. And in the article it is given that one transistor will turn on first. Why this transistor turns on first


texts: How precise is the frequency of the AC electricity network?

texts:
If I make a digital clock which first detects the AC frequency roughly (whether it is 50, 60, 100Hz, etc), then uses it as its clock pulse source, how precise would it be? Would it work world wide precisely?

For instance, in USA, what is the mean and standard deviation of the 60Hz AC frequency?


texts: Which formula to use in order to choose the right power rating for a resistor used in a half-wave rectifier?

texts:
It's not very clear for me which are the differences between Idc^2 * Rl and Irms^2*Rl in a simple circuit where I have an AC source, a load resistor, and a diode:

If I have a 40Vpp Sinus voltage with 0V DC offset (Vmax = +20V) and a 0.25Ohm Load resistor connected in series with a diode (a half wave rectifier), Rd much smaller than Rload (Rd = diode equivalent resistance), I will have a peak current Imax of 80A, when the diode conducts. The RMS current in this circuit will be Imax/2 and the Idc will be Imax/pi.

As I see on this website, the DC power delivered to the load will be Idc^2*Rload and the power dissipated in the load will be Irms^2 * R.

So, using these two formulas I get:

DC power delivered to the load = 162.278 W
Power dissipated in the load = 400W

If I want to buy a resistor and use it in this circuit, I should buy a 500W resistor or a 200W resistor?

I think is 500W but I'm not sure. If yes, what is the DC power delivered to the load?

I hope someone is kind to help me understand a bit better the differences between this two powers.


texts:
I have designed this circuit and I expect the output to converge to 1 when stimulating it with a step input. The problem is that I get almost 10 times the input as output. Is there something wrong with the design or am I measuring the output from the wrong place? I am currently measuring the output voltage before R20. The op-amps serve the following purpose from left to right:

1st: The summing point of the negative feedback and the input.
2nd: The three parallel op-amps are the P I and D stages of the PID controller
3rd: The summer of the three PID stages.
4th: The inverter of the PID output.
5th and 6th: Realization of the following transfer function:

$$
\ G(s) = \frac{100*20*100}{(s+10)(s+20)(s+100)}\,
$$


texts: Confusion between Kirchhoff's current law and voltage law

texts:
My wire is running 5 volts, 2 amps. I am splitting that wire into two. I want to make sure 1 amp goes to each half. According to Kirchhoff's law, that is possible, because it states that the sum of currents through all wires on the receiving side of the junction (node) is equal to the sum of currents through all wires on the supplying side.

However, I don't understand it properly. What is the "loop" in Kirchhoff's voltage law? Is there a difference between KVL and KCL?


texts: How long does it take 1mA discharge current to discharge 24V 35Ah battery down to 8V

texts:
I am using a circuitry which has to be connected to 24V battery at all times. The circuit works 8-32VDC so it will be OK down to 8V.

How long does it take 1mA discharge current to discharge 24V 35Ah Lead Acid AGM battery down to 8V if initial voltage is 24.0V?


texts: Atmega328 AU has a low Voltage output pin

texts:
For a project I am programming an Atmega 328 AU on a custom made PCB. After a lot of struggles I managed to get a bootloader and a program on the chip. I programmed some IO pins and they seem to work fine. The output pins that I use give: LOW = 0 Volt High = 5 Volt which is desired. However, one pin, pin 9 of the chip, gives: LOW = 0 Volt, HIGH = 1 Volt. The 1 Volt does not trigger my opto-coupler so I would like this pin also to give HIGH = 5 Volt. Is there any way to change this in software?
I use the Arduino IDE for programming.
Thank you guys.
edit:
Still not figured out. Ill add some schematics. Note: The supply is not that flat with my own power supply, but I could add a bigger capacitor. However, for the opto-coupler is does not matter and the output will correctly trigger the opto-coupler for the 5V.


texts: supply power factor of a residential transformer

texts: A transformer winding is generally more inductive than resistive thus there is a considerable phase difference between voltage and current, so wouldn't  the supply power factor be very very poor in case of residential transformers where no means for power factor corrections are used?


texts: Is it possible to use coolers/fans as wind powered generators?

texts:
Is there a way to make a fan/cooler generate electricity by rotating its blades using the forces of nature?

I just tried rotating different coolers and fans I have at home with a 2 volt pocket flashlight lamp attached to the wires, but it wouldn't light up. Then I remembered that there are controllers installed to make fans utilize energy with more efficiency or to help control rotation speed, so I guess that'd be the problem.

Would a simpler design of a fan work both ways?


texts: Why are latches level triggered and flip flops edge triggered?

texts:
I know what it means to be edge or level triggered but considering the block diagram or logic diagram of inside of latches and flip flops I cannot see what inside them specifies this property of each, or how are they different that makes some level triggered and some edge triggered?

Can someone explain please?


texts:
I am trying to derive the equation of small signal vout/d for a CCM flyback converter. In order to do this, I need the small-signal average model. I am having difficulty seeing how the small signal model for the flyback (or buck-boost) is derived from the flyback converter:

I recognize that the Vout/Vin for the flyback and buck-boost include a D in the numerator like a buck converter, and a 1-D in the denominator like that boost converter, and that is why the small signal model has a buck type stage (1:D) and a boost type stage ((1-D):1). I just wish to be able to be able to derive the small signal model directly from the normal circuit schematic.


texts:
I have an exercise from a textbook about smart antennas. I think I have the right approach to solve this kind of problem. However, I'm not quite sure if I'm handling it correctly due to the additional phase delay of one radiator.

The exercise looks like this:

  Consider two isotropic radiators located at a distance of d=0.55λ.
  Both radiators are driven by a sinusoidal carrier signal with equal
  amplitude. The phase of the signal feeding radiator 1 lags behind the
  signal of radiator 2 by 60°. Calculate the angle α, at which there is
  a zero of the radiation.

So the setup looks like this:

My approach would be adding two complex signals togehter like this
\begin{equation}
\underline{g}(\phi)=\sum_{n=0}^{N-1} \underline{w}_{n} \cdot g_{n}(\phi) \cdot \exp (-j \cdot k \cdot n \cdot d \cdot \sin \phi)
\end{equation}

As far as I understand \$g_n(\phi)=1\$
because the antennas are isotropic and \$k = \frac{2\pi}{\lambda}\$
because it is the propagation constant.

\$\omega_n\$ has to be the sinusoidal which should look like \$A\cdot cos(2\pi f t+\phi)\$. Here I am not sure. This is the correct way of adding the phase right? And do I assume correctly that I cannot get a numerical result because there was never mentioned which frequency the signals have?

Since the formula above looks like a Fourier transformation I assume one can make use of it. I don't see how. Transforming two sinusoidal to 4 peaks, adding them and transforming them back doesn't help much.

In the end I get something like this:
$$g(\phi)=cos(2\pi ft)exp(0)+cos(2\pi ft-60°)exp(-j2\pi0.55 sin(\phi))$$
which I then would set equal to zero.
Whilst writing this I just noticed that I have introduced a variable t. No clue how to handle this. All my exercises before did not depend on the frequency nor on time. Why would the pattern in two dimensions not depend on the signal and the time? In all the baby examples we did before there was an easier formula if all antennas were equally spaced: \begin{equation}
\Delta \varphi=-k \cdot n \cdot d \cdot \sin \phi
\end{equation}

First I thought this might be applicable since I could convert the phase delay in an additional distance. But I guess this is only true in x direction. I just got more confused writing this all. Guess I haven't understood it at all.


texts:
I'm currently working on a side project which uses an SSD1306 128x64 OLED display. I'm then using I2C to communicate to this.

However, I'd like to better understand what exactly is going on when I'm writing values to the various registers.

From what I've read I believe these registers can be re-mapped inside the device so they might not be the actual register addresses that I'm writing to.

For arguments sake, say I was writing to the register itself, what is happening in the chip? Does it get used directly as part of the logic within the circuit - one of the bits as the input to an AND gate for example?


texts: Can AC synchronous motors be controlled with VESC?

texts:
I want to drive something like these ac synchronous motors:

Small Mige:

https://www.alibaba.com/product-detail/Small-Mige-130-series-1KW-best_60394196285.html?spm=a2700.7724838.2017115.13.6f2a2896JUGbXc

or Kollmorgen: (let's say 52k, doesn't mattter ultimately)

https://www.kollmorgen.com/en-us/products/motors/servo/akm-series/akm-series-ac-synchronous-motors/ac-synchronous-servo-motors/#tab2

So is driving these possible with VESC? I downloaded vesc software and there is a FOC mode which uses sine waves. But this is still a BLDC drive, not BLAC (PMSM)?

Oh yea since i'm confused about driving BLDC and PMSM. Can you drive PMSM with trapezodial (theoretical square wave)? BLDC can be driven with ac so I'm curious, and there are no straight answers on the internet.

Edit:
My plan is to use vesc torque control. The motor would not spin above, let's say 500 RPM. The torque is the most important to me.

Position feedback would be done with incremental encoder.

I will feed the data to vesc using another microcontroller. Haven't decided how to do it yet.


texts:
I want to know if my understanding of this state machine diagram is correct.

The input is connected to a toggle: 0001,1 <- This 1 represent toggling the input

Initially, when the circuit powers on, it is in state 00 and the input could either be 1 or 0.

If 1, 0001 displayed again and the input is toggled to 0.
When the input is 0 there is a state transition which displays 0010, at this state there is no toggle bit so the input is still 0, this causes a transition to the next state again

Is my understanding correct?
Thank you


texts: Multiplexing an I2C bus between two masters on a Xilinx FPGA

texts:
I have a single external I2C bus (SDA and SCL pins).  This is currently controlled by a third-party IP core which provided "implicit" inout ports in the MPD, specifically:

PORT IIC_DATA = "", DIR = IO, THREE_STATE=TRUE
PORT IIC_CLOCK = "", DIR = O, THREE_STATE=TRUE

I've hit a situation where I want to be able to talk to a device on that bus independently of the IP core (at a time when the IP core itself can be held in reset so that I know it cannot interfere).  I've tried creating a separate axi_iic master and connecting it to the same external ports, but this doesn't work as it gets upset about multiple output drivers connected together.

So I think I need a simple I2C multiplexer as glue logic between the two masters, and I think I know how to do that in terms of the internal _I, _O, _T signals of each master, but I'm not sure how to "extract" those internal signals for the existing core given the MPD above (they are present in the underlying VHDL).

For the moment I've just manually modified the MPD file to expose these signals, but I was wondering if there's a better way to do this (either getting at the signals without changing the MPD file, or doing the whole I2C multi-master thing); while the manual edit is workable, the changes to the MPD file may get lost when the core is updated, so it's error-prone.

Another solution that I've considered (but I'm not sure if I like, though it's still possible since the FPGA pinout isn't final yet) is to double-route the external bus (so the external SDA goes to two separate FPGA pins, one for the third-party core and one for the new core).  This seems fairly ugly and wasteful though, but then I'm not an expert. :)


texts: attiny13a SMD production programming without programming jumper? Possible?

texts:
I'm struggling to find a decent way to program a production run of some boards. The boards are going to be about 2cm by 3cm ovals with a surface mount SOIC 8 pin Atmel attiny13a microcontroller.  The board is too small to have jumpers and jumpers are too expensive anyway.

This is a small production run of about 1000, but will lead to a greater production run.

What is the cheapest/easiest way to program these without adding any physical components to my board besides copper traces/pads?

If there is no easy way, how much extra would it cost to buy my attiny13a microcontrollers preprogrammed? And where could I buy them like this?

Thanks!


texts: Why is this digital output circuit non-linear to the load?

texts:
I'm simulating a DAC which puts out 0-20mA, but in practice, the output varies depending on the load of 300 ohm resistor. If I using a 1k ohm resistor, then I get a different output current.
If you don't understand the schematic below, I can tell y'all that this circuit is a feedback circuit.

This is a P-gain controller. It uses two transistors -
one NPN and one PNP to let the current flow through from 24V power supply.
I could use an NPN transistor only, but then the base voltage of the NPN transistor would be very high e.g 24V-0.6V. Therefore I'm using a PNP with a NPN transistor so the NPN transistor is releasing the "pressure" at the base of the PNP transistor so current can flow from emitter to collector.

And this is the feedback where we measure the voltage drop over the 160 ohm resistor.

Try to change the load of the 300 ohm resistor and change the input voltage of 1.0v to e.g. 3.3v and then change the load. Why does the current output changes? Should this circuit not be a feedback circuit?
Link to simulation
What do you think about this?


texts: When to use pull up/down resistors on IC inputs

texts:
In a very general sense: When should you use pull up or down resistors on IC inputs and when should you connect the pin directly to Vcc/GND?

Particularly if no impedance is mentioned for the pin. Or can you assume the impedance to be near infinite so it does not matter?

For example, the TUSB2036. It either doesn't give an impedance for the control pins or I'm not looking in the right places (which is a very real possibility).
Do I place a pull-down resistor on the ~BUSPWR pin or do I connect it straight to GND?

The schematics in the data sheet connect it directly, so that gives a strong indication that a pull-down resistor is not needed, but are there other indicators I can use to determine this, in case example schematics are not available for other ICs?

And, if a resistor is necessary (or at least a good idea), but I don't know the impedance — how do I determine the value of the resistor to use?


texts: USB Type-C to Type-C Cable has voltage in one orientation only

texts:
I'm designing a battery powered device, which gets charged with 5V.
I wanted Type-C as the charging interface, so I designed an appropiate Type-C Port for the device:

As you can see, I added the needed 5.1k Pull Downs on CC1 and CC2, to get 5V.
Well, It works as it should when I charge via an USB-A to USB-C cable with my phone wall charger.
But when I use a modern Type-C charger with a Type-C to Type-C cable, it only gives voltage in one plug-orientation and I can't understand why. In the other orientation there is no voltage on VBUS (or anywhere).
I think I did everything needed to get standard 5V from Type-C. As I don't need special voltages or current, I don't want to add an overpriced PD-Controller.
I tested the same setup with a Type-C female breakout-board and it was the same.
Type-C Connector in schematic: https://datasheet.lcsc.com/szlcsc/1811101526_Korean-Hroparts-Elec-TYPE-C-31-M-16_C283541.pdf


texts: Daisy-chaining two 74hc595N registers, the last pin of the first register, and the first pin of the second register act as one

texts:
I'm experimenting with some 74hc595N shift registers and I think I'm missing something, I have my breadboard set up with the QH' output pin of the first register connected to the serial data pin of the second register, however this seems to make QH of the first register and QA of the second register behave the same, rather than in sequence.

My understanding is that when the SRCLK pin (I have my SRCLK and RCLK pins connected) goes from low to high, the contents of the shift register moves to the right. A high value in the QG position gets move into QH, and thus the QH' output pin also goes high. Since both registers share a clock, on the same pulse the high value on QH' gets read into the second register as it's QA value, thus the value of Reg1 QH and Reg2 QA will always change simultaneously to the same value

So I believe I understand why this is happening, but not how to prevent it since this seems to be the standard setup everyone recommends. Am I missing something?

quick and dirty wiring diagram of my setup (all outputs are connected to LEDs):


texts: I am trying to control dc motor(12V,1A) using npn transistor(BC547) and p channel mosfet(FQP7P06).PWM signal from MCU switches transistor which switches mosfet(Functioning ok).But in that case too much heat is generated across mosfet which is intollerable.Pmos has a rating of -7A,-60V. How can i solve the generated heat issue?


texts: Is there a way to trigger a 5V relay that is more robust than just feeding it with 5 V?

texts:
I'm using a ESP8266 to activate a siren. The siren is activated thru a 5V relay, and the 5V relay is connected to a transistor, the transistor is connected to a pin of the ESP8266. The power supply of the ESP8266 failed and it hung, in this state the pin went high and the relay was triggered.

I was wondering if there is someway to trigger the relay with some kind of code, not just voltage, as a safety mechanism to avoid activation due malfunction. My first idea was replacing the transistor with a cheap microcontroller, like an ATmega 88p.

Is there a more robust way for doing this?


texts:
my question is on bipolar junction transistor, npn with 2 emitters, used in ttl nand gate.
when in reverse active mode, and 2 emitter are in logic high, how is the collector current calculated ?
since there are 2 emitters, should I add 2 currents 2* Beta r * Ib  ?


texts: difference in charging battery of different Ah

texts:
Can i use a lower Ah battery charger(say 20,30)to charge a higher Ah battery ie 110Ah?What are the consequences?
What is the  difference in  the charger circuit in both case?


texts: Problem into shifting from 3v3 to 5v using a BJT

texts:
I've encountered a problem when I've made a small circuit to shift logic level of my 3v3 MCU to a 5v signal. Probably I've misunderstood usage of BJTs. Here's schematic:

As said, my purpose is to switch from 3v3 supply line of my MCU to 5v to transfer data to external slave device (just sending).
What I get with my scope is:

Vmcu = 3,38V
D-n-BJT side = 3.18v Low and 3,82v High
BJT base side = 4,30v Low and 4,38v High
STRP-D-n side = 5,00v
BJT device is BC856S,115 .

What I get is a 5V constant output, on base side I've as low level 4,30v and high level 4,38v . On MCU output pins I've 3,18v low level and 3,82v high level.
In case I open a base resistor (disconnect it from BJT and probe MCU output), for example I remove R53, I get normal output level as 0,00v low level and 3,38V high level.
What I've wrong in this schematic? Maybe I've wrong resistors values?
Otherwise, in case resistors are not the problem (or the only) and changes on layout should me made, how I can do a lessees complex correction to this circuit avoiding to make a new one? (just because I've already etched it).


texts: Should I connect "line" to "line" and "neutral" to "neutral" on my power supply

texts:
I have an industrial power supplyy that I use in a device I am making. I am attaching a picture of it. It has "line", "neutral" and "ground" input connections. Ground is ok. But I don't know if I should be careful to connect "line" of my AC plug to "line" input of the power supply.

We use German type plugs here in Turkey:

As you can see you can connect these German type plugs whatever way you want. So line might become neutral and neutral might become line depending on the direction you inserted the plug.

What should I do? Is it ok and safe to use German plugs with this power supply? Are there special power supplies where switching line and neutral inputs doesn't matter?


texts: Suppressing the turn off transient for a trailing edge 120V AC dimmer

texts:
I am designing an 120V 60 Hz AC trailing edge dimmer based on the reference design above.  The gate is driven starting at 0/180 degrees of each cycle and turns off at a programmable phase later in the half cycle. As shown in the first scope trace below from the line side of the dimmer, there is a voltage spike at the point where the dimmer interrupts the connection from line to load, in this case about 6.7 ms from the start of each half cycle. The second zoomed in trace shows that the spike is about 20 us wide. The spike height increases as the load on the dimmer increases, presumably due to the increased current that is being interrupted.

The dimmer is driving a purely resistive load, so I assume the transient is due to the inductance of the isolation transformer powering the circuit.  Is this a reasonable assumption?

I am considering using a TVS to limit the spike so that it does not exceed the rating of the MOSFETs. Assuming that using a TVS is a reasonable method of clamping the spike, how do I calculate the power requirement for the TVS diode?

Are there other possibilities for clamping the spike besides TVS diodes?


texts:
I have an Adafruit motor shield v2 on top of an Arduino.

I also have a very very small DC motor (tiny) and one a bit bigger. (Dont know the exact V and Amp, but large enough for a small helicopter)

I am trying to get the motor shield to work, but somehow its not responding to anything.

The light goes on, but thats it. I've tried all 4 M ports, I've tried both motors.
I have also tried the "jumper" for power from Arduino and from external. Both times the board lights up, but no movement on the motors.

I have no servo's or steppers laying around to test those, nor do I have a voltage meter.
If there anyway for me to test that this board is actually working?

Sorry if this is a real beginners stupid question, but I am very very new to electronics.


texts: Which harmonics will be missing when duty cycle = 30%?

texts:
After some Googling, I found that every n=(1/duty cycle)th harmonics will be missing in the spectrum of a pulse wave. E.g. a 20% duty cycle will have their 5th and 10th harmonics missing.

However, if (1/duty cycle) is not a integer, what kind of spectrum should I expect? I generated a pulse wave of duty cycle = 30% and it seems the 10th harmonics is missing, why is this happening?


texts: Determining the truth table and simplifying logic expressions (full adder)

texts:
I've been taking an intro computer architecture class and doing some research of my own, I've found the following exercise:
Determine the truth table and simplify the logic expression derived from the following circuit:

After some searching I found out this is a Full Adder, so I started reading up on this and found that the above circuit is basically the go to example to explain Full Adders.

What I don't understand is how one simplifies the resulting expression when there are 2 outputs (S and Cout).

The truth table for a Full Adder is:

Inputs      Outputs
A   B   Cin Cout S
0   0   0   0    0
1   0   0   0    1
0   1   0   0    1
1   1   0   1    0
0   0   1   0    1
1   0   1   1    0
0   1   1   1    0
1   1   1   1    1

I understand the carry logic behind this, but I'd like to understand how exactly should I approach an exercise like this, how to determine the truth table and the logic expression?


texts: Find rotor stator loss in a 3 phase delta connected induction motor?

texts:
I'm trying to work out stator input power of a 3 phase delta connected induction motor.

I have the equation Stator Input Power (P1),

where P1= Pm + rotor copper loss + rotor stator loss.

I have Pm and rotor copper loss but don't know how to find the equation for rotor-stator loss. If anyone could help out that would be greatly appreciated.


texts:
I am new to electronics, and I inherited a breadboard from my grandfather. I could fit 2.54 mm headers into it (as shown below):

I recently got a new breadboard, but the holes seem to be closer to each other, and the headers won't fit (shown below, on the left it looks like it lines up, but as it gets further to the right the pins are further and further from the hole):

I also got a compatible/clone Arduino Nano, which plugs just fine into my new (narrower) breadboard, but not my older (wider) breadboard (pictures below):

I measured the pitch and found that the old breadboard has a 2.54 mm pitch, but the new breadboard seems closer to 2.45 mm.
Is there more than 1 standard for breadboard and header pitch, or if not, what's going on???
Thanks!