texts: How to asynchronously receive USART data using STM32 HAL?

texts:
I'm trying to accumulate any bytes that come into the UART peripheral at any moment into a circular buffer.  I want to match proprietary protocol packets on this window of data, but it's unclear how I can use the HAL in non-blocking mode to always accept bytes.  I'm used to having a slightly more generic ISR that fires on a byte received.  What I find in stm32f3xx_hal_uart.c is:

/**
  * @brief Receive an amount of data in interrupt mode.
  * @param huart UART handle.
  * @param pData pointer to data buffer.
  * @param Size amount of data to be received.
  * @retval HAL status
  */
HAL_StatusTypeDef HAL_UART_Receive_IT(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size)

I do not know ahead of time how many bytes I want to listen for, or what to put for the Size.  Packets are variable length and can be corrupted or cut short at any moment.  The best idea I have so far seems to start a reception for 1 byte then call that again on each completion interrupt.  It just seems like a lot of code to run for a single byte.

In my_usart1.c module:

// Start
HAL_UART_Receive_IT(&my_uart_handle, my_buf, 1);

...

// Implement the Rx callback
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) {
  // Add the new byte to a circular buffer to be processed by the protocol

  // Register another callback the next time we receive a byte
  HAL_UART_Receive_IT(&my_uart_handle, my_buf, 1);
}

How can I receive a stream of bytes asynchronously?


texts:
I've been trying to follow:
http://www.anandtech.com/show/3851/everything-you-always-wanted-to-know-about-sdram-memory-but-were-afraid-to-ask/3

On this page, they say:
"Following activation, the open bank contains within the array of Sense Amps a complete page of memory only 8KB in length."

How can a page of a particular bank be 8KB in length? There are 1024 bits (column lines) on a single row of a bank. Then how does this add up to 8192 bits?


texts:
Is it possible to connect the circuit like this.

The circuit is from the resolver input circuit, It takes the sine (or cosine) signal from the output of resolver and reduce to appropriate voltage for controller IC to handle.

For example, if the input voltage of this circuit is 1Vpp then the output voltage will be 0.5Vpp, but how much will the DC bias of output voltage be.


texts:
I was trying to answer these questions (picture below) but I am not sure if I did a good job.

The way that I solved it is shown on this picture below:

At the inverting part of the op-amp where the two resistors are connected, I supposed it is a virtual ground so the voltage is equal to zero.

Can someone please see if I solved it correctly?


texts:
I need to use an ISO124P isolation amplifier. The data sheet for the device is here http://www.ti.com/lit/ds/symlink/iso124.pdf

My question is with regards to powering the amplifier. I am really confused with the power supplies.
I think I need two different power supplies.

Perhaps a diagram is beter

In my opinion I should connect:

Ground1 to Gnd1
+Vcc1 to Vs1
-Vcc1 to -Vs1
Ground 2 to Gnd 2
+Vcc2 to Vs2
-Vcc2 to -Vs2

I am correct? Or should I use the diagram of the Figure 22 or Figure 23 of the data sheet for powering the ISO amplifier?

I know this is probably stupid, but I'm pretty new to this stuff.

Any help would be appreciated.

Thanks so much.


texts: Why is there no resistor at the input in below op amp circuit which converts sine wave into square?

texts:
Below circuit seem to use negative feedback in a weird way. There is no input resistor at - terminal, and  instead of putting a resistor in the feedback branch, they put two 4.3V zener diodes. I kinda get why the output may be a 5V square wave. But I'm really not so sure about it as two things are throwing me off:

1) Input is a voltage source without a resistor. Since the + input of op amp is at ground, the op amp should try to pull the - input also to ground. Doesn't this actually short the input voltage source to ground and infinite current flow?

2) Is it legal to put zener diodes in feedback branch as shown in the figure?


texts:
I need to build 100 coach tracking devices. I am a web/mobile programmer, not an engineer,  so I'm going to be looking at outsourcing for this. To outsource this work however I should know the components I'm going to need in the device (I am able to program the device). As I'm outsourcing I need to consider the price/quality of the components, ideally I need to pay as little as possible (to state the obvious).

I need the device to send its current latitude and longitude coordinates to our servers along with the registration of the vehicle the device is inside.

1) Cheapest way to transmit the vehicles position/registration?
From my current knowledge, I think the three channels to do this are a 3G/4G network, SMS or radio. If I'm transmitting the vehicles position and registration every 30 seconds, which would be the best compromise between accuracy and price?

2) The microcontroller
At the moment I only know of the Raspberry Pi and the Arduino. Are there any other perhaps cheaper computers more commonly known for wholesale? I simply need a cheap component that sends the vehicle's registration and its location.

I can't comment on power just yet as I don't know what power is available in the coaches.

I would really appreciate any advice/ideas. Thanks


texts: Xilinx Xpower Analyzer: Expected scope definition in VCD

texts:
I use a VCD file to evaluate the power of my design. The VCD is generated using the following command in the testbench file.

$dumpfile ("testb.vcd");
$dumpvars (0, tb.gcm_tb);

tb is the module name of the testbench. gcm_tb is the instantiated name of my design.

Xpower (version 10.1) gives me the following error:

ERROR:Power:976 - Parsing Error parse error line 7825 Expected scope definition here

I notice that if I change the parameter into

$dumpvars (1, tb.gcm_tb);

then it does not give me the error. However, my design has several levels. Recording the power of only one level is not accurate.

How to solve this problem?


texts:
I bought some chinese COB 100W Led lamps from Ebay and I was wondering what would be the most efficient way to power them.

Led specifications: 24vDC 4.2A

I want to use 4 leds in total, so that makes 400W @24v (16.6A)

Idea 1: Use 24V Voltage regulated power supply in combination with very heavy limiting resistor (1 Ohm @18w). => Bad idea I think, to much power loss?

Idea 2: Buy some chinese current regulated "Led drivers" => Are they efficient, can someone make recommendations ?

Idea 3: Use AtMega (Arduino) chip in combination with transistors to PWM regulate the power. Do I still need a limiting resistor if using PWM ?

Question 1: Is there a way to power them using AC ?

Other ideas anyone ? (Don't need any dimming functions, on a budget)

Thanks everyone.


texts:
I would like to implement the power-on sequence of an IC. It has 3 different power supplies plus the clock, which has to be enabled after the power supplies. I am considering employing a ATTINY202 for the implementation, while the LDOs all belong to TLV755P family. Clock has not yet been decided, but it will have an EN pin as well.
Now, my main concern is about the initialization (programming) phase of the MCU, on boot. When the MCU boots, until it has complete its own power up sequence and programs itself, the outputs are in High-Z state. That means that the EN pin of the LDOs are, and please correct me if I am wrong, floating. I could not explicitly locate in the datasheet what happens if the EN pin is unconnected, in chapter 7.3.2 Enable (EN), so I am forced to assume that the behavior is undefined.
So, I am worried about that tiny fraction at the very beginning of powering up the PCB. I am thinking of tightening all EN inputs to the ground via a 10 kΩ pull-down resistor, to ensure that nothing is on the LDOs and clock output, but I don't like the idea of the constant current consumption.
Am I missing something? Is the power up time of the MCU insignificant to worry about? Also, could I use 100 kΩ / 1 MΩ pull down resistors safely, to further limit the current?


texts:
i would like to buy a supercap for my project, something small likes 5F 10V .

I have read some datasheet about supercap, but i do not completely understand if i can charge a super cap with, for example, 1 o 2 Amps of current to charge it super fast. According to the ESR.

I will use a DC-DC converter with fixed Amperes and 9V with a zener diode.

For example, this datasheet (http://www.vishay.com/docs/28409/196hvc.pdf) give me a "RECOMMENDED charging current", but that(https://content.kemet.com/datasheets/KEM_S6017_FS.pdf) does not.


texts: Triggering button press from raspberry pi

texts: I want to be able to solder to a gamecube controller circuit board and, from the raspberry pi, trigger the button press to register. From what I understand, the buttons work by being grounded when the conductive pad is pressed down. My current thought is to hold the button at the input voltage then, using the pi, when I want the button "pressed" use GPIO.low to do a weak ground and hopefully make the button register as pressed. Anyone know if this will work? I am a beginner at this stuff and have very little experience or knowledge on electric work.


texts:
Here is my code for 4 to 1 mux:

entity a is
Port ( a : in STD_LOGIC;
       b : in STD_LOGIC;
       c : in STD_LOGIC;
       d : in STD_LOGIC;
       contr : in STD_LOGIC_VECTOR (1 downto 0);
       z : out STD_LOGIC);
       end a;
end a;

architecture Behavioral of a is

begin
 with contr select
 z <= a when "00",
 b when "01",
 c when "10",
 d when "11",
 '0' when others;

 end Behavioral;

But I've seen that this code is also written with a signal declaration:

 entity a is
    Port ( a : in STD_LOGIC;
           b : in STD_LOGIC;
           c : in STD_LOGIC;
           d : in STD_LOGIC;
           contr : in STD_LOGIC_VECTOR (1 downto 0);
           z : out STD_LOGIC);
           end a;

          architecture Behavioral of a is
signal control_signal : std_logic_vector (1 downto 0);
begin
control_signal <= contr;
with control_signal select
z <= a when "00",
     b when "01",
     c when "10",
     d when "11",
     '0' when others;

end Behavioral;

So what's the difference between these two? When and why should I use signals?


texts: resistance of the load in the parallel resonant circuit

texts:
Does resistance felt by the parallel resonant circuit because of electromagnetic induction inside the ferritic material influence the resonant frequency calculation?

The circuit is like this, but the coil is transfering power to the ferritic material. This increases resistance of the circuit. Does that resistance also effect the resonant frequency, or do I have to take into account only the resistance of the coil, but not the load itself?

http://circuitglobe.com/wp-content/uploads/2015/10/PARALLEL-RESONANCE-EQ3-compressor.jpg

I found this equation for the resonance calculation (which implies that the resistor next to capacitor is infinetely small). But the problem is that when I use that equation, even at 10 Ohms I get that the resonant frequency is almost 0. This can't be right. Is that equation even remotely right?

EDIT: When I test this circuit in a simulator I see that resistance does have an effect on the resonant freuqency. Increasing the resistance of L branch decreases it's current, so I have to reduce the frequency untill both branches have the same current. People say that resistance plays no role in determining the resonance of the RLC circuit, but that is only true for a series RLC circuit. I have also confirmed this with the RLC meter while setting up a resonant circuit. But the problem is that I don't get the same values. If I add the resistor the resonance decreases more in an actual setup, than in the simulation software. But I can find no equation that take resistance into account. The one I provided is wrong, since if I add a 6 Ohm resistor in series with inductor I calculate practicaly 0 Hz resonance, which is not the case. Does anyone have the working equation for it?

edit 2: I have found the solution. In parallel the resonance point is shifted and is calculated by that equation. I get imaginary numbers if I increase the resistance past a certain points because the circuit becomes overdamped so it is not resonating anymore. But the interesting thing is that resonant frequency is not the frequency at which this circuit has the lowest current flowing trough the power source. Nor is it a frequency at which the L and C currents are the same for reasons I don't understand. But if looking for the lowest source current draw is what we're after, than it can for the circuit here

be calculated by

Umax= (x - y)^1/2

x = (a + b)^1/2

a = 1/(LC)^2(1+2*RL/R)

b = (RL/L)^2*(2/(L*C))

y = (RL/L)^2

In my case I don't have the resistor R, only RL, which means that the equation a becomes

a = 1/(L*C)^2

When I simulate at which frequency the generator current is lowest, it exactly matches this frequency.


texts:
I have a 120V to 12V adapter with a molex end that I want to use to power a PC fan controller. However, the pins on the female molex (the 12V adapter) doesn't have holes that fit with the pins from the male molex (the PC fan controller molex connector). This figure shows the problem I'm having.

Is this normal? From my understanding of molex connectors, the 12V adapter molex connector 12V ground pin is missing, and for the PC fan controller molex, the 5V ground pin is missing. Also, when connected like that, the molex connection would be in a 7V configuration. If I'm correct, the fan controller needs 12V + 5V to function correctly (which my 120V to 12V adapter is supposed to provide). So why both connectors pins are not correctly aligned?


texts:
Well, we all know that in a voltage Divider circuit like this, Output voltage is:
(R2xV1)/(R1+R2)

Can someone tell me how do you go about finding voltage in this?

I want to find out voltage between Point A & B, and then the voltage between A & C?


texts: Can a novice safely splice in wire to lengthen 5V charging cable?

texts:
I have a 5V 1500 mA charging/power cord for a camera that was too short to reach the mounting position I need, so at the suggestion of my electrical engineer father, I decided to try to lengthen it. He said to just twist and tape the wires together but I wanted a sleeker look so I decided to try soldering and heat shrinking. The cord will be left plugged in and powering the camera 24/7. The original cord is 20 awg but the closest I could find was 4 extra feet of 18 awg lamp cord (2 wires in both). So I cut the original, stripped the 4 ends between 1/4 - 1/2 inch back, spread the strands out, butted and twisted them.

Next, I soldered them together and this is the part I feel uncomfortable with. For starters this was only like my second time ever soldering and the first time with this iron. The first joint looked ok, maybe slightly light on solder - it didn’t flow very well - but it was holding together against a gentle tug. The second was my worst joint, it ended up with a little too much solder and kind of thick. I figured out that my iron wasn’t hot enough even though it was set at about 380-390. After turning up the heat, it flowed into the next two, but the tips of the insulation on the original wire melted a tad (see photo). Is that bad?

Next I applied heat shrink over each individual joint. The heat shrink seemed a little thin so I also wrapped a little electrical tape around one joint on each end of the spliced length for extra insulation. Then I applied larger heat shrink over both wires together on each end. Then finished it off with white electrical tape just to match the cord color.

My question is, is this safe to use? I tried plugging it in and the device indicates it is charging. I feel pretty confident it’s not going to short with two layers of heat shrink and electrical tape separating the conductors. But being a novice, I’m just looking at my taped up cord picturing a fireman holding it up for a look in the remains of my burnt home. I’m most worried my solder joints aren’t good enough and might cause a dangerous resistive connection.


texts: Is galvanic isolation needed when the output voltage is higher than mains?

texts:
For a flyback converter, 120 V AC in and 400 V - 2000 V out, is it necessary to provide galvanic isolation between the input and output?

First, from a safety point, would not having a direct connection provide any benefit?

And from a certification perspective, if a product were to be sold to the public, would having the output isolated be helpful?

The high voltage is used to produce the electric field in an ionization chamber to detect radiation.

The entire system would be enclosed in a plastic enclosure, with a LCD screen at the front with some buttons and showing some system information.


texts: How much hardware is needed for HAL_CAN_Transmit not to give a TIMEOUT?

texts:
This question is related to Question

I wonder how much hardware is needed to not make HAL_CAN_Transmit give a TIMEOUT...

Is only the STM32F103C8T6 needed (in my case)

Or a CAN transceiver attached to Can Rx and Can Tx (PB8 and PB9) ?

Or is it also needed that the CAN transceiver is coupled with another CAN transceiver?

Or is there a mistake in my circuit:

What I connected:

- STM32F103C8T6 #1: PB8 -> CAN Transceiver 1 RX
- STM32F103C8T6 #1: PB9 -> CAN Transceiver 1 TX
- CAN Transceiver 1 CANL -> CAN Transceiver 2 CANL
- CAN Transceiver 1 CANH -> CAN Transceiver 2 CANH
- STM32F103C8T6 #2: PB8 -> CAN Transceiver 2 RX
- STM32F103C8T6 #2: PB9 -> CAN Transceiver 2 TX

(and of course all VCC/GNDs)


texts: Charging a bank of lead-acid batteries in paralel

texts:
I have a lead-acid battery similar to the one in the picture (mine is 15Ah) and I also have a spare car battery (50Ah).

Is it safe, or a good idea to put them both in paralel to achieve a bigger battery that lasts longer?
Will the voltage of both batteries increase/decrease evenly as they are charged/discharged?


texts:
This one is very simple but I guess I am missing out something and hence finding it hard to understand.

When a coupling capacitor is connected in an amplifier circuit, one of its plates is connected to the DC voltage coming out of a voltage divider.
This tells me that it has a voltage on it. So now when the electrons from the AC signal come, won’t the electrons present on the DC side plate repel them? How does this AC signal cause electrons on the DC side to repel and move towards the transistor's input? I know that electric forces act on charges such that the force felt by two interacting charges has the same magnitude.

I don't know if I have framed my question correctly, but for me it’s simply not easy to understand that we basically charge the capacitor from both sides.

I feel I am missing something vital.


texts: Parallel binary counter using T flip-flops

texts:
Can someone explain me how this parallel binary counter works:

For example, if the state in the beginning is 0000, what happens when Pt goes high?


texts: Grounding standard for mechanical/crimping connector

texts:
Can anyone tell me if there is a grounding standard that takes about mechanical/crimping connectors, I am looking for an IEC standard.
I cam across IEC 61238-1 but this talks about power cables, are there other standards specially dedicated for grounding purpose or can IEC 61238-1 be used?


texts: Why does MOSFET input capacitance change with Vgs?

texts:
I recently saw that the input parasitic capacitance of a MOSFET (Cgs, etc.) changes with the applied gate source voltage? Why is that?

I always thought that it was fixed since the parasitic capacitances are due to overlap capacitances or due to the gate channel (with oxide as dielectric) capacitor itself?

How can a physical overlap area or channel area (hence capacitance) change with the applied voltage???


texts: Question regarding shunt regualtor using zener diode

texts:
simulate this circuit – Schematic created using CircuitLab

I am not able to get proper 3.3volt output at the output capacitor. Since 3.3 volt zener diode have been used, there is a drop in the voltage along zener diode when 3.3v is flowing.

What should I do?


texts: Host (baseband) controller in mobile phone

texts: Hi mobile world I met many times the term "host controller" or "baseband controller" used interchangeably in the context of being the heart of the mobile. What exaclty is that, som SoC with CPU, GPU, GSM modem???


texts: CAN bus traffic is destroyed for unknown reason

texts:
I am a bit stuck with connecting several STM32F405 with BeagleBone black via CAN bus.

Strange things happen when I connect 3 stm32 and 1 BB. I have checked that BB works perfectly with any combination of two STM32 devices. However after connecting the third one to the bus SocketCAN starts to send error frames to user space.

There appears relatively long idle gaps, sometimes several milliseconds long as shown in picture. Which does not look like CAN bus error frame. Unfortunately linux driver provides only counter related errors and no specific reasons for my CAN controller. At the same time on stm32 I catch all possible CAN errors: stuff, bit dominant/recessive, form and etc. If I just halt one of the stm32 devices using debugger everything works well.

Total CAN bus resistance is 60 Ohm as expected.

My beaglbone CAN bus parameters (ip link output):

bitrate 100000 sample-point 0.875
tq 625 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1

My stm32 CAN bus configuration:

MCR = CAN_MCR_ABOM | CAN_MCR_AWUM | CAN_MCR_TXFP | CAN_MCR_NART;
BTR = (25U << CAN_BTR_BRP_Pos) |  // PCLK1 is divided by 26. Tq = 26*Tpclk = 26 * 1/(42*10^6)) = 624 nS */
      (12U << CAN_BTR_TS1_Pos) |  // 13 time quantas for the first bit segment
      (1U << CAN_BTR_TS2_Pos) |   // 2 time quantas for the second bit segment
      (0U << CAN_BTR_SJW_Pos);    // 1 time quantas for resync.

I am not much of an expert in CAN bus and I have no ideas of what is going on. What are the possible reasons?

UPDATE

I noticed that disabling CAN interface on BB removes errors. So it seems that BB CAN controller for some reason destroys traffic.

UPDATE

I have uploaded the wrong images. Large gaps were dropped messages due to many errors, this is custom feature for each message(can contain many can frames) counter is held and after it is more than threshold I drop it.  Unfortunately my oscilloscope can not analyze CAN data and it is very hard to detect error frames. Since there are too many errors and it is hard to select anything particularly usefull I have attached full logic analyzer data. You can view it with salae logic software. Click "Options -> Open capture/setup". You will see protocols window, type "error" to find all errors.

Capture file: Salae Logic capture


texts: confused about the value of current in the circuit

texts: Its a simple question and i am sorry if the question is repeated.Here in the given figure i am confused about the value of i2 .Is it 20 A or 0 A ?


texts: How is it possible that shorting base and emitter allows current to pass?

texts:
My setup is simple: a NPN transistor is connected to a DC motor and a battery. The series goes like this: positive terminal - motor - collector; emitter - negative terminal. The transistor base is a loose, long wire.

I would assume that shorting the base and collector would turn the transistor into a diode, allowing current to pass. However, this does not happen. Instead, shorting the base and emitter makes the motor turn.
Is it possible that this is not a NPN transistor and some other type instead? Or am I mistaken somewhere else?


texts: High accuracy wireless triangulation in a small space?

texts:
the question pretty much states the basic idea, but here is my use-case; tabletop war-gaming.

Optimally I would like to be able to tag each of my “play pieces” with some sort of tag, place a few sensors around the perimeter of the play space, and have a device running an application that would be able to tell how far such and such tag/unit is from any other in the play area.

As such:

Such a system would need to be able to differentiate different ‘tags’, or if tags aren’t used, some method of doing so
Have millimeter or better accuracy, and scope over a variable play area approx. 5 to 10 feet cubed.
Be able to ‘refresh’ in a reasonable amount of time. (every few seconds is good enough)

Optionally

Some sort of powerless tag if its workable (so I don’t have to worry about switching batteries on hundreds of small figures)
As many ‘store bought’ components as possible. (and hence, hopefully reasonably affordable and with a minimum of home made parts)

I’m a software guy, so once something gets to the point where there are raw numbers coming into a computer I'm good. The figures just need to be found/tracked in the play-space accurately, and the computer can crunch the numbers to determine distances. As far as electronics, I’m having a hard time finding (see edit below) or even thinking of how to put this system together. I have looked at rfid tags, and they seem good for storing information, but not so good at triangulating distances. Any help or advice would be appreciated, but for this question;

What hardware/technology/setup can possibly (and hopefully nicely) fulfill the above requirements? Is there such a thing?

  EDIT (plausibility)

I did some more searching and found;
 http://lunantech.blogspot.com/
The videos seem to demonstrate that this is possible? This gentleman seems to have achieved an effect similar to what I'm looking for. (I'm just not sure how, is this applicable?)

Likewise, the Soloshot device tracking a 'tag':
https://www.youtube.com/watch?v=ApqQW5Nx1qI


texts:
TL;DR: Output voltage of boost converter depends on load. I assume because the load is altering the voltage between the base of the boost transistor and ground, thus altering the duty cycle. No idea how to solve that.
Context: I am trying to charge a Lithium battery using a 2V solarcell. I burnt the original converter, so I wanted to build one by myself for the fun of it. As I am a mechanical engineer, I don't have that much knowledge about electronics.
In the design of the boost converter there is not much to vary. The switching signal is created by the Meissner circuit, which is powered by the battery (or the solar cell, I am not that fixed on it yet). I simulated the circuit using LTspice (nice tool, btw).
Anyway, I observed that the output voltage is dependent on the load (resistance).
I assume this is because the voltage between the base of Q1 and ground depends on the resistance, thus altering the dutycycle.

Sadly, I have no idea how to overcome this problem.
Any suggestions? A simulation and sketch of the circuit can be seen in the picture below. If necessary/desired I will supply/upload said LTspice sketch.


texts: What causes loss of power over lifetime of a magnetron?

texts:
The power of a magnetron declines over time\$^1\$. While not noticable for most consumer applications (A 2000-hour lifetime would last over 20 years if the device is used only 15 minutes a day), this is a problem in industrial situations.

What causes this loss of power? The best I have been able to find is "cathode degradation"  but I still do not understand what this is supposed to mean (what mechanisms are actually going on to ''degrade'' the cathode?) and if this really is the only cause of loss.

I am familiar with semiconductor devices, and in those cases decline in performance can be attributed to factors such as electron-migration, hot-carrier injection, diffusion of dopants over time, etc... But a magnetron just seems to be a very ''simple'' mechanical construction, and large with respect to semiconductors, hence I can't imagine those effects causing issues here...

\$^1\$Leaders in Microwaves magazine, Microwaves & RF, 2018, page 13-14


texts: Does the resistor have to be before or after the component

texts:
I am an electronics beginner and I created a small little circuit, just a battery a resistor and a led, then to ground. This is the circuit:

simulate this circuit – Schematic created using CircuitLab

Now I have a few questions about it. I know voltage is the different of electrical charge between two points, so I measured that difference:

Point A to B: 3.27V
Point B to C: 1.82V

First question:
Does that mean that the actual voltage of:
Point A: 5V
Point B: 1.73V
Point C: 0V?

So I am not sure if my calculations of voltage are correct. I also have this other questions:

Does the resistor have to be before the component I am trying to protect, like an LED. I have seen people place it after, but wouldn't that give a full 5V to the led or component?
Ground has a neutral charge right? so why do electrons want to travel so badly to a point that has no electric charge?

Thank you


texts:
If one was looking for an audio amplifier of high quality, with very low distortion, which one of these two options would be better?

Large loop gain (i.e. \$af\$) but small open loop bandwidth
Small loop gain but large open loop bandwidth

I think that the first option would be the best one, because a large loop gain would mean that the bandwidth of the final circuit (namely, the closed loop bandwidth) would be increased by a factor of \$(1+af)\$, so the bandwidth would not be a problem. But also, distortion would decrease by the same factor, so, as I see it, the first option guarantees a large bandwidth and a decrease in distortion, while the second one only offers a large bandwidth.

However, this is a very general reasoning. I don't really know where that decrease in distortion comes from: does it depend on the position of the open loop poles? Does it depend on anything as well as on the loop gain?

So the specific question would be: which one of the two options would you choose for a very low distortion audio amplifier, and why?


texts: How to find the exact value of K for SN54LS123

texts:
I have a circuit containing SN54LS123 (Datasheet) IC. I want to know the output pulse width but unable to figure out the value of K.

The formula is PW = K * R * C.

The values of K is given in the plot (how to read figure) also there are two formula (page no.8 for LS123) one for capacitor >1uF and second for capacitor < 1000pF. I am confused. I want to know the exact value of K for

R = 75k and C = 0.022uF
R = 24K and C = 200pF

Update:

I found a document "Designing With the SN54/74LS123". This document discuss the Pulse Width calculation but one strange thing is that it contains two similar equations (comparing to datasheet) with different capacitor value ranges. One for >1uF and second for < 1uF. But again the curve in the plot for K values.


texts: I have a circuit which has about 10 kilovolts input and I want to store that voltage on a capacitor. I calculated and drew the circuit but I am now using an 18 nano farad capacitor at the end. I simulated the circuit in LtSpice and I am getting what I want. However, my common sense tells me that 18 nF is a very low number to store 10kilovolts in the real world. I looked at some specifications and it is actually okay to apply that much voltage to the capacitor but I am curious about is it possible to have 10 kilovolts stored on a capacitor with capacitance 18 nano Farads.


texts:
It says in the datasheet these values in this picture:

But I've also seen it with these values:

So what values should i use or doesn't it matter? And its for when its first starting.


texts:
I am using an emitter and a receiver circuit in order to communicate through the power line.
The receiver circuit I am using is shown at the figure below and it uses the LM567 tone decoder to decode the 100KHz signals sent by the emitter. These 100KHz signals are 1msec long.

The receiver is powered by an external 230 to 24V adapter.
The grounds GND_ANA and GND are connected.

I am connecting an oscilloscope at the test point and adjusting the R51 potentiometer in order to decode the 100KHz signals. The signal is decoded and the LED D6 is blinking accordingly.
The problem I am facing is that when I am removing the scope from the circuit board, the LED D6 remains ON (not blinking) even when I stop sending the signals from the emitter.
I have also noticed that (in the situation where the Receiver is disconnected from the AC line, the Receiver is powered by the 230 to 24V adapter, the Emitter is sending its signals and the scope is connected to the test point) when I am touching the Line (L) of the receiver, I can correctly see the emitted signals and the LED D6 blinking ...
I am thinking about a coupling issue somewhere but not sure …May you have any suggestion ?


texts: Why are car head or tail lamps blinking/flickering in slowmotion (slomo)

texts: I have seen this many times that the daytime running LED headlamps or taillamps of cars blink in slow motion videos, why is that?


texts:
Recently, I have installed an off-grid solar system - MPPT charge controller, batteries and solar panels.

Overall the system provides a DC 12/24/36/48v power (60A Max).

The main load I want to drive is a full spectrum COB LED which is used for indoor grow of cucumbers and strawberries.

I have 2 of these LEDs, each is 150W - 300W total - rated at 30V.

Currently I drive them with a standard 220v LED driver power supply.

I was wondering what is the best way to drive these LEDs with the use of solar power -

12/24v to 220v and use the driver I used?
Using one the DC Output available with some method of limiting the current?

Or maybe you guys got another solution?


texts: How to connect two inputs to one output for a mains connection

texts:
I have a digital switching system in my home that controls the water heaters. One heater is shared between two rooms and I need a connection such that it can be turned on from either room.

I'm looking for something like an OR gate that will work for mains rated 250V/5A. What can I effectively place in the blank space to physically achieve this?

Thanks in advance!


texts: Unknown equation in the SPICE resistor model

texts:
I was looking for simple resistor spice model, and came across this:

parameters
+rsh = 40           dw = 0              dl = 0
+tc1 = 0            tc2 = 0             pvc1 = 0
+pvc2 = 0           pvc3 = 0
...
+teff = 1+tc1*temp+tc2*temp*temp
R0 ( p n ) resistor r=rsh*(l-dl)/(w-dw)*teff*(1+pvc1*(tanh(pvc2*abs(v(p,n)/(l-dl))+pvc3)-tanh(pvc3)))

Source

I am pretty familiar with almost all of typical resistor parameters, but I can't find any information about that particular resistance equation and any of the "pvc" parameters. Specially about this part:

(1+pvc1*(tanh(pvc2*abs(v(p,n)/(l-dl))+pvc3)-tanh(pvc3)))

Where does this equation come from? Where can I find out more about it?

UPD:
This is probably on-silicon model


texts: the maximum and minimum output voltage of op-amp

texts:
my question is a bit specific, I have done the research but I got confused.

I am trying to measure the current using current sense resistor and a current sense amplifier INA 210 . my measurements will be taken using a 5V ADC( arduino). and I will be having 5V power supply to power up the ADC and the op-amp.

I want to measure current from 0- 0.5 amp, and lets say my op-amp gain is 100. so I have a chosen a current sense resistor of 0.1 ohm so when the current is max 0.5 amp, the voltage across the resistor will be 0.5 amp*0.1 ohm = 0.05 volt and when amplified amplified it will be 5 volt which is the full range of the op-amp.

that is okay but then I figured that the output of the op-amp will not swing to reach the supply voltage as it will reach bellow the 5 V supply voltage and it won't reach 0 volt which is my system ground.

my questions are:
1- I got confused getting the maximum and minimum output ranges and here are two pictures of the values I suspect, which one is true?

and here is the second picture:

2- second question is , if the second picture is the case, how to solve this problem? I mean this way I want be able to read the higher voltages above the op-amp range and the lower voltages bellow the other end of the op-amp output ranges


texts: Why, using a EMF tester on a smartphone in airplane mode, do I get a very low measure (\$< 1 mG\$), whereas using some applications which exploit the phone magnetometer, I get a very high value, something as \$35 \mu T\$? I get also a significant difference when I switch airplane mode off.


texts:
I am working on a project where I want to programm the atmega via usb serial connection, just like an arduino.
In order to do that, I have wired up both chips as the documentation suggests. The reset circuit should be similar to the one, used by the arduino uno.

My problem appears when I am uploading a sketch, the reset pin on the arduino isn't trigged by the CP2102N. When reseting the Atmega manually in the right moment everything seems to work fine.
As I just have to give an logic LOW pulse(in the right moment) to the reset pin, I am using following circuit:

My guess is that the setting of the DTR Pin is wrong, which I configured in simplicity Studio.

Do you have any idea what is causing this problem?
Is it even correct to use a reset circuit, which was actually indented for another chip?
If more Information is needed please remind me kindly. Thank you for any feedback.
EDIT: The state of DTR pulses to HIGH just when I upload and falls down to LOW afterwards. What is needed at RESET is excaly the opposite: HIGH all the the time and should fall down to GND just when uploading. The state of RESET with given circuit is constantly HIGH right now.
Do you think a different value of the capacitor would solve that? Is a closed transistor a better and easier method for this application?


texts: How to use libraries with delays inside within a time critical STM32 HAL application?

texts:
I want to use a library for an LCD for STM32: LiquidCrystal, and possibly some other libraries.

I noticed this library is full of HAL_Delay calls, not only during initialisation but also during processing functions.

My application needs to read MIDI data and process them, preferably within 10 ms, so a HAL_Delay of 1, 2, 5 and 50 ms as are part of e.g. that LiquidCrystal library is messing up the MIDI data.

What should I do (in general or specific) to use libraries using HAL_Delay calls inside a time critical application? Things I can come up with:

Rewrite the library using interrupts? (seems like a lot of work)
Use another MCU (STM32) to handle that (more hardware/soldering work)
A better solution?


texts:
I have circuit with photointerrupter GP1S092HCPIF. The documentation is rather weak and D-shape pin strange but I need a small SMD type. I hopefully identified pins correctly and when soldered on board I see it does not work.

When slot is opened then I measure collector voltage as high as 4.2V (it seems transistor is only semi-opened). When is closed then 4.8V (which seems ok, Schmitt input current Ii=100uA in datasheet, EDIT: bug in Diodes datasheet). Hopefully chip is connected correctly because of measured voltage Vr=1.2V identifying LED side. I'm afraid I can't check visually because of IR spectrum. I have two parallel PI circuits on board and both behaves equivalently. Soldered with heat gut at 320°C - hopefully not demaged.

Can somebody help me to detect what is wrong ?

simulate this circuit – Schematic created using CircuitLab


texts: Output frequency unstable in 555 oscillator

texts:
I'm trying to make a simple astable NE555. The output frequency increasing alone. For example it start from for example 4.2 kHz and immediately change to 4.3 kHz, 4.6 kHz, 5kHz, then play around 4.5 kHz up and down.

I tried different NE555 IC like TLC555 and a different 9V battery, same problem.

I am using breadboard.

C1 is a ceramic capacitor. I measured the frequency using a PIC microcontroller based frequency counter.


texts: Proper connection of choke coil in ethernet magnetics

texts:
I need to use the medical ethernet magnetics by Pulse HXU6200NL (it is the only 2MOPP medical-certified PoE magnetics I can find). These are of the rather common transformer/choke coil topology. My confusion comes from the location of the common-mode choke coils.

As I understand common practice, and most magnetic data sheets I have seen (except by Pulse), you should place the common-mode chokes on the cable side of the magnetics. The intention being avoiding the injection of circuitry-generated EMI into an (unshielded) ethernet cable.

But Pulse places the chokes on what they denote as the PHY IC-side of the magnetics.

Which side is the correct one? Should I ignore Pulse's data sheet regarding this?

(There is a related, but unanswered, question regarding this)


texts:
I am looking for an easy way to implement a line code (both the encode and decode parts).  This could be something like Biphase Mark Code, Differential Manchester, or anything else that has the following properties:

Considerable jitter is ok (edge timings can be off by ~20% of the time of a bit)
No separate clock or clock synchronization needed (this can't use SPI or UART, there is only one line which can only transmit two levels)
Approximately balanced 1's and 0's (not worse than 2:1 imbalance) and no long runs of the same symbol (not more than 3-5 consecutive 1's or 0's)
Fast! Need 1Mbit/s or more.  (I have 80MIPS microcontrollers on either side, but software decoding is probably still impractical)
Cheap!  Ideally something that can be done with microcontroller peripherals, or an inexpensive encoder/decoder IC.


texts: Motor Speed Controller Causing Relay to Lose Voltage and Stop Working

texts:
I'm having some trouble wiring up a camera slider where a motor moves the camera to one end of a slider and hits an NC/NO/C 3-pin switch which triggers a 12V 8-Pin DPDT relay to reverse the motor polarity and move to the other end of the slider and trigger another switch. The camera keeps "ping-ponging" back and forth as it should. I'm basically following this example: http://cheesycam.com/cheesycam-diy-auto-reverse-polarity-motorized-video-slider-update/

Here is the wiring diagram from the cheesycam post:

The trouble is that I need to be able to control the speed of the camera, so I added a speed controller to the motor. The speed controller reduces the voltage to slow down the motor - which causes the relay to stop working once the speed/voltage is low enough.

Here is my wiring diagram:

Is there a way to retain the speed controller without reducing the voltage (and thus making the relay stop working)? Does it make sense to use a lower voltage relay (6V DC, for example) so it will work for a wider range of speeds?

I thought I could move the speed controller directly between the motor and the relay (basically use the relay's output as the input to the speed controller, and then use the speed controller output directly to the motor), but couldn't make it work.

Here is a related post regarding the same circuit I'm trying to build, but the answer uses a 3PDT relay (and plus I'm not able to read the wiring diagram there unfortunately): Adding Speed Control for a DC Motor

I not at all experienced with wiring circuits, so any help or ideas are greatly appreciated.

**UPDATE WITH FINAL SOLUTION:
@Charlie provided the solution after some back and forth. Here is the final working solution:

Ideally, this would be wired with a 3PDT relay, but all I had on hand was a 4PDT, so the last of the 4 relay switches was not used. This is working great, and the speed controller is now independent of the relay voltage, so the relay continues to work and reverse the polarity/direction of the motor even at low speeds.


texts: What is a good microcontroller for Ethernet applications?

texts: What is a good microcontroller for doing Ethernet applications?  Or do I just need a good Ethernet library to connect with an Ethernet MAC/PHY?


texts:
Well, I have a USB device (kindle) with the lock/unlock button broken. The Only way to unlock the device is to connect it to a computer (not to a charger) via USB.

Is there any way to modify one usb cable to emulate the computer connection to unlocks the device been away from a computer?

Thanks


texts: Downloading programs from Microcontrollers?

texts: So I'm trying to reverse-engineer a small PCB which has an ATMEGA48-15AT1 microcontroller on it. My question is, can a program, on said microcontroller, be downloaded and read as the C# code that its programmed in (e.g. through AtmelStudio) ?


texts: Losses over frequency for microstrip vs. coplanar waveguide

texts:
At mmwave frequencies, coplanar waveguide transmission lines generally have lower loss than microstrip.  What accounts for this, besides radiated losses?  Or is the difference mostly related to the radiated losses?
Also, supposedly at microwave frequencies (C-Band and below), microstrip has lower losses than coplanar waveguide.  What explains this difference between behavior at microwave frequencies vs. mmwave frequencies? Is it primarily a radiated loss phenomena as well that accounts for this spectrum dependent difference?
I know that tightly gap coupled coplanar waveguide is less affected by surface roughness than microstrip.


texts: When can a characteristic curve (here an amplifier) be considered linear?

texts:
I have built a difference amplifier and I have a pretty linear characteristic with a coefficient of determination of 0,9999478 (by a linear regression). Is it enough to say it's "pretty linear" (I don't want to make a bold claim but it's not very important in my paper) ?

The difference amplifier is for measurement and control in a DC DC converter. The amplification is approximately 100 times the input value, and the values should be used for stability analysis.


texts:
I'm doing a simple lab (I'm a hobby EE) to reinforce my ohm's law math and learn a little about how to do proper measurements with a multimeter.

I have simple circuit with a 2.2k ohm resistor connected in series with an LED. Everything works fine up to the point I go to calculate voltage drop across the resistor and LED.

My initial calculations only accounted for the 2.2k ohm resistor. As such I got the full voltage dropped across the resistor. However, when I measured the circuit for real I found the result to be nearly half of the input voltage, which would indicate to me

My math is wrong
There's resistance left unaccounted for

The only thing left to account for is the LED. What is the best method for determining the resistance of a simple LED? I tried doing what I do with resistors (hold it up to the probes with my fingers) but I don't get a proper reading. Is there a technique I'm missing here?


texts: Wild AC to DC for Arduino and high power leds

texts:
I've seen some similar posts but none did exactly match.

I'm looking to power a Arduino Uno and  1x 10W + 4x 3W LEDs (Using BUZ11 from Arduino output) from a very wild AC source which is on a very old 50cc motorcycle. The AC may drop below 6V and can go much higher. Also the alternator doesn't provide enough wattage from one coil. There is one coil running 6V 20W and one 6V 10W. How would you recommend doing this?


texts:
I have a general question regarding MOSFET Selection. I am trying to select a MOSFET for DC use. I am looking to replace a 5A 24V Relay with a N Type MOSFET.

The MOSFET would be driven from a micro so I would need a logic level gate. The micro is 5v Logic.

I am going to be mass producing these so cost is my main driver.

Most of the MOSFETs that I have come across do not have a DC area called out in the SOA curves. For instance the one I was potentially looking at was the IRLR3105PBF.

Datasheet here

Here are the params I looked at:

VDSS Max = 55V which is >> than my 24Vdc Bus so that is fine.

Power Calc -
5A*5A*0.37mOhm = .925W (High but I think a DPAK can handle that)

FIGURE  1 & 2 -
VGS @ 5V -> VDS = 0.3V @ 25C (but the graph 20uS Pulse I want this to be DC?)
VGS @ 5V -> VDS = 0.5V @ 175C (again I want this to be DC?)

FIGURE 8 -
Looking at VDS - 0.5V (Worst case) it only shows 1V. 1V can go up to 20A way more than I need for a 10mSec pulse. (I am actually confused on this should I just assume that I will have VDS of 1V looking at this?)

But then comes my main question I want DC where do I look for that?

Is this just a bad choice? (I get the feeling it is because no where in the data sheet does it talk about DC) What should I look for when searching Digikey?

TLDR How should I select FETs for DC use?


texts: How to open up serial terminal for my USB device converter (or, how to enable VCP in linux)?

texts:
I am using a new Cyclone V SoC board by Enclustra (Mercury+ SA2) mounted on their PE-1 BaseBoard.

To connect to the board serially on Windows platform, I have to connect the board which is detected as USB Serial Device Converter in the Device Manager. And, next, from the properties, I need to enable VCP. By doing this, now the attached board shows up as a COM port, which enables me to access it using a serial terminal such as putty. This works correctly.

I'm trying to do the same on my Linux system running Ubuntu 16.04. The device is detected as ttyUSB0. I have already tried the screen statement. The moserial GUI. Doesn't Work. How should I proceed from here? Below is a screenshot:

Thanks :)


texts: Tracing spike/surge on ac/inverter circuit

texts:
my friend has a sailing yacht with a 3000W inverter and a remote switch. When the ac circuit is switched to battery via the inverter all the dc powered navigation instruments power off before rebooting and resuming normal operations.
I have looked at the basic maths of the ac side and less than 1000W is on switched to take immediate power -eg fridge is plugged in and on but tv, kettle are off, some ac sockets may have random iPhone adapters plugged in adding to load but not consistently so don’t appear to be the source of the problem.
As my friend is neither electrically minded ( talk slowly I am a mechanical Engineer) or able bodied I have said I will try to determine the cause.
What is the best approach for investigating the issue, I have good practical electronics skills access to oscilloscope and multimeters signal generators etc but my experience is mostly building electronics projects and domestic electrical work not investigating this level of issue.


texts:
Why we see a spark when we connect a plug into an already switched "ON" socket? But I've also noticed that this isn't the case always, ie. sometimes when connecting a plug into a socket which is already "ON" it doesn't spark, while sometimes it does.

This question has been in my mind for some time, I've experienced it a few times in the past, but when I encountered the same situation today it reminded me of this old question in my head and hence I asked.

Any help is highly appreciated.


texts:
In our design used TRIAC to control the load, As per the product field test setup i should short the neutral and earth connect together also the digital GND is connected with chassis.

The input AC power for TRIAC taken from the UPS (the power used for control circuit through DC power supply), when I load the TRIAC 500 watts my input power from UPS going for TRIP, due to the earth leakage current settings.

my questions are:

Can I connect the AC INPUT power from raw GRID (without UPS) to LOAD the TRIAC? , Is it will affect or increase the earth leakage current or any damage will accrue?
If I use isolation transformer to isolate the neutral and phase and secondary neutral and earth tie together, Is it will help ?
Any alternate method will work out?

simulate this circuit – Schematic created using CircuitLab


texts: How to calculate the differential impedance for a stackup design

texts:
The design is basically a copy from a reference design. I used a few different tools to calculate the trace impedance with different results. While the manufacturer uses Si9000, the result does not match with what the other tools get.

The questions are:

Which of the results below is the accurate?
If the reference design is not that accurate in impedance control, how to evaluate the effect of the mismatch on the actual PCB it produces?

The questions are mostly on the inner layer differential impedance item [4] below.

Details:

In the list below, [1] is the reference design stackup information; [2] and [3] are the processes to get the result close enough to the reference design target so as to know the tool is valid; and [4] is the calculation in question because it is either 5% higher than the target or 10% lower.

[1] The reference stackup information is read from an original .brd file by an "Allegro Free Physical Viewer 17.2". The screenshot is as shown in the picture q1-pro-pcb.png  . As also noted in the picture, the subsequent calculations are on the: [2] top-layer single-end impedance; [3] top-layer differential impedance; [4] inner-layer differential impedance.
[2] Calculate the top layer signal end impedance: Two tools are giving Zo=48 and Zo=47. Assuming both are accurate enough.

[2.1] Using the "Saturn PCB Toolkit V7.04", set W=3.5, H=2, F=500MHz, T=1.05, Er=4.5, the result is Zo=48 Ohms. This is close enough to the 50 Ohms target. It gives an Effective Er=3.12.
[2.2] Using the online Montaro Impedance Calculator, choose Microstrip Zo.  Set w=3.5, t=1.05, h=2, Er=3.12, the result is Zo=46.3. Change to t=1.0, the result is Zo=46.9.

[3] Calculate the top layer differential impedance:

[3.1] Using Montaro, choose Microstrip Zdiff. Set w=3, d=6.5, t=1, h=2, er=3.12. The result is Zd=100.6.

[4] Calculate the inner layer differential impedance:

[4.1] Using Montaro, choose Asymmetric Zo. Set w=3, t=1, h=3, h1=10, er=3.12, the result is Zo=57.143. Then choose Zdiff from Zo, set Zo=57.143, d=7, h=14, the result is Zd=104.984.
[4.2] Using the "Polar Si9000 PCB Transmission Line Field Solver v7.1.0", set H1=10, H2=4, Er1=Er2=4.5, S1=7, W1=W2=3, T1=1, the result Zdiff=90.02. See the picture q42-polar-si9000.png  .


texts: Power input selector and regulator design improvement suggestions

texts:
I am building a power selecting/splitter module and would like to ask if there are any glaring ommisions or reccomended additions to the system.

I have two inputs which will get connected at the same time or either one of them depending on the setup.
If the 24v one is present it should have higher priority so I am using an MBR2045CTG Switch Mode Power Rectifier to select the higher voltage.

As outputs, firstly the unregulated output of the rectifier, and then I would need 12v and 24v. The values don't have to be exact on the decimal point. For that I plan on using two LM2587 Auto Buck Boost boards set to the respective values.

The LM2587: https://www.amazon.com/Converter-Electrical-converters-Regulator-DCCON-MS8/dp/B00LGJ48AC/ref=sr_1_3?ie=UTF8&qid=1482500052&sr=8-3&keywords=LM2587

Do you have any suggestions to improve the circuit?  Maybe diodes for each output? Voltage suppressors for the buck boost? Caps?

Thanks!


texts: Different voltage drop in serial and parallel circuit with resistor

texts:
I have a circuit powered by 9V battery, I'm using two 2V LEDs. If I connect the LEDs in series with 10k Ohm resistor, the voltage before resistor is 9V, after the resistor it's 3.3V and after the first LED it's 1.65V. Both LEDs are dim, since they are at voltage lower than they are supposed to. If I connect them in parallel from the resistor, after the resistor it's 1.65V for both of them, they are still dim.

How is this voltage difference possible? I am aware of the Ohm's law, but it still doesn't make any sense to me. In my mind, a resistor can't change it's resistance, it's 10k Ohms no matter what.

Q: How is it, that I get different voltage after the resistor, depending on how the LEDs are wired? Why isn't resistor's behavior constant?


texts: Does Camera Power Consumption Lower Without Output?

texts:
I have a camera with power consumption listed at 24 VDC +10% @ 1.5 A max.
That same camera has a built-in output for an external light, 24VDC @ 750 mA max.

Without the external light output, will my max power consumption be 750 mA max?

I keep hearing that current draw of the camera will remain @ 1.5 A max, however, I do not see why.

Model of the camera is a Cognex 7600. Below is a snip from the datasheet.


texts:
I'm using the lecture by Dave Wilson at TI to implement a BEMF observer.

I have the motor winding currents for phase A, B and C.

I also have the Bus Voltage

I also am in the stationary reference frame (I did the Forward Clark Transform), so I have Alpha and Beta.

I've also measured the winding resistance and inductance for each phase.

So, the idea is that you make a mathematical model of the motor, using an RL series circuit with a voltage source (which exists as the BEMF generated by the windings when you're driving the motor).  Then, you observe the voltage and currents directly (since my hardware allows for direct measurement of those two parameters).  Then, I'm supposed to sum the estimate of where the current vector should be and the actual observation of where the current is...This difference is an error signal that's fed through a PI controller, then inverted to create negative feedback, and is then fed back into the modeled motor...This signal MUST be the BEMF voltage vector, assuming that the other two components (the resistance and inductance) of the motor windings are correct.

Anyway, here's a block diagram of what it's supposed to be doing:

Where i'm getting into a jam is how to get the the exponential terms into my code.

Here's a snippet of the function that get's called to try and implement this...It get's called after every ADC conversion, which happens each time the mid point of the drive signal (~16kHz, although Dave's slides shows a 10kHz carrier...It doesn't matter).

How do I get the LPF into this code?  I've got the operating frequency and I have the inductance, so that means I've got the reactance...But, I'm not sure if this is something I can just hard code in, or if there's more to it than that to stay robust and future proof.

void Current_Observer(motor *c)
{
  uint16_t current_observer_p = 10;
  uint16_t current_observer_i = 10;

  uint16_t winding_voltage_estimate = (BUS_VOLTAGE + c->bemf_estimate)/MOTOR_RESISTANCE;
  winding_voltage_estimate = ??????LOW PASS FILTER GOES HERE ?????;

  winding_voltage_error = winding_voltage_estimate + c->motor_current;

  ///BEGIN PI CONTROL
  c->bemf_error= current_observer_p * c->bemf_error;
  c->bemf_error+= current_observer_i * c->bemf_error;

  c->bemf_estimate += c->bemf_error;

}


texts: How to stop capacitive buttons being triggered by acrylic sheet

texts: So I have a bunch of capacitive buttons sitting behind a large 50x50cm acrylic sheet and whenever I place there acrylic sheet over the buttons, they start triggering all by themselves. I can't figure out how to stop this. Any ideas?


texts: Is it 'normal' to use a DSP's internal timers to generate lower speed clock signals for audio codec sampling?

texts:
I'm currently working on a project that features a Blackfin BF592 processor (datasheet).

I'm trying to interface this DSP with a stereo audio codec (datasheet).

Originally, I assumed that this audio codec would have some high frequency clock signal (i.e. frequency much higher than the sample rate) that would likely be fed from some oscillator circuit. I believed that this input clock would be divided as necessary to get a lower clock signal (e.g. 44.1kHz).

However after looking through the datasheet of this codec, it appears that the expected clock signal inputs are meant to be 'exact' and relatively low frequency (i.e. 44.1kHz-ish). And because this chip is a delta sigma codec, it actually expects two sample rate related frequencies: the actual sample rate clock, and then a multiplier of the sample rate clock to achieve proper oversampling.

Because I plan on sampling at 44.1kHz, with a oversample rate of x32, I will need two clock inputs: 44.1kHz and a 1.411MHz.

So my question: is it standard practice to use a DSPs internal timers to generate these signals? Or would it be more common to have a dedicated IC generate these two signals?


texts: Starting FPGA project on Xilinx - trouble with some basics! Coming from Altera background

texts:
I'm just looking for a bit of help getting started with Xilinx FPGAs. Specifically, I'm looking for the analogue to Altera's HEX and KEY keywords which are peripherals (HEX LED display and a toggle switch, respectively).

Can anyone provide a relevant link or resource that could get me going?

Cheers


texts: Does a transformer work well below its rated input voltage?

texts:
I found myself answering a recent question that I now have doubts over. For a given transformer, is the output voltage proportional to the input voltage for all input voltages? So specifically if VRi is the rated input voltage, and VRo the  rated output, does x VRi = x VRo for 0 < x < 1? For example, will you get 0.6V out from a 240V /6V transformer if you input 24V only? Since transformers are complicated little things, I wonder if there might be non linearity especially with a small x .

I've found this and this question that initially seemed to ask what I wanted to know, but the actual answers drifted onto other matters.


texts:
I want to use a small slide switch to turn my circuit on and off so that the circuit draws no/very little power when off. The circuit will only draw a maximum of approx. 500mA @ 5V when on, but to my surprise the switch I want to use is not rated to this. So I decided to use an N-channel MOSFET to switch my circuit on and off. Part number for the MOSFET is DMN3404L-7. A bit overkill, I know.

Header P1 is the power supply header for the entire circuit.

I am wondering if this is a proper implementation of an N-channel MOSFET. In particular, is there a good reason why I should not connect the drain port to common ground as shown? Also would a P-channel MOSFET on the high side be better suited for this?


texts: How can I produce a fractal pattern on the oscilloscope using resistors, capacitors, op amps, MUX's, comparators, and other common circuit components?

texts: I found this online and as amazing as it is, I don't have multipliers so I can't build this. This spurred me to find other things that I could design on the oscilloscope using basic components. One idea I had is to make fractals. How can I produce a fractal pattern on the oscilloscope using relatively basic circuit components?


texts: Develop Software for Microchip ARM Controller in MPLABX?

texts: Is it possible to develop and debug software for a microchip ARM controller in MPLABX?


texts: Large range delay at medium frequency for MC

texts:
I have a program that varies the step time and duty cycle for a 6 step commutation sequence.  It takes an 8-bit ADC result and stores it as the TMR0 value, when TMR0 overflows, the ISR selects the next sequence.

I have 2 problems:

This only works at low INTOSC frequencies, where UART will not work, and
I don't get a large enough step range.

Any general ideas on how to create a larger ranged delay at a higher frequency?  My first idea is to use a nested loop, still using a TMR0 value, then putting that inside of a loop the steps the inverse of TMR0 times...


texts: Why doesn't the negative feedback current in an op-amp inverting amplifier drive the op amp into saturation?

texts:
I know the rule that states that the negative feedback will keep the difference in potential between the inverting input and the non-inverting input (almost) zero.
Now I just wanted to take a moment and imagine how the circuit does that with the inverting amplifier and I think I get myself very confused.
First I tried to imagine the voltages and current when the Vin rises a little bit above ground potential (as always) this will drive the output terminal towards the (-) supply by some amount.
And here it comes, Now the negative terminal should compensate this rise in Vin but when the Vout is driven negative now the potential difference across Rf increased (I imagine the current now is from Vin to Vout) which means that the V- will also increase and now I am in a loop the inverting terminal is now behaving like a non-inverting one (in my head.)
I don't know what I got wrong or what I didn't notice I think it's very trivial but I am stuck I would appreciate any clarification.


texts: Is it allowed / possible to OR two opamp-outputs?

texts:
See schematic.

As from what I have been able to read, coupling two outputs together is a Very Bad Idea. I yet lack the knowledge to understand why, though.

But; if one adds a diode in serial with each opamp-output, would it be possible for them to act like an OR-gate (so to speak), controlling the NPN-base? That is, if either U1 or U2 (or both) has a high output, and R1 is chosen properly, will the NPN-base be turned on here?


texts: Are there bridge rectifier chips that work at 40 kHz?

texts:
As part of a circuit handling signals from a sound receiver, I'm apparently in need of a bridge rectifier that works at a frequency of 40 kHz. I came across this thread talking about how most are only reliable up to 10 kHz. Are there ones that exist that work at this high of a frequency or should I try to find another workaround?
Edit: I have linked the wrong thread


texts: I have a heating element (essentially a very resistive wire) that has two threaded bolt-like connectors on each end.  I want to avoid soldering any components of the heating element, so I asked a friend what would work best for this situation, as the heating element need to be connected to a power supply.  He advised that I use two nuts on the bolt to hold what he called an "automotive connector" in place.  He didn't know the actual name of this part, but described it as a washer with an extension off of one of the edges, where a wire can be soldered.  I was hoping someone could tell me the name of this part, as I am looking for places to buy it.


texts: Sharp Infrared sensor-Filtering supply ripple

texts:
I am using Pololu's sharp infrared sensor board  part# GP2Y0A60SZLF and I am trying to minimize the noise caused by the sensor on the voltage supply as much as possible.

I have made a filter and voltage regulator circuit  as shown below,
The IR sensor and the filter PCB are directly connected together. The output is carried out via a wire  7" long from the filter circuit as shown to a main PCB that has another RC filter (R2,C10)

Here is the scope shot at the 6-12v supply terminal. The spikes below are 1khz, 46mv p-p.

What do you suggest to clean the supply line below?

I am also including the waveform on the sensor output.


texts: 16 Volt on a 12 Volt LM317 Regulated Power Supply

texts:
I recently purchased a 1,2-12V regulated power supply with an LM317 chip and accordingly, a 220V to 12V transformer.

Because I did not need the added functionality of the "logic pen" facilitated by an included IC, I unsoldered it only to find out that without it the power supply could be cranked up to 16 Volts (with no other modifications).

My first question is: How are 16 Volts possible if the transofmer is rated to output only 12 Volts?

My second question is: When trying to drive 96 standard 3,5V LEDs connected in parallel, I noticed that they were rather dimly lit, even when the power supply was set to max. Having found out that the power supply can only deliver a max of 2 Watts and accordingly 2/3,5 = ~571mA I was wondering what could be done to increase the maximum current it can handle seeing as the LM317 can handle a max of 1,5A.

Below is a schematic of the power supply (with the only difference that C1 & C4 are 1000uF instead of 680uF)


texts: Level shifting digital signals with a comparator

texts:
I'm trying to understand the voltage levels associated with a comparator used for level shifting digital signals. The comparator is the MAX995. The input voltage levels are +1.5V/-2V, and the output levels are +3.3V/0V.

Could someone explain to me what exactly is happening with the voltages at the positive comparator input when the a logic high and logic low are transmitted, respectively?


texts: Will adding a resistive load to a lighting circuit stop my electronic dimmer from leaking current to my LEDs?

texts:
I changed my bedroom lights yesterday for 220V 7W dimmable LED lights.
My bedroom dimmer is an electronic type (LightwaveRF).
In the pitch black, last night, I could see the lights faintly glowing/flickering slightly.
I wondered if adding a resistive load to the circuit would help prevent this? It seems like the dimmer is somehow passing current to the lights even when off?
I've found a resistive load on Amazon
Would this work? Or is there a better alternative fix? Thanks


texts: Reason for having a resistor at gate of MOSFET

texts: If the gate current i_G=0 then what is the point in adding the resistor R1? Here is the circuit diagram:


texts: Library of footprints for Cadence Allegro / PCB Editor

texts:
I keep having to design my own footprints for Cadence Allegro / PCB Editor even for standard parts. There are lots of libraries for schematic capture symbols but I am having trouble finding footprints.

Can somebody point me towards a library of PCB footprints?


texts: Can I use this transformer for a DIY spot welder?

texts:
I have the following transformer out of a UPS:

Is a good idea to use it in order to convert it as a Spot welder? I am worried about the flimsy cables on the High Voltage side.


texts: Estimating error due to Vref deviation on delta-sigma adc

texts:
I am trying to estimate the error caused by deviation on the reference signal for the following 22 bit Delta-Sigma ADC and high precision linear voltage regulator:

http://ww1.microchip.com/downloads/en/DeviceDoc/20001950F.pdf
http://www.linear.com/product/LTC6655

I've followed the design guide of National Semiconductor on "voltage reference selection basics" but although it is not mentioned anywhere I think the error estimation only applies for SAR ADCs (in my result, I have a typical error of 10.1 bits).

Hence my question, how do I estimate the error due to deviation in the reference signal of a Delta-Sigma ADC? I am measuring DC voltage (a battery).


texts:
I am trying to create outside lighting and using 6 identical LED light sources in a string. The 6 lights I am using are individually 11-16v 3W MR16 3W. I want to use a regular 110-120v AC input to power the lights.

The producer of the LED advises to use 12V or max13V for a single light. The light string is 50 feet long and so I want to stick to a chain setup and avoid parallel installation.

I am reading a lot about adapters and resistors but cannot find the right answer to this setup. Hopefully your knowledge can help me out.

My basic knowledge says I would need and 78v AC output.
Is this thought correct and how can I best achieve this?

Your help is greatly appreciated!


texts: PCB layout for 8-16MHz crystal very near WiFi module AND small DC motor

texts:
I'm designing an "Internet of Things" appliance where space and layout are constrained by mechanical and cost requirements. The main processor is a PIC18 and its crystal (probably 8MHz, maybe 16) is mounted close to some things I regard as "scary" from an EMI point of view:

(~5mm away) A (2.4GHz) WiFi module (a PCB-with-shielded-can-on-top style module which solders onto the main board - the "business end" is to the top left of the module so as far away from the µC and xtal as it can be).
(~10mm away) A small DC gearmotor (mounted a few mm above the board on a metal 'L' bracket which is grounded to the PCB).
(~15mm away) A3906 motor driver IC and associated power components.

I've looked over a few other "how's my crystal routing?" posts here and it seems like mine is probably OK (though I'd really welcome any criticism) but I am a bit worried about the nearby noise sources, especially as this is a solar + battery powered device that will be minimising power consumption as much as possible including minimising the power drawn by the oscillator.

I have given the crystal section its own ground planes and connected these to the bottom main ground plane at one of the PIC's VSS pins, so there will be return current on this pin but presumably not via any of the oscillator circuit.

OSC1 goes µC<>cap<>xtal and OSC2 goes µC<>xtal<>cap - is this OK?
Is the local ground plane around the xtal area going appreciably to increase the power draw of the oscillator?
Is the way I've connected the system & crystal grounds together sensible?
The top & bottom ground planes for the crystal are tied together with 3 vias but there is a return path that doesn't go through any of them. Is this "right"?
Are any of the above noise sources likely to be an issue and if so how might I mitigate this? (the rest of the PCB is full up, so "move it further away" isn't really an option)

2 layer board. Top red, bottom blue, white area around crystal & caps is a cutout from ground pours on top and bottom, returning via the via (ha) next to one of the two VSS pins on the PIC18 (other one is on the other side of the chip). White hatched is the top soldermask stop (motor bracket grounded to topside ground pour this way). 8 mil traces & .5mm via drills.

Below the crystal you can see the motor mounting bracket (red) and motor outline (cyan). Motor driver in extreme bottom right. BR corner of WiFi module to top/left.

Edit 0:

Edit 1:
Improved grounding around signal traces in bottom right area below motor.


texts: Issue with powering MP3 module with Amplifier

texts:
I'm not a electronics engineer/student, so please escuse me if my query sounds a bit naieve.

I have a Mp3+FM module (link) which I can power with a regular micro USB charger(or desktop USB). As the module cannot power a speaker I have attached a PAM8403 Class D Amp module (link) (i think it can take from 3.5 to 5.5 V).

To make this setup mobile I added a 18650 rechargable 3.7V 2200mAH battery (link) and a TP4056 1.2A 5V charging module(link). Now when I run the circuit with 5V external power attached to TP4056 it works well (thoe the volume is low and it takes few power cycles to start). But when I run it using only
 the battery, the module just keeps cycling the power (On/off..).

(Diagram 1)

I thought as my battery is a bit underpowered and TP4056 only provides 4.2V power I can add a step-up converter. So I added MT3608 DC-DC Step Up Converter (link) and adjusted it to 5V, 7V & 8V but none of it seem to work. Can you please let me know if I had missed anything ?

Unfortunately as I don't have any electronics background, I am not aware of how do debug (sorry for the software lingo) this issue. I do have a multimeter so I would really appreciate if anyone can point me in a right direction or jolt down some steps to do more investigation.

Update:
As requested these are the power specs of the various modules:

MP3

  Input Supply: 5V;
  S/N: 65dB;
  Distortion: 0.2%;
  Output: 550 mV;

PAM 8403

  3W Output at 10% THD with a 4Ω Load and 5V Power Supply;
  Speaker With: 4~8ohms, recommended: 4ohms Speaker Power: 2~8W

TP 4056 Battery Charger

  Based on TP4056 1A Standalone Linear Li-lon Battery Charger with Thermal Regulation chip;
  Preset 4.2V Charge Voltage with 1.5% Accuracy;
  2.9V Trickle Charge Threshold (TP4056);

MT3608 StepUp

  Integrated 80mΩ Power MOSFET;
  2V to 24V Input Voltage;
  1.2MHz Fixed Switching Frequency;
  Internal 4A Switch Current Limit;
  Maximum Output Current: 2A;


texts: What properties other than Henry and Current ratings should be taken into account when replacing inductors

texts:
I am in the process of upgrading some older circuits with newer components. One of which components is a 150uH iron core inductor. For reference, this is the part at DigiKey:

http://www.digikey.com/product-detail/en/6000-151K/M6021-ND/242072

The circuit that this inductor is in is a UV Lamp drive circuit that is powered by a LT1172 100kHz constant current driver. According to DigiKey, the resonant frequency of the inductor in the circuit is 3.2MHz, with a maximum current draw of 1.15A.

I imagine the resonant frequency is quite important, but can i use an inductor with a different harmonic perhaps?
Also, the quality rating DigiKey lists 20 @ 796kHz, could i choose an inductor with a lower quality rating because the circuit is running at a much lower frequency?
The DC Resistance is listed as 370mΩ max. I'm assuming that as direct replacement the DC Resistance is pretty important.
Is it important that the replacement inductor has the same core material? Will a ferrite core inductor suffice in place of an iron core?

I'm guessing that a lot of these properties are somewhat application specific. It doesn't seem like there are a ton of inductors on DigiKey that have the same set of properties.

What properties do i have some wiggle room on? I suppose the 150uH is pretty set in stone, and anything with the same current rating or above; other than that I'm in uncharted territory.


texts: Can RFI be radiated by connector wire even if shunted at opening?

texts:
Imagine a metal enclosure with an XLR connector. My understanding is that it is vitally important for pin 1 of the XLR (the shield) to be connected to the chassis with a very short conductor to make the shield (and connector shell) part of the chassis and shield everything from RFI. For just this reason, Neutrik connectors (like NC3FAV1) often have a little metal spike in one of the screw holes to make contact with the chassis. This is connected to pin 1 so that RFI is shunted into the chassis over what is only maybe 1-2 cm of metal.

The question is, if there is something connected to pin 1 like a long PCB trace, even if RF is shunted into the chassis as described above, can the presence of this trace still emit RF noise?

Similarly, if pin 1 was not shunted by said spike, and there was an unterminated PCB trace, could it emit EMI? (Not that I would do this, I'm just trying to understand how HF noise is radiated).


texts: What is the definition of Cload for MOSFET drivers?

texts:
I am currently looking at the LTC4444 MOSFET driver.

It states that the rise and fall time of the gate driver for 1nF load. Is this 1nF load the Ciss value or Qg/Vgs of the MOSFET?

Thanks


texts:
I was reading a book about PLCs (Programmable Logic Controllers).
I found this paragraph: "A ladder diagram is read from left to right and from top to bottom...  The top rung is read from left to right. Then the second rung down is read from left to right and so on....
Each rung must start with an input or inputs and must end with at least one output.".

In another source i found that a rung is a single line...

I am not sure if i understand well...
A rung can consist of multiple lines, right? For example is this a rung?

   A      B                  X
--| |----| |--+-------------( )-
              |
   C          |
--| |---------+

Let's say both A and B are 0 and C is 1.

In this case, how it is evaluated?
From left to right and from top to bottom:

It can not be:
1. Evaluate (A AND B)
2. Set output X
3. Evaluate C - can't go back?

I think it should be:
1. Evaluate ( A  AND B ) OR C
2. Set output X


texts:
On my multimeter I have two current measurement connection. One for the mA and one for the A.
On the ampere one there's a time limitation but not on the mA one. Also they mention in the manual a kind of "cooldown time" after the measurement for the A one. So, basicaly, probing with this input can really slow down my project. (max 15 sec every 5 minutes)

My question is, I have to switch to that A one for a 600-700mA current (mA input is 500mA), as it's not a "big" current, can I bypass this limitation ? Is it design for higher current only or any measurement done on that input ? It's a middle-end multimeter but even the online datasheet is not complete about what. (Was excepting a kind of measured current/cooldown time graph)


texts:
The 10 Gigabit Media Independent Interface (XGMII) is an interface standard that uses 72 data pins for both RX and TX. As far as I understand, of those 72 pins, only 64 are actually data, the remaining 8 being for error and flow control.

I haven't been able to find out what exactly those 8 pins are, and how they should be controlled. I'm considering writting a XGMII Verilog driver module but I cannot find the relevant specification.

What are the 8 RX and TX control pins for XGMII? Where can I find a specification? (Are there publicly available XGMII Verilog implementations?)


texts: Microprocessor & sub 2.4GHZ transmitter for underwater application

texts:
I am looking for a device that has following properties:

Can transmit data underwater (sub 2.5GHz,1-2m below surface)
Very small (max. 15mmx15mmx2mm)
In-built microprocessor
Able to read sensors

So far I found the XBee, which is too big, and the Bluegiga BLE121LR Bluetooth® Smart Long Range Module, which uses Bluetooth. I read that Bluetooth is really unreliable underwater. Is that true even for only 1-2m? http://www.silabs.com/products/wireless/bluetooth/bluetooth-low-energy-modules/ble121lr-bluetooth-smart-long-range-module

I have little experience when space becomes the limiting factor, that's why I am asking here.
Thanks!


texts: Purpose of 2 serial resistors on voltage divider

texts:
In the schematic/picture below, what is the purpose of 2 serial resistors for voltage divider? Temperature, thermal runaway, stocks, prices, or something else?

Thank you.

simulate this circuit – Schematic created using CircuitLab


texts:
I'm trying to figure out the dropout voltage for a 1.5V Output MIC37100

http://ww1.microchip.com/downloads/en/DeviceDoc/mic37100.pdf

From the datasheet above, it shows the dropout voltage for when Iout = 500mA to be 350mV Max.

This doesn't make sense to me because the Vin range is 2.25 Min. Which means that you're already going to have a 750mV dropout voltage. Am I reading this right? Is that how the drop out works?


texts: What sensor to use to track human presence outside of a room from inside

texts:
I would like to track human presence (or could also be sound). I will place these sensors inside my room and should be able to track these events outside of my room.

The door of my room is in-front of another door. I want to track if a person enters or exits that door (through sound or whatever). The catch is I want to do this from inside. The distance between the doors is just 1 meter. And the sound of the both doors can be heard from both sides when they are opened.


texts: VHDL 2008 - Use of custom floating package

texts:
I am trying to use the floating point package that comes with VHDL2008 to have a custom floating point type ; I need half-precision (16 bits) floating numbers.

Being unexperienced with VHDL, I folowed the "Floating point package user guide" found here. On page 7, it describes how to use "float_pkg" with custom bit sizes.

To test it, I made a simple file that I simulate with Modelsim.

When trying to compile it :

vcom -work work -2008 -explicit -stats=none C:/.../testfloat.vhdl

I get the error :

** Error: C:/.../testfloat.vhdl(32): (vcom-1443) Interface package "fixed_pkg" requires a package instance actual

I tried to Google that error since I don't understand it, but with no result so far.

Here is my VHDL file :

Library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_unsigned.all;
use IEEE.numeric_std.all;
use IEEE.fixed_float_types.all;
use IEEE.float_pkg.all;

entity test is
  port (
    data_A    : in  std_logic_vector (25-1 downto 0);
    data_B    : in  std_logic_vector (25-1 downto 0);

    data_out  : out std_logic_vector (25-1 downto 0)
    );

end entity test;

architecture rtl of test is

use IEEE.fixed_float_types.all;
package my_float_pkg is new ieee.float_generic_pkg
  generic map (
     float_exponent_width => 5,          -- 5 bits of exponent
     float_fraction_width => 11,         -- default will be float(5 dt –11)
     float_round_style    => round_zero, -- Truncate, don’t round
     float_denormalize    => false,      -- no denormal numbers
     float_guard_bits     => 0,          -- Unused by round_zero, set to 0
     float_check_error    => false,      -- Turn NAN and overflow off.
     no_warning           => true        -- turn warnings off
     );

begin

  process(data_A, data_B)
    variable data_A_float     : work.my_float_pkg.float(5 downto -11);
    variable data_B_float     : work.my_float_pkg.float(5 downto -11);
    variable data_out_float   : work.my_float_pkg.float(5 downto -11);
  begin

    data_A_float := to_float(data_A, data_A'high, data_A'low);

  end process;
end architecture;

The content of the process is not relevant for the moment.


texts: ATmega2560 I2C (TWI) assembler configuration problems

texts:
I am using ATmega2560 for testing an I2C code. I wrote subrutines in assembler
 for init, start, write, read and stop the I2C setup. The goal is that master writes 11110000 to a slave with address 1101000 (SLA+R/W): 11010000.
The code is given below:

.nolist
.include "./m2560def.inc"
.list
.cseg
.org 0x00
jmp inicio      ; PC = 0x0000   RESET

inicio:
    LDI R21, HIGH(RAMEND)           ;Set Up Stack
    OUT SPH, R21
    LDI R21, LOW(RAMEND)
    OUT SPL, R21

    CALL I2C_INIT                   ;Initialize TWI(I2C)
    CALL I2C_START                  ;Transmit START condition
    LDI  R27, 0b11010000            ;SLA(0b1001100) + W(0)
    CALL I2C_WRITE                  ;Write R27 ato the I2C bus
    LDI  R27, 0b11110000            ;Data to be transmitted
    CALL I2C_WRITE                  ;Write R27 ato the I2C bus
    CALL I2C_STOP                   ;Transmit STOP condition

HERE: RJMP HERE

;----------------------------I2C_INIT-----------------------------
I2C_INIT:
     LDI    R21, 0
     OUT    TWSR, R21           ;Set prescaler bits to 0
     LDI    R21, 0x47           ;R21 = 0x47
     OUT    TWBR, R21           ;Fclk = 50 KHz (8 MHz Xtal)
     LDI    R21, (1<<TWEN)      ;R21 = 0x04
     OUT    TWCR, R21           ;HEnable TWI (I2C)
     RET

;----------------------------I2C_START-----------------------------
I2C_START:
     LDI    R21, (1<<TWINT)|1<<(TWSTA)|(1<<TWEN)
     OUT    TWCR, R21           ;Transmit START condition
 WAIT1:
     IN     R21, TWCR           ;Read Control Register TWCR into R21
     SBRS   R21, TWINT          ;Skip the next line if TWINT is 1
     RJMP   WAIT1               ;Jump a WAIT1 if TWINT is 1
     RET

 ;----------------------------I2C_WRITE -----------------------------
 I2C_WRITE:
     OUT    TWDR, R27           ;Move the byte into TWRD
     LDI    R21,  (1<<TWINT)|(1<<TWEN)
     OUT    TWCR, R21           ;Configure TWCR to send TWDR
  WAIT3:
     IN     R21, TWCR           ;Read Control Register TWCR into R21
     SBRS   R21, TWINT          ;Skip the next line if TWINT is 1
     RJMP   WAIT3               ;Jump a WAIT3 if TWINT is 1
     RET

 ;----------------------------I2C_STOP------------------------------
 I2C_STOP:
     LDI    R21, (1<<TWINT)|1<<(TWSTO)|(1<<TWEN)
     OUT    TWCR, R21           ;Transmit STOP condition
     RET

;----------------------------I2C_READ------------------------------
I2C_READ:
     LDI    R21,  (1<<TWINT)|(1<<TWEN)
     OUT    TWCR, R21
WAIT2:
    IN      R21, TWCR           ;Read Control Register TWCR into R21
    SBRS    R21, TWINT          ;Skip the next line if TWINT is 1
    RJMP    WAIT2               ;Jump a WAIT2 if TWINT is 1
    IN      R27, TWCR           ;Read received data into R21
    RET

The code produces the flowwing compilation errors:

 I never could find the possible solution to make it work.


texts: Working with usb on stm32f103c8 bluepill

texts:
I want implement my bluepill as a midi controller from scratch(like register twiddling or using cmsis max in a text-editor with gnu-arm toolchain and makefiles) and I have been trying to find out resources on working with the usb peripheral. After extensively searching through the data sheets, I cannot find any proper resource on using the usb of the mcu. I even tried looking at the usb protocol specifications but I could not find much apart from intimidation due to information overload...
Tl:dr can't find any resource on how to implement usb on stm32f103c8t6 from scratch.


texts:
I'm trying to use an ATTiny84 pin to power an LED. I initially thought that I would get around a 3 V output at all voltages, but there is a graph in the datasheet showing that that isn't the case:

However, the graph stops at 20 mA. I might be using up to the maximum current output allowed from the pin (40 mA). Is there a way to figure out what the voltage would be at this current? Also, why didn't the designers put those values in the graph?


texts: Convert a ringing telephone voltage of 90V AC to 3.3V 1000mAh DC current so that it only triggers when the telephone is ringing?

texts: How can I convert and step down a ringing telephone voltage of 90VAC current to 3.3V 1000mAh DC current so that it only triggers when the telephone is ringing? Bridge rectifier? Inductor? Step Down Converter?


texts: Is it possible to obtain an approximate guess of what the thermal resistance of a device (i.e. a power MOSFET) would be in a vacuum based on the ambient thermal resistance value provided in the datasheet? Obviously it would be higher, as the only way to carry away heat is through radiation, but how much? What would be a reasonable safety factor to use when estimating temperature rise of a power circuit in a vacuum environment?


texts:
I have this component and it does not shows ANY identification (which I never saw before).

Can anybody shed a light on what it can be?

The left/right side is metallic, the rest looks shiny plastic (?)

The dimensions are about 10 mm x 7 mm x 5 mm (L x W x H)


texts: Why does this Motor change speed when polarity is changed

texts: I have disassembled an old tape deck to use its motor for a home project. Turns out that depending which wire I connect to + or - on my power source the motor goes a lot stronger/faster. So far I have only encountered motors that change direction if I switch + and - around. Why is this one different?


texts: ADC Value from load cell to MSP430 not correct

texts:
I have a 1000lb load cell (LC302 from omega) being fed through an INA125 OPAMP then to the ADC10 of a MSP430G2553 with 2.5V as reference.

2.5V is coming out of the OPAMP that's being fed into the load cell, and it's being amplified to 2.5V (actual is about 2.49V) from the INA125 which then feeds the signal into the MSP430. I have set the ADC to REF2_5.

When I tried to apply a load (my own weight, 175lb) to the load cell, it would only go up marginally, maybe up to 32. When there's no load, it would normalize to 22. I'm expecting the value to be close to 170, but clearly it isn't. Why might this be happening?

I tested this set up by substituting the load cell with a potentiometer. I fed the 2.5V ref from the INA125 into the POT and then fed the signal into the ADC. I twisted it from left to right and it was giving me a lower bound of 0 and a upper bound of about 1010. This should mean that the setup is okay.

Advise on how to diagnose would be appreciated.

Note: if this matters, I am powering everything with a switching regulator (MAX756 set for 5V, boosted from 3V (actual is about 2.66V))

Edit: I thought about this a little more, I forgot to account for the accuracy of the measurement. With a zero balance accuracy of +/- 2%, the 22 value read seems to make sense. However with a +/- 0.5% accuracy, with 175lb, I should still be expecting about 170 steps.


texts: Broken headset, repaired, but microphone doesn't work on computer, does work on phone

texts:
I have a headset for my desktop computer. It's an analog device with two 3.5mm jacks, one for the headset, one for the microphone. It also has inline volume and microphone toggling.

By wire was chewed up by a cat and torn between the headphone jacks and the inline controls.

I have repaired the headset by re-soldering the wires. It works fine...sometimes.

When I plug the headset into one phone, and the microphone into another, I can play audio onto the headset and record my voice just fine on the other phone, with no crossover.

However, when I plug the cables back in to my computer, the headset works just fine, but there is nothing but what sounds like some background interference coming from the microphone when I test it. I have tried it with two sets of audio jacks on the system, both produce the same result.

Why would it work on the two phones, but not on the computer? This isn't making much sense to me and I hope it would to someone else.


texts: Triggering the thyristor for the single phase AC voltage controller in MATLAB

texts:
I have been trying to study the output characteristics of a thyristor based single phase AC voltage controller through the model in the picture attached. Could anyone tell me what I could do to achieve the output voltage(vout) characteristics by firing the thyristors at 30 degrees? I have used the pulse generator to trigger the thyristor with a supply frequency of 60 Hz.

I first set the period with respect to time base i.e; 0.0166 sec( because the frequency is 60 cycles/sec. therefore 1cycle or period=360 degrees=0.0167 sec)
then I enter phase delay(ie;firing angle) as
(x*0.0167)/360 where 'x' stands for your desired firing angle in degrees.
if firing is required for negative cycle, then
phase delay= ((x+180)*0.0167)/360.


texts:
From a bespoke board I'm receiving 18vdc that I need to switch. This 18vdc will usually be +18vdc but at times can be -18vdc. The load is .35A. The polarity is being changed via a H-Bridge and unfortunately it's not possible to do the switching before or using the H-Bridge (I can't change the existing board).
I'd like to switch with a logic level (5vdc ideally) signal, and I've only got a single GPIO to play with. At present the best plan I can come up with is to use a non latching EMR, but would really like to avoid this due to noise which will be factor.
Switching at no more than a 2-3Hz at most.
Is there another solution I'm overlooking?


texts: Is microUSB connector used for charging inherently lighter than USB-C solution?

texts:
Let's say you have a device that uses USB just for charging, like a rechargable light torch (like this: https://www.ultralightoutdoorgear.co.uk/equipment-c3/lighting-c30/head-torches-c162/petzl-bindi-headlamp-p8589 ).

Does using microUSB instead of USB-C save weight (even when it is one gram)?
And if they weight the same, would a solution with USB-C be able to use features like USB-PD?

I happen to own the torch and given the small size of the battery, I am always puzzled by the fact that it takes about two hours to charge. Is it because it has no circuitry in order to save weight and the lowest current is used?


texts: how to drive high amp stepper motor 4 wire without driver

texts:
I was wanting to use this motor:
https://www.circuitspecialists.com/nema_34_step_motor_85bygh450A-08.html
rating shows: 4 amps and 1.05 Ohms
which would be 4.2V?

and possibly wanted to use this power supply:
https://www.circuitspecialists.com/12-volt-8-amp-power-supply.html

it has an adjustable output Voltage control, which I believe I should adjust to get the V- and V+ to be 4.2V based on the motor.

I have previously controlled a stepper motor with the big easy driver from sparkfun: https://www.sparkfun.com/products/12859
I would set M1, M2, or M3 HIGH or LOW to microstep then pull step low and high to step.
The power supply Im looking to use doesn't have those input pins that the driver had and my understanding get a little unclear at this point.
 My question is how can I control the motor with a microController?

will I need to use transistors between the V+ and the motor to control it in one direction? Would I need transistors between V- and the motor also to control direction?
Or should I be looking for a driver still?
The part about looking for a driver that confuses me is that the driver I have used in the past had Voltage inputs to the board then the inputs from the MC would control the motor wires, but this power source has inputs for the motor wires but it doesnt seem to have inputs to control via a microController, so I am definitely misunderstanding something there


texts: I am using a MQ135 gas sensor in my project. It takes a max of 200ma and I have connected the Arduino to a battery so I can disable it when needed to save battery. I am using a transistor for that but noticed I get a voltage drop of around 0.7V so I only have 4V left at the sensor, which is not enough. Is there any transistor / FET available with a very low voltage drop so I can power and control my sensor without any problems?


texts:
I'm designing an inverter for trapezoidal control of a 500W BLDC motor, using DRV8301 for the gate driver. My switching frequency is 10Khz, Vdd is 48V, and Imax=20A. I've been trying to calculate the power dissipation in the FET's based on a few preliminary FET choices. One FET is the STB46N30M5. This FET is overkill for the application, but even with a lesser FET, the switching losses are huge - larger than the conduction losses. My calculation was as follows:
$$ Q_\mathrm{tot} = Q_\mathrm{GS}+Q_\mathrm{GD} = 95\,\mathrm{nC} $$
$$ R_\mathrm{ds} = 40\,\mathrm{m}\Omega $$
DRV301 average gate current is 30mA, divided by 6 MOSFETs:
$$ I_\mathrm{gate} = \frac{30\,\mathrm{mA}}{6} = 5\,\mathrm{mA} $$

$$P_\mathrm{sw} = \frac{1}{2}V_\mathrm{dd}I_\mathrm{o}f_\mathrm{sw}\frac{Q_\mathrm{tot}}{I_\mathrm{gate}}$$
$$P_{sw} = \frac{1}{2}\times48\,\mathrm{V}\times20\,\mathrm{A}\times10\,\mathrm{kHz}\times\frac{95\,\mathrm{nC}}{5\,\mathrm{mA}}= 91.2\,\mathrm{W}$$
$$P_\mathrm{con} = I_\mathrm{ds}^2R_\mathrm{ds}=16\,\mathrm{W} $$

The switching time is 19uS, which is quite long. Possibly using 5mA is incorrect, but using peak drive current doesn't seem logical to me.

$$ t_\mathrm{r} = \frac{Q_\mathrm{tot}}{I_\mathrm{gate}} = 19\,\mu\,\mathrm{s} $$

Do these values seem reasonable? Do I just need to find a beefier gate driver?
Thank you for any tips.


texts: lower current than expected through simple circuit powering laser diode

texts:
I have a circuit I designed for a raspberry pi to turn a laser off and on. I designed it to supply approx 22mA but it's barely getting 11mA. I've tried numerous tests but I can't figure out what's wrong

Circuit:

Vcc = 5V, GPIO BCM 21 = 3.3V, voltage loss across laser (L1.V) = 4V

For that circuit, I tried to get R2 with the eq
$$Vcc−I2R2−L1.V−Q1.V_{CE}=0 \\
R2 = \frac{1}{22mA} (5V - 0.02V (negligible) - 4V)$$
which gave me $$R2 \approx 49\Omega$$

Using that, I've tested these values
$$
\begin{align}
I_{R2} &\approx 10.8mA (!) \\
I_{R1} &\approx 1.8mA \\
L1.V &\approx 4.6V \\
Q1.V_{CE} &\approx 0.02V \\
\end{align}
$$

edit updated L1.V from 4 to 4.6
update the laser isn't just a simple diode, it has integrated APC

Datasheets
2n4401 npn bjt
syd1230 laser (link is to HML1230 docs because SYD1230 docs do not appear to exist and laser closer resembles HML1230 in appearance, ie. has focusable
 acrylic lens)

I've looked over all the data sheets (the whopping 2 of them), rechecked calcs, design... I can't figure out what I didn't account for. Why isn't \$I_{R2}\$ closer to the expected 22mA