texts: Are USB power banks protected from time-limited short-circuit with a huge capacitor?

texts:
I would like to put a huge capacitor (>=0.1F) to provide power when my bank switches from to external power source to battery (unfortunately it cuts off output for about 2s).
I need an undisturbed power source for my raspberry pi and a huge capacitor is the simplest solution that came to my mind. But I have no idea whether I'd destroy my bank with this kind of treatment or not.


texts:
I am interested in designing a BLDC motor driver capable of operating at low supply voltages and relatively high currents (i.e. a device capable of operating with a 3V minimum supply and a phase current > 4A would be ideal). My preference is to use only N-channel MOSFET's, for the usual reasons they're preferred for BLDC motor drivers. To achieve this, I have been investigating half bridge pre-driver IC's. After an exhaustive search (on digikey), I was unable to find any half bridge gate drivers (i.e. both high and low side N-MOS) capable of operating below ~5V (the lowest I've found is the DGD05473, which can operate at 4.5V with an external bootstrap diode).

I am wondering if there is some fundamental reason why these gate drivers have a 5V minimum that I'm missing? Out of thousands of options I expected to see at least a few which could operate at a low supply voltage. If so, does this essentially relegate me to using P-MOS to switch on the high side, or would it be feasible to build out my own discrete high side N-MOS gate drive circuit (inexpensively and in a small form factor).


texts: Trying to figure out how to power this heart rate sensor circuit

texts: I'm using an MSP430 as my mcu, and a nokia 5110 lcd display. Both these devices work off of 3.3V. The LM324 opamps work with a minimum of 3V, so using 2xAA batteries will be cutting it close. I could use a 9V battery for the heart rate circuit portion, and use a 3.3V regulator for the msp430 and LCD, but regulating 9V->3.3V will waste a lot of energy. What is the best way I can go about this? I am open to using a different op-amp.


texts: How to learn dsPIC UART program based on PIC USART experience?

texts:
I've learned USART of PIC16F883, and I want to learn UART of dsPIC33FJ64MC802.(Actually I need to learn dsPIC, but I learned PIC16F883 first since I thought it's easier to learn.)

Here's my circuit diagram of PIC16F883 in Proteus simulator(I can send messages to virtual COM port):

And here's the code:

void main() {
     char ch;
     UART1_Init(19200);
     Delay_ms(100);

     while(1)
     {
             if(UART1_Tx_Idle())
                 UART1_Write_Text("OK2\r\n");
             Delay_ms(500);
     }
}

I have found some resources teaching dsPIC UART, but I can hardly read the sample code. And I don't know how to what's the circuit of the sample code and how to learn. Can anyone provide some help? How can I learn dsPIC UART based on the what I've learned from PIC?

1.UART Example for DSPIC33 (DSPIC33FJ128GP802)

2.Setting up RS232 transmission on a dsPIC

3.dsPIC33F UART transmission problem

4.Thread: [dspic33] UART - Transmits ok, but receives garbage

EDIT:

An easy way to run dsPIC UART is using mikroC for dsPIC, it's very user friendly. It provides sample code and the code is easy to understand.


texts: MOSFET broke after attaching capacitor bank

texts:
I have a solenoid that has a coil resistance of \$0.3\Omega\$ and accelerates a steel projectile here. I've posted the schematics below.

Normal Version that acts as a control

The GPIO8 goes to 5V to switch on the MOSFET and turn it off when the projectile is detected with the optical sensor. And it works just fine.

Next, I tried it with 10 supercapacitors that are connected in series. I charged it up to 27 volts.

Version #1

When I powered up the circuit, there was a spark when I connected the capacitor ground to the MOSFET's ground. The Gate and Source circuit should have been opened because when I first connected it, GPIO8 is at 0v.

After some troubleshooting, I found that I killed the MOSFET.

I believe there are 2 possibilities at play.
First, it is possible that the parasitic capacitance on the MOSFET may have caused an oscillation and thus, voltage spike. I added R2 to increase the fall time slightly and thus, reduce the charge. See the video here (Skip to 4:00)

Not only is the parasitic capacitance causing an oscillation, but another factor is also that I actually have an RLC circuit here. My load is a solenoid and my power source is my supercapacitors. Thus I added D2 so that it doesn't start cycling back and forth. I also replaced the MOSFET with a new one.

Version #2

And yet the same thing happened, GPIO8 is at 0v before I connected the capacitor but the MOSFET completed the circuit anyways and broke, this time it is caught on camera.

So that's where I'm at now. My capacitor is charged to 27V and since I've added the components to get rid of oscillations, I can't think of anything else. According to the datasheet, the breakdown voltage of the IRF3205 is at 55v and I'm well below that.

Any bright ideas?


texts: Charge pump has an unexpected voltage drop with a 1K load

texts:
I have been reading this tutorial about how to design a charge pump with BJTs.
I have built my own one, that aims to produce ~-6V instead of the above's -5V. I'm able to reach -6V when no load is connected. However, when I connect a 1K resistor to simulate a load, I get a voltage drop of ~2V, that is, the circuit output stays at ~-4V. The schematics is below:
Edited to match the 7V that my battery provides

The output is the negative terminal of C2, and RL the resistor that simulates the load. The circuit is supposed to drive ~45mA through Q1 when charging C1, and ~87mA through Q2 when discharging it into C2 and RL. The clock signal is 10kHz, 7V.
What I do is calculate how much C1 will discharge when clk is low. Clk stays low for \$\frac{1}{10kHz\times2} = 0.05ms\$. If \$C1\$ is fully charged, then \$V_0*e^{\frac{-t}{RC}}\$ with \$V_0 = -6V, R=1kOhm, C=1uF, t = 0.05ms\$, the C1 voltage should be ~-5.7V, however in my case it drops to ~-4V. In addition, if C1 is discharging faster than I think, I should see spikes with my oscilloscope, but I se a flat line at ~-4V. In addition, if I put a smaller load, it directly drops to 0V.
What am I missing?
Notes:

I'm assuming that C1 charges almost instantly when Q1 is conducting, since there is no resistor.
The example design I'm reading puts a resistor (R5) in the Q2's emitter to limit the current and make Q2 independant from beta. I want to do a simpler design for now, so I don't use it. I limit the current with the Q2's base resistor (R7).
I don't understand very well what role the currents set by the BJTs play in this design.

EDIT
The voltage at Q1's emitter when Q0 is off is ~7V. When Q0 is on, it drops to ~1.7V
EDIT2
I have tried the experiment @Math Keeps Me Busy did with the parameters I have:

The square signal parameters are: off = 0V, on = 7V, no delay, rising and falling time set to 1s, period 100uS (10kHz) and on time = 48uS (I substract 2 to compensate rising and falling edges and get a 50% duty cycle signal)
I have tried this schematics with \$C1=1uF, C2=10uF\$ (what I currently have) and with \$C1=10uF, C2=100uF\$. These are the results:
C1=1uF

C1=10uF

Important: However, I have tested \$C1=1uF\$ in my breadboard connecting the C1 input directly to the 555 timer, which provides a ~7V , ~10kHz square signal, and I don't get the same results as the simulator: I get the same voltage drop to ~-4V with 1K resistor.
Notes:

I can't test \$C1=10uF\$ physically because I don't have 10uF non-polaryzed cap.


texts: Powering a 12V and a 9V device from single power supply with LM7809 voltage regulator

texts:
I have a little electronics project where it would be nice if I could power two devices from a single power supply (12V switching adaptor).

One of the devices is a high power LED with 350mA, 12V and the other is a 9V lower amperage device.

Using a 12V, 1A power supply, would the circuit below work to regulate down the voltage?
Will the LM7809 will have problems with the load if I switch off the LED?

Sorry if the questions seem silly, it is the first time I am dealing with that kind of stuff.

EDIT:
I'm aware that the LED is not added correctly. This was more for illustration really. It is a high power 10W RGB LED that I was hoping to connect with this constant current circuit


texts: wrong voltage when splitting from 5V to 3.3V

texts:
I am trying to connect the MMA5452Q accelerometer to arduino on 5V (later it will be substituted with attiny85, hence the 5V voltage).
It works just fine when i supply arduino's 3.3V. When i try the 5V supply and split it with resistors (R1, R2, R3) the accelerometer does not work any more.
I measured the voltage of the circuit. It is 1.1V but MMA5452Q requires 1.6-3.3V. I was trying different combinations but i am afraid that doing it blindly at some point I will just burn the chip.
What is going on here? Could anyone tell me how to connect it so the voltage maches? (And how to calculate this - so I dont need to ask every time :)  )

P.S.
R5 and R4 are pull ups required by accelerometer's documentation. Works when the circuit is powered with 3.3V

P.S.S.
I am not an electrical engineer. I am hoping that this question is not terribly stupid.

simulate this circuit – Schematic created using CircuitLab


texts:
I have set up Timer 1 Channel 1 for pwm mode 1. I used the STM32CUBE to generate code for MDK-ARM. Parameters as below-

CLOCK: 160 Mhz
CLK_DIV:NONE
PRESCALE: 3
PERIOD:3999

Period value for channel 1 is 1999 for 50% duty cycle.

I have verified the parameters by looking at the registers in a debug session.

This is giving me output at 10 kHz as expected (confirmed on scope). However... there is a glitch. Every 200 milliseconds or so, the output goes to a low level for a short period( couple of milliseconds). If I change output frequency to 20kHz, the interruption gets shortened to 100 mS, exactly half. I am not updating the timer parameters at all (so preload does not matter). Changing the channel replicates the issue on the other channel. No other code is running. No interrupts. Why is this happening? I would very much appreciate some help. I will be able to post some code tomorrow, but since it is CUBE generated, I assume it is correct.

Rough outline:

Setup GPIO
Setup Timer 1
Start pwm on channel 1
Infinite loop.


texts:
I am currently working on a project when I need to step down 12V to 6V. This 6V will serve 3 motors. The motors pull 4 amps, 1.5 amps, and 1 amp when they are each at full power.

I am having trouble finding a regulator to step the voltage to 6V while still being able to handle high currents.

In addition, the battery is not attached to an alternator. The battery will slowly lose voltage.

What options do I have? The simpler the better!


texts:
I am currently studying The Art of Electronics, third edition, by Horowitz and Hill. Appendix C.4 Resistor types says the following:

The usual choices for general-purpose use are metal-film  (axial-lead) or thick-film (surface-mount) parts. Thin-film  surface-mount resistors offer improved characteristics (accuracy, stability, and ability to operate in cryogenic environments).

Why are thin-film surface-mount resistors particularly suitable for use in cryogenic environments/conditions? I know that there are some optoelectronic devices that require cryogenic conditions to operate, so I'm curious about this.


texts: Understanding Responsivity of an IR sensor paired with a black body IR emitter

texts:
I'm building an air quality measurement system with the following components:

IR Dual Channel sensor by Pyreos
Axetris IR Balck Body emitter

Reading the sensor datasheet I've seen there's the Responsivity expressed as 150.000 V/W at 10 Hz.
Now, I was trying to figure it out how this value is translated on my specific case.

According to Wikipedia

  Responsivity measures the input-output gain of a detector system. In the specific case of a photodetector, responsivity measures the electrical output per optical input.

The datasheet of the emitter says that the Optical output power between 4 μm and 5 μm is 4.2 mW. Just for the sake of this example, let's say that the same power is seen by the sensor (of course it is not).

Do I need to check now on the graph of the Responsivity the value for my Frequency, which is, if the wavelength is 4.5 μm, 66.6 MHz? And, with this value, to know the output voltage do I need to multiply the optical power seen by the sensor (that we have supposed to be the same of the emitter, 4.2 mW) to find out the final output voltage of the sensor?

Does it make sense and How the input voltage affects the output as soon as on the datasheet is written: "Output voltage normalized around mid-rail"?

Thanks


texts:
I would like to be able to run this motor clockwise and counter-clockwise and speed control.

I have 3 phase power 380 volts (AC) and this is a 110 V DC motor (max 40 amps).

What is the correct type of controller for this?


texts:
I know this is very basic, sorry. But what material do I need to have enough resistance to boil water with the 120V household outlet?

Thank you


texts: Differential equations for a transformer

texts:
I would like to set up differential equations (please, no phasors in answers) for the circuit below:

So far I have two equations:

where I assume perfect magnetic coupling (so I treat M as a known constant).

Initial conditions are that at time=0, both i1 and i2 are zero.

The system is underdetermined and I have to put one more equation. What equation is it?

My intention is to solve for i2. Again, please no suggestions with phasors. I am looking into a more general case where v1 isn't necessarily a perfect sinusoidal function.


texts:
I'm experimenting yet again with the following audio mixing circuit:

On the scope with signal gen as source, everything looks great. When hooked up to the input of a mixer with a laptop as the source, I get the following audio noise (recorded with no audio playing):

https://drive.google.com/open?id=0B-CfAXQUjGL5T2tNNjluQzdnUmc

The ticking and staticky blips/bloops are coming from the circuit, the slight background hum is not. Is this noise caused by opamp oscillations?? Or what is causing it?

What I've tried: I get the same results plugged into the mixer's unbalanced input or when adding an extra network to balance the output and using the mixer's balanced input. I've tried removing the virtual ground and using a dual +-6V supply, the noise is still there. It seems to be coming from the NE5532 opamps, adding more buffers increases the noise. Initially the diff amps were biased by the virtual ground, and the NE5532's were biased using a voltage divider. Scrapping the voltage divider and connecting everything to virtual ground reduced the noise by about half, but it's still present. The entire setup is on a breadboard, but I've tried gluing an NE5532 on it's back and wiring it that way and the noise is still present.

Update: After trying different scopes and getting some external feedback I was able to see what I'm dealing with at the output that is causing the noise. Here are the scope results:

Zoomed In:

The spikes are pretty much dead on 30Hz (with 60Hz power grid) and zooming in they're a relatively constant frequency of around 27-28MHz, but sometimes measured around 21-22MHz. Any idea what might be the cause? Some type of antenna pick-up?

I've tried unplugging or cutting power to everything in the vicinity and beyond, changing outlets, adding/removing filtering surge protectors, the only thing that seemed to affect it was when the light switch, which switches the adjacent outlet on/off was switched on, the 30Hz peaks increased significantly, whether anything was plugged into that outlet or not. But nothing eliminated the spikes.


texts:
I read that the intersection of a row and column represents a bit, and if an intersection is linked with a diode the corresponding data output line goes low or 0. But why?
Take the following figure for example. An input of \$ A_2 A_1 A_0 = \{0, 0, 0\}\$ gives a 0 (LOW) out of a's NAND gate and 1 (HIGH) out of b-h's NAND gate. The low potential of a's NAND gate sinks all current in the circuit, and there will be four parallel currents from \$ 5V \$ voltage supply, each through \$ R_3, R_2, R_1, R_0 \$ into a's NAND gate. For \$ D3 \$ to be 1 (pulled HIGH), the impedance of a's NAND gate has to be significantly larger than \$ R_3 \$ keeping \$ D_3 \$ at a potential close to \$ 5V \$.
Current through \$ R_2 \$ will then get a diode voltage drop (e.g. -0.6V) before reaching a's NAND gate. Assuming all four pull-up resistors have the same value, then voltage difference between \$ D_3 \$ and \$ D_2 \$ is just that diode voltage drop (i.e. 5V vs. 4.4V), but a 4.4V will not get interpreted as a LOW (0). So instead of outputting 1011, I should get 1111.
Above is my interpretation which make sense to me, but it got to be wrong.
To output 1011, there has to be no current through \$ R_3, R_1, and R_0 \$, pulling \$ D_3, D_2, and D_0 \$ to HIGH (5V), leaving only current running through \$ R_2 \$ and the diode into a's NAND gate. The voltage drop of \$ R_2 \$ and the diode takes \$ D_2 \$ low.  This has to be what's happening but nothing sense to me: a's NAND has the lowest potential in the circuit and sinks all current through all four pull-up resistors.


texts: Batteries connection to load and charging port for DIY bluetooth speaker

texts:
What I'm trying to accomplish is buidling a battery powered bluetooth speaker. In order to do it I'm using the following parts:

    Bluetooth amplifier module
    3x Samsung ICR18650-26FM Batteries
    Battery protection board
    Generic 24w (12v 2A) wall charger

Now, I actually have some doubts about how to properly connect the battery protection board to the bluetooth board and to the charging port. Would it be sufficient to connect all of them together in a T-like connection? I'm pretty sure that the wall charger will output enough current to power the board and charge the batteries at the same time since I will not blast it to full volume all day while charging it, but is it the correct way to connect them anyway?


texts: How to determine sign of voltage with a current source in series

texts:
Current flows in the same direction (or CCW) for both circuit A and B. In respect to ground, circuit B is just a rotation of circuit A along the same path - these two circuits (A and B) should be entirely identical, regardless of the rotation positions of these elements. Why is there a change of sign in voltage (i.e. +12V for B and -12V for A)?

Circuit C is a flip of circuit A. Current in A and C flows in the opposite direction - CCW for A, and CW for C. Their signs of voltage should flip as well. Why is that is the simulation I get the same voltage sign (-12V) for both nodes (A and C)?


texts: Termination resistors for RAM vs drive strength

texts:
I'm considering using a RAM IC (S27K HyperRAM from Cypress).
The layout guidelines document suggests adding series resistors "if necessary."
However, the datasheet for the device has a register where you can set the "Drive Strength." The registers allow for a wide variety of values: 19, 22, 27, 34, 46, 67, 115 Ohms.
Does the "Drive Strength" (output impedance) work similar to adding a series resistor for signal integrity purposes? Does this mean I could skip the series resistor and just program the correct value?


texts: Choosing the right motor to control mirrors

texts:
I am developing a computer vision project which involves developing a system using mirrors for pan and tilt movement of the camera field of view. Mirrors are independent of each other regarding movement. I am confused on which kind of motor should be best suited for rotating the mirrors.

I have already tried stepper motor and digital servo motor for this application with not so good results. With servos control and speed are easy but update frequency is not so good (50 Hz). I am using Pololu Maestro controller to control servos. Since this is comparable to time between two frame capture, motors do start-stop sort of motion which kills smoothness. With stepper motors, control is difficult as compared servos. With no obvious reason to me, when I send commands to stepper motors, it gives very bumpy motion.

I am looking for motors which can be updated almost every 10ms with a resolution of around 0.1 degrees. I also want to control parameters of rotation like speed and angular acceleration.

One similar system is shown on Youtube: https://www.youtube.com/watch?v=vabC62F56q4


texts: Will a low power factor busniess load upstream of my home cause a low power factor supply to my home?

texts:
If a business near my home has a low power factor of say 0.80 will my utility company also penalize my monthly charges because of the low power factor? Or stated another way, how does a utility company know who on the common distribution line is causing the low power factor?

Please provide answer with supporting calculations. I think only customers with poor power factor have to pay because the each of the loads on a distribution line are in parallel and the data collected at each meter is unique to each load. Correct?


texts: Unified Driver model for low speed and high speed microcontrollers with limited and good memory

texts:
I am trying to develop an experimental RTOS. I am stuck in the driver layer design. I want to make the driver layer libraries friendly for the other layers but then again I would like to have high performance.
  I have narrowed this down to a mixture of 2 approaches. The first is to have a structure for the controller with callbacks as elements.
 For eg:

struct peripheral_controller {
    int32_t (*init) (struct peripheral_instance_regs *peripheral_instance_regs);
    int32_t (*isFull) (struct peripheral_instance_regs *peripheral_instance_regs);
};

The second approach is to have helper macros which take the peripheral_instance_regs as arguements.

For eg:

#define isFull(reg)
 (reg&0x01 == 1)

Is this the right approach? Will it confuse the users of my library? The problem with the callbacks as I see is in the interrupt routine where I would not want to call any functions.


texts:
I'm currently converting an arcade board into a console, and I've been using an original Xbox 360 power supply with it, as it provides 5v and 12v. I thought it would be neat to build a soft-power circuit so that I can hook it up to an arcade button to power it on.

The Xbox 360 power supply provides constant 5vSB.  It provides 12v when 5vSB goes to a control/Enable pin.  So I built the following circuit connected to the 5v line and ground line, with the output split to the arcade board and the control pin:

This doesn't seem to work.  Pressing the button has no effect with the arcade board plugged in.  With the board disconnected and the power supply running "dry", pressing the button causes the light on the PSU to go green to indicate 12v momentarily, before fading back to the standby yellow.

Should this circuit work as depicted, does it require more components for my specific application, or am I barking up the wrong tree?  I've had a look around for specific examples on this, and I can find a fair bit of information about hooking up devices electrically similar to the 360 to ATX supplies (can't post the links because of low rep) but not so much for going the other way.

EDIT: "Questions on the use of electronic devices are off-topic as this site is intended specifically for questions on electronics design." – Andy aka, Sparky256, Peter Smith, uint128_t, Daniel Grillo

Except my question WAS regarding electronics design, I even linked to schematics ¯_(ツ)_/¯


texts: Simple current limiting on linear regulator

texts:
I'm building a simple 9v linear supply using a 7809. The transformer is capable of the 300mA that might be drawn (guitar effects supply). I'm looking for a a simple way of limiting the output current. The regulator has a inbuilt current limit of course but that leaves me with a choice  of 500mA or 100mA - too much or too little. Any suggestions? Putting the regulators in parallel seems wrong as it relies on them being very closely matched as the load is variable, but maybe that's a workable solution?

Edit: Should have said that I'm thinking about a through hole device - My experience predates SMD. I'm just getting back into design after a few decades away and I'd like to avoid surface mount for this project, but realise it may not be possible.


texts: Do I need a Schottky diode as a flyback diode with PWM @ 30khz?

texts:
I use a regular diode (1N4007) as a flyback diode for a 250ma 5v fan. My transistor is a 2N 3904 and the PWM generator is an attiny85:

I use this one because originally I was switching the PWM signal at low frequency (<1000hz).

I was able to ear a high pitch noise because the PWM signal was in the audible range. I decided to raise the PWM signal to 30khz. It seems to be working fine, I don't have a good scope to see the signal and most importantly, I can't hear the high pitch switching sound anymore.

But after watching the video from afrotechmods (https://www.youtube.com/watch?v=LXGtE3X2k7Y) he says that we need a Schottky diode when we are switching at >1khz.

Should I de-solder my diode and replace it with a 1N 5817?

Thank you


texts: DC Motor Controller: hacking it bidirectional?

texts:
I just picked up two of these DC motor controllers (https://www.amazon.ca/Controller-Yeeco-Universal-0-01-1000W-Generator/dp/B00RZ97DDQ/ref=sr_1_10?dd=1QzB1w0bE3cxmYrmXew-NA%2C%2C&ie=UTF8&qid=1548387512&sr=8-10&keywords=dc%20motor%20controller&refinements=p_90%3A11828088011).

which indicated in the title a "Reverse".  Unfortunately it now seems that this was cut off text, only referring to the reverse polarity protection.  Is there any way to hack this device to get bi-directional performance?

Unfortunately I don't have a datasheet, but I assume most of these devices operate in a similar manner.  Is there any way to proceed?


texts: finding the output resistance of npn current mirror

texts:
I have the following BJT based current mirror

for part a, I used an approximate analysis illustrated below:
\begin{equation}
V_{B2}=0.7V=V_{C2}\\V_{BE1}=V_{B1}-V_{C2\:}\rightarrow V_{B1}=0.7+0.7=1.4=V_{C1}\\V_{BE3}=V_{B1}-V_{E3\:}\rightarrow V_{E3}=1.4-0.7=0.7V\\R=\frac{V_{E3}}{I_{E3}}=\frac{0.7V}{10\mu A}=70K\Omega
\end{equation}
Now for part b, to find the output resistance, I must use the small signal equivalent circuit. That is done by opening the current source and attaching a test voltage vo to the output. The equivalent circuit is displayed below:

simulate this circuit – Schematic created using CircuitLab

Here is my mathematical analysis for the small signal circuit:
\begin{equation}
v_o=r_o3\left(i_o-g_{m3}v_{\pi 3}\right)+R\left(i_o-g_{m3}v_{\pi 3}+\frac{v_{\pi 3}}{r_{e3}}\right)\\re-arranging:\\v_o=i_o\left(r_{o3}+R\right)-\left(g_{m3}\left(r_{o3}+R\right)-\frac{R}{r_{e3}}\right)v_{\pi 3}
\end{equation}
Now using the v_pi3 loop of the emitter of Q1 and R we get:
\begin{equation}
v_{\pi 3}+R\left(i_o-g_{m3}v_{\pi 3}+\frac{v_{\pi 3}}{r_{e3}}\right)=0\\re-arranging:\\v_{\pi 3}=\frac{R}{Rg_{m3}-\frac{R}{r_{e3}}-1}i_o
\end{equation}
Now substituting we get the final Ro as:
\begin{equation}
\frac{v_o}{i_o}=R_o=r_{o3}+R-\left[g_{m3}\left(r_{o3}+R\right)-\frac{R}{r_{e3}}\right]\left(\frac{R}{Rg_{m3}-\frac{R}{r_{e3}}-1}\right)\\now:\\r_{o3}=r_o=\frac{V_A}{I_o}=\frac{40V}{10\mu A}=4M\Omega\\r_{e3}=r_e=\frac{\alpha V_T}{I_o}=\frac{\left(0.99\right)\left(25mV\right)}{10\mu A}=2.5K\Omega\\g_{m3}=g_m=\frac{I_o}{V_T}=\frac{10\mu A}{25mV}=0.4mS
\end{equation}
Substituting the corresponding values, I get Ro to equal:
\begin{equation}
R_o=116M\Omega
\end{equation}
Now I tried to verify my results, so I decided to simulate my circuit using LTSpice. Here is my schematic:

Below are my DC operating point results, they do seem close to my hand calculated values:

Now utilizing the AC analysis to find Ro, I get that Ro=83M Ohms as displayed below:

Can somebody please tell me why am getting such a big difference between my calculated and simulated values for Ro?? Please help me figure out if there is something wrong with my analytical equations or the way I set up my circuit in LTSpice. Thank you for your help in advance.


texts: Change a quartz clock timebase by changing the frequency of the quartz crystal oscillator?

texts:
I've been doing some research on rewiring clock circuits for a project, but I'm new to these types of pulse-counting circuits.  My question at this point is:  If I replace the existing quartz crystal oscillator in a clock's timebase generator circuit with an oscillator of a different frequency, will the timebase change?  My goal is to make clock circuit with a shorter or longer space between pulses - making the clock's "second" shorter or longer.  Is there a smart way to do this without use of arduino or additional stepper motors?  Quartz clocks are fascinating so far- I look forward to learning more.
Thank you for any input!


texts: How to measure ac Power using a micro-controller?

texts:
I want to measure AC power of any general device such as TV, laptop etc using a microcontroller. My MCU is ARM Cortex-M TM4C1233H6PM.

I am using ACS712 current sensor to measure the AC current and then using an optocoupler to isolate it from my MCU. After which, it is fed to the ADC of my MCU and it's value measured.

My problem is with voltage measurement. I do not have access to many transducers and voltage measuring IC's in my area. Here is what I have though so far along with my questions related to it:

Use a transformer to convert from 0-220V AC to 0-5V DC and then feed it to my MCU's ADC using another optocoupler.But my questions are these:

1)Won't my voltage measured, be in a smaller range (0-5V DC) then my current measured in AC and the power will come out wrong?
Also, since my voltage is now measured in DC, how can I calculate the AC power?

2)How can I find the zero crossings and phase difference (theta) to measure P=VIcos(Theta) in both current and voltage?

I know my questions may seem rather lengthy but I really do need your help.
Thanks for any help!


texts: How can I design a light-weight, on-board battery & charging system for a self-charging robot?

texts:
My project involves the robot navigating to its charging station, docking, charging, then resuming whatever it was doing. The robot is a hexapod with 18 leg motors, 2 camera motors, and will be operating on an NVidia Jetson Nano (which shouldn't use more than 5W according to the website).

Since there are so many motors, I'm planning on a 5-6S li-po or li-ion. I expect the system to use around 10-30W while operating. I want to keep it compact, but at the same time I don't want to have to manually plug the robot into a balance charger. The charging station design I have in my head consists of 2 metal contacts on either side, which connects to some charging circuit. The charging circuit needs to be able to charge the batteries without powering off the robot.

I've done quite a bit of research to the best of my ability into products that might solve this problem, but I'm afraid I either haven't found anything or haven't been able to understand anything...

I don't want to have to design / fabricate the circuit if I have to, since the bot catching on fire would be many $$$, but I am capable and willing.

Do such charging modules exist? How do engineers in the autonomous robotics industry solve this issue?


texts:
I'm studying Fault Analysis Using Symmetrical Components and I have doubt over the single Phase to Ground Fault.

On the book is written that generally Is and It are equal to 0 during a single-phase fault ground, and I really don't get the reason behind this statement.

The line prior to the fault event is supposed to be symmetric and connected to a load,  therefore after the fault I don't get why Is and It should be equal to 0. I would say that Is and It are affected by the fault but not necessary are equal to 0 and their value depends on the characteristic of the load (i.e if the load is grounded or not).

Furthermore, if we suppose that the system is not grounded (So R is very large), how does the fault evolve?

Hope that my questions are clear.
Have a good day!


texts: Failover Management from AC to DC and DC to DC

texts:
I'm working on a project that has a high availability requirement. As such, I must maintain a power supply output of 12vdc ~1a (ideally 13.5vdc ~35a). The 1a option will sustain the core equipment, whereas 35a will maintain everything

Currently, we have the ability to use an AC to DC converter, OR a DC supply (Battery/Alternator/etc.). In order to meet the new requirement, I need the ability to transfer from an AC input source to a DC input source, and back.

I've included a simple diagram below showing what I need. Both the 120v AC and 12v DC inputs will be connected at the same time, but with the default power coming from 120v AC. In the event either is unplugged, it will fail-over to the other. If AC is ever connected, it will run off of AC.

In short, an off the shelf battery backup would function just fine for this - however I would need to find one that offers high amperage DC outputs vs the AC outputs.


texts: Why not run high power truck-mounted electronics from the truck's engine?

texts:
At Burning Man, I see a lot of "art cars" based on internal combustion engine platforms using generators separate to the original vehicle's engine to power their LED displays and sound systems.

Why do they do this? A typical truck engine might produce 200-400kW and even an extremely large LED array and sound system would only consume a few kW at most. Wouldn't it be simpler and more efficient to upgrade the original vehicle's alternator to supply the required power rather than adding a whole additional engine?


texts: There is a way to write into FIFO on both clock edges?

texts:
Im using Lattice ECP3 FPGA, didnt found any information about it on the internet.
I have ADC which providing me 12bits data on both clock edges, so I used Lattice High Speed I/O Interface:

This Interface latching the ADC data on 24bit bus which compound of the positive edge data (lower bits- 11:0) and negative edge of the data (higher bits- 23:12).
my next step is to transfer all this ADC data to FFT block, problem is the FFT need to work on the 12bits data coming from the ADC and not the 24bits, so I need to seperate the data to 2 and send on every rising edge of clock another half of the data, and its important not to lose any sample.

So I already have a working design, I did 2 FIFOs one for the positive edge data and second for the negative edge data, created mux which change its state evey rising edge clock, and when I want to read the data from the FIFOs to the FFT block, I taking one sample from the 1st FIFO and 2nd sample from the 2nd FIFO and so on... I have working synthesis and debuggin:

as you can see the input to the FFT block (dire) gets the adc_data_posedge/negedge_buff as described.
but I have strong feeling that this way of implementation is not the right way to make this design.
I read that using 2 FIFOs for the same input block could make sync problems and so on..

It could be better if I could take the ADC data bus of 24bits and write to 2 cells of the FIFO at a time in the rising edge of the clock. This way ill create 12bit width FIFO and write to 2 cells at a time and dont need to use 2 FIFOs.
there is a possible way to do it?

another way to ask my question is, lets assume you have to design architecture which takes DDR ADC data and store it in the FIFO and then use the FIFO output as input to FFT block.
how would you do it?


texts:
I connected STM32 F334R8 microcontroller to L298 H-bridge. I made some measurements. The problem is output signal on L298 has quite slow slopes and is not as sharp as input signal. I do not understand why the distortion occurs. As you can see the frequency is very low - only 10 Hz.

Pink color = L298 output signal,
Yellow color = L298's Enable pin (STM32's PWM output),
Green color = L298's Input 1 (STM32's output),
Blue color = L298's Input 2 (STM32's output),

Input 1 and Input 2 determine direction of output current.

Also when we increase the frequency of PWM to 25 kHz and change duty cycle dynamically to achieve stepped sinusoidal signal, then output not always follows the input:

Not sure are the distortions showed on 1 and 2 related.

Note 1: Oscilloscope waveform acquire is in Hi-Res to average signals.

Note 2: On PWM output (yellow) I am generating abs(stepped_sin(x)). Then to make stepped_sin() on the L298 output I am changing Input 1 and Input 2 (just inverting current direction).

I'm just curious what's the reason of such strange behavior.

L298 logic supply voltage is 5 V, power supply voltage is 8 V. Output load is 4Ω power resistor.

I have already checked L298 datasheet and typical PWM switching frequency is 25 kHz. Also input's logical high starts with 2.3 V. My microcontroller uses 3.3 V logic so it should be sufficient, isn't it?


texts: Context Information Saving on microcontrollers?

texts:
I make a search for context information saving method in microcontrollers (especially PIC), and the only thing i found is a patent of the "tamper resistant microprocessor". According to the patent a microprocessor save a contex information for one program whose execution is to be interrupted and the execution of that program can be restarted by restoring the execution state from the saved context information.

link: http://www.google.com/patents/US20050166069

Is this what i am searching for? And if this is correct and i have understand correct this method is used for example in interrupts when you save the registers values that you need and probably the interrupt routine can change and when you return to the normal execution of the program you take back the saved values? Or when you pop a value to the stack that indicates an address that start a piece of code and when you return from a call instruction you retrieve this address??


texts: Why doesn't a resistor on the non-inverting lead of the op amp affect dc offset (non-inverting amplifier)?

texts:
Why doesn't a resistor on the non-inverting wire of the op amp affect dc offset (non-inverting op amp)?
And does it have any effect on the dc offset of the inverting amplifier.

The reason I ask is because I tested this by simulating a non-inverting amplifier and the result was: no effect on the dc offset.

But I expected change in the dc offset as we model the dc offset source voltage as a dc voltage source attached to the positive terminal of the op amp. And so if there is a resister attached on the same wire than naturally some voltage should drop on that resistor. And thus the voltage see by the positive terminal of the op amp should change.

Why is this conclusion not correct and also explain the "no-change" in the dc offset. ty.


texts: Bidirectional 5V-3.3V level shifter and ADS1115 resistor implementation reduction

texts:
I’m using the ADS1115 with 5V because my measuring device provides 0 to 5V measurements but since the microcontroller is not tolerant to 5V, I need to shift it down to 3.3V.

I plan to use the BSS138 which in a popular configuration uses two 10K resistors to do so (R1 and R2 for one line and R3 and R4 for the other in my case).

The configuration on the right is for one device and the basic single configuration. The datasheet for the ADS1115 calls for pull ups in the range of 1K to 10K in the SDA and the SCL lines.

Lower values more power consumption, faster speed, higher values lower power consumption, lower speed, as far as I understand. Power and/or speed are not a concern.

My questions are

can I delete R5 in SDA and R6 in SCL and connect those pins directly to the High Level (HL) side of the shifter since it already has 10K resistors?

And better yet delete the 10K resistors (R2 and R4) without a connection to 5VIN?
And by doing so, R1 and R3 become the only pull ups?

I’ve read that   for 5V a good pull up resistor is a 4.7K and for 3.3V is around 2.?K.

If not, can I substitute the two 10K resistors (R2 and R4) with a 5K
resistor (4.7K for standard value resistor)?

How would you minimize
the use of resistors and have a reliable design?


texts:
This might be a newbie question, but I have always heard these terms interchangeably and never given it another thought. Recently I have seen them used differently in data sheets for a board I am designing and I am unsure what the distinction is between the two.

I assumed they both meant to just have it connected to a solder pad that goes nowhere. Is this incorrect?


texts:
In many applications, when a PWM signal is converted to an analog signal, they use a second order low pass active filter cascaded with a low pass passive filter, like the one shown below,
(from microchip https://www.microchip.com/developmenttools/ProductDetails/MCP1630RD-DDBK3) page 16/30,

In the attached circuit, I did not understand the usefulness of R28 and R35. Why do we need to create a voltage divider of V=0.18, is this voltage needed as an offset or it has other role in the circuit ?


texts: If during a short circuit, the resistance becomes negligible then what is the reason for getting the wire heated?


texts: Is the TPS54202 buck converter a good solution to pass the FCC SDoC?

texts: I want to design a PCB with the ESP32-WROOM module which has bluetooth. I want to pass the FCC verification. I would use a linear regulator, but it makes too much heat. My input is 14V car battery, output 3.3V, 0.5A peak. I've decided to give a try to TPS54202 as it's EMI friendly. The ESP32 says it can take up to 80mV ripple, so with a proper design, ripple should be fine. I'm just not sure about the EMI of TPS54202.


texts: What is Ethernet diff. pair referenced to between connector and magnetics

texts:
This is a little bit confusing part. I clearly understand that in ethernet cable fields are coupled between wires of differential pair. On PCB on IC/PHY side it is also known that differential pair fields are coupled to ground (reference) plane - coming from that, that on PCB diff. pair is actually just two single ended transmission lines close by.
And then there is this confusion land where cable connects to PCB and goes to transformer...
To what are the diff. pair lanes coupled to ? To ground, but why would they, as magnetics on both ends of cable give then isolation. Or do they still couple to each other ? If so, then every Zdiff. calculation tool is unusable as those assume some reference plane.


texts: Voltage Regulator reverse current protection

texts: Do I need a diode for reverse current protection using the ADP7142? I haven't found any information in the data sheet.


texts:
TLDR: what are the potential issues with boosting a 13V power source using a boost converter (6A) to say 16V, and then reducing it to 12V using a 6A step down regulator?

I am trying to power a 12V circuit off a 12V car/marine battery source. In the circuit is a 12V LCD screen (2.5A) and a 12V data overlay device (0.2A). The manufacturer of the overlay specifically states the device requires tightly regulated 12V.

When I use a typical step down regulator, there is a large voltage drop, which I understand is a function of the regulator (since the battery max voltage is around 13V). At 13V the voltage drops to 11.3, I want to avoid this to protect the overlay. The other issue with this setup is that the voltage swings as the monitor powers up, lights up, goes into standby etc, again which I want to avoid.

Note, would prefer to use off the shelf parts or modules as I am not an engineer.

Any advice much appreciated. Cheers


texts:
I have a Pi Zero which i need powered by a large lithium ion/polymer battery. I would like to avoid paralleling 2 or more cells because if balancing issues causes a fire, certain chestnuts will most definitely be roasted ;) (the device is on the underside of my bike). So ive been looking at a few 5000mAh+ batteries but they generally seem to come without protection circuitry (which i am unsure of how to approach that issue).

The battery im looking at:

LP7249135 - 6300mAh - 135 x 49 x 7.2mm (http://www.lipolbattery.com/li-po%20battery.html)

Currently im using an Adafruit Powerboost 500 charger to boost the voltage to 5v and charge the cell. It does provide over-charge protection and the like but i doubt that would be enough to connect a raw unprotected cell?

How would you go about adding protection circuitry and how do you know what circuitry you need for specific batteries?

Bearing in mind i have simplistic knowledge of circuitry


texts: Is there a circuit element which dissipates energy but does not act as a resistor?

texts:
I know this sounds a bit weird, but is there a circuit elements which dissipates energy if a current flows through it but is not a resistor?
In other words, is there an energy sink which does not alter the properties of the circuit?


texts:
I have a STM32F429 Discovery and wants set a PWM to toggle led with period of 1 second using Timer 1, channel 1.

So, I follow this equation:

My clock APB1 is set to 1MHz.

So by my calculations I got a value for the Prescaler = 19.

PWM_Frequency = 1Hz;
Timer_Clock = 1MHz;
Timer_Count = 49999;
RCR = 0;

And for the pulse 50% I use:

pulse_length = ((TIM_Period + 1) * DutyCycle) / 100 - 1;
pulse_lenght = 24999;

But not works, the Led blinks very faster.

Follow my code:

static void MX_TIM1_Init(void)
{

  TIM_ClockConfigTypeDef sClockSourceConfig;
  TIM_MasterConfigTypeDef sMasterConfig;
  TIM_OC_InitTypeDef sConfigOC;
  TIM_BreakDeadTimeConfigTypeDef sBreakDeadTimeConfig;

  htim1.Instance = TIM1;
  htim1.Init.Prescaler = 19;
  htim1.Init.CounterMode = TIM_COUNTERMODE_UP;
  htim1.Init.Period = 49999;
  htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
  htim1.Init.RepetitionCounter = 0;
  if (HAL_TIM_Base_Init(&htim1) != HAL_OK)
  {
    _Error_Handler(__FILE__, __LINE__);
  }

  sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL;
  if (HAL_TIM_ConfigClockSource(&htim1, &sClockSourceConfig) != HAL_OK)
  {
    _Error_Handler(__FILE__, __LINE__);
  }

  if (HAL_TIM_PWM_Init(&htim1) != HAL_OK)
  {
    _Error_Handler(__FILE__, __LINE__);
  }

  sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
  sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
  if (HAL_TIMEx_MasterConfigSynchronization(&htim1, &sMasterConfig) != HAL_OK)
  {
    _Error_Handler(__FILE__, __LINE__);
  }

  sConfigOC.OCMode = TIM_OCMODE_PWM1;
  sConfigOC.Pulse = 24999;
  sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH;
  sConfigOC.OCNPolarity = TIM_OCNPOLARITY_HIGH;
  sConfigOC.OCFastMode = TIM_OCFAST_DISABLE;
  sConfigOC.OCIdleState = TIM_OCIDLESTATE_RESET;
  sConfigOC.OCNIdleState = TIM_OCNIDLESTATE_RESET;
  if (HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_1) != HAL_OK)
  {
    _Error_Handler(__FILE__, __LINE__);
  }

  sBreakDeadTimeConfig.OffStateRunMode = TIM_OSSR_DISABLE;
  sBreakDeadTimeConfig.OffStateIDLEMode = TIM_OSSI_DISABLE;
  sBreakDeadTimeConfig.LockLevel = TIM_LOCKLEVEL_OFF;
  sBreakDeadTimeConfig.DeadTime = 0;
  sBreakDeadTimeConfig.BreakState = TIM_BREAK_DISABLE;
  sBreakDeadTimeConfig.BreakPolarity = TIM_BREAKPOLARITY_HIGH;
  sBreakDeadTimeConfig.AutomaticOutput = TIM_AUTOMATICOUTPUT_DISABLE;
  if (HAL_TIMEx_ConfigBreakDeadTime(&htim1, &sBreakDeadTimeConfig) != HAL_OK)
  {
    _Error_Handler(__FILE__, __LINE__);
  }

  HAL_TIM_MspPostInit(&htim1);

}


texts: high voltage igniter for carbon arc lamp

texts: I know how a carbon arc lamp works, but knowing that an arc lamp of inert gas, ignited by a discharge of high voltage that ionizes the gas inside, I wonder if it would be possible to cause the ignition of an arc lamp with carbon electrodes by high voltage discharge instead of the separation of the electrodes ...


texts: Will my 555 timer circuit work the way I want it to?

texts:
Essentially, I am trying to implement a safety system for another project of mine. I am running a very high current through a rather large solenoid and want to ensure that a failure in its control circuitry does not result in a hot and dangerous mess.
I decided to use a 555 timer in its monostable configuration, after scouring the internet for a while I found a circuit that would output a set pulse length, regardless of the trigger length. (Ie. if the trigger length is longer than the output, the output will not be held high for the duration of the trigger, and if the trigger length is shorter than the output, the output will stay high for the duration of the set output length.)
The trigger is just a pushbutton, and the desired output length is around 1 second, (This is just over the time it takes for the solenoid do complete its function). The output goes to a 150R resistor then the base of a Bc337 NPN transistor, which switches the relays for the power to the solenoids circuitry. Although one relay is shown, I plan to implement one for the overall circuit power and one directly switching the power to the solenoid. The relays are 893-896H1CHD00112VDC, automotive relays from Mouser.
Long story short, will my circuit maintain its output length for all durations of the input length (within reason, the button will not be held for minutes on end).
More Info
The original circuit activated a solenoid on the button press and pushed a metal rod into a furnace for melting. After having the issue where the button was left on, completely melting said solenoid, I felt it important to add a safety circuit. A sensor was added to ensure that the circuit only ever worked while a rod securely seated in position. The 555 timer as intended to activate the solenoid for just enough time for the rod to be injected, while ensuring it was fully injected. The short pulse length sent from the 555 would also prevent a sensor or circuit failure from keeping the solenoid on, thus preventing another solenoid meltdown.
The idea for the circuit was to simply cut the power using the relay, so that when the button was pressed and the sensor was being triggered the solenoid would activate. The sensor circuit is very simple, and by cutting the power I could control all the solenoids at once without much difficulty, while also being able to add more solenoids in the future.
As the device will be in a rather dirty and hot workshop, the main failure states of concern would be; a blocked sensor, a false trigger (accidental press), components overheating/melting, the rods getting stuck, etc. I assume my 555 timer circuit will solve most issues as the solenoids would never be on for long enough to cause damage, allowing us to fix/unblock issues without the risk of catastrophic failure while allowing workflow to continue.
Note:

Only one relay needs to be rated for a high current but I have multiple already on hand
The solenoids circuit used to be triggered by a button and is now triggered via a sensor, so the additional circuitry isn't an inconvenience
I need to be able to re-trigger the timer after the output pulse has ended
The specs of the NPN and the relay in the diagram are not correct
The relays already have a diode built in

This is what I decided on:

All suggestions welcome, including complete redesigns if they would be a significant improvement. (preferably without a microcontroller)


texts: Implementing Processor Core for Cache Module in Verilog

texts: I have written a simulation module for a Direct Mapped Cache (consisting of data, tag, and valid rams and cache controller) in Verilog. I now want to implement a Processor Core/Driver (also in Verilog) which will provide read, write and other instructions to the Cache Module for reading/writing data. I'd be thankful for providing any help in implementing this processor module as I have no clue where and how to begin.


texts:
DS18B20 temp sensor IC Dq pin is connected to PSEN of controller in my application.

But in datasheet its mentioned that its connected to I/O port.

And second doubt is how I/O port senses temp? It should be connected to ADC pin of controller.


texts: AC detection for switching to battery source

texts:
I am designing a DC-powered ceiling fan. Fan is working on AC and I convert it into DC when light is out; we attach a 12V battery so that fan runs continuously.

I want to make a circuit which senses that AC power is gone and automatically switches fan supply to the battery sources.


texts: Is a 5.5V to 15V GPIO a suitable controller for a 120V/30A relay?

texts:
I'm trying to create a simple computer-controlled switch for some speakers that plug into my home 120V outlets.

I was thinking I could cut a surge protector or extension cord open, and wire this relay to the cables.

I'd want to then plug this controller into my computer, and then write some simple driver that would let me turn the relay on and off.

I have no experience with relays. I read up on them and know that's what I need, but I don't know how to tell how much Amperage or Voltage you would need to use to power the change between an open and close circuit here.

Controller specs:

Processor:  ATmega32U4 @ 16 MHz
RAM size:   2560 bytes
Program memory size:    32 Kbytes
Motor channels: 0
User I/O lines: 15
Minimum operating voltage:  5.5 V
Maximum operating voltage:  15 V
Logic voltage:  5 V
Reverse voltage protection?:    Y

Relay:

American Zettler, Inc.
AZ2280-1A-120AF RELAY;
POWER;
MINIATURE;
30A;
SPST;
120VAC;
1 FORM A;

Given the specs of the relay and the controller.. Would this work? How can I tell?


texts: Current controlled switch with negative current?

texts:
I am trying to create a current controlled switch, which opens only at negative current, I tried this approach:

Wswitch com no Vcurrent negative_switch
.model negative_switch CSW it < 1nA ih=0 ron=1n roff=1g

but, I got error:

unrecognized parameter (<) - ignored

Any idea? how can use less than in the mode above?

EDIT

I tried to flip the switch as below but worked only at positive value:

Wswitch2 no com Vcurrent negative_switch
.model negative_switch CSW it=1nA ih=0 ron=1n roff=1g


texts:
I have to describe methods how one can determine the parameters of a DC-Motor by meassuring them. In my problem, I have to actually to determine the parameters for two motors, that is why everything is bold (I only need to know the method for one motor). I know that one could try to use parameter identification by comparing simulation data to measurements, but I have to do it experimentally.

The model that I have is the following:

$$\boldsymbol{u}_{\text{a}}=\boldsymbol{R}_{\text{a}}\boldsymbol{i}_{\text{a}}+\boldsymbol{L}_{\text{a}}\dfrac{d \boldsymbol{i}_{\text{a}}}{dt}+\boldsymbol{K}_{\text{e}}\boldsymbol{\omega}$$

$$\boldsymbol{M}_{\text{e}}=\boldsymbol{K}_{\text{m}}\boldsymbol{i}_{\text{a}}=\boldsymbol{J}_{\text{m}}\dot{\boldsymbol{\omega}}+\boldsymbol{i}^{-1}_{\text{G}}\left[\boldsymbol{\tau}_q+\boldsymbol{B}_v\dot{\boldsymbol{\alpha}}+\boldsymbol{B}_c\operatorname{sgn} \dot{\boldsymbol{\alpha}} \right]$$

$$\boldsymbol{\omega}=\boldsymbol{i}_{\text{G}}\dot{\boldsymbol{\alpha}}$$

\$\boldsymbol{u}_a\$ is the input voltage, \$\boldsymbol{i}_{\text{a}}\$ is the current of the motor, \$\boldsymbol{\omega}\$ is the angular velocity of the DC-Motor, \$ \dot{\boldsymbol{\alpha}}\$ is the angular velocity of the transmission output shaft, \$\boldsymbol{i}_{\text{G}}\$ is the known grear ratio of the DC-Motor,  \$\boldsymbol{\tau}_{\text{q}}\$ is the motor torque, \$\boldsymbol{L}_{\text{a}}\$ is the inductance, \$\boldsymbol{K}_{\text{e}}\$ and \$\boldsymbol{K}_{\text{m}}\$ are modor constants, \$\boldsymbol{J}_{\text{m}}\$ is the inertia of the motor.

  I need to determine the resistance, inductance, the motor constants and the inertia of the motor.

I have almost no practical experience in measuring electrical parameters. So the following ideas are just from a layman's perspective :D. I thought that I could maybe drive the motor with constant current and stop the motor from rotating by holding the output shaft. Then by \$u_a/i_a\$ I could determine the resistance. Then I would try the same but now with linearly increasing current again holding the output shaft. That would make it possible to determine \$L_a\$. Then I would again use constant current but now I would let the motor rotate such that I can determine \$K_e\$ by using the gear ratio and the angular velocity of the output shaft.

In order to determine \$K_m\$ I would use different currents to obtain multiple equations such that I can determine the unknowns \$K_m\$, \$J\$ and \$\tau_{\text{q}}\$.

  Are the methods that I described in any way applicable? What is the
  easiest way to determine the parameters?


texts: The argument that was presented to me was that at node N, i2 + i3 = 0 since it is an open circuit. I do not understand this argument, if there is no current at the positive terminal, than how can there be a voltage change across the circuit? Could someone help clarify this?


texts:
On a space heater, I replaced a 20A DPST switch with a 16A one I found at radio shack.  I am unsure about the amperage of the circuit itself (how to find this?) but I'm assuming it's 20A or else the company would have bought a cheaper switch.  Seems to be working now, and I have a 20A switch on its way, but am I going to burn down the house in the interim?

In other words, I know I'm currently using the wrong switch, but would you consider it dangerous to leave this heater on until I get the proper switch?


texts: Trouble with selecting a single wire segment of a net in Altium

texts:
Below I want to select and edit only the bottom wire of three parallel wires:

But when I click on the bottom wire the program also selects the middle wire as well because they share the same net.

Is that possible to single out only a desired wire segment without selecting the entire net in Altium?


texts: Bare metal ARM cortex M programming sequence

texts:
I'm beginning ARM projects with bare metal STM32F051R8 development by CMSIS core in KEIL. Used the
following sequence to blink LED:

Enable Reset and clock register bit (RCC) for the AHB bus controlling the LED port.
Set the mode register (MODER) for the LED pin as General purpose output mode.
Set output type register (OTYPER) for LED pin as Output push-pull.
Set output speed register (OSPEEDR) to normal speed for the LED pin.
Set the pull up down register as no pull up/ down for LED pin.
In an infinite loop, set the pin bit to high/ low in the output register (ODR) to blink the LED with a delay in between.

Is the sequence above a standard for ARM Cortex M LED blink regardless of manufacturer? Or each
manufacturer has its own sequence?

If it is a standard, it will make switching between manufacturers (ST, NXP, TI, etc) a less
daunting task with more complicated projects where you don't have to dig through a gigantic manual.

For example, a protocol like I2C will have the same execution sequence for data transmission regardless
of manufacturer, so I thought if ARM is a similar standard for MCU's. Hope I made the question clear.

Waiting to be enlightened!


texts:
I am a beginner and my question is the following:

The alternator has an output voltage 13.7V. I know that each load is not a linear resistor but each load represents a certain resistance to the flow of electricity then can we say that the current depends on the resistance of the load.

Example is car alternator has a capacity of 900W of power to give that power to load at 13.7V. Maximum output current is 65A if the load resistance is 0.21077 ohms. This all calculation are based on ohm low.

Can we calculate like this for every equipment that must support rated current?

Summing up: Can we use Ohm's law to calculate the output current of the alternator?


texts:
I've got the following program, in AVR assembly:

.DEF    WR = R16

.ORG 0

SER    WR
OUT    0x24, WR

When I call avr-as beeep.s, where beeep.s contains the previous code, I get an error message:

beeep.s: Assembler messages:
beeep.s:1: Error: unknown pseudo-op: `.def'
beeep.s:5: Error: constant value required
beeep.s:5: Error: register number above 15 required
beeep.s:6: Error: constant value required

I can't find the origin of my error... What did I do wrong ?


texts: How do the diodes protect the input of amplifier from excess voltage in the circuit below?


texts: Interfacing with a Nest Hello 'chime connector' module

texts:
I currently own a Nest doorbell that uses a "chime connector" between the doorbell wires and doorbell chime as shown below.

I have tried to create a digital doorbell chime that will wirelessly connect to another device to notify me of visitors. I tried using this schematic for my doorbell but after a month of use, the solid state relay in the chime connector would not release and it would stay "closed," causing the doorbell to turn off because all the current was going through my chime design instead of through the Nest doorbell.

Forum posts describing the inside of the chime connector show that it uses a solid state relay which I presume is controlled by a triac. My guess for why my design would not allow the doorbell to "stop ringing" would be because there is no zero-crossing point for the triac when it's outputs is two diodes, causing it to conduct forever. Would using a single diode and a voltage divider work better in this situation than an optocoupler for detecting doorbell presses from a microcontroller? How can I fix my design so the solid state relay in the chime module stops conducting?


texts:
With a homemade PCB, I've built my own Arduino-inspired controller, with an ATmega328P flashed in a way to work @3.3 V. I power the whole thing with a battery@ 7.4 V.

I use the LDO MCP1755S (with 3.3 V of output voltage).

It really doesn't work. The LDO outputs something between 1.9 and 2.6 V, making the ATmega really unstable (it didn't even pass the serial welcome printf).

If I make a measurement at the output of the regulator, plugged to the battery in input, I've more or less 4 V. With just an LED and a 330 Ω resistor, I get the 3.3 V.

It seems like this LDO doesn't like my circuit, but it doesn't take more than 50 mA, so I in the capacity of the LDO.

Between the ground and the VOUT I've two 22 µF capacitors to stabilize the voltage across the circuit (I use an NRF24L01 RF module, and it's really sensitive to voltage stability).

I've tried to remove the two 22 µF capacitors, and I've replaced them with a 1 µF X7R ceramic capacitor (input capacitor). Just changing that and I was able to upload code to my Arduino-bootloaded ATmega328P, and it was booting and sending a serial message. The output voltage was between 2.8 and 3.2 V. I've put a 1 µF capacitor on the input side (input capacitor) and voltage is now stable at 3.3 V. Already a good progression!

But if I plug anything into my PCB (RFID reader, RF module, etc.) then it stucks and doesn't boot again.

Here's the PCB we've designed (stab Vreg2 being the input capacitor, stab RF2 is removed and replaced by a through-hole wire to link both PCB sides):

What's going wrong? With another LDO I don't get the trouble.


texts:
I want to control a backlight LED whose recommended current draw is \$22.7\;\textrm{mA}\$.

Looking up the DC Current Gain on the BC637 datasheet and using the formula:

$$I_b = I_c/\beta$$

I calculated:

$$I_b = 22.7/25$$
$$I_b = 0.908\;\textrm {mA}$$

Arduino logic levels are 5V = High and 0V = Low so I think I should add a current limiting resistor in series on the BC637 base pin.

So using the formula:

$$R_b = (V_{cc} - V_{be})/I_b$$

I calculated:

$$R_b = (5V - 1V)/0.908\;\textrm {mA}$$

$$R_b \approx 4405\;\Omega$$

I'm planning to use a \$4.7\;\textrm k\Omega\$ resistor for \$R_b\$ so the backlight should always be dimmer than the maximum (since less current will flow).

Is my calculation correct? Will it work the way I planned?

Here is the simplified schematic:

I don't have much experience with electronic components, and I would like to ask someone with more experience than me to check if my calculation is correct.


texts:
we have made a 2 layer board for a STM32f103, and apparently it works fine but we get a random resets now and then. When that occurs there is a 1 in the Bit 27 PORRSTF: POR/PDR reset flag and Bit 26 PINRSTF: PIN reset flag of the Control/status register (RCC_CSR). I think it might be some kind of noise on that trace? This is a picture of that portion of the PCB, with the RESET trace highlighted.
Any ideas of what could be the error?


texts:
I have circuit working perfectly on a breadboard - motors are spinning as expected.
But same circuit with same components is not working when I soldered it - motors barely can spin (you hear buzz instead of spinning).

Spent few days trying to figure it out - checked all connections - looks fine.

What it can be? How to troubleshoot such situation?

p.s. Let me know if it worth recording a video of the behavior.
p.p.s. I'm a complete newbie in all that - so probably missing something obvious.

Breadboard connections:

Soldered board back side

NOTE: Ground sometimes connected using very tiny wire.

Soldered board connections

Upd 6/24/2014: Inverted soldered board picture horizontally to match schematics.


texts: How can I use the watchdog timer in interrupt mode?

texts:
I am using an atmega168 with avr-libc. Now, to form control loop of a fixed duration, I need a, say 1 second interrupt. Being clocked from an 8MHz clock, the only useful clock source seems to be he 128kHz watchdog oscillator.

The datasheet(page 49) hints that this is possible:

  In interrupt mode, the WDT gives an interrupt when the timer expires. This interrupt can be used
  to wake the device from sleep-modes, and also as a general system timer.

However, the library reference makes no mention of operating modes. What now?


texts: How is the amplitude of an output signal of a binary input determined using a constellation pattern?

texts: I understand using the pattern to find the output line single phase but how is the amplitude determined?


texts: Short circuit detector (autoreverser circuit) using current sensor and switching relay

texts:
First of all I’m not electrical engineer. The original idea is described here.

It is a model railroad problem. The rails are carrying a power signal (DCC) 12-18 V. The frequency is ~17 kHz. It is a square wave signal described here.

The circuit swaps the hi and low rails when the short occurs. This it happens at the gap between two insulated parts of the rail track with the hi and low rails not corresponding. When the train wheel bridges the two unmatched rails we have a short. The reverser has to detect this at a lower level of the boosters  amper limit  and switch the signal to the rails of the reverse section.

In the original circuit, I replaced the shunt with an ACS712 current detector. I replaced the other parts in the circuit with parts that are available in Ltspice to simulate it. The original circuit checks and the second gap. In my scheme is only the detector for one gap.

Will this circuit work?
Is the ACS712 sensor a good replacement?
What are the suitable DIP components?
Can I "catch" the output from the 555 with an Arduino and switch the relay?

I have and other thoughts like set the comparator's limits with a potentiometer or from Arduino.

I hope the comments in the LTspice schematic will help. Any thoughts and critique are welcome. I didn't find a way to attach the LTspice file.


texts:
I'm building an attenuator using an Lpad. Do I need to connect '1' to GND? What difference will it make?

Here's my circuit (Fritzing didn't have mono-jack connectors or an Lpad, so I'm using the ones shown):

Don't want my circuit to cause any damage. Left out specifications of the source and output to not further complicate things. Just want to know if the '1' needs to be connected or not.


texts:
I want to control power RGB LEDs, for efficiency and safety  they are better to be driven by a current source. I can use either linear or buck converters. I made a linear       current source using LM317.

I PWMed the input (Vin) and it worked fine. Is it OK if I PWM the output(using a MOSFET right before the load)? As I learned in theory if the output is left open the output voltage reaches infinity (hear maybe a maximum of input voltage), so as I turn the MOSFET on a high voltage goes to the LED momentarily and might damage it after a while.

I think a decent step-down LED driver is PT4115E (Datasheet) it has a PWM pin. Are chips like this OK for driving LEDs that duty cycle may change several times per second?


texts: I was wondering what would be the best waveform to generate for a phased array short range imaging radar? Square, sine, etc. Also what frequency would be best to operate at for the carrier wave given that this radar wants to point out people and dimensions of say a building or forest. So seeing through walls is an objective as well. I assume higher frequency for close range is best. Any info will help, thanks


texts: How to construct high speed logarithmic amplifiers

texts:
Objective :

Converting laser pulses from photo diode ranging from 10nA - 100mA  to digital format, for measuring pulse width exactly.

Pulse width 10ns-150ns and repeating at a rate of >20us up to 1second.

Observations :

I have seen pretty encouraging application notes like this for a wide dynamic range TIA requirements, but my doubt is how fast they can be? The normal diodes can't be very fast as 2ns (considering my photo diode rise time,) how about a GHz BJT as feedback element or a schottky diode in feedback? ( I did not find people trying such.) I have found a few integrated designs like LOG112 but  I could not find high frequency log amplifier modules.

More than bandwidth, it is the pulse response of such log amplifiers, for example MAX4206 matches all requirements but the response time is very poor, my pulse being 10ns the rise time of photo diode is 2ns.

EDIT:

As suggested I have also seen very high bandwidth log amps like SDLVA which have ns response time but oriented for different applications and are very much advanced than my requirements and too costly, surprisingly achieving only 5ns response time!

Problem Statement :

Is it  possible to sense ns pulses using log amplifiers? If so how? I want to construct from off the shelf components only.

EDIT:

Here I have one flexibility.  I have two channels -  that is two diodes, so I can break this 10nA-100mA range in to two, one being 70nA-70uA from one channel  and 70uA-70mA in another channel, so even if the log amp covers this range it would be satisfactory, I understand how difficult its to sense 10nA even if 100nA is sensed that is a good job.


texts: 20v solar panel powering two 12v fans and a 6v pump (swamp cooler for burning man)

texts:
Building a solar swamp cooler for burning man, how can I use a 20v 0.8a (in full sun) 15watt solar panel to power TWO 12v 0.4a fans, AND a 6v 0.1a water pump?

One of the fans and the water pump have their own mini solar panels (that don't work very well), any way I can connect the solar panels in series?

What components would I need (and where would I get them) to make this work? This apparatus would ideally function only in full sun (in a remote Nevada desert)

Sorry, I'm a newb at this, and thanks for any insights!


texts: I crossed two wires, and fried my circuit. How do I test for parts that need replacing? (I'm new to this, schematic included)

texts:
I built a metal detector with the Surf Pi 1.2 kit. This guide was a big help.

This was my first project outside of soldering two wires together, definitely a learning experience. Probably a little more advanced than I should have gone.

Everything was working, until I accidentally crossed the speaker wire with the coil wires while adjusting my coil's sensitivity. There was a spark, and the sound coming from the speaker got very loud, and then died (forever). Below is the schematic, and I've noted the two wires that got crossed in red.

Note that I already tried a new speaker. Still dead.

I now have two questions:

What could I expect to find wrong? What typically gets fried first?
How can I go about testing the parts? And will I need to unsolder them to test?

Any help is appreciated!


texts:
When I hook a device to the monitor input of my digital piano, I get a very noticable 50Hz hum.

I understand that the monitor input doesn't have to be particuarly good quality, but it really is annoying.

I'd know what to look for if the attached device had a ground connection, but it happens even with battery powered products such as an ipad.

The cable is a cheap 3.5mm-jack to 3.5mm-jack thing.

I've done some experimenting:

ipad attached to piano, electrically insulated from everything else --> hum
ipad attached, touching ipad screen --> even more hum
Unplug the cable from the piano--> no hum
Cable pluged into piano, other side unplugged -> no hum
Cable pluged into piano, touch exposed jack parts for left and right channel -> hum (on the according side)
Cable pluged into piano, touch exposed jack ground part -> a little hum
Cable pluged into piano, shorten all three terminals on exposed jack with a bit of wire -> no hum
Cable pluged into piano, shorten all three terminals on exposed jack with a bit of wire and touch the wire -> hum

I first suspected the cable to act as an antenna, but the cable alone is quiet.

Looks like it happens only if an antenna is attached to the cable. Both ipads and humans seem to be effective antennas.

What I don't understand how this can work with everything shortend to the ground part of the jack. With a low-impedance path to ground, how can I still inject the 50hz signal?

edit (more investigation)

Piano has a built-in class II power supply with no ground connection.
Piano is connected to AV receiver via 6.35mm jack - cinch cable.
AC voltage between 3.5mm jack ground and mains ground measured with multimeter--> 33mV
Resistance between 3.5mm jack ground and mains ground -> 3 Ohm
Unplug the connection to the receiver -> lots of extra hum
The 3.5mm to 3.5mm cable is defect. Ground has a loose connection.

I'm pretty sure the faulty cable is not the culprit as the connection seems to be intact with the cable hanging from the jack. We'll see, replacement should arrive tomorrow.

The only ground connection of the piano is through audio cables and the AV receiver. I also get the hum without that connection, that is with no ground connection at all.

If it is caps in the power supply, shoudn't it hum all the time? I only get the hum through the monitor input.


texts:
In the picture below we see 3 LEDs in a parallel circuit. When the switch is closed only LED 2 and LED 3 are on. LED 1 isn't on because it's a diode in the opposite direction. You observe what happens when the switch is closed and opened by opening the switch first and then closing it. Explain:

Which LED(s) are on for a short while after opening the switch;
Which LED(s) are not on for a short while after closing the switch.

p.s. - I probably made some mistakes in translation. Here is the image of the circuit:

My Problems:

I can't answer any of these questions. I know for sure they have something to do with electromagnetic induction. But I'm having trouble grasping what will happen in these situations. Can someone help? I know that if a switch is open and closed there will be induction for a short time.


texts: How do you adjust the trace rotation on a Hameg HM 307?

texts:
I have a [rather old] Hameg HM 307 oscilloscope with the trace rotation slightly off. There is no trace rotation adjuster anywhere on the outside of the device. The user manual mentions that it is possible to adjust the trace rotation but it doesn't say how to do it.

Does anybody know how this is


texts: View physical size before placing component, DipTrace

texts:
Is there a way to view the physical size of a component before it is placed in the schematic editor in DipTrace, like it's shown in Eagle?

I like to use DipTrace because it seem to have a nice autorouter with automatic component placement. But, it seems more difficult to add components if you don't know the exact package name in DipTrace.


texts: 5 V, 3 A to 5 V 3 A current limiter for DC motor

texts:
I've found a 5 V 3 A motor and I tested it using a lab power supply that limits the current draw to 3 A.

I've bought a 5 V, 3 A power supply without thinking that the motor would draw too much current if possible. In fact, it does draw too much current and the power supply goes into security mode about every 0.5 seconds.

How can I limit the current to 3A with a small circuit?

Here is the power supply I bought: https://www.velleman.eu/products/view/?id=433054

Here are 2 photos of the motor, I can't find the datasheet.

Btw, I assumed it's a 5V 3A motor: the lab power supply can only deliver currents up to 3A and I adjusted to voltage to 5V.


texts: Preemptive Interrupts and "Context Switching"

texts:
In RTOS, when a Higher Priority task becomes Ready to Run, it stops or preempts currently running (Lower Priority) task and start executing itself. Before switching tasks, RTOS saves required data related to lower priority task (Context Switching)

Coming to my question, Like tasks, Interrupts also have priorities. When a Lower priority interrupt is executing and a Higher priority interrupt comes, What happens?
Does it stores all data on Stack etc. just like RTOS? What will happen to my variables used in ISR?

(Note that, this scenario is possible in a Non-RTOS based application too!)


texts: Making Hot and Cold room at the same time with Peltier stack

texts:
I am thinking about 2 small boxes with peltier stack middle of them to get a cold room and hot room at the same time.

Is it possible to get -40 degree celsius cold room and 100+ degree celsius hot room?

Don't care about power dissipated. I will create DC power supply for that if it is possible.


texts:
I am trying to read from 2 channels of ADC 1, I have followed other tutorials and tried but I am not getting any success. I can read from one channel but not the other.
ADC configuration:

This is my polling code that runs in a while loop.
 HAL_ADC_Start(&hadc1);

         HAL_ADC_PollForConversion(&hadc1, 100);
         i_ADC_1_reading = HAL_ADC_GetValue(&hadc1);

         HAL_ADC_PollForConversion(&hadc1, 100);
         i_ADC_2_reading = HAL_ADC_GetValue(&hadc1);

         HAL_ADC_Stop(&hadc1);

Why is Channel 1 and 2 containing the same reading?, I had a look at the reference manual and I could not see anything specific.


texts: Capacitive Touch Faucet Solenoid Battery Box vs AC/DC adapter

texts: I have a MSTJRY touch kitchen faucet purchased through Amazon. It uses a valve solenoid in line with the water supply to control the on/off of the faucet based on capacitive touch on the faucet stem. There is one black wire that connects the solenoid to the stem (I'm assuming this is the capacitive sense wire). It works extremely well when using the 4AA batteries. What I'm wanting to do is convert that 4AA batteries into house power (standard outlet). I tested the 4AA battery output to make sure they were wired in series producing 6V DC. I found a old 2 prong 6V 1A AC/DC adapter and spliced the wires accordingly, replacing the battery power pack. I tested the AC/DC output on my multimeter and got 6V DC. When I plugged the solenoid into the modified AC/DC adapter (house power), the capacitive touch solenoid went crazy and started randomly firing. The house power outlet is not isolated as there are other devices on the circuit which I'm assuming is causing noise. Delta has a similar faucet technology called Touch20 with an optional power adapter (Delta EP73954). The only difference I see in that power adapter vs mine (besides 6V 1A vs 9V 1.5A) is the use of a grounding pin (3 prong). Any help would be much appreciated.


texts: What are some reasons my atmega32u4 loses program when disconnected from power?

texts:
I have two different boards running the same code with the same chip (ATMega32u4).

Problem Summary

THe problem is that the 2nd board seems to lose the program that has been flashed to the chip if it loses power.

Both of these boards have mini USB connectors and get power from USB and both run at 5v.

First (Working) Board

The first board is an "official" SparkFun Pro Micro.

Second (Failing) Board

The second board is a knock-off of that board which I bought on amazon.  You can see the details for that board at:
Pro Micro knock-off board at amazon

NOTE: I'm not expecting anyone to examine those boards perfectly and tell me the exact reason why.  I'm just adding that info in case someone notices something completely different that would indicate the problem.

Programming the Boards

When I program the boards I set the Arduino IDE to the Pro Micro board at 5v and 16Mhz and the program flashing works equally well on both boards.  I then run the knock-off board and it works perfectly.  It's a little program that receives data from bluetooth and displays the data elsewhere.

Loss of Power, Loss of Flashed Program

On the first board, I programmed it once weeks ago and it works after being powered off for days.  Obviously, that's the way it is supposed to work.

On the second board, if it loses power at all it seems to lose the program.

Common Things To Check?

I'm just wondering if there are some common things I can check to determine why the program seems to be lost.

Are there any obvious things that I'm just missing?  Is it possible the manufacturer hasn't wired something up properly which would cause this --- I mean is this common problem with board manufacturing?  I have 5 of these knock-off boards and have tested two so far and both seem to have the problem.

Any help is greatly appreciated.

Edit: Additional Info

I found the following information in a review on Amazon:

  Like some other reviewers, my Pro Micro seemed to be losing the sketch
  when disconnected from power. However, I've now figured out that the
  Pro Micro isn't actually losing the sketch, there is a different
  problem altogether. When the Pro Micro is reconnected to power, for
  some reason the bootloader isn't running the sketch. If you then do a
  soft-reset by connecting the RST pin to ground, upon reset the
  bootloader starts running the sketch successfully.

  So the issue can be worked around by wiring a button to the RST pin
  and hitting the button every time you plug in the Pro Micro so that it
  will reset and run the sketch. It's annoying that the issue exists,
  but at least it's workable.

Can anyone explain this phenomena?
Might there be another workaround that is an automated solution-- versus pushing a button each time?


texts:
I have a query.

Suppose, I have a battery.

Can some battery have enough voltage but not deliver the required current? How is this possible?

My question comes from car batteries but it is not limited to automotive. It is batteries in general.

I have seen, some car batteries holding like 10V,  but the car does not start-up.

Similarly, does this scenario arise in other fields also? Like having some voltage, but the load doesn't get the required current? How is this possible?

Request you to provide some clarity on my misunderstanding.


texts: Power supply issues with many identical PCBs

texts:
I've designed a PCB to run two stepper motors from an Atmega8. With my current implementation, I can however only run two of these PCBs at the same time.

In this picture you can see the overall structure of the project. One PSU (5V, 10A) is supposed to run all modules. The Arduino talks to each Atmega via I2C and has it's own power supply over USB. (I left out the SDA/SCL lines to reduce the clutter)

Each of the "duostepper"-modules mainly consists of an Atmega8 and two 28YBJ-48 stepper motors. There's also two ULN2003s and ports for two optical sensors, an AVR-programming port and the I2C/TWI-connection on there. To make it more compact, I designed a PCB to have all ports together.

The schematic:

This is the board layout.
I'm using the I2C/TWI-port at the top to feed 5V/GND and then connect each PCB with the next one. There is no power jack on there. From my power supply I'm currently just using a breadboard to get 5V/GND to the first module and GND to the Arduino.

One module runs very smooth. Even two run okay. Now I started to build up 6 modules and suddenly only one of the modules runs smoothly. All others are either are having trouble with their steppers.

To me it looks as if the modules are not running in parallel but in series. However, I don't know what changes are required to fix this. Did I miss something crucial on the PCB?

edit3:
I've updated the schematic and the board.


texts: How come serial cables LEDs don't get dimmed instead of switching on and off when sending serial data?

texts:
This is I would say less researched question because I couldn't really find any interesting on net and I am noob and people around me are not so resourceful when it comes to electronics hardware. I asked my mate who does hardware mostly at my job but his answer doesn't satisfy me because he said they have controller inside that switches it on and off at a frequency so that it doesn't dim.

But when I am using serial cable to send/recieve data, I don't find a continuous pattern of simply switching on and off, it seem(idk maybe) but it seems like it is switching on when it encounters high and switching off when it encounters low. The baudrates I have confirmed it not be dim is from 4800-38600.

I believe it would be more like PWM so it should expect it to dim?

The serial to USB here in question is ATC-810.

I suspect there is some kind of hardware magic lying there. I would love to know that. I don't expect exact schematics. But just tell me how do they do it basically?


texts: Unsigned int values gives negative number above the halfway point of max byte value?

texts:
MCU: Atemga328P: Datasheet:https://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-7810-Automotive-Microcontrollers-ATmega328P_Datasheet.pdf
Note: I am a beginner :)
Considering a 2 byte unsigned int data type, where 65535 is the max value and 32767 in the halfway point.
Problem: unsigned int num; in the below code yields negative numbers on serial monitor for unsigned int num values above 32767 even though it is an unsigned variable.
Examples: unsigned int num = 65534 shows -2 on the serial monitor and unsigned int num = 32768 shows -32768 on the serial monitor.
Note: I am using USB connection provided by Arduino board for UART communication.
#include <avr/io.h> // header file file for input output pins
#include <util/delay.h> // header file for delay.
#include <avr/interrupt.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define F_CPU 16000000UL
#define BAUD 9600
#define BRC  ((F_CPU/16/BAUD)-1)

void uarttrasnmitinteger(unsigned int num,  char*snum, int delay);
void uarttransmitenable(void);

char snum[20];
unsigned int num = -65534;

int main (void)
{
    uarttransmitenable();

    while (1)
    {
        uarttrasnmitinteger(num, snum, 1000);

    }
}
void uarttransmitenable(void){ // Enables UART transmission
    UBRR0H = (BRC >> 8);
    UBRR0L = BRC;

    UCSR0B = (1<<TXEN0);
    UCSR0C = (1<<UCSZ01) | (1<<UCSZ00);
}

void uarttrasnmitinteger(unsigned int num,  char*snum, int delay){
    itoa(num, snum, 10);  //Converts integer to string
    unsigned int i;
        for (i=0; i< strlen(snum); i++)
        {
            while (( UCSR0A & (1<<UDRE0))  == 0){};
            UDR0 = (char)snum[i];  //outputs to serial monitor
        }
        _delay_ms(delay);
}


texts: PC internal piezoelectric vs magnetic-driven speaker

texts:
Do magnetic-driven speakers provide better "quality" (more frequencies) than piezo speakers?

Do they consume power even when not in use?


texts:
I'd like to connect a Raspberry Pi A+ with an Arduino leonardo. I'd like the rapsi to be able to upload HID sketches on the arduino.Then I'd like the arduino to run the sketch over the USB interface which is connected to a laptop for example.
Is it possible?

The i2c connection seems to be easy to make: only 3 wires to plug. However I'd like to know if a single power supply was possible? For example only the raspi or only the Leonardo. I planned to provide energy to my raspi and plug a single wire between the two +5V of the devices. I read it could work but it was not safe at all. Is there a simple and safe way to proceed ?


texts: Are MOSFETs Sensitive to heat while soldering?

texts: I'm soldering through the hole MOSFETs in to a PCB and I don't have a temperature controlled soldering iron. So will I need to heat sink the legs as I solder them to stop internal damage. I as this as bipolar transistors are damaged from heat.


texts: Extension cord's power socket grounding pin soaked in cleaning agent sud, what is a proper way of cleaning?

texts:
I didn't really know what tags to use. Anyways, this might sound stupid, however I was cleaning up something above the extension cord which was laying on the ground, and while I pressed the wipe suds and agent dripped into the grounding socket, nothing as far as I am aware. Now I don't know what can corrode and what can go bad, however this was a cleaning agent with the common Benzalkonium chloride 0.75g/100 g and among others: <5% amphoteric surfacatans, buthylphenyl methylpropional, Linaool, perfume.

It is a pretty good surge protecting extension cord though, so I don't really wanna throw it. I am not sure how to "cure" it and what damaged I might've done. Few hours has passed and I haven't turned it on - although it is plugged at the wall right now. I cleaned it with a q-tip and a bit of water few times, the color is now gone when wiping, but of course a bit of the moisture went inside. It wasn't a terrible amount, more like few milliliters though.


texts: Triangular wave generation using consant current

texts:
I am trying to design a circuit, that will generate a triangular wave from charging/discharging a capacitor with a constant current, but am stuck.

I have a power supply of +-12V and +5V, the circuit will source/sink at maximum 200mA.

I was thinking of building something along this line:

push-pull stage controlled by something like an op-amp (where the duty cycle can be set),
comparator one with a sufficiently high hysteresis or two comparators, one for positive and one for negative part

This is just a "pseudo-schematic", of what I was talking about:

simulate this circuit – Schematic created using CircuitLab

Please note that resistor and capacitor values are not real. And that U3 is this controlling circuit.

So, my question is, if this is a suitable circuit, how would you design "U3 part"? And, if this is not a good circuit, could you show me a correct one.

A description of the operation of your circuit is desirable.

EDIT:

I forgot to mention that the frequency and the duty cycle will be setable. Frequency by the resistor and the capacitor. Duty cycle, I dont know yet.


texts: Pull up on NPN transistor (during microcontroller power up)

texts:
I am using an ESP8266-01 to control a 3.3v relay via a 2N2222A NPN transistor. The ESP8266 GPIOs use a 3.3v logic level.

The idea is that by setting GPIO2 to hi/lo I can saturate/cut off the transistor and control the relay. This works fine - so long as I connect GPIO2 to the transistor after startup, because GPIO2 needs to be held hi during power up in order to boot normally from flash (http://robertoostenveld.nl/esp-12-bootloader-modes/). I have some concept that I probably need to have a pull-up on the pin, but I am confused with how GPIO2 can be held hi without always having the transistor in the saturated state (ie how can I then make GPIO2 low...). What is the best approach here?

Also - on an unrelated note - I've noticed that in many diagrams of relay driver circuits using transistors, there is a resistor between GPIO and transistor. Any good reason for this? Everything is working as is but maybe there's something I'm missing.

EDIT: To clarify, the problem is that the circuit does work as intended if I let the ESP boot and then connect GPIO2 to Q1. The problem occurs if I try to boot while GPIO2 is connected (ie, as shown in the diagram I provided) in which case the GPIO2 is presumably being pulled low, which results in the wrong boot mode.


texts:
I have a breakout that comes with two 10kOhm resistors: one on the SDA and one on SCL. The chip takes a max of 3.6V. AFAIK, I2C needs pull-ups on its pins, but could SPI be used on this module? I'm powering it with an Arduino and SCL seems to be around 4.5V - is it too high or is the pull-up going to shift it down?

Thanks

EDIT

The schematic of the breakout is essentially this:


texts: Is it safe to use a Li-ion battery after being completely discharged?

texts:
I've got a Li-ion battery (LGDBHE21865 Q153F022A2) that has no protection circuits (as far as I know). The battery can support a 20 A current. I used it in my vape device some time in the past, but then the battery was lying on the shelf for a long time and it has discharged to approximately 0 V (may be ~0.5 V). I charged the battery (using a charger with about 0.5-1 A current; the charger has a special signal when a battery is completely charged) and set it up into my vape again. Device shows 100% battery level even after 10 minutes of intermittently using at ~35 W.
My questions are:

Is it still safe to use the battery after being completely discharged and then charged again?
Does it mean that the battery has some protection circuits that rescued it from losing capacity? Or should I test the capacity in a more accurate way?


texts: Error with no description with compling a project in MPLAB X - might be HEXMATE problem

texts:
I've got a project from a retired colleague that I'm trying to get up and going so I can make some modifications to it, but I'm having some problems compiling it. Below is the compiler, processor, and an abbreviated version of the build log. Please note that I'm doing a Clean and Build
using MPLAD X IDE V5.45
processor: PIC18LF4620
Build log (errors in the last 10 lines or so)
CLEAN SUCCESSFUL (total time: 35ms)
make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory 'C:/temp/MFT_NewCode.Ver 2.9.1/MFT_NewCode.X'
"--------------------------------------"
"User defined pre-build step: [if "false" == "false" echo NOT Debugging!]"
NOT Debugging!
"--------------------------------------"
+ Parallel make disabled. Project contains mpasm files, mpasmx versions older than 5.58 do not support parallel make. +
make  -f nbproject/Makefile-default.mk dist/default/production/MFT_NewCode.X.production.hex
make[2]: Entering directory 'C:/temp/MFT_NewCode.Ver 2.9.1/MFT_NewCode.X'
"C:\Program Files (x86)\Microchip\mplabc18\v3.47\bin\mcc18.exe"  -p18F4620 -ms -oa- -Ls -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-  -I "C:\Program Files (x86)\Microchip\mplabc18\v3.47\bin"\\..\\h  -fo build/default/production/user/AcquireData.o   user/AcquireData.c

<about 30 other similar lines>

MPLINK 5.00, LINKER
Device Database Version 1.17
Copyright (c) 1998-2013 Microchip Technology Inc.
Errors    : 0

MP2HEX 5.00, COFF to HEX File Converter
Copyright (c) 1998-2013 Microchip Technology Inc.
Errors    : 0

make[2]: Leaving directory 'C:/temp/MFT_NewCode.Ver 2.9.1/MFT_NewCode.X'
"--------------------------------------"
"User defined post-build step: [if "false"=="false"  HEXMATE r200-fffe,"dist\default\production\MFT_NewCode.X.production.hex"  -FILL=0xADDE,0xDEC0@0x200:0xFFFE -O"dist\default\production\MFT_NewCode.X.production.BootLoad.hex" -LOGFILE="dist\default\production\MFT_NewCode.X.production.BootLoad.Log"]"
nbproject/Makefile-default.mk:103: recipe for target '.build-conf' failed
make[1]: Leaving directory 'C:/temp/MFT_NewCode.Ver 2.9.1/MFT_NewCode.X'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
(2031) An error, warning or message was generated, but no description is available
make[1]: *** [.build-conf] Error 1
make: *** [.build-impl] Error 2

BUILD FAILED (exit value 2, total time: 42s)

it seems like it's in the post build step, which has a "execute this line after build" defines in the project properties with the following code. I'm pretty sure this is being done for bootloading purposes.
if ${IsDebug}=="false"  HEXMATE r200-fffe,${ImagePath}  -FILL=0xADDE,0xDEC0@0x200:0xFFFE -O"dist\default\${IMAGE_TYPE}\MFT_NewCode.X.${IMAGE_TYPE}.BootLoad.${OUTPUT_SUFFIX}" -LOGFILE="dist\default\${IMAGE_TYPE}\MFT_NewCode.X.${IMAGE_TYPE}.BootLoad.Log"

I'm not quite sure where to go next from here, but appreciate any advice. If any other information is needed i'd be happy to supply it.


texts: Identification of a part on a power line's lightning arrester

texts:
I recently spotted an arrangement of wires on a lightning arrester on top of a power line. The power line is IIRC a 110 kV, 16.7 Hz, two phase line for railway systems.

The lightning arrester is of a linear type on top of the power line arrangement.

The device attached to the lightning arrester seems to consist of two short pieces of rigid wire wound around the lightning arrester itself. They form a helix with increasing radius to the middle of the arrangement. Between the ends of the helices there is a distance of perhaps 10 cm I think.

The helices seem to be fixed to the arrester just by their winding radius at the outer ends.

It might be that these devices may perform a similar task as a stockbridge damper, but this doesn't explain why only the lightning arrester is equipped with them.

There were three or four of these mysterious wire couples between two power poles.

On the picture you can see the lightning arrester on top with one of these arrangements and one power line (much thicker) below.

What could be the purpose of these devices?