texts: What causes a faulty Linear Voltage regulator to output wrong voltage

texts:
I made a circuit where I needed DC 8v supply. I was using a KA7808 to regulate the voltage. While testing the voltage regulator unit, I identified that the Regulator IC might be faulty because I was getting an output voltage of 4.8v - 4.9v for input voltage 18v. I am curious to know what might cause a voltage regulator IC to output wrong (not the rated) voltage. My assumption was, a faulty one would either passthrough the input voltage as is, or burn out, or output 0v.

I'm using the KA7808 with simple config, input pin directly connected to input voltage, Gnd pin connected to ground and measuring output voltage directly from output pin, no other passive component used. And I measured the output voltage at no load condition.

My questions are:

For the given circuit (see below) can we expect a Linear Voltage regulator to fail in a way that it generates a wrong output voltage which it is not rated for?
If answer to first question is 'yes', does it mean we should check every regulator for expected output voltage before using it in a circuit? I mean, do professionals do that as an 'always do' in everyday work where these regulators are used in large numbers?
This is not a yes/no question, but I was also looking for an explanation which might explain what could have caused the regulator to fail in this way, if the external circuitry supporting the Linear Regulator to work as expected, is correct. Can this be expected if any of the building blocks (the internal Error Amplifier, Thermal Protection, Current Generator, Series Pass Element etc) of the regulator fails? Or there is a chance of simple 'wrong labeling' by the manufacturer? (I thought, wrong labeling is impossible, because that is what an Electronics Professional would blindly believe in!)

Hope this clarifies my exact questions.

See the circuit diagram below:

simulate this circuit – Schematic created using CircuitLab


texts: What happens to 5.8 GHz signals when too many transmitters are in a confined space?

texts:
I'm helping set up an Airsoft arena in the UK and I plan to have RC-FPV cameras mounted on the weaponry and masks which the players use/wear (similar to wireless drone cameras). As it's an open space we'll be testing the 5.8 GHz bandwidth first using 40 channel transmitters/receivers.

A few people have suggested that using anything over 8 channels in this bandwidth concurrently would cause problems but what would those problems be?

For example:

Would the video become merged or blended with neighboring channels?
Would the receiver swap from transmitter to transmitter depending on
the signal strength?
Would it just not work?
Or something else?

It just not working and signal merging would represent a problem for me but just channel hopping is no major issue.

These are the channels available in one of the systems we are considering.

In case it's relevant here are the available specs.

5.8G 600mW 40 Channel Wireless AV Transmitter:
Transmitter Frequency /Channel Amount: 5 bands / 8 channel each = 40 frequencies
Output Power:600mW
Frequency Control: Built-in frequency & phase lock loop
AV input: Analog AV signal input
ANT connector: SMA (needle inside)
Power Supply: DC 7-12 volts
Current Consumption: 220mA
Size: 54*32*10mm
Neat weight: 22g

Some additional specifications as a clarification to answer questions:

I'll be streaming low quality AV (320tvl at 24fps and 22 kHz audio) which should come in at under 18mhz bandwidth per device. The modulation is most likely to be Airwave on one side and Boscam on the other.

To clarify, this is not a duplicate question to How to avoid interference in wireless communication. While everyone would like to avoid interference my question relates to what would happen when interference is encountered.


texts: Sine wave clipping before rectifier when wire resistance is added at secondary of transformer in LTSpice

texts:
I'm simulating 4 different circuits, they are all power supplies, with loads, filter capacitors, rectifiers made by four 1N4007s, and transformers fed from 120VAC:

They all have the same problem, which is that the voltage signal at the input of the rectifier has a strange clipping.
It took me a while to figure out where it was coming from, I tried several things until I removed the series resistances from the inductor models themselves and the clipping went away, I then added the resistances as resistors in series (R1 and R2) but the clipping came back. The green plot is the voltage measured across L2 alone (series resistance left blank), the pink clipped plot is measured across R2+L2, the inductor plus it's wire resistance:

It makes sense that there is voltage loss in the wire resistance, but shouldn't it look like a sine wave but slightly scaled down instead of just a hard clean clipping at the peaks?

When I disconnect the circuits from the secondaries and connect R2+L2 directly to just R3 to simulate an open transformer measurement, the pink plot is no longer clipped and matches the green plot perfectly, like this:

Graph for the 4th circuit, with current plots for D1 and C1, no clipping ¿?


texts: Constructing decoder 5/32 using smaller ones, without enable

texts: I need to construct a decoder 5/32 using any number of 2/4 and 3/8. How do I start? With Enable it's not hard to figure out, but without them it gets complicated. Advice?


texts: I am trying to use the LM2904P as a voltage buffer. i am using a volt meter at the output, and i get 10v when it should be 2v.  This is pretty much what my setup is. - is In1- and + is In1+. i dont know what I'm doing wrong here (or right). I am a mehcnaical engineer and haven't touched electrical since first year. but i cant find anything wrong with my setup.


texts: How does the output (say, a sine wave) of a single supply inverting op amp compare with output of a single supply non-inverting, since it cannot go below 0v? Is the phase shifted? I'm trying to understand what happens, since I don't have access to an oscilloscope.


texts:
I have a board containing a PIC16 (see datasheet here) that is drawing too much current. We're able to measure the current draw for the board as a whole, but we can't measure the current draw for every single component.

Our theoretical calculations put the current draw at 300uA, but we are seeing a 500uA. To debug for this 200uA overshoot, we want to put the PIC in it's lowest possible current mode. How can the PIC be put in it's lowest power mode?

What I have done is disable all the flags (such as brown-out reset, stack overflow/underflow reset, etc.) and put the PIC to sleep at the first instruction. Should I put the PIO pins in a specific state? Are there peripherals that are enabled by default and should be turned off?


texts: How to remove schematic reference information in Altium Designer?

texts:
I want to remove the schematic reference information for a pcb component.
How is it possible?

To clarify I do not mean reference designators 'R1', 'R2', 'C7' and 'IC1' for example but part information such as 'OPAMP LM741' from the PCB file so somebody manufacturing a PCB does not have access to the parts list.


texts: Stock (factory) bootloader in ATmega16U2

texts:
I have an issue with ATmega16U2 which includes hardware USB support. As the datasheet describes:

  The 8bits mega AVR with USB interface devices are factory configured with a
  USB bootloader located in the on-chip flash boot section of the controller.

So I have created a printed circuit board with ATmega16U2 and plugged it into my PC. To start it into bootloader mode I have shorted RESET and HWB to ground, then released RESET and HWB after that (both pins are pulled up). Unfortunately, my PC is unable to communicate with plugged device, leaving following error:

To make sure that it's not hardware problem (bad circuit: coupling, long paths, high impedance, shorts etc) i connected to it with an ISP programmer. I was able to read chip signature, fuse/lock bits. I wiped whole chip and flashed it with Arduino software (first easy-to-find hex file on the Internet that came into my mind). It does work - recognized as serial communication device, which received it's COM enumeration. Then I have soldered another ATmega16U2 chip onboard and connected it again, but still I cannot communicate with factory chip bootloader. Only thing that changed is the chip: from flashed stock chip to pure stock.

Here is my circuit schematics. I'm using 16 MHz crystal right now, I have teste 8 MHz crystal too:

Thank you for reading and please share your experience if you have worked with those microcontrollers.


texts:
Not sure whether this is too broad a question but...
Why would one choose CAN Bus over RS485, or vice versa, as a system interconnect?
I have a MCU SBC with multiple interfaces including the two mentioned. Feeding into that I have various sensors/transducers (up to 20 in total).

RS485 is the most common, but some also have CAN. The ones with CAN also have RS485.

In certain cases we cannot hang 2 device sets which have differing protocols if they automatically send NACK packets, because one device's perfectly good NACK is another's bad packet (and so sends a NACK...)

Given that all devices have short packets, and interconnects of length less than one metre, what other factors would mandate which to use?


texts:
I'm using a computer PSU to power several controller boards and sensors.
To be more precise, I'm using the 24pin ATX connector wires to power everything.

There are two 12V+ wires coming from the connector. I've noticed that one of these wires is connected to a ground wire via a capacitor. While the other wire is just a stand alone 12V+. I assume the capacitor is to smoothen the power supply on that wire?

Can anyone explain the reason for the capacitor?


texts: TDC1000 SPI Interface resistor selection

texts:
I am working on Fluid Level Detection using Texas Instruments MSP430L092 Mixed Signal Microcontroller with Texas Instruments TDC1000 AFE. They are connected via SPI Bus and in its datasheet there is reference PCB design, as seen in screenshot:

As you can see, there are resistors placed in SPI Bus and regarding them I have following question:

What is their purpose?
What is their recommended type?
What is their recommended value?


texts: Waveform at the switch of a boost converter. What is causing the oscillation when the switch is open?

texts:
I see this waveform at the switch of a boost converter, which is based on LM2588.  I was expecting to see a square wave (or something close to it, like trace A on fig.48 in the datasheet).  Instead, I see this oscillation when the switch is open.

Channel 1, (yellow) is the waveform in question. Channel 2 is not related to the question.

What is causing the oscillation when the switch is open?
(I also wonder if this oscillation can be a source of EMI?)

Details for the boost converter.

The switching frequency is 100kHz.  The input is +12V.  The output is +35V.  The load current is approximately 200mA.  The converter does maintain the output voltage and current.


texts: the importance of isolation in a BLDC drive

texts:
i am designing a 3 phase inverter to run a BLDC motor, i am using ir2110 half-bridge drivers.
 i am wondering what are the benefits from optically isolating the control side from the power side?

the BLDC motor is (120V-4kW).


texts:
I was recently hit with the thought as to what safety tests a domestic electronic product has to go through before it is sold to consumers more specifically in the EU?

I have been looking through online but there is no clear answer. It mentions CE testing, but are there any other regulations/tests before it is sold to consumers and how do they work?

For example, as I look at a USB Power Supply I see it has the CE mark and other logos as well. I should mention that I was looking into EU laws.


texts:
I'm looking into creating positive square wave sharing same reference ground as primary on the secondary side of a transformer without using a rectifier. Assume that I have ability of providing the top of primary winding with a square wave voltage alternating between 0 V and 9 V.
Would following earthing configuration provide a transformed voltage on the secondary that would alternate between 0 V and 9 x N volts? N is the turns ratio. Primary and secondary share the same ground.

If such configuration is not possible, would a shunt resistor help the situation?


texts: 3 Phase PMSM Motor Current Measurement: Figuring out the 2 negative terminal currents with 1 positive current measurement

texts:
I am trying to implement F.O.C for a PMSM machine with a custom made inverter board. The H-bridges are from Infineon (IFX007T) and they provide current sensing capabilities. The problem is, i need the current information from all three phases and the H-bridges provide this information only when the High side is active - so no negative/return current info.

If two of the H-bridges are High-Side active, then it is easy to calculate the third since the sum of their magnitude must be 0.

My question is: Is there a viable way to calculate/estimate other 2 phase currents when i can only measure 1 phase current. This can be a mathematical transformation exploiting the fact that its a 3 phase balanced system. Any other shunt-resistance like solution is also appreciated.

PS: I need the current info to compare it with the rotor flux angle provided from the rotary encoder to do a feedback control.


texts: Identifying Danfoss compressor controller connector

texts:
I have a Danfoss refrigeration compressor that is connected to its electronic controller via a three-pin connector. (I.e. the connections for the three motor windings.) I am looking for the name of this plug and corresponding receptacle.

The dimensions of the plug are approximately 20x30mm. The pin holes are separated by 11 or 12mm (center to center).

The pins of the opposite look like solid, round metal pins with a diameter of approximately 1.5mm and a length of approximately 5mm (maybe more).


texts:
simulate this circuit – Schematic created using CircuitLab

How does C1 hold Vr1 when V2 is off(0-3v). I'm confused since C1 is referenced to 4V from V1. Shouldn't there be a negative charge on the "R1 Side" of C1?


texts: Writing and Reading From FLASH ROM on Nexys 2 Spartan 3-E FPGA

texts: I am a newbie to VHDL and FPGA platform. I have a Nexys-2 Spartan 3E FPGA board which is provided with a 16 MB Flash ROM.I want to preload first 10-20 memory locations of this ROM,each location with some 16 bit data.Once I am done with the writing part I wish to read these memory locations in my VHDL code (which is an another *.bit file).I checked out Digilent website and also checked some reference manuals but I could not get the idea of accessing this ROM.It would be a great help if someone could guide or enlighten me on how should I proceed to implement this.


texts:
Trying to upload code on atmega328 to display temp but throws me this error :
temp1:12:3: error: 'DDRA' was not declared in this scope
DDRA = 0x00;          /* Make ADC port as input */
^~~~
Here's the code :
#include <LiquidCrystal.h>

#define F_CPU 8000000UL
#include <avr/io.h>
#include <util/delay.h>
#include <string.h>
#include <stdio.h>

#define degree_sysmbol 0xdf

void ADC_Init(){
  DDRA = 0x00;          /* Make ADC port as input */
  ADCSRA = 0x87;          /* Enable ADC, with freq/128  */
  ADMUX = 0x40;           /* Vref: Avcc, ADC channel: 0 */
}

int ADC_Read(char channel)
{
  ADMUX = 0x40 | (channel & 0x07);   /* set input channel to read */
  ADCSRA |= (1<<ADSC);               /* Start ADC conversion */
  while (!(ADCSRA & (1<<ADIF)));     /* Wait until end of conversion by polling ADC interrupt flag */
  ADCSRA |= (1<<ADIF);               /* Clear interrupt flag */
  _delay_ms(1);                      /* Wait a little bit */
  return ADCW;                       /* Return ADC word */
}

int main()
{
  char Temperature[10];
  float celsius;

  LCD_Init();                 /* initialize 16x2 LCD*/
  ADC_Init();                 /* initialize ADC*/

  while(1)
  {
     LCD_String_xy(1,0,"Temperature");
     celsius = (ADC_Read(0)*4.88);
     celsius = (celsius/10.00);
     sprintf(Temperature,"%d%cC  ", (int)celsius, degree_sysmbol);/* convert integer value to ASCII string */
     LCD_String_xy(2,0,Temperature);/* send string data for printing */
     _delay_ms(1000);
     memset(Temperature,0,10);
  }
}

Error :
In function 'void ADC_Init()':
temp1:12:3: error: 'DDRA' was not declared in this scope
   DDRA = 0x00;          /* Make ADC port as input */
   ^~~~
C:\Users\Yagna\Documents\Arduino\temp1\temp1.ino:12:3: note: suggested alternative: 'DDRB'
   DDRA = 0x00;          /* Make ADC port as input */
   ^~~~
   DDRB
C:\Users\Yagna\Documents\Arduino\temp1\temp1.ino: In function 'int main()':
temp1:33:3: error: 'LCD_Init' was not declared in this scope
   LCD_Init();                 /* initialize 16x2 LCD*/
   ^~~~~~~~
C:\Users\Yagna\Documents\Arduino\temp1\temp1.ino:33:3: note: suggested alternative: 'ADC_Init'
   LCD_Init();                 /* initialize 16x2 LCD*/
   ^~~~~~~~
   ADC_Init
temp1:38:6: error: 'LCD_String_xy' was not declared in this scope
      LCD_String_xy(1,0,"Temperature");
      ^~~~~~~~~~~~~
exit status 1
'DDRA' was not declared in this scope


texts: Why both leds does not light equally when power is applied?

texts:
At our kids school there was one day when parent go to school and tells kids about their profession. I am working as programmer, so I got to school and tell kids who is doing programmer. Of course in 5th class is not funny to open IDE and write some words, so I took raspberry pi with motion sensors, camera, temperature sensors, ultrasonic and hall effect sensor. So, that kids can touch temperature sensor and picture kids when they moves around motion sensor. It was nice experience. I also made simple led with capacitor, to demonstrate what is capacitor.

simulate this circuit – Schematic created using CircuitLab

But when I applied power to it, Led1 light up bright, but led2 was very dark. See on second picture (Power ON). After I switched power off, led2 now lights bright and led1 is off as expected.

Question: Why booth leds not at same brightness when power is on and what components is missing in schematics so that booth leds will light when power is on and led2 only when power is switched off?

Parts: Capacitor is 6.3v 3300uf, resistor is 670 ohm, diode is 1N5817, 5.9 volts applied.


texts: Is there an affordable Power Supply capable of 12 Volts and 7 Amps?

texts:
I am trying to power a pump that requires 12 Volts and 7 Amps to run. I have looked around but cannot seem to find a power supply capable of the voltage and the current. Does anyone know where would be a good place to find something like this?

(If an off the shelf power supply is not affordable) Is there some simple combination components to go from 110V AC to 12V DC and deliver the 7A?

I have to admit I am not very well informed in this field, so any help would be greatly appreciated.

Thank you


texts: Conditions for a JFET transistor to saturate

texts:
I have come across the relations:
vDS > vGS – VP for n-channel JFET
vDS < vGS – VP for P-channel JFET
The two are given as the conditions for JFET to be in saturation.
How can I arrive at these two relations?


texts: Does this DC pump and similar ones output at different rates or at one constant pressure/air flow rate?

texts:
https://www.youtube.com/watch?v=nLLq4CB9EkU
[3 minute video demonstrating a small diaphragm pump driven by a brush DC motor.]

I would like to use a DC diaphragm pump similar to this, small in size and powered by batteries. However, I would like for them to siphon liquid at different rates.
Does anybody know if these pumps only output at one constant pressure/air flow, no matter your input voltage? Or will your input voltage correspond with the output pressure/air flow of the pump?


texts: How can I calculate current with load switch?

texts:
I want to use a load switch for protecting my PCB.
I also want to watch/measure the current drawn by my board.
How can I sense/measure the current drawn by my board, using a load switch like the Microchip UCS3205T-E/Q8A?
I can't find articles about sensing/measuring the load current.


texts: How to deal with unused components in pick-and-place file?

texts:
I intend to send a board to a PCB manufacturer and I am wondering how to mark unused components in the pick and place file. I'm using EAGLE and I saw that it includes all components in the file, but I do not want all of them to be mounted.

Can someone give me an advice on how it is better to proceed? Should I set those component's values to DNP (Do not place) so the manufacturer knows they shouldn't be mounted, and remove them from the BOM? Or should I manually remove the unused components from the pick and place file and BOM?


texts:
I'm trying to switch off an opamp using the high-side MOSFET switch (Q4, Q5).

The issue is that after OpAmp_Vcc_Switch goes low, the voltage on the +VCC pin doesn't go exactly to 0, but stays at 1.8V, leaving the opamp operating.

Why is this happening and how can I fix it?

(The opamp I'm actually using is LT1490A, Q5 is SSM3J338R)

Here is the rating table for Q5:


texts:
I want to learn how to work with interrupts and I have done my first try.

I have done a very simple circuit based on ATtiny13.

There's a led in PB1 and a button in PB3. When the button is pressed, PB3 pin change its state from low level to high level, this produces an external interrupt. The code of this interrupt, makes the led turn on for 500ms.

schematic

This is my code, what's wrong here? I'm getting this warning:

  'PCINT3_vect' appears to be a misspelled signal handler, missing
  __vector prefix [-Wmisspelled-isr]

What's wrong here?

#define F_CPU 9600000UL

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

ISR(PCINT3_vect)
{
        PORTB |= (1<<PB1);
        _delay_ms(500);
        PORTB &= ~(1<<PB1);
        _delay_ms(500);
}

void SystemInit(void)
{
        PCMSK |= (1<<PCINT3);   // pin change mask: listen to portb, pin PB3
        GIMSK |= (1<<PCIE); // enable PCINT interrupt
        sei();          // enable all interrupts

}

int main(void)
{
    DDRB |= (1<<PB1);
    DDRB |= (1<<PB3);
    SystemInit();

    while (1)
    {
    }
}

Thanks guys!


texts: Which is better for resonant frequency in terms of capacitor and inductor?

texts:
Calculating a resonant frequency requires a capacitor and inductor.

I'm trying to figure out the optimal capacitor and inductor values for 49Mhz.

Is it recommended to go for a lower inductor value and higher capacitor value? or vice versa? I'm aiming for best quality.

For example, should I go for 22pF and 480nH inductor or should I go for a 12pF cap and 879nH inductor?

The inductors I will use are premade axial and the capacitors might be ceramic disc.


texts:
I'm trying to solve the following question from "Communication Circuits: Analysis and Design"
by Donald T. Hess:

For the circuit shown in Fig. \$1.P1\$, determine an expression for \$v_o(t)\$(Q1 and Q2 are identical).

My try: Q2 and Q3 form a current mirror. We can determine the current \$I_{C2}\$ which is equal to \$I_{E1}\$ since \$1\mu F\$ capacitor is an ac short circuit(So here are we assuming that ac and dc analysis are separable? But I think this is true only for linear circuits). Since Q2 and Q3 are identical,
$$\frac{0 - (-10+V_{BE})}{2} = \alpha I_E + \frac{2I_E}{\beta + 1}$$
$$\alpha = \frac{\beta}{\beta + 1}$$
Which leads to $$I_E = \frac{99\times 4.65}{100} \implies I_C = \frac{99}{100}\times  \frac{99\times 4.65}{100} \approx 4.557mA$$
At this point we should use $$i_E = I_{ES} e^{\frac{v_{BE}}{x}} \\ x = \frac{kT}{q} \approx 26mV$$
I think \$v_{BE} = -V_{dc} -v(t)\$ but according to the solution because of the capacitor there is no dc voltage. Is this really correct? If we accept my expression for \$v_{BE}(t)\$, we have $$i_E = I_{ES}e^{\frac{-V_{dc}}{x}}e^{\frac{-v(t)}{x}} = I_pe^{-10\cos\omega t} \\ I_p = I_{ES}e^{\frac{-V_{dc}}{x}}$$
Using the Fourier series we have $$e^{-10\cos \omega t} = I_0(10) + 2\sum_{n = 1}^{\infty}(-1)^n I_n(10) \cos (n\omega t)$$ Where \$I_n(x)\$ is the modified Bessel functions. The biasing circuitry demands $$I_pI_0(10) = 4.557 \times 10^{-3} \implies I_p = \frac{4.557 \times 10^{-3}}{I_0(10)} \approx 1.6 \times 10^{-6}$$ Since \$i_C = \alpha i_E\$ the output voltage should be $$v_o(t) = 10 - \alpha I_p (I_0(10)Z_L(j0\omega) + 2\sum_{n = 1}^{\infty}(-1)^n I_n(10)Z_L(jn\omega) \cos (n\omega t))$$Where \$Z_L(jn\omega)\$ is the impedance of the parallel RLC at harmonics. The impedance of the RLC circuit to dc is zero and the resonance frequency is $$\omega_0 = \frac{1}{\sqrt{LC}} = 3\times 10^7$$ Assuming \$\alpha \approx 1\$ the answer should be $$v_o(t) \approx 10 - 3.2\times 10^{-6}(-I_1(10)Z_L(j\omega)\cos(\omega t) + I_2(10)Z_L(j2\omega)\cos(2\omega t)-I_3(10)\times 10^3\cos(3\omega t))$$From the table we know that \$I_3(10) = 1758.4\$ which implies the third term is $$-5.62\cos(3\times 10^7 t)$$and we can determine other terms. One solution manual gives $$v_o(t) \approx -0.155\cos (\omega t) + 0.424\cos(2\omega t) - 5.45\cos(3\omega t)$$And Hess's book gives $$v_o(t) \approx -0.28\sin(10^7 t) + 7.3\cos(2\times 10^7 t)+0.33\sin(3\times 10^7 t)$$The first answer seems very close to my answer but there is no \$10\$ dc voltage in the final answer. The second answer differs considerably from my answer. So what's the correct answer?
Here is the summary of the problems:

Are we assuming that ac and dc analysis are separable? If yes, why is this possible? Obviously the circuit is nonlinear and superposition doesn't hold.
Is there a dc voltage across BE junction?
Is my final answer for the \$v_o(t)\$ correct?


texts: How to reliably update duty cycle to PWM on arduino due with SAM3XE

texts:
I have arduino due, which has Atmel SAM3XE MCU.

I want to generate PWM signal and I want to change duty cycle every cycle of PWM reliably so
i can generate output signal such as sine on output pin.
How can I implement this using an interrupt?
I need to add an interrupt routine, that will be run in time before
next PWM cycle starts.

I have this code so far:

// Output 50% duty cycle PWM at 10kHz on digital pins D4 and D5 using TC6
void setup()
{

  REG_PMC_PCER1 |= PMC_PCER1_PID33;                 // Enable peripheral TC6 (TC2 Channel 0)
  REG_PIOC_ABSR |= PIO_ABSR_P26 | PIO_ABSR_P25;     // Switch the multiplexer to peripheral B for TIOA6 and TIOB6
  REG_PIOC_PDR |= PIO_PDR_P26 | PIO_PDR_P25;        // Disable the GPIO on the corresponding pins

  REG_TC2_CMR0 = TC_CMR_BCPC_SET |                  // Set TIOB on counter match with RC0
                 TC_CMR_ACPC_SET |                  // Set TIOA on counter match with RC0
                 TC_CMR_BCPB_CLEAR |                // Clear TIOB on counter match with RB0
                 TC_CMR_ACPA_CLEAR |                // Clear TIOA on counter match with RA0
                 TC_CMR_WAVE |                      // Enable wave mode
                 TC_CMR_WAVSEL_UP_RC |              // Count up with automatic trigger on RC compare
                 TC_CMR_EEVT_XC0 |                  // Set event selection to XC0 to make TIOB an output
                 TC_CMR_TCCLKS_TIMER_CLOCK1;        // Set the timer clock to TCLK1 (MCK/2 = 84MHz/2 = 48MHz)

  REG_TC2_RC0 = 1400;                               // Load the RC0 register, 30 kHz PWM
  REG_TC2_RA0 = 350;                               // Load the RB0 register
  REG_TC2_RB0 = 700+350;                               // Load the RB0 register

  REG_TC2_CCR0 = TC_CCR_SWTRG | TC_CCR_CLKEN;       // Enable the timer TC6

}

void loop() {}


texts: Confusion in PID loop for the case of zero error?

texts: I am already studying PID control and some how to some extent I have understood it except one main confusion. When the difference between reference input \$r(t)\$ and current output value \$y(t)\$ is zero, \$e(t)\$ will be zero and hence \$u(t)\$ will also be zero, so how will then the plant act or work when its input \$u(t)\$ is zero?


texts:
I have 16 * 3.2v 12AH Lifepo4 cells.
I would like to use them as a 8*2 configuration, so to get 24AH 24V.
I need 24V but could do with 12AH, 24AH would be better do.
Now my question is, would it be ok to use 1 24V (8 cells) BMS and connect this BMS to the 2*8 packs in parallel, that is, charge 2 cells at the same time.
Or would it be better to use a separate BMS for each 8 cells pack but then connect the 2 packs in parallel.


texts: How to deal with low space and high current?

texts:
In my circuit I am using a stepper motor driver, providing me up to 3 A current per trace. Thus I calculated the required trace width with a trace calculator, which told me to use a trace width of 0.07'' (or 1.78mm). Unfortunately, the chip itself does not allow me to connect them directly onto the IC legs. These are only 0.012'' (or 0.3mm)  traces.

Therefore I created this routing:

Pin 1, 21, 24 and 26 are responsible for the high current. I used 0.012'' traces right after the pin connections, then switched to 0.016 and 0.024 and as soon as possible to 0.07''-traces (the big vias). Is that enough, or will the possible heat damage my board? How can I improve it (instead of soldering copper bars on it)?
Driver Datasheet


texts: Running Relay in parallel to switched neutral rocker switch

texts:
Complete beginner here, so apologize if this is obvious - but I'm trying to hook up a fog machine to a relay module for my Arduino. The Fog machine has a plug for the wall, then a second drop cord plugs into the back of the fog machine that is connected to a little unit that has a light on it, and a rocker switch that, when depressed, causes the fog machine to spit out smoke.

The rocker switch is spring loaded, so letting go flips immediately back to the off position. The setup is exactly like this thread: https://forum.sparkfun.com/viewtopic.php?t=29518 There is a black wire that comes in, which is soldered to a post for a small light, then a blue wire is soldered on the other post. A small jumper goes from the same post as this blue wire, to the outside post of the rocker switch. Then the middle post of the rocker switch is connected to the white wire. I believe this is called a 'switched neutral' Hooking up a multimeter shows a 120v difference between both the black and blue wires, and the black and white wires.

On that thread, the solution was to wire the relay 'in parallel' to the switch, but it doesn't explain the circuit past that. How do I hook up a relay module before the switch so that I can trigger it from my arduino? The relay is SPDT relay with COMM, NO and NC posts. Hope I explained that clearly!


texts:
I'm trying to understand ARM instruction encoding.

The following image shows C code along with its corresponding assembly instructions:

I looked at the ARMv7 reference manual. However, I couldn't find the relationship between the machine code and the corresponding assembly instruction.

For example,

I couldn't relate the machine code

F1AD0D08

to the assembly instruction

sub.w sp, sp, #8

Could you help me with this?

======================================================

Based on the answers and after looking at the reference manual, I added the following information.

The processor name is Cortex-M4F.

The processor architecture of the microcontroller I use is ARMv7.

Specifically, the microcontroller profile employed is ARMv7-M.

From the manual:

  ARMv7-M The microcontroller profile for systems supporting only the
  Thumb instruction set, and where overall size and deterministic
  operation for an implementation are more important than absolute
  performance.


texts: Differences between downsampling and upsampling

texts: Explain why the amplitude of the Fourier transform of a sampled signal changes when downsampling, but not when upsampling.


texts: I have looked everywhere, but I can't seem to find a way to simplify this circuit. I wish i could tell you some of my ideas, but I'm really lost here, can someone help me? If you could explain how to go about it, it would be awesome.


texts:
I'm Getting warnings while synthesing the below code. Tried many ways but in vain.
Can anyone please suggest what might have gone wrong with my code. The code is to latch the data as and when the corresponding ring counter values become one.
I've just started learning HDL coding !..

entity PLowLatch is
  Port (
    ppOut_MUX1    : in   STD_LOGIC;
    ring          : in   STD_LOGIC_VECTOR (3 downto 0);
    PlowLatch_out : out  STD_LOGIC_VECTOR (3 downto 0)
  );
end PLowLatch;

architecture Behavioral of PLowLatch is
begin

  process (ring, ppOut_MUX1) begin
    if (ring(0) = '1') then
      PlowLatch_out(0) <= ppOut_MUX1;
    elsif (ring(1) = '1') then
      PlowLatch_out(1) <= ppOut_MUX1;
    elsif (ring(2) = '1') then
      PlowLatch_out(2) <= ppOut_MUX1;
    elsif (ring(3) = '1') then
      PlowLatch_out(3) <= ppOut_MUX1;
    else
      PlowLatch_out <= "0000";
    end if;
  end process;

end Behavioral;

Below is the warning

WARNING:Xst:737 - Found 1-bit latch for signal <PlowLatch_out_0>. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
WARNING:Xst:737 - Found 1-bit latch for signal <PlowLatch_out_1>. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
WARNING:Xst:737 - Found 1-bit latch for signal <PlowLatch_out_2>. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
WARNING:Xst:737 - Found 1-bit latch for signal <PlowLatch_out_3>. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.


texts: Is it possible to combine independent digital TV antennas?

texts:
Is it possible to create a TV antenna that is composed of smaller antennas that are pointed to different broadcast centers? So in essence, many antennas for just a single digital TV.

Is it possible without any problem?
or
It is possible but with some problems?

Do antennas for digital TV still need to be tilted to the right directions?


texts: What's the difference between a 9v DC battery and a power supply?

texts:
I am using a power supply set to 9V and current limited at 0.6 amps to power a radio which includes a RF amp (using a transistor) and an audio amp. If the current limit is reached the device shuts off and beeps--it is an older power supply.

The power supply is a GoldStar Gp-105.

My circuit is:

The input for the 9V battery is labelled as an antenna terminal (it was due to PCB printing requirements at my school).

I tried switching the power supply out with a 9V battery and I get awful noise in my speaker which is a 8 ohm 1 watt speaker.

Why is the 9V battery not equivalent to the power supply? It works when I put a small 800 ohms resistor, but the sound is very low.


texts: Why won't this trace connect to the copper pour?

texts:
Why is Altium not letting the trace touch the copper pour?
They are both the same net.


texts:
I read that the propagation speed (m/s) of a lossless transmission line, which I know is equal to 1/sqrt(LC),  is also equal to 1/sqrt(L'C')  where L and C are distributed inductance and capacitance (per length values), and L' and C' are the total line inductance and capacitance (i.e. L'=L*length and C'=C*length)  (see slide 21 at http://www.montana.edu/blameres/courses/eele461/lecture_notes/eele461_module_03.pdf

Can someone explain how this is?   If L' = L * length and C' = C * length, it seems like 1/sqrt(L'C') would be different than 1/sqrt(LC) by a factor of sqrt(length^2) (i.e. not equal).

The answer to this will help me understand how just two parameters (characteristic impedance and time delay) are sufficient to model a lossless transmission line.

Thank you.


texts: What are the difference between PIC24FJ256GB110 Rev 00004 & Rev 00003

texts: I have a hex file to program a PIC24FJ256GB110 which I do with an ICD3 the revision code it returns from an older board is 00003 from the newer board 00004.  This implies the silicon has changed. The code works in the 00003 board but not the 00004 board, as I am now fault finding the boards could this be a reason?


texts: Frequency response - all zeros smaller than all poles?

texts:
For the following circuit the middle band gain is:

\$A_v=-g_mR_D\cdot R_{in}/(R_{in}+R_{sig})\$, where
\$R_{in}=47\cdot 10/57=8.25M\Omega\$ and \$R_D=4.7 || 10k\$

The total resistance which the capacitor 0.1uF "sees" is \$10k+4.7k=14.7k\$

The total resistance which the capacitor 10uF "sees" is \$R_S || 1/g_m\$

The total resistance which the capacitor 0.01uF "sees" is \$100k+8.25M=8.35M\$

Hence,

\$f_{p3}=1/(2\pi\cdot 14.7k\cdot 0.1\mu F)\$

\$f_{p2}=1/(2\pi\cdot R_S || 1/g_m\cdot 10\mu F)\$

\$f_{p1}=1/(2\pi\cdot 8.35M\cdot 0.01\mu F)\$

\$f_{L}=f_{p1}+f_{p2}+f_{p3}\$

I then found \$A(s)=-((8.25M+1/sC_1)/(8.35M+1/sC_1)) \cdot g_m((10k+1/sC_3)||4.7k)/(1+g_m(2k||1/sC2))\$

This yielded for the zeros:

\$f_{z1}=1/(2 \pi \cdot 8.25M \cdot C_1)\$

\$f_{z2}=1/(2 \pi \cdot 2k \cdot C_2)\$

\$f_{z3}=1/(2 \pi \cdot 10k \cdot C_3)\$

Hence, \$f_{p3}<f_{z3}, f_{p1}<f_{z1}\$ whereas I was asked to prove that in this circuit for each capacitor \$f_{zi}<f_{pi}\$.

What was I doing wrong? Could anyone please help settling this discrepancy?


texts: Relay protection with MOV and RC Snubber

texts:
I am going to build a protection circuit for a 240 volt pump motor.  It is believed that when the relay cuts out the motor generates voltage back into the relay and burns out the contacts.

It has been suggested (on this forum) that a MOV and RC Snubber will save the day and relays.

Would someone help me with this?  It is most appreciated.

Please see the original question.

P.S. This is a great forum.  I am a materials engineer - but have learned so much from this forum that I missed in engineering school.


texts:
I just started with small projects with capacitors, like astable multivibrator and I do not understand where the capacitor discharges. The theory always show the capacitor charged by the battery, then the battery is taken away and the capacitor is discharged in a circuit with only a bulb or a resistor.

But in circuits like astable multivibrator, what happens during discharging, where does the current created by the capacitor during discharging go? Back Into the battery?


texts: Does this circuit problem have a solution without an Op-Amp?

texts:
I was going through the definition of a voltage follower in this site
http://www.learningaboutelectronics.com/Articles/Voltage-follower

And a basic problem was presented, and an op-amp voltage follower as the solution.

Can this problem be solved without an op-amp ?


texts: Bode diagram calculating for random frequency

texts:
The max Gain of an opamp is 100dB (=100000). I have a cutting frequency at 10 Hz and then the slope of my bode diagram decrease by  -20dB/dec . I have unity gain at 1MHz.

For 100 Hz its increasing by 1 decade so the Gain is (100dB-20dB)= 80dB=10000.
But if i want to calculate for a random value like 20kHz how should i calculate the gain?


texts: How to create a pointer to code memory in microchip C30

texts:
i'm having a bit of a problem with this code. The code is intended to create an LCD MAP, with LCD routines to interface a 7 segment based LCD with the PIC24FJ128GA310 MCU with internal LCD driver.

the arrays DIGIT1 to DIGIT6 contain the LCD mapping for each 7segment DIGIT on the LCD, and they are all saved in code memory.

the array DIGITS[] is meant to contain the address of all the segment arrays so that a numerical index can be used with DIGIT[] to access each digit on the LCD for display.

enum COMS{COM0=0,COM1=0x40,COM2=0x80,COM3=0xC0};
enum SEGS
{//COM 0
    SEG_1A      = COM0 |0 , SEG_1B = COM0 |53, SEG_2A = COM0 |33, SEG_K1 = COM0 |44,
    SEG_K2      = COM0 |22, SEG_K8 = COM0 |21, SEG_4A = COM0 |62, SEG_4B = COM0 |61,
    SEG_5A      = COM0 |60, SEG_5B = COM0 |59, SEG_6A = COM0 |58, SEG_6B = COM0 |50,
    SEG_7A      = COM0 |61, SEG_7B = COM0 |48 ,SEG_8A = COM0 |59, SEG_8B = COM0 |26,
    SEG_9A      = COM0 |25, SEG_9B = COM0 |24, SEG_10A= COM0 |23, SEG_10B= COM0 |45,
    SEG_2B      = COM0 |52, SEG_3A = COM0 |32, SEG_3B = COM0 |51, SEG_S3 = COM0 |24,
//... LCD MAPS for COM1 - COM3 are ommited here for space
};

const BYTE DIGIT1[] = {SEG_1A,SEG_1B,SEG_1C,SEG_1D,SEG_1E,SEG_1F,SEG_1G};
const BYTE DIGIT2[] = {SEG_2A,SEG_2B,SEG_2C,SEG_2D,SEG_2E,SEG_2F,SEG_2G};
const BYTE DIGIT3[] = {SEG_3A,SEG_3B,SEG_3C,SEG_3D,SEG_3E,SEG_3F,SEG_3G};
const BYTE DIGIT4[] = {SEG_4A,SEG_4B,SEG_4C,SEG_4D,SEG_4E,SEG_4F,SEG_4G};
const BYTE DIGIT5[] = {SEG_5A,SEG_5B,SEG_5C,SEG_5D,SEG_5E,SEG_5F,SEG_5G};
const BYTE DIGIT6[] = {SEG_6A,SEG_6B,SEG_6C,SEG_6D,SEG_6E,SEG_6F,SEG_6G};
//...
const BYTE * Digits[] = {DIGIT1,DIGIT2,DIGI3,DIGIT4,DIGIT5,DIGIT6};

enum DIGITS {DIG1,DIG2,DIG3,DIG4,DIG5,DIG6,DIG7,DIG8,DIG9,DIG10};

enum MASK {
        ZERO = 0x3F, ONE = 0x06, TWO   = 0x5B, THREE = 0x4F, FOUR = 0x66,
        FIVE = 0x6D, SIX = 0x7C, SEVEN = 0x07, EIGHT = 0x7F, NINE = 0x67,
        BLANK= 0x00, MINUS = 0x40, OVERFLOW = 0x49,};

void DisplayDigit2(BYTE idx,BYTE Mask)
{
    const BYTE * digit;
    digit = Digits[idx];
    //BYTE vals;
    //vals = *digit;
    for(i=0; i<8;i++){
        DisplaySeg(digit,(Mask&1));
        digit++;//incrememt pointer
        Mask >>=1;
    }
}

The function DisplayDigit2() is called like this:

DisplayDigit2(DIG1,ONE);//Display 1 on the first digit of the LCD

The code compiles without problems, but when i try to step through the code, it compiler stopped on the first line

digit = Digits[idx];

with the message "User program stopped"

I then observe that in the watch window that the address of DIGIT1 in code memory is 0x48A, while that of DIGIT2 is 0x491.

But on checking their address in the array DIGITS, i see the values 0X848A, and 0x8491 for DIGIT1 and DIGIT2 respectively.

I'm not sure where exactly i got it wrong.


texts: Design (Block diagram/topology) of high-current (I>100 A) power supply

texts:
I recently watched this video about the design of a high voltage (300 V) commercial power supply. I reckon that the block diagram is essentially a bridge rectifier followed by a DC/DC convertor like the following image shows.

Given the high voltage involved, it is implemented with a Phase-Shifted Resonant Convertor that uses soft-switching to reduce switching loss.

I was wondering, how are high current commercial power supplies designed, let’s say DC current above 100 A such as these and these one.

In theory, a bridge rectifier followed by a buck convertor would do the job, but I imagine it would be terribly inefficient (the same reason that the high-voltage supply isn’t implemented using a boost convertor).

Does someone know topologies are used in commercially available high current power supplies?

Many thanks in advance


texts: ATTiny project resets when plugging in phone

texts:
Project

I'm not very experienced with electronics and microcontroller-programming yet. I recently (accidentally) bought a couple of ATTiny13A microcontrollers, assuming I could program them using the Arduino IDE.

Because of the small amount of memory on these things, I decided to make a simple project: a reading light that automatically switches off. And I decided to use AVR Studio (6.0) instead of the Arduino IDE.

The circuit is quite simple I think. Two buttons to add half an hour of light, and another one to switch off the lights immediately. Everything is powered by a USB wall wart, supplying around 5V (5.2, I measured).

I simplified the led. In fact there are 2 leds (I planned on 3 at first) and the appropriate resistors, which is also why I added the resistor. I also left out the connections to the AVR programmer, since they are not relevant to the circuit itself.

simulate this circuit – Schematic created using CircuitLab

The light works as it is supposed to. It burns for 3 seconds when I plug it in. I can turn it on and off. And when I turn it on, it burns for about half an hour before switching off by itself. If I know beforehand that I want to have more than half an hour of light, I can press the button multiple times, to get N times half an hour.

So far so good.

Problem: undesired resets

Now the problem is, it seems to be quite sensitive to peaks or drops. I got a wall wart with two connections. When the night light is plugged in in one of them, and I plug my phone into the other, the night light resets, burning for three seconds and then switching off. This also happens most of the time when I unplug the phone. It doesn't matter whether the light was switched on or off when I do.

So my main question is, how do I solve these resets? I'm open to other advice as well.

I'll paste the program here for reference as well. I think it's not relevant, but I tried to use interrupts and have the controller in sleep mode most of the time, so I'll post it anyway, just in case it contains vital information.

/*
 * NachtLampje.c
 *
 * Created: 22-10-2014 19:46:50
 *  Author: GolezTrol
 */

#define F_CPU 1200000UL // Sets up the default speed for delay.h

#include <avr/interrupt.h>
#include <avr/sleep.h>
#include <avr/wdt.h>

volatile int seconds = 3;
int secondsInc = 1800;

void setupLed() {
    DDRB = 1<<DDB0;
}

void updateLed() {
    // Blink for a moment when we're at 15 seconds, so user might prolong.
    if (seconds > 0 && seconds != 15)
        PORTB |= 1<<PB0;
    else
        PORTB &= ~(1<<PB0);
}

void setTimer(int state) {
    if (state) {
        WDTCR |= (1<<WDP2) | (1<<WDP1); // 1sec
        WDTCR |= (1<<WDTIE); // Enable watchdog timer interrupts
    }
    else {
        WDTCR &= ~(1<<WDTIE); // Disable watchdog timer interrupts
    }
}

ISR(WDT_vect) {
    // Timer interrupt
    if (seconds == 0)
      return;

    if (--seconds == 0) {
        setTimer(0);
    }
    updateLed();
}

ISR(PCINT0_vect){
    // Button interrupt

    // Button 1 = PB3 = Add half an hour of light.
    if (~PINB & 0x08) {
        seconds += secondsInc;
    }

    // Button 2 = PB 4 = Turn off the lights
    if (~PINB & 0x10) {
        seconds = 0;
    }

    // Enable timer, if necessary
    setTimer(seconds > 0);

    // Update the led.
    updateLed();
}

int main(void) {
    setupLed();

    updateLed();

    setTimer(seconds > 0);

    GIMSK = 0b00100000;    // turns on pin change interrupts
    PCMSK = 0b00011000;    // turn on interrupts on pins PB3 and PB4

    sei(); // Enable global interrupts

    // Use the Power Down sleep mode
    set_sleep_mode(SLEEP_MODE_PWR_DOWN);

    for (;;) {
        sleep_mode();   // go to sleep and wait for interrupt...
    }
}


texts: Microcontroller power directly from SMPS DC-DC (SPR01 series) - is it OK?

texts:
Is it OK to supply power durectly from 5V SMPS DC-DC converter? Of course I will put several capacitors:

at the DC-DC output (I'd put 1uF or something),
at the controller power input(s) (I'd put 100nF or something at each input).

The schematic has no analog circuits. Only RS-485 interface (based on ADM2587) and several digital inputs and outputs.

How likely that I will face with some problems due to low power quality?


texts: Do solenoids exhibit back EMF like motors?

texts:
I just purchased some pinball machine solenoids and was experimenting with them; DC resistance is about 30 ohm, they actuate at about 30 volts, and they hold at about 6.  I tried controlling them with 10A relays and found that the a relay sometimes latched arced even though I have flyback diodes, so I looked at the solenoid voltage with a scope.  One side of the solenoid is connected to the positive supply via relay and a PTC fuse; the other side is grounded.  The scope is directly across the solenoid.

It appears that the when the solenoid is active the voltage flies up to over +200 volts.  Not the reverse voltage that would appear when releasing a solenoid with no flyback diode--forward voltage.  I would guess that the coil is effectively magnetizing the slug, and that when the slug then moves into the coil it generates back EMF; because the coil is crossing more lines of force at it gets closer to the slug, the back EMF is not limited to the driving voltage as it would be with a conventional motor.  Would such back EMF imply that the solenoid current would be dropping to zero during the stroke?  Is such behavior typical for solenoids?

If such behavior is typical for solenoids, it would seem that all of the "useful" energy, except what might be needed to hold the solenoid (if desired), would be imparted before the current dropped to zero, and one could reduce energy consumption enormously by watching current usage.  I would guess that if mechanical factors prevent the slug from moving quickly, the current might not drop all the way to zero, but watching for the derivative of current to go positive-negative-positive should still provide an identifiable "optimal turn-off" point.  Are there any solenoid-driver circuits that exploit this?  Certainly end-of-travel contacts could help provide such behavior, but those add mechanical complexity.  Are all-electronic solutions practical?


texts:
I know that capacitors in parallel are used for filtering, but what could possibly a resistor in parallel be used for?

Take for example the schematics I pinned to this post http://i.stack.imgur.com/Y1Ttr.jpg and the resistor I circled in black what could possibly be its use??

I hope I've been clear enough, Thanks.


texts: A crystal's effective series resistance effect on circuit operation

texts: I am trying to replace our current through hole crystals with a surface mount version. I have found a SM equivalent however the only difference is the max ESR rating on the through hole is 25 ohm whereas the SM is 40 ohms. Will this have a sluggish effect on the circuit? Or can the SM version be implemented?


texts: How can I power and dim two sets of LED lights where one requires12VAC and one 12VDC

texts:
I am building a wall unit and I would like to use some LED Tape Light (12VDC, 48ft Total 1.45W/Foot) to light the shelves. Then I'd like to use a 12VAC adjustable LED spot light (5W) for the center area. I'd like to have all lights able to be dimmed by using either an ELV or standard in-wall dimmer.

I think I can basically use the 12VAC electronic transformer and then use a full wave bridge rectifier (and maybe some caps?) to turn the 12VAC into 12VDC for the LED Tape lights. Is this correct? The 12VAC will be output at 20kHZ. Will frequency play any issue here? I can use a standard magnetic transformer as well if that makes things easier.

Any suggested schematics or part numbers would be helpful. The total DC load will be ~75W with AC load will be ~5W.

EDIT:

Here is the transformer I'm considering using.

WAC Lighting: EN-12100-RB-AR
http://www.waclighting.com/data/TOOLS_SPEC/en-1260-rb-ar.pdf


texts: Why two 2nd order filters have different roll off?

texts:
I have designed these two butterworth filter for 1.5k cutoff frequency. what it surprising me that roll off of first design is more than roll off of second design. According to me both are 2nd order hence it should be 40dB/dec for both.
Kindly explain or give some hint that where should i look at.


texts: Can this ultrasonic emitter be DC driven?

texts:
The datasheet of this ultrasonic specifies that the maximum driving voltage is 10 Vrms, which suggests that it should be driven by an AC.

Is my assumption correct? Can the emitter be DC driven?


texts: Difference between a n bit Latch and a buffer

texts:
What is the difference between a 8 bit buffer and a 8 bit latch?

Are they both used for the same purpose?

The 74LS273, is a buffer or a latch?


texts: ESP8266 and ATmega328 UART communication, gets() function

texts:
I'm trying to get an ATmega328 and an ESP8266 to talk to each other over UART.

In the attached minimal example, I have an LED on pin 16 (B2) that should start on and do a slow blink to show data was sent / received.  However, it seems to hang on the gets() call, as the LED never comes back on.

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

#define F_CPU 16000000
#define BAUD 115200

void init_uart() {
    // UART setup
    uint16_t ubbr_value = F_CPU / (16UL*BAUD) - 1;
    UBRR0H = (uint8_t) (ubbr_value >> 8);
    UBRR0L = (uint8_t) ubbr_value;
    UCSR0B = (1 << RXEN0)  | (1 << TXEN0);
    UCSR0C = (1 << UCSZ01) | (1 << UCSZ00);
    // Status LED on pin 16.
    DDRB |= (1<<DDB2);
}

void transmit(char c) {
    // Wait for the flag to say we're good to write to the data register.
    while(!(UCSR0A & (1 << UDRE0)));
    UDR0 = c;
}

char receive() {
    // Wait for the Rx flag to say we've received a message.
    while(!(UCSR0A & (1 << RXC0)));
    return UDR0;
}

FILE uart_output = FDEV_SETUP_STREAM(transmit, NULL, _FDEV_SETUP_WRITE);
FILE uart_input = FDEV_SETUP_STREAM(NULL, receive, _FDEV_SETUP_READ);

int main(void) {
    init_uart();
    stdout = &uart_output;
    stdin  = &uart_input;

    PORTB=0xff;         // Comms LED on
    _delay_ms(1000);    // Makes sure LED on/off isn't too fast to see.

    puts("AT");         // Send AT command to ESP8266
    PORTB=0x00;         // After command sent, turn LED off to show where we get stuck
    _delay_ms(1000);

    char input[64];
    gets(input);        // Get a response from the ESP8266

    PORTB=0xff;         // Turn LED back on if successful (Never reaches here)
}

Using the same circuit/code, the LED comes back on if I use an FT232 to send a string from the terminal to the ATmega.  I can also get the OK response from the ESP8266 if I send an AT command to it.

I'm probably doing something incalculably stupid, but it looks as though I'm not able to use the gets() function to receive from the ESP8266.

I originally assumed it must be something to do with the line endings, but from what I gather puts() sends the carriage return / line feed required by the ESP8266 anyway.


texts: What do the two series-connected, forward biased diodes do?

texts:
This is an example circuit providing a constant current for a laser diode:

What does the two diodes in the circuit do?


texts: "Conflict power between pins" with a voltage regulator

texts:
I've built a simple adjustable voltage regulator, but running the ERC shows two errors:

The first one claims that PIN1 is not being driven (it's connected to GND through a resistor; the label is connected to a power pin, connecting the label directly without a resistor fixes the error). I can "fix" the warning with a PWR_FLAG.

The other problem is that the LM1117 family parts have a hidden 4 pin hidden below the 2 pin, both marked as "Power output", and this makes the ERC show an error of "ErrType(5): Conflict problem between pins. Severity: error. Pin 4 of U2 is connected to pin 2 of U2".

Is it possible to fix this error?


texts: What is the nuance between these electrical parameters in this load cell datasheet?

texts:
A load cell has the following specs:

I've highlighted the relevant part in yellow. There are two parameters called Uref and Bu. Both of them is about the excitation voltage for the Wheatstone bridge inside the load cell. But I couldn't conclude which voltage I can or should use as the excitation voltage. Can someone describe these parameters more explicitly?


texts: If you use headphones with a TRS connector, you might also have noticed that if you plug it into your music player and pull it out halfway, the music sounds strange. It seems as if there are some frequencies missing. Why is that?


texts: Calculate Base Voltage In Collector feedback bias Configuration

texts: Given the above configuration and Vcc = 5V, Ie = 0.5mA, β = 100 and Vc = 1.7 how can i calculate the values of the two resistors? By approximating Ie = Ic, I have calculated Rc = 6.53 KΩ but I don't know how to calculate the base voltage to find Rb. Thanks in advance for any help!


texts:
I'm working on a project to create an infinity mirror based on an Instructables tutorial. Instead of the larger analogue LED strip that the author uses, I opted for a shorter addressable LED strip that runs on 5V.

I thought I would be able to run it off the 5V port on the Arduino, but that seems not to be the case. I understand that the strip can draw up to 3.3A and the Arduino can only supply ~0.5A, but I thought it would work fine if I only turned a few lights on (each one draws ~0.05A). However many lights I program the Arduino to turn on, I always see ~10 random lights with a bias towards red.

The fact that the lights are usually red and there are ~10 of them working at any one is evidence that it is a power issue (because red is lower power and 10×0.05A = 0.5A).

Does anyone have any ideas how I can either

turn on only a chosen subset of lights at one time, or
supply the appropriate power to the LEDs (preferably from a battery) ?

Here's the code I'm using below, on the chance I made some stupid mistake:

/* LedStripGradient: Example Arduino sketch that shows
 * how to control an Addressable RGB LED Strip from Pololu.
 *
 * To use this, you will need to plug an Addressable RGB LED strip from Pololu
 * into pin 12.  After uploading the sketch, you should see a pattern on the LED
 * strip that fades from green to pink and also moves along the strip. */

#include <PololuLedStrip.h>

// Create an ledStrip object and specify the pin it will use.
PololuLedStrip<12> ledStrip;

// Create a buffer for holding the colors (4 bytes per color).
#define LED_COUNT 72
rgb_color colors[LED_COUNT];

void setup() {
}

void loop() {
  // Update the colors.
  byte time = millis() >> 2;
  for(uint16_t i = 0; i < LED_COUNT; i++)
  {
    byte x = time - 8*i;
    // colors[i] = (rgb_color){ x, 255 - x, x };
    colors[i] = (rgb_color){ 0, 0, 0 };
  }
  colors[0] = (rgb_color){ 0, 0, 255 };
  colors[1] = (rgb_color){ 0, 255, 0 };
  colors[2] = (rgb_color){ 255, 0, 0 };

  // Write the colors to the LED strip.
  ledStrip.write(colors, LED_COUNT);

  delay(100);
}

Thanks!


texts: I have a circuit where i have 4 binary numbers, they are all stored in D FlipFlops. I want to be able to pull out one of those numbers based on an "index" number. The index number would be a 2 bit binary number that would be created by pushing 2 buttons. So lets say my numbers are A, B, C and D. When the index number is 00(0) i would like to have A as an output, when the index number is 01(1) i would like B to be the output, when the index number is 10(2) i would like C to be the output and when 11(3) is the number i would like D to be the output. So my question is: do i use a multiplexer or a demultiplexer to do this? Can you recommend me a chip out of the 74LS series that would be able to do this? All relevant answers are welcome.


texts: Why cap across shunt resistor, input bypass caps and small resistors on current sensing inputs?

texts:
I want to build a sensitive current sensing circuit using shunt, and since I also repair MacBooks occasionally, I have some contact with the schematics of real working expensive devices (although whoever follows Louis Rossmann, knows there are issues there too sometimes, but it's not the point here).
While browsing through the schematics of a macbook, I've noticed an interesting thing: most current sensing circuits are simply shunt resistors with each of their sides connected to current sense amplifier such as INA210. All cool and easy, no magic outside Hogwarts detected.
But when it comes to PPBUS (main power line) and charging power line, there is a 0.02R SHUNT, and sides of the shunt go through 10R RESISTOR each, then there is a CAPACITOR between the inputs of 0.047uF and a 0.1uF CAP on each input line to the ground. And only then the lines go into an IC. Why so much mess, while on other lines it's simply shunt straight to amp. Should I have something similar?
Here's a screenshot of that part of the circuit:

There is some info here about the small resistors, but it doesn't exactly compare what happens with resistors and without, like with: this happens. Without: this happens.
I still didn't understand how some 10 Ohm resistor is supposed to make things better if input impedance is like a megaohm or greater.
Besides, there is also a capacitor question (why cap across? why bypass caps there? what value? what for? should I do it too?)


texts: Switch between power and signal with MCU

texts:
I am trying to make a basic EPROM programmer using an Arduino. It is designed to programme M27c322/160/800 devices.

One problem I am encountering is that these 3 devices have a couple of the pins different. For example, the A20 pin on the 322 is actually the BYTE pin on the 160/800. This means that my Arduino will need to be able to switch this pin between a digital address signal line and a power line that supplies 12V at something like 100mA, depending on which chip is being programmed.

What is the best way to do this?

EDIT 3 - OK so I've had a go at this based on the answers I've already had, does this work as intended?

So basically with the APPLY_A20 line low, the mux just shows a floating pin to the rest of the circuit, allowing me to assert APPLY_12V or APPLY_5V to get power, then if I need to use the A20 address then I pull the APPLY_12V and APPLY_5V lines low and assert APPLY_A20 high.


texts:
I currently have a project installed in an outdoor location.  It currently uses a 16x2 blue OLED display for simple messages to the user.

Over the past 4 years I have had to replace the display twice as it fades to the point of becoming unreadable.  The display mostly only receives indirect sunlight, except for a few hours as the sun sets in the evening.  However, it needs to be readable in bright daylight.

The display is mounted to an enclosure, behind a plexiglass screen.  The interior of the enclosure is kept above 0ºC.  The outdoor ambient temperature can range between -40ºC and +40ºC.

The reason I picked an OLED screen vs. a typical LCD was my worry that the cold temperatures contacting the face of the display would make it unusable.

Question

What type of display would be best suited for my project?  Stick with the OLED, switch to a bright LCD, or something else?


texts:
I have salvaged this TrackPoint from a lenovo laptop keyboard. Unfortunately I don't know the exact model, but I don't think it's older than say 6 years. I would like to connect this to my PC via an Arduino, mbed, teensy or direct PS/2 and use it as a mouse.

Here's my question: What's the pinout of this device, or how can I find out what it is (without harming the device)?

I've found numerous pinouts online, but none of the pictures/descriptions that have pinouts appear to match the PDB layout of my TrackPoint, because they typically have the VCC and GND rails close together, whereas mine appear to be on pins 1 & 5, since those lines are the thickest in the flexible connector. Furthermore, my TrackPoint has 8 pins, many of the ones found around the web have 10. I don't have the keyboard or laptop anymore, so I can't exactly use a multimeter to measure voltages in a working system.

Here are some pictures, I'll add links to the sources I've found so far below.

Markings:

PCB front:

LVC9
142399H
Rev. A

PCB back:

1046
CPCP GG
94V-O
C 9U

The bigger chip (32 pins):

PTPM754DR
CT2926 10
D104IC
0 B

What I've found so far..

This question on this site: VCC & GND are on adjacent pins
TrackPoint @ deskthority - has some good links to firmwares and datasheets for the controller
Pinout for 10 pin TrackPoint
This question on geekhack.org seems to be about a similar (maybe even the same) TrackPoint, but the owner at some point gave up and went back to a TrackPoint powered by a 28-pin controller.
This keyboard hack seems to use a TrackPoint which looks exactly the same, but I think he's using the keyboard controller to interface with the TrackPoint.
More trackpoint pinouts
USB trackpoint library on GitHub (10 pin trackpoint)

Any ideas?


texts: How to sample a non-periodic signal using an Arduino Due?

texts:
Input: fig(1)

/* graph plot
input signal freq :3KHZ
*/
Here is my code :
#define SAMPLES 1024
#define SAMPLING_FREQUENCY 20000 //HZ

unsigned int sampling_period_us;
unsigned long microseconds;

double rawData[SAMPLES];
//bool INTR_FLAG=0;

void setup(){

  Serial.begin(9600);
  pinMode(A0 , INPUT);
  pinMode(DAC0 , OUTPUT);
  analogReadResolution(12);
  analogWriteResolution(12);

}

void loop(){
  //ok
 /*int a=analogRead(A0);
  Serial.println(a);
  analogWrite(DAC0,a);
  delay(100); */

       sampling_period_us = round(1000000 *(1.0/SAMPLING_FREQUENCY));

  for(int i=0 ; i<SAMPLES ;i++){

      microseconds =micros();

      rawData[i]=analogRead(A0);
      Serial.println(rawData[i]);

      while(micros() < (microseconds + sampling_period_us)){

      }
  }

for(int i=0 ; i<SAMPLES ;i++){

  analogWrite(DAC0,rawData[i]);
  //Serial.println(rawData[i]);

}

}

output on arduino serial port : fig2

DAC0 waveform on CRO


texts: Can't seem to properly generate a delay via timer

texts:
So I am trying to create a delay using a timer but doesn't seem like it's working as expected.
With a clock of 16MHz and a prescaler of 1, it should take 10us to reach a count of 160 (unless I did something wrong).
static void MX_TIM2_Init(void)
{
    __HAL_RCC_TIM2_CLK_ENABLE();

  TIM_ClockConfigTypeDef sClockSourceConfig = {0};
  TIM_MasterConfigTypeDef sMasterConfig = {0};

  /* USER CODE END TIM2_Init 1 */
  htim2.Instance = TIM2;
  htim2.Init.Prescaler = 1;
  htim2.Init.CounterMode = TIM_COUNTERMODE_UP;
  htim2.Init.Period =  160;
  htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
  htim2.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
  if (HAL_TIM_Base_Init(&htim2) != HAL_OK)
  {
    Error_Handler();
  }
  sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL;
  if (HAL_TIM_ConfigClockSource(&htim2, &sClockSourceConfig) != HAL_OK)
  {
    Error_Handler();
  }
  sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
  sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
  if (HAL_TIMEx_MasterConfigSynchronization(&htim2, &sMasterConfig) != HAL_OK)
  {
    Error_Handler();
  }
}
void Delay() {
    while (1) {
        if(__HAL_TIM_GET_FLAG(&htim2, TIM_FLAG_UPDATE))
        {
            GPIOC->ODR ^= GPIO_PIN_10;
        }

    }
}

Capture:


texts: 1:1 isolation transformer fuse on secondary side - an option?

texts:
We sometimes use an old self build 1:1 isolation transformer (150VA) in our company to isolate devices under test.
It is equipped with a primary 500mA fuse (slow) in series with a on/off switch. However, due to inrush currents when the transformer is first energized, the fuse tends to blow from time to time. I am aware that the inrush current can already be pretty large for a transformer of that size.

I would also like to use an even smaller fuse, since 500mA is still pretty much from a shock perspective and most DUTs require far less current.

Would it be an option to just move the fuse to the secondary side of the transformer or would you advise against it for safety reasons? If a secondary fuse is fine, would you advise leaving the switch on the primary side?


texts: Custom LCD display design considerations

texts: I'm in the early stages of designing a device that will have a custom, backlit LCD display and an injection molded case.  I've never worked with a custom LCD display, and have not yet spoken with any manufacturers. The only known dimensions are the height and width of the glass. Are there standard dimensions that one should add to the glass dimensions?  If there are not, can I specify my required dimensions, or does the mfr. generally dictate the final module dimensions?  I'm considering COG and FPC.


texts: Process time-independent data in Simulink for VHDL synthesis

texts:
I am new to the topic but want to implement some simple algorithms processing metric data in simulink and later generate some vhdl from it.
I am using the Matlab/Simulink environment with the Intel DSP-Builder library.
The data I want to process is time-independent. But what I understand from the documentation and tutorials, the simulink solver is always time dependent. Either variable or fixed-step.
Is there any better solution than putting additional time values in the source-matrix and change the step size to this resolution? because if not, simulink always interpolates values I do not want/need.
What is your best practice for this use case?


texts: Automobile Project (Electrical Parts Requirement)

texts:
I'm looking at putting together a circuit board to be used in an automobile. It will only be connected to a 12 V and ground. Everything else will be internal to my board.

I was planning on putting a 12 V regulator up front to make sure I could rely on clean power for my design and found a few that seem to be rated for cars. While looking for regulators I stumbled on automotive grade regulators.

Here is one from Digikey:  12 V - 497-10192-1-ND  (LD1086DTTRY, IC REG LDO ADJ 1.5A DPAK, -40°C ~ 125°C)

I know that they're designed to protect the downstream circuit from possible voltage dumps (or surges) from all the electrical noise found in a car.

Anyway this brought up a whole set of questions, but the main one was this: As long as any external connections between the electrical system and my board are bridged with automotive grade components (and I stay out of extreme climate areas found in/around cars) can I just use regular off the shelf components?

Or do I need to find automotive grade for everything?

For example, if I'm trying to use this circuit:

Can I just use an automotive grade for the upstream regulator (IC1) and an regular grade part for the downstream 5 V regulator (IC2)?

I'll try to add some details for clarity. I want to run a small 12 V device and was planning on running a current divider to the microchip so I don't run the device if I ever have less than 12 V.

The rough current requirements are as follows:
 - 12 V @ .833 A
 - 5 V  @ .05 A
 - 3.3 V @ .15-.20 A

I was debating getting an automotive grade LDO and then using regular LDO's after that on the back end for the other devices.

This is a one off project currently but if it works I think I could build up a few and sell them down the road. So I'd rather do it correctly the first time and hopefully get a good design.


texts: Leakage current of ESD protection diode vs regular zener diode

texts:
I am using a voltage divider to measure input voltage, a zener diode was added to protect opamp in case of voltage spike.

simulate this circuit – Schematic created using CircuitLab

I was told that the leakage current of zener will reduce measurement accuracy and advised to use ESD diode below:

simulate this circuit

How is the design better? Doesn't ESD diode also have the leakage current?


texts: MOSFET goes into saturation mode much later

texts:
I am using IRLML6346 NMOS in LTSpice. Its threshold voltage is Vt = 0.95V. I plotted the graph of Vds(voltage between drain and source) vs Ids(Current from drain to source) for different values of Vgs(Voltage between gate and source)

I have written the gate voltage Vgs on the right below each plot and the approximate Vds value after which the NMOS goes into saturation mode.

For Vgs = 4.5, the saturation should start as soon as Vds >= Vgs - Vt. So it should go into saturation mode at 4.5 - 0.95 = 3.44. But in the plot, it goes into saturation at 5.4 volts.
Similarly, for Vgs = 4, the saturation should start at 4 - 0.95 = 3.05, but it starts at Vds = 4V.

This same case happens for all the Vgs values. The saturation occurs much later. Why is this so?

This is the circuit I have made.

Why does the MOSFET does not go into saturation mode as soon as Vds >= Vgs - Vt?


texts:
I have 4 batteries of 150AH each. Earlier these were connected as series to 48v solar inverter of 3000 Watts, now as that old inverter is dead and I need to replace it with new one. I want to know which inverter is better

24v Inverter with 4 batteries in parallel of 2
or
48v Inverter with 4 battereies in series

What are the benefits in term of charging time, backup etc

Note: 48v is costly as compare to 24v


texts: Can I use a single crystal oscillator for multiple ICs?

texts:
Possible Duplicate:
What's the schematic to share one crystal with two micros?

Background
I am building an Arduino project that basically consists of five Bareduinos.
Question
Can I share a single 16Mhz crystal with multiple ICs (ATMega328), or does each IC have to have its own crystal?
If each does need its own crystal, will I have any execution latency among the various ICs?  For example, if I send a signal from one IC to four other ICs, telling them to each to start blinking their own LED, would the LED blinking be synchronized or slightly out-of-sync?


texts:
Say I wanted to learn AVR ASM, and I had an arduino.

Now i know you can program assembly on the arduino, but is there a way to do it through USB. I assume i'd just write normal assembly and do it through avr-dude, but am I missing anything or do I need a serial programmer to do this successfully?

am I missing anything? or should this be as easy as i said above?

I believe i've heard around using "inline" assembly....but how different would this be from actually writing ASM directly to the AVR?


texts: How to terminate binary counting using a logic gate

texts: So I am designing a 3-bit asynchronous binary counter which counts up to 11 then repeats using D flip-flops. That much I have done, however I am stuck when it comes to decoding the outputs to stop the counting sequence. I am only supposed to use one logic gate, though. I was thinking of how I could do this using an actual decoder, but I am completely lost when it comes to using just one gate. Any tips to get going? I want to actually figure this out.


texts: Feasibility of custom parabolic mic (amplified, bandpass filtered) for use with mobile phone app

texts:
I am not an electrical engineer, but I am up for a challenge and this is my first venture into electrical engineering.  However I am beginning to think this may be a step to far!

As a hobby I survey insects, at the moment particularly those that 'sing' in the 6kHz to 20kHz range. Some of that range I could never hear and the rest I have mostly lost with age!

Last year I built a simple parabolic mic (an old car headlight reflector) with an Electret microphone mounted at the focal point, wired to a 3.5mm jack into my phone (Android). There I have an app, which visually displays the input from the microphone, allowing me to see the frequencies in which I am interested but can no longer hear.  This didn't give me the detection range that I needed (it only gave up to about 5 metres and I'd like 10 times that or better).

So I started researching off-the-shelf kits to pre-amplify the signal and found some available online, but I need something more specific. Ideally I am only interested in amplifying a small band of frequencies from 6kHz to 20kHz. So then I started looking at active bandpass filters and have found some education material that shows calculations for the bandpass components, but I am getting a bit lost as to which amplifier to use.

Am I jumping in too deep for a complete novice?  I hope that it is feasible to design/build a simple circuit powered by the Android 3.5mm jack, which will filter the frequency range in which I am interested, and amplify it to a level that doesn't damage the phone (but does increase my detection range)?

I'm assuming that the key input to the design would be the voltage from the phone jack, but what other attributes would I use to filter the choice of opamp? How do I ensure that the gain through the circuit isn't going to harm the phone?

Another input is that I'd like the resonant frequency of the bandpass amplifier to be close to 14kHz (where the hardest to detect insect 'sings').

Any pointers to appropriate references to help me progress or other considerations in the design that I have missed would be greatly appreciated.

Thanks.

Thanks for comments/suggestions.

The (hand)shotgun looks interesting but I think I will iterate on my parabolic mic first - a quick read suggests that the shotgun is more sensitive to be pointing accurately at the noise source whereas I will be 'scanning' with the parabolic mic as a search aid to find the source.

Should have also stated that the app I am using is actually a BAT recorder so has all the recording etc capabilities that I need (and I do use audacity to post process) but the key for this problem is detection/discovery.

Noted the advice regarding electret mics tailing off at the high end.

I think the suggestion of separation from the mobile power supply would set me off on the right tracks and give more flexibility.  However, looking at an even simpler option (not being an engineer) , if I did the filtering visually in the app (as i do today) could I just use something like this: https://www.adafruit.com/product/1713 ?  Is the electret frequency roll-off between 10khz to 20khz going to be significant? If so, maybe use the MAX9814 with a different mic?


texts: Differences between a planar coil and coplanar waveguide to create a local 1D AC magnetic field

texts:
Coplanar waveguides (for example picture look here) are often used in research to create a local in-plane magnetic field. Now if compared to a planar microcoil like this,

driven by a AC voltage in the 1-5 GHz range, what would be the major limitations or differences when comparing those 2 techniques looking at the output/spectrum/power?

the cpw has probably the advantage to create a narrow band ac field with high q-factor and can be simply tuned by the GHz-Emitter over the whole 1-5 GHz range?
what will the AC magnetic field spectrum of the microcoil look like? Symmetrical/asymmetrical and broad around a peak at the driving frequency of the AC voltage source? But compared to CPW not temporally constant and underlying light resonance excitation? Is 1-5 GHz too high driving frequency to transport here energy at all to create a AC field?
what the difference in field strength (nT, mT, Tesla) that can be reached with those 2 techniques? Consider that both systems have a size in the the low micron meter range (below 100 micron lateral size)
the inductance of the microcoil will vary strongly over the 1-5 GHz range and due heating of the coil change additionally?

Where am I wrong/right. What did I miss?


texts: Measurement of Cmos Parasitic capacitors

texts:
i've had a question which asks if we assume that capacitance of capacitors with w/l of 1u/0.5 are

then what are capacitance of capacitors (with the actual w/l)

now i know cgs in saturation for example is cgs0+2/3Cox(w)(L) but wouldn't Cgs0 change with new size ? if so how much ? and what about csb ? isnt it zero ? also in other questions i've seen asking capacitance of Cgb or Cgd too what about measuring them ?

The circuit :


texts:
I have limited knowledge on electrics and wanted to ask how I can complete this circuit, how would I go about wiring it up?

Bulb should ONLY be ON when Input A is ON and Input B is OFF.
Bulb should turn OFF whenever Input B is ON or when both Inputs are OFF or when both Inputs are ON.
Input A is always ON when Input B is ON.

Is there any semiconductor or electrical device I need for it? If someone can redraw diagram including if there is anything else to add like ground wire to make this work I would appreciate it a lot.


texts:
I'm using TI's PGA chip PGA204. It has a DGND and an AGND. And it states:

Digital ground can be connected to any potential from the V– power
supply to 4V less than V+. Digital ground is normally connected to
ground. The digital inputs interface directly CMOS and TTL logic
components.
.....
It is good practice to return digital ground through a separate
connection path so that analog ground is not affected by the digital
ground current.

Then I wonder if I need short the DGND and AGND together near the part like some ADCs with DGND and AGND? What about to short them at a farther point such as the power supply?


texts: Efficient power utilization by MPPT battery charger

texts:
I am designing an MPPT solar charge controller to get more efficiency out of my system. At the moment I am at the conceptual stage and I have some questions about MPPT battery charging in general.

First of all, the way I understand it, the implementation of MPPT works via varying the resistance of the circuit such that panel output voltage * current drawn are at the maximum point on the power curve.

Then the battery charger section takes whatever voltage is 'given' by the MPPT section and drops it to within the battery charging voltage band (e.g. 13.5-14.5V for lead acid), maybe using a buck converter. Further, the way I understand it, most MPPT battery chargers use the constant-current bulk-charge method followed by a constant voltage topping method (perhaps followed by a constant voltage float charge).

Now what mystifies me is how the charger is supposed to run a constant-current bulk-charge algorithm while using the power coming to it efficiently. Because, if the charger simply regulates the output voltage via a sense resistor such that the output current remains at some predetermined constant level, that voltage is dependent on the battery characteristics and charge state, so essentially the battery charging power curve is fixed for a fixed current. So what if the MPPT suddenly gives more power? Does it get wasted? What if the MPPT produces less power? Does the constant current become not so constant?

Lastly, if there is such a thing as a constant-voltage MPPT charger (which makes more sense to me for this situation) how would transition from bulk charge to topping charge be carried out during changing conditions (changing current). Plateau detection for instance would be impossible.

Thanks very much for your help.

Billy


texts:
I have a broken Philips alarm clock FM/AM radio broken, so I stripped some parts out of it.

One of it seems like an AC converter, but I cannot find any reference/datasheet about it. Do you have any information about this? (or what the meaning of the yellow/green wires are, I assume the black is GND and Red is VCC).

The dimensions of the yellow 'block' are 35.3mm x 29.7mm x 11.6mm.

The text is:

SIL35T0000095
3004

So all wires going out of this transformer and I would like to know the meaning of the yellow and green wires:

Blue wire (on the top back), going into the black cable you can see on the right page, it's going to the AC mains power plug (220V).
Brown wire (on the top back), going into the black cable you can see on the right page, it's going to the AC mains power plug (220V).
Green wire: What is the meaning of this wire?
Yellow wire: What is the meaning of this wire?
Red wire: I assume this is output? (AC/DC?)
Black wire: I assume this is ground


texts: I have tested HCl+peroxide etching with the light/transparent for SMD but it is very easy to get lines broken -- even though I had blue liquid and a proper etching equipment that I could monitor. I am thinking about using just ready fabs such as OSH Park unless finding a good home solution. Which etching method is good for doing finely-packed SMD boards?


texts:
I have a problem with writing Verilog HDL code. I want to design a simple PID controller in FPGA I am using Cyclone II family. I want to feedback my output value as an input in a previous stage of calculations. Equation looks like this u(n) = u(n-1) + x (x is calculated correctly) so I created a register to save the output value and connected it to a previous stage in my design.

Unfortunately this solution doesn't work when I simulate this I get 'unknown' value in the register that I am saving the output value to and the output value itself is also 'unknown' (by unknown I mean 'x').

Is it possible to create a feedback loop between certain components in HDL design? How can it be done? Should I try to resolve this issue by doing the calculations step by step in an FSM?

EDIT: This is my code as requested

PID Module

module pid(clk,rst_n,Kp_in, Kd_in, Ki_in,temp_data_in,setpoint,pwm_out);

parameter N = 8;
parameter M = 16;

input   clk;
input   rst_n;
input   [N-1:0]temp_data_in;
input   [N-1:0]setpoint;
input [N-1:0]Kp_in;
input [N-1:0]Kd_in;
input [N-1:0]Ki_in;

output [N-1:0]pwm_out;

wire    clk;
wire    rst_n;

reg [N-1:0]temp_data_reg;
reg [N-1:0]setpoint_reg;
reg [N-1:0]pwm_out_reg;

localparam [1:0] idle = 2'b00, load = 2'b01, run= 2'b10;
localparam k = 2;

reg [1:0] state_reg, state_next;

always@(posedge clk, negedge rst_n) begin
    if(!rst_n) begin
        state_reg <= idle;
    end else
        state_reg <= state_next;
    end

reg sum_out_old_reg_en;

reg     [N-1:0]K0;
reg [N-1:0]K1;
reg [N-1:0]K2;

wire [N-1:0] ex0;
wire [N-1:0] ex1;
wire [N-1:0] ex2;

wire [2*N-1:0] out0;
wire [2*N-1:0] out1;
wire [2*N-1:0] out2;

wire [2*N-1:0] sum1;
wire [2*N-1:0] sum2;
wire [2*N-1:0] sum_out_old;
wire [2*N-1:0] sum_out;

register e0(clk,rst_n,(temp_data_in-setpoint),ex0);
register e1(clk,rst_n,ex0,ex1);
register e2(clk,rst_n,ex1,ex2);
mult u_mult1(ex0,K0,out0);
mult u_mult2(ex1,K1,out1);
mult u_mult3(ex2,K2,out2);
adder u_adder1(out0,out1,sum1);
adder u_adder2(out2,sum_out_old,sum2);
adder u_adder3(sum1,sum2,sum_out);

register16b u_old(clk,rst_n,sum_out,sum_out_old);

always@(posedge clk) begin
    state_next = state_reg;
    case(state_reg)
        idle: begin
                    state_next = load;
                end
        load: begin
                    K0 = Kp_in + Kd_in + Ki_in;
                    K1 = -Kp_in + (-2)*Kd_in;
                    K2 = Kd_in;
                    state_next = run;
                end
        run: begin

                state_next = run;
              end
    endcase
end

endmodule


texts: Limiting peak power consumption with energy bank

texts:
I have a POE splitter capable of delivering a maximum of 1A at 12V. This device is intended to power a Raspberry PI 3B+ and a 3.5 inch hard drive. The Pi gets the 5V from a DC to DC step down converter, and the hard drive utilizes the 12V to drive the motor, and it is connected to the Pi via a USB to SATA adapter. This arrangement consumes on average 10W at full load, so I have 2W "to spare".
As expected when the hard drive spins up the platters, the instantaneous power consumption of the entire arrangement spikes to about 20W for around 2 seconds and it stabilizes at 5s, if connected to the splitter, the device cuts off power as soon as it detects the excess power draw. When the splitter restes and the power returns, the arrangement attempts to start up again and the cycle repeats. So I need to devise something to handle this peak load, and if possible have enough energy to allow the Pi to do a soft power off when the power goes out.
The peak handler would need to limit the power consumption to 12W, deliver power to the Pi and the Hard Drive while routing the rest to an energy storage device. If the power required by the arrangement exceeds the 12W the POE splitter can deliver, it should source energy from the storage. Optionally, the device could be configured to not deliver energy to the Pi until a minimum amount of energy is stored, if super caps are used I'm guessing a simple comparator and a voltage divider could be used given that the energy is a function of the voltage on the caps. Ideally I would want to use supercaps, as I think it will make the circuit much simpler, without the extra complexity using batteries implies.
How can I implement such a device? How should the circuit diagram look like? Related to this I could only find this question (Low power device with high current peak), and I'm not very well versed in "practical" electronics, building circuits and such, so I'd very much appreciate any guidance.
Update:
I found the article Supercapacitor Charger with Adjustable Output Voltage and Adjustable Charging Current Limit by LT that describes the use of a LT3663 IC to charge the supercaps at a constant current and output at a constant voltage, this seems to be exactly what I need. I'll evaluate this option and post an update if I get something out of it.


texts: Controlling a AC valve solenoid using a SSR relay

texts:
I have a micro controller based irrigation controller which should control solenoid valves.
The solenoid is 24V AC type, with 25 Ohm resistance.
I am considering to use some triac based SSR to switch the 24V AC circuit. The input (emitter) is fine, just needs a limiting resistor to keep the current around 30mA.
I want to have the circuit as simple as possible, but reliable as well. I think if I use a zero switching triac based SSR then there will be no need to worry about any voltage spike from the inductive solenoid, right? The output can be just the 24V AC source connected to the solenoid through the SSR output. And of course the SSR should be capable switching current around 1A.
Thank you for your advice.


texts:
I was wondering if anyone can help me with choosing a right inductor.
My aim is to create circuit, which would start oscillation of a steel-core string. This would be achieved by oscillator (tuned to the fundamental frequency of the string), amplifier and inductor (which would transfer the oscillations to magnetic field). The only thing I am not sure about is the inductor - can you please help me with some formulas / tips maybe? I've hear an advice to just start wiring coil until it works, but I am not sure about the diameter of the wire also.

Thank you very much for any tips/help!


texts: Help with connecting electromagnet to dimmer

texts: I have an electromagnetic powered off a AA battery. Is there some kind of dimmer switch or similar item that would allow me to control the amount of power going to the electromagnet?


texts: how to select one logic signal between two?

texts:
I'm working on a tic tac toe project using logic gates. I'm trying to make it automated.

At one point , my circuit have to get one signal (high) among eight input pin.But there will some case arise when two pin simultaneously give high. But I only want one . So I'm thinking of a buffer circuit which take all the input but give the output only one like priority encoder . I'm looking for an IC which should have same number of input and output pin, but only give output to only one pin . Is there any IC like that.

I don't wanna go to design that cause it may couse my jumbled.


texts: Grounding of IT equipment for office ESD protection

texts:
We've been having a lot of problems in my office with ESD. People touch cubicle frames and monitors shut off momentarily, painful shocks through laptops, etc. I'm worried about equipment getting damaged and I'm fed up with getting shocked by furniture.

As the EE in the office, I went and bought a bunch of wrist straps, table mats, and staticide carpet spray. While shopping, I discovered this Desco 09839 USB Ground Adapter, which is a USB port on one end with a banana jack on the other end of the cable. Checking it with a multimeter, the signal ground pin is connected directly to the banana plug. The shield is not.

This smells like a good way to damage a laptop, particularly if it's shorted to the wrist strap. Under what circumstances would I want to use this as part of an ESD protection strategy? My first thought is to connect it to earth through a separate 1M resistor from my wrist strap to help prevent discharges to the laptop chassis.

The AC-DC adapters for our laptops are Class II with functional earthing. They have a third prong on the AC but I assume it only goes to a line filter.


texts: what kind of three phase full wave rectifier should we use?

texts:
We have the following generator: Permanent Magnet Generators. For the project we would like to use this converter. Between this generator and converter we've to convert the three phase voltage to an useable DC voltage, and we want to do that with a three phase full wave rectifier. According to wikipedia there are a few types of that kind of rectifiers. Can some of you that has experience in this field give us the right path to follow.

Important is that the rectifier has to be able to handle the current that passes trough it.

For the output voltage of the generator, we got the following data from it:


texts: How to select series resistor for a Zener Diode

texts:
I have to simulate the reverse bias curve in Multi Sim with a 1N4681
I understood the equation to work out the series resistor to be:

$$R_s = \frac{V_S-V_Z}{I_Z}$$

Which in my case would create a 101 Ohm resistor.

However, this doesn't seem to be creating the characteristic curve that I was expecting.

Datasheet I am using for reference

simulate this circuit – Schematic created using CircuitLab

Therefor, am I selecting the correct value for the series resistor? And when you're making the above calculation with the view of performing a DC Sweep what Voltage do you use for the source voltage calculation? Mean voltage? Max Voltage? Arbitrary value?


texts: How to drive miniature incandescent light bulbs with a micro controller?

texts:
I have an assortment of minuature (~2.5mm diameter) light bulbs that I'd like to use for a retro-looking project.

Driving LEDs is fairly easy with a micro controller, if the output is too weak, I'd just use a FET, a dropper resistor, etc.

But if my supply voltage is 5V, what kind of circuit do I need to turn on that light bulb?


texts: Need help making a counter controlled by a button

texts:
I'm trying to simulate a binary counter that is supposed to be activated by a button B, then count until 40, reset and stop until B gets pushed again. If B is pushed while the counter is working it resets and starts over.

I'm supposed to build this with simple stuff like flip flops. I already have an 8 bit counter available with a clock and Reset input entries.

I know how to read 40 off the counter (2^5+2^3, or when outputs 5 and 3 are true).

I think I need a variable B, for the button, a variable T, which is $$\lnot (C_5.C_3)$$
(C is the counter's outputs, so T will be true while the counter's output isn't 40), and R which is the value of reset. I tried to draw the state diagram:

I'm not sure which are flip flops and which are variables here or even if this is entirely correct. I think I am supposed to use a flip flop for R but I don't really know how to go about it.


texts: Building an AND gate using switch-diode pairs and two power supplies

texts:
I do not understand how the AND gate circuit shown functions (with high measured as ~6V and low as ~0V at the voltmeter PR1). Primarily I think I'm confused about the interaction between both power supplies and how that affects the behavior of the circuit around the diodes.

With both switches open (as in diagram), the top most supply (labeled as V1) drops its 6V
across resistor R1. This is also the case if one of the switches but not both are closed. Can someone explain this behavior?


texts: Lithium Ion Battery Charger and Power Path Management IC

texts:
I am to analog electronics. I am building a circuit that has a lithium ion battery. I  understand the importance battery charger in battery management.

My question is how does a designer set specifications of the battery charger IC. What tools are needed?
I would like to use BQ2423x by Texas Instruments


texts: Are power supplies for USB drive enclosures required to have UL certification?

texts: I bought a cheap USB hard drive enclosure off eBay. It turns out that the power supply has absolutely no electrical certifications for either the US or EU (no UL, CE marks). Is electrical certification required for these power adapters (that come with USB drive enclosures)? Is it safe to use a power supply that doesn't have the electrical certification?


texts:
Here are the graphs of flux vs angle and EMF vs angle.
From it, I have to derive the following relation (expected answer) between EMF -Ui and change in flux with respect to time.

My approach:
I find the function for every piecewise continuous graph which gives me the following result:

Φ=-B∙A,
Φ=((2B∙A)/(π-2θ))∙(φ-π/2),
Φ=B∙A, Φ=-((2B∙A)/(π-2θ))∙(φ-3π/2),
Φ=-B∙A
and lets me find the derivative of flux with respect to angle first which gives me:
dΦ/dϕ=(2B∙A)/(π-2θ),
dΦ/dϕ=-(2B∙A)/(π-2θ)
for two slopes and derivative of flux with respect to time comes out to be:
Ui= (dΦ/dϕ)∙(dϕ/dt)=((2B∙A)/(π-2θ))∙dϕ/dt,
Ui=(dΦ/dϕ)∙(dϕ/dt)=-((2B∙A)/(π-2θ))∙dϕ/dt,
where dϕ/dt=2πn.
It still isn't equal to the answer that I should be getting.
'The commutator gap can be neglected.' does that mean there will be no flat top and bottom on the graph of flux vs angular position? The graph sort of becomes triangular and even in that case where the theta goes to zero, the required answer is not in sight.
I need insight on it.


texts: I want to charge Lead acid battery (12V, 55Ah) I have adjustable DC power supply (I can set voltage and limit amps). Do I need to put resistor in between power supply and battery? If so.. how much Ω ?


texts: Implemention of indoor posistion using Bluetooth 5.1

texts:
I see how Bluetooth 5.1 is going to explode once released commercially. However when I watch the videos on Youtube and how these companies are tracking these BLE 5.1 devices and how accurately it is, I do not see them showing the receiver, where the magic happens.
Has anyone had insight on how I can implement my own receiver to track these BLE 5.1 tags?
I have read the plethora of theory (such as Bluetooth Indoor Positioning, Applications for Bluetooth 5.1 Direction Finding and Bluetooth Direction Finding) that clearly says in a theoretical manner how to track these tags by using the Angle of arrival method. However, there is no mention on how to practically go on about this. Such as what receiver chip do I use to track the BLE tag, how do I even start with the code/software...
A Bluetooth 5.1 chip