texts: Errors in SPI communication with SD card due to heat

texts:
Given is a PCB with a STM32L432KCU6 and a microSD card connected to it via SPI at 40 MHz in SPI Mode 0. The communication is protected by CRC which is calculated by the microSD card on the fly. When heating up the PCB to approximately 55° C, the microcontroller receives erroneous data from the microSD card. A wave file is being read out and there occur several bit flips in the wave header data (for example, the microcontroller receives data that says the wave file has 0 channels instead of 1 or has sampling rate of 22051 instead of 22050). These errors only occur from 55°C on. The strange thing is that the CRC seems to be correct as the microcontroller does not detect any CRC errors. Therefore, it seems that the microSD card calculates the CRC for the erratic data. The data are transmitted as 16 bit. If the errors occur, they always occur in the middle of the transmission (i.e. between the first and last bit). I tested several microSD cards (Kingston class 10 and SanDisk class 10 which are rated for 85° C), but the problem maintains. Only the needed temperature to produce this behavior differs slightly.

Kingston class 10: erratic data at temperatures above 55° C
SanDisk class 10: erratic data at temperatures above 63° C

All parts on the PCB are rated for 85° C.

Does anyone have an idea what could cause this?


texts: Illuminate an LED when a ground switch is open

texts: I have a switch that connects the negative side of a solenoid to ground when closed and I need to have an LED that is illuminated when the switch is open. I was thinking of using a transistor to do this but I am not sure exactly how to incorporate it with the solenoid. Any help is greatly appreciated!


texts: NodeMCU / ESP8266 - Light Sleep Wakeup via SIM808 RI (Falling Interrupt)

texts:
I have a NodeMCU v1.0 and a SIM808 Circuit board. To save power I put the NodeMCU into Lightsleep via:

wifi_fpm_set_sleep_type(LIGHT_SLEEP_T); // set sleep type, the above posters wifi_set_sleep_type() didnt seem to work for me although it did let me compile and upload with no errors

gpio_pin_wakeup_enable(CONFIG_GSM_RING_PIN, GPIO_PIN_INTR_LOLEVEL); // GPIO_ID_PIN(2) corresponds to GPIO2 on ESP8266-01 , GPIO_PIN_INTR_LOLEVEL for a logic low, can also do other interrupts, see gpio.h above

wifi_fpm_open(); // Enables force sleep
wifi_fpm_do_sleep(0xFFFFFFF); // Sleep for longest possible time

With that code the NodeMCU wakes up when the RI goes from HIGH to LOW to HIGH again, which would be OK for SMS, but for calls it mean the Node wakes up when the call is already gone.
So the idea was to use GPIO_PIN_INTR_ANYEDGE / GPIO_PIN_INTR_NEGEDGE as interrupt condition. But the Node seem not to support that.

Any ideas how to solve that?


texts: Is an older APC backup UPS likely to be the source of blown fuses in new lab equipment?

texts:
I have new laboratory equipment plugged into an older APC Back-UPS XS 1000. It derives all of its power from this backup system, which in turn is plugged into a regular power outlet. The lab equipment has blown a fuse on two separate occasions, once when plugged into the backup battery portion of the APC unit and once when plugged into the surge protector portion of the APC unit.

The APC unit is at least 3, possibly 5+ years old and (according to their website) has an output power capacity of 600 Watts/1000 VA and nominal output voltage of 120V. The lab equipment fuses (there are two fuses operating at all times) are medium blow, 2A and 250V, and made by Bel .

The fuses have blown after periods of protracted, heavy use. The lab equipment is less than 6 months old, under warranty and has never gotten wet or been damaged. The equipment's power requirements are 100-250 VAC, 50/60 Hz and 2A.

Is it likely that the older APC unit is the source of these blown fuses? Or is there a potentially problematic mismatch between the power output of the APC and the requirements of my lab equipment?

Thanks in advance for helping!


texts:
I'm using Mentor Graphics's DxDesigner to design a PCB. As a side note, I do know what design rule checks (DRCs) are, but I'm completely new to DxDesigner and am not sure what each of their DRCs are.

I currently have 335 errors.

328 connectivity errors

drc-106 --> more than one driver on a net
drc-121 --> redundant hierarchical symbol on net

7 migration errors

drc-001 --> Property ______ has invalid format
Note: the specified properties contain these characters: letters, numbers, dashes

If anyone knows how to fix these DRCs that would be great. Otherwise, a link to some good documentation would also be great.


texts: Voltage between two points of a square contour in a magnetic field

texts:
a,d,R is given. Current of infinitely long wire is \$ i(t)=I \cos(\omega t) \$

I get the flux
derive it over time
what to do with R?

The solution in the book is:
$$V=-((µ0*I*a*\omega*ln(d+a/d))/(20*pi))*sin(\omega*t)$$

Ignoring Rs you get same similar, \$2\pi\$ instead \$20\pi\$.


texts: Convert blinking (On/Off) power LED to fading

texts:
I couldn't come up with a better title...but here's the explanation.

Basically, I need to create a small circuit for my PC to attach to the power LED. The way my motherboard works is that if the system is powered-on then the LED is ON. But when the system goes to standby the LED starts blinking.

I want to do two things:

Have two separate color LEDs for each state i.e. powered-on(green) vs standby (amber).
I want the standby LED to slowly fade-in/out (not fully out though, half-way).

I figured that I can make the blinking signal fade by attaching a capacitor and a diode (to prevent current going back to the motherboard). That should take care of standby light.

However, I can't figure out how to switch LEDs when the current goes from continous to intermittent. So when the system goes to standby the LED switches from green to amber. Any ideas? Btw, I don't want a expensive or complex circuit. I need something that will Not require any outside power-source and will work just from the current coming for the power-LED. Someone suggested me to use two RC circuits as such:

Explanation here: http://forum.allaboutcircuits.com/showpost.php?p=411691&postcount=8


texts:
I'm currently a third year undergrad electrical engineering student studying linear control system and very much confused regarding the term "linearity".

Does the term "A linear ODE" necessarily mean that the system it is describing has to be a "linear system"?
Given a differential equation, can one directly test the linearity (Homogeneity and Superposition) of the equation without first finding its solution?

If you can explain the concepts in a more simpler manner instead of rigorous math, that would be appreciated. But if it's necessary to understand the math behind it, I'll try my best. Thanks!


texts: Connecting DC Common Node (Ground) to Three Phase Neutral

texts:
I know I shouldn't. But I just wanted to ask due to a specific requirement. I also searched the forum but couldn't find any similar question. Please give me a link if there's any.

I'm asked to modify one of our own design commercial three-phase electric meters according to a big customer's requirement: The e-meter should never affected by outer magnetic flux densities up to 300mT, and it should be as cheap as other cheaper brands' e-meters.

I decided to modify and "cheapen" the power supply first. In the original design the power supply consists of a flyback regulator following a three-phase full-wave rectifier (simplified):

simulate this circuit – Schematic created using CircuitLab

VDD is the supply for digital blocks (MCU, ADCs, communication interfaces etc.) and, as can be seen from the simplified schematic above, its ground (shown as SEC-GND) is tied to the NEUTRAL through a ferrite bead to guarantee accurate phase voltage measurements.

So I decided to make a transformerless power supply since it is relatively cheaper and is relatively resistant to magnetic fields due to the lack of magnetic components (i.e. inductor/transformer):

simulate this circuit

The problem is that I don't know what should I do to guarantee accurate phase voltage measurements. I know I shouldn't connect the rectifier's GND to the NEUTRAL even if the system is ideally balanced (The system wil never be balanced because the phase voltage differs in tougher environments here in Turkey).

Any suggestions?


texts:
I'm trying to make a circuit to drive a transformer from a PWM signal produced by an AVR MCU. Here's the schematic:

The MCU output in fact has 2 complimentary PWMs feeding two transistor pairs. For this scenario, let's suppose I can guarantee both signals coming from the AVR are always complimentary, and are never on at the same time.

The first transistor on each pair is low power, and is there to avoid direct connection between the AVR and the higher power transistor TIP41.

I did some measurements, and initially, all seemed fine. Please note I still didn't add the transformer, it's on the schematics just to show where it's supposed to be connected, but all measurements below were made without it.

The first one shows both TIP41 emitters (in yellow and blue), and their difference, using scope math (in red). Both probe grounds are on circuit ground. This is what I expected: each half of the primary would be driven by one TIP41 at a time, with alternating voltages, so I have half above zero, and half below zero:

Please note that both signals don't invert immediately, there is a delay introduced by the transistors and I don't know how to fix that. Measuring the signals directly on the AVR, I can see they switch immediately, there's no delay there.

Now comes the trouble: when I measure from one emitter to the other emitter of the TIP41s (probe ground on one emitter, and tip on the other), this is what happens:

Same signal zoomed out:

Does anyone have a clue on what may be happening? I expected to see something roughly similar to what I saw in red on the previous picture.

Perhaps I'm just using the scope wrongly, I don't know. I repeat: this all happens with no transformer, the transistor emitters are floating, there's no load.


texts: why resonance is not considered in RC and RL Circuit

texts: Why resonance is considered in RLC circuit and not in RC or RL Circuit


texts: Designing parallel RLC band-stop filter in series with load from f0, gain, Q parameters

texts:
I've been trying to design a band-stop filter for my headphones to cut back on excessive highs and to provide a more flat frequency response.

With a software EQ and lots of tries, I managed to arrive at a reasonable one: \$f_0 = 4800Hz\$, \$gain = -10dB\$, \$1/3 < Q < 0.4\$ (or in octave bandwidth, \$3.447 > BW > 3\$). See the raw frequency response and the filtered one.

I would like to turn this into a parallel RLC filter in series with the headphones. Unfortunately I have no formal education in electronics, so I have to rely mainly on various websites and tutorials.

However all of them describe RLC circuits without a load attached. Adding a load resistor completely changes the gain and the \$Q\$ factor, and I am unaware of the exact relationship. Is it related to the voltage divider rule or something similar?

I managed to get an appropriate \$R\$ by trial and error, from \$Rload\$ and gain. I also managed to calculate \$LC\$ from the relationship \$w_0 = \frac{1}{\sqrt{LC}}\$. However, the equation \$Q = R \sqrt{\frac{C}{L}}\$ that is appropriate for a parallel RLC without a load, is plain wrong in this case.

My question would be is to how to determine \$L\$ and \$C\$ from these parameters:

f0 = 4800Hz
gain = -10dB
Q between 1/3 and 0.4
impedance of headphones: 32 ohm nominally, can get around 35 ohm at 4800Hz
impedance of amplifier: 0.09 ohm

The circuit so far (with imprecise \$L\$ and \$C\$ values):


texts: Unexpectedly N-ch MOSFET high drain to source voltage in "on" state

texts:
Inside a bigger project, I'm trying to control a simple resistive load (A heating element) with an N-channel Power MOSFET. The load runs on two parallel lithium-ion cells, so at around 3.7v. The microcontroller (An Atmel Attiny85) which I am using to control the MOSFET also runs at this voltage, and outputs this voltage from its pins.
The MOSFET used is a P80NE03L-06.

The diagram represents an on state of the MOSFET, with the IC Output theoretically being at the positive voltage of the battery. Vgs should therefore be at 3.7 volts right? The minimum threshold voltage is 1.8v, so I expect it to be fully on at this point. The datasheet indicated that the on resistance should be under 0.006 ohms and the maximum current is 80A.
The problem is that that when running my load (17A), the voltage between the Drain and Source pins is a whopping 0.43v, creating an enormous power loss in the circuit and causing the MOSFET to heat up dramatically.
I stumbled upon this answer while trying to find a solution, and it mentions an "on-region characteristics" diagram. The output characteristics of my MOSFET states that Vds should be no higher than 0.25v at 25A and Vgs=4v
Does anyone have any ideas on why the voltage drop is so high in my particular configuration? I must've forgotten something, but according to any MOSFET wiring schematic this is all that is put in.


texts: Can I set the slider on my universal adapter between 4.5V and 6V to get 5V?

texts: I have a dehumidifying cabinet which requires 5V 900mA, and I have a universal adapter that is rated at 1000mA 12V, however the slider doesn't have a 5V marking, only 4.5 and 6V. Is it okay to point the slider to somewhere between 4.5 and 6 in hope of getting around 5V?


texts: Control system error based on differential process value

texts:
In a basic PID controller, you measure the process value y (such as temperature) directly; then the error e is equal to the difference between the process value and the set point r. The error feeds a PID controller C which in turn outputs a control signal u to an effector, in this case maybe a heating element, controlling the process P.

But what about a peak-finding system such as an antenna tuner? Here, it's still closed-loop but there is no defined "set point", and rather than being able to measure the process value directly, we can only measure some non-directional figure of merit such as signal strength. We simply try to adjust for peak carrier strength, where the effector could be a tuning capacitor. The error could be set as

$$
e = - \frac {\Delta y} {\Delta u}
$$

That is to say, for some positive perturbation in the effector, if it improves the signal strength, then decrease the error.

Is there such a control system already? If so what's its name so that I can do further reading?


texts:
In the analysis of a passive 2nd order RC high pass filter, I find that the damping ratio zeta = 3/2 and the Quality Factor Q = 1/3. These values do not depend on R and C. I was under the impression that if the damping ratio is greater than one, then the system step response does not overshoot its steady state value. However, when performing step response in MATLAB to my system, I find that the circuit does overshoot slightly. I am analyzing the circuit below for equal R and C (10k and 100nF respectively).

MATLAB Code:

MATLAB Output:

I believe the calculations for zeta and Q to be correct, something must be wrong in my understanding of their role in the step response. Why does the circuit overshoot if it is "overdamped"?

I have repeated this procedure with a passive 2nd order RC LPF (same R and C values) and I do not see any overshoot. This agrees with my intuition. Why is the HPF different?

Thanks for any help that can be provided.


texts: How do I plan for in circuit programming of an AVR?

texts:
My usual method of reprogramming AVRs (so-far limited to ATtiny13 and ATtiny2313) is to disconnect the chip from the host circuit, plug it into another breadboard with all of the ICSP hookups in place, program, then replace.  However, I keep hearing that one can program the chip in place (which is, I understand, the whole point of ICSP).

Are there any special hardware considerations one has to take into account before programming the chip in situ?  For instance, I worry that the ICSP process may damage circuit components connected to the same AVR pins which are used for ICSP.  Does one occasionally need to add diodes or some other kind of buffering to protect these components?

I know this question sounds kind of vague, and I guess it is - but I've not provided details of my particular circuit because I'm interested in more general rules of thumb. I.e. does one never have to worry about this, or does the answer really depend on the particular circuit the MCU is a part of?


texts:
I am using SPI to write and read the data from slave board. I have two questions regarding this process:

Question 1. Why when I am trying to read 1.000.000 bytes through SPI using 1 message, it works slower than if I divide them into K messages?

I tried to play around difference between one huge message per transaction and multiple smaller messages (which in total gives us exactly the same sized buffers) and I observed that lesser the message size, faster SPI transaction speed.

Question 2. Is there a way to increase SPI transaction speed?

According to my tests, pure SPI transaction for 1.000.000 bytes divided into 500 packages is taking 380ms of working time.

Which means that I have 8.000.000 bits per 0.38 seconds => 20.55 Mbits/sec, which is less than 48Mbits/sec that it is supposed to be.

In addition here is some pieces of code that I used to compare and test:

device = "/dev/spidev1.0";
mode = SPI_MODE_0;
bits = 8;
speed = 48000000;

fd = open(device, O_RDWR);

memset(read_buffer, 0, sizeof(read_buffer));

mass_xfer[0].tx_buf = (unsigned long)tx1;

mass_xfer[0].len = 2;
mass_xfer[0].speed_hz = speed;

// sz - amount of bytes within one SPI message

// n - amount of messages in one SPI transaction

unsigned long sz = 2000, i, n = (nbytes + sz - 1) / sz;
for (i = 0; i < n; i++) {
    mass_xfer[i + 1].rx_buf = (unsigned long)read_buffer + i * sz;
    mass_xfer[i + 1].len = min(sz, nbytes - i * sz);
    mass_xfer[i + 1].speed_hz = speed;
}

timestamp_t t0 = get_timestamp();
ret = ioctl(fd, SPI_IOC_MESSAGE(n + 1), mass_xfer);
// ret = ioctl(fd, SPI_IOC_MESSAGE(1), &read_xfer); // When I tried to read using one message, time was more than 600ms
timestamp_t t1 = get_timestamp();
printf(" SPI READ: %.2f (%d) %d\n", (t1 - t0)/1000.0L, n + 1, SPI_MSGSIZE(n + 1)); // After this output, for 1.000.000 bytes I am receiving 380.xx ms
if (ret < 1)
    pabort("can't send spi message");

Any ideas?

UPDATE 1:
OS: Linux 3.15.10-bone8 #1 Fri Sep 26 14:20:19 PDT 2014 armv7l GNU/Linux
CPU: Sitara AM3358 1GHz. According to this CPU, SPI clock max speed is 48MHz.

Code is written in C++ and using spidev.h library.

Basically the board is BeagleBone Black.

UPDATE 2:
I have done lots of tests and figured out what is going on and what causes the problem.

The reason is gaps between byte readings. To be more specific lets review the code lines:
    read_xfer.rx_buf = read_buffer;
    read_xfer.len = ;
    read_xfer.speed_hz = 48000000;
    ioctl(fd, SPI_IOC_MESSAGE(1), &read_xfer);

If we place 100 (which is read 100 bytes) instead of  we will see next picture on oscilloscope:

As you may notice, it reads 8 bits then pause, then reads another 8 bits. So the problem is those gaps between reading the bytes. Here is some test results using oscilloscope:

bytes_amount = gap_width
10 Bytes = 480ns
50 Bytes = 410ns
100 Bytes = 200ns
50 000 Bytes = 200ns
70 000 Bytes = 350ns

According to results, I cannot read messages larger than 100 000 Bytes in one package, since the gaps will create a huge overhead.

ANOTHER QUESTION
What causes those gaps and how to reduce them?


texts:
I want to check (in hardware) whether a bit is on (1) in a 64 bit number - the bit I want to check can be any bit but I'm only interested in checking that one bit.

I get the number -ie offset - of the bit as a 6 bit number eg if that number is 0 I need to check bit 0, if the number is 17 I need to check bit 17 etc.

Is there anything faster (even if more costly in power and area) than this idea:

Input (bit I want to check) is X - so use a barrel shifter to left shift 1 by X and store result in Y
Then Z<-(Y AND Bitmap)
OR together all bits in Z - if output is 1 then bit is on, otherwise bit is off.

I suspect that 1 is the costly operation, so any ideas about a faster way of doing that would be particularly welcome.


texts: Mystery Diode in Schematic - MPQ8039 HALF BRIDGE DRIVER

texts:
The below image shows four example schematics for the the MPQ8039 Half Bridge Driver. Three of the four examples show a diode connected between the DRV pin (Gate Drive Supply Bypass) and the BS pin (Bootstrap  Supply). The Function Block Diagram shows an internal bootstrap diode, so I'm curious as to why the schematics show and external diode for three of the four examples. The datasheet has zero information about adding an external diode.

Why would the audio amplifier and DC converter circuit require an additional diode, but the motor driver not?

I'm interested in using two of these driver IC's to drive a transformer with 20-80kHz square wave. My circuit is more similar to the examples with the external diode, so the lack of documentation about the diode is disturbing.

Datasheet is HERE.


texts:
I have a 3-phase bridge rectifier (shown below). I am using an IGBT (STGE200NB60S) to limit the inrush current from the capacitors at start up. I also added the NTC thermisters to help with the inrush current. That end is all fine in that the main breaker is not tripping and and the current is fairly smooth looking.

The problem is that the IGBT is failing a lot, the collector-emitter is completely shorted. Its probably caused by a voltage spike at turn off. I cannot capture it exactly as fails randomly.

The IGBT in question does not have a built in diode. Should I add one and should I add a snubber circuit or would a flyback diode on the load be more suitable or all of the above.

What is the best way to protect the device?

Thanks.

edit 1:

Gate driver

Graphs:

Waveforms: diff probe scale 1/50

Vge

Vce


texts: STM32: Is SWDIO pull-up required on the board?

texts:
One section of the STM32L431 manual (46.4 Pinout and debug port pins) says:

To avoid any uncontrolled I/O levels, the device embeds internal pull-ups and pull-downs on the JTAG input pins:

JTMS/SWDIO: internal pull-up

In another section (46.8 debug port), it says:

For SWDIO bidirectional management, the line must be pulled-up on the board (100 kOhm recommended by ARM).

Are both of these statements correct? How can this be?
People seem to be getting other ARMs working without an external pullup on SWDIO but my STM32 isn't working so I'm trying to narrow down the cause.


texts:
I'm currently trying to make a simple circuit to shutdown an IC (GPS SIM28ML). So I ended up with this:

In green are the voltages measured when activating the NPN transistor, in blue the voltages measured when the NPN transistor is off.
Reading the datasheet of the PMOS, it says that the Vgs is from -0.3V to -1V.
Then there is thi graph:

I dont understand what am I doing wrong, I tried searching in other posts before making this one but i still dont understand it.
EDIT: R2 goes to GND


texts:
I am designing a system using RS485. There will be >100 nodes on a bus, each with input and output connectors, separated by ~1m.

In order to determine the signal quality at various speeds, I would like to make low-cost nodes that behave electrically in the same way as the actual node.

I'm thinking of replacing the node transceiver with high-value resistors (based on input impedance of intended device) and the simulating the connectors with 15pF capacitors (value based on page 4 of this TI application note).

In terms of verifying signal integrity, will this work to a degree of accuracy that I can be confident of the performance of the actual system?

Is this necessary, or can I be confident that I will not have issues if I pick the correct drivers based on desired speed and unit loading?

Is there a better way to simulate an RS485 bus (in software or hardware)?


texts: What electrical connectors to use underwater?

texts:
I am looking at doing a project with a AUV (autonomous underwater vehicle) and need to know the best type of connectors to use. I have listed the things I need from most important to least important:

Reliability
Ease of in installation
Availability(ship time)

Project Details

My project is to have a main board(small atom motherboard), and a few other small micro-controller boards(arduinos) to be inside a main compartment. This compartment will utilize the connectors to provide a leak-free interface with the AUV's navigation(thrusters, ballast) and sensor systems(sonar, depth gauge).

The vehicle will only be subject to about 20 - 40 feet dept, or around 18 psi.  I need something that can be connected "dry", and then is waterproof afterwards, rated IP-68. I have looked a little into Buccaneer. Does anyone have any experience on what is the best, or if I can DIY these?

Picture of Buccaneer Connector


texts: When connecting two battery grounds together, which battery specifications can tell us the limits?

texts:
This question came to me while connecting a lower voltage battery to a higher voltage battery
by connecting their grounds using an NPN transistor switch.

I know it works, but I don't know how to calculate the limits.

Why isn't the lower battery destroyed from the higher voltage and current and how can we know the limits ?

(I am using "lower voltage" and "higher voltage" instead of specific values because I want the answer to be a general rule.)

simulate this circuit – Schematic created using CircuitLab


texts:
I've the following schematic :

the Harness connector goes to TCA9548A  as followed:

based on the datasheet of the IC, the address is 0x70 and it can run with 100kHz or 400kHz. I've run this code on the uC :

    #define F_CPU 8000000UL
#define SCL_CLOCK 400000   // I've tried both 100khz too
#define BAUD 9600
#define MYUBRR    F_CPU/8/BAUD-1
#define TWIMUX  0x70

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

void init_i2c(void ) {
     uint8_t   twst;
     char add  = 0x70;
     short i = 0 ;
     TWSR = 0;                         // no prescaler
     TWBR = ((F_CPU/SCL_CLOCK)-16)/2;
     TWCR = (1<<TWINT)|(1<<TWSTA )|(1<<TWEN);

     printf("TWCR 0x%x \n",TWCR);
     while(!(TWCR & (1<< TWINT)));
     printf(" Start condition has been transmitted \n");
     if( (TWSR & 0xF8) != TW_START){
         printf(" TWSR start 0x%x\n",TWSR);
     }

        for  ( i  =0 ; i< 8 ; i++ ){  // After trying everything with 0x70 I tought the problem could be with the address

     // Setting Address
     TWDR = add;
     // clearing TWCR
     TWCR = (1<<TWINT) |(1<<TWEN);
     while (!(TWCR & (1<<TWINT)));
     twst = (TWSR&0xF8);
    if ((TWSR & 0xF8) != TW_MT_SLA_ACK){
         printf("Device address wrong  at TWSR   0x%x    SLA_ACK  0x%x  address 0x%x \n",twst, TW_MT_SLA_ACK,add);  // here is the problem !!!!!!!!!  TWSR value should be 0x18
         add++;
    }else {
        printf("device found at 0x%x   TWSR : 0x%x \n",add,TWSR);
    }
    }
 }

.............................................

int main(void)
{
    unsigned short i = 0 ;
      DDRD |= (1 << PD5);       // damit ist dann PB0 ein Ausgang
        // UART init and printf
    init_uart(MYUBRR);
    stdout = &mystdout;

    init_i2c();
    while(1){
    }
    }

Here is the output that I get :

So  As you can see I don't get the ACK from the slave.

here is what I can see on the scope:

for 100Khz:

for 400kHz

Both measurements are for 0x70 address.
my question  is what I'm doing wrong here, and why are both SCL and SDA not on high despiste pull-up ?  is it a software setup that I'm missing ?

thanks for your help!


texts: How do I configure the LIS3DH as a pedometer that generates interrupts when walking?

texts:
I found a lot of algorithms for pedometers that assume a fast CPU with a decent ALU and high sampling rates, which I don't have. (Z80) However, the LIS3DH has various options for generating interrupts when some condition occurs.

How can I configure it such that it generates interrupts when I'm walking?
High accuracy is not needed, I just need to know if the user is moving or not.

I looked through the datasheet, but there are more options than I can wrap my head around. Click detection looked promising, but gave useless, semi-random results, maybe because it only detects fast clicks and not walking speeds. There are also options for free-fall interrupt, inertial interrupt, orientation detection, high-pass filter, FIFO, and more.

I'll sleep on it and toil along tomorrow, but any wise words are hugely appreciated.

Datasheet
Application note


texts: 12V motor running with 24V L293D H-bridge

texts: I have two 12V motors (300 RPM) running from a L293D H-bridge circuit. I find that the speed when I provide 12V is not satisfactory. Will it damage the 12V motors if I provide 18V or 24V? Will they go at higher RPM at higher voltage? The L293D circuit has maximum rating of 36V anyway.


texts: stm32f103c8t6 cannot connect using stlink after upgrade, how to fix?

texts:
I upgraded the firmware using stlink>upgrade firmware (using cheap stlink v2)
with stm32f103c8t6 connected (boot0 and boot1 are both 0).
After successful upgrade i unplugged and plugged it back and then i can no longer connect to the stm32f103c8t6 using stlink v2

note:below images show the screenshots of my firmware. I can upgrade downgrade firmware but no longer connect and program or read the binary, also the software used is st32 stlink-utility
firmware version

UPDATE:I noticed that the problem started when i downloaded a blink program using stmcubemx and keil .The program is working successfully but i cannot reprogram or modify it shows st link usb communication error


texts: A general math problem that pertains to resistors in AC circuits

texts:
I've been reading from this website as a refresher on basic circuits and circuit components.

I have no problem understanding the properties of resistors in circuits and how to calculate V, I, or R, using Ohm's Law. This is not an issue.

However when I moved on from basic DC circuits to AC circuits all of the concepts are the same and I still have no problems understanding them, however from the website above I do have a basic simple question about their equations when the supply voltage is a sinusoidal waveform.

For example they show this equation:

My question has to pertain to how they are evaluating the sine. Is it

Sin(Omega) * t

or is it

Sin(Omega*t)

I know this seems to be something that is elementary and something simple, but this currently has me stumped...


texts: Designing a fast LED-driver from scratch

texts:
I plan to build a LED driver that can pulse a high-power LED (3W) down to the 100s of nanoseconds pulse regime, yet also allows longer pulses (up to 100ms) should be possible. The LED should be driven off a TTL/GPIO signal.

I’m admittedly a bloody beginner in electronics but did some reading upfront. I came to the following conclusions so far, which also might be wrong:

buck/boost driver are too slow
timer or avalanche circuits have fixed pulse width
single mosfet driver can introduce oscillations
my best bet is a push-pull mosfet driver
shunt drivers might also be an option

Sadly, I haven’t found a comprehensive tutorial on designing such a driver specifically for driving high-power LEDs. If there is one I have overlooked I would be happy if someone could push me in the right direction. If there really is none, I have the following questions:

Which transistor pair would be good to drive a 3W LED in push-pull?
How do I calculate the resistors specifically for the LED (3.5V, 700mA)?
What type of power supply can I use to drive the circuit? Are voltage regulators interfering in such circuits?

Independently from this: what do I need to do to step such a circuit up to drive a 30W LED?

As mentioned above I would be happy to read a existing tutorial about this if this is a repost!

Thank you!


texts: Capturing a 16.368MHz data stream with a MCU running at 32MHz

texts:
I have a 32MHz MCU (Atmel XMEGA A4) and I need to recover a digital signal coming from a GPS front end chip which is outputting SIGN and MAGNITUDE data at 16.368MHz.  Clearly this is a hell of a task for the XMEGA running at only 32MHz.  Is there any way that this is possible?

I ultimately want to save the data in a compressed form to some memory.  I'd like to convert the 16.368MHz data stream to I/Q samples at baseband (0Hz IF).  Using some DSP techniques this is quite feasible, I could filter the incoming data and then downsample (keep every M'th sample and discard all others).  This could be done in a reasonable number of clock cycles although it does seem like a bit of a task for the 32MHz XMEGA.

So is an MCU even the right tool for this job?  I've chosen this one because the final application is a battery powered device and every nanoCoulomb needs to be conserved.  With this in mind, if there's no good way to accomplish this with the XMEGA, should I maybe be looking at some kind of DSP chip?  Or possibly a low power FPGA?


texts: Source-free RC circuit current directions

texts:
I have the next circuit:

The textbook says that the capacitor is initially charged, but the current directions was selected as in schematic, why? If capacitor is charged and "+" is on upper node then the capacitor must be a voltage source in this circuit and "iC" must go up to node.

The textbook solution is:

Here an author derivate the result equation. But stop at a second and look. He use hard-coded iC direction. What will be if I try to derivate result myself and select the iC to "up"? The KCL will be: $$ C*\frac {\partial v_{C}}{\partial t} = \frac {v}{R} $$.

Solving, get:

$$v(t) = A*e^{\frac{t}{R*C}} $$

And there is no "-" in "e" power. The other current direction give another tau. I know that one task may be solved with different solutions, but anyone can't take in mind not general solutions in mind for every task. I want to see where an error and how to changing directions of currents I can get proper results with method of that textbook.

For more clarification of my problem I redraw the schematic:

Now I think so: as the capacitor is charged and the external voltage source is turned off then I can think about capacitor as a voltage source with it's own stored charge and the "iC" current begin going through the circuit in one direction with "iR" and the capacitor is discharging through the resistor. The textbook recommends to write KVL with components sign equal to first achieved through loop, in my case it would be:

$$ -\frac{1}{C}*\int {i_C}{\partial t} + i_R*R = 0$$

solving it I get:

$$v(t) = A*e^{\frac{t}{R*C}} $$

Here ther is no "-" sign in exponent and that equation shows that the voltage on "R" will be increasing and stay on max. values. But it's incorrect! Where is an error? It seems to be I can't interpret a capacitor with stored voltage as an active component.


texts:
I want to generate a 15MHz clock from a 60 MHz clock. The 60 MHz clock has a duty cycle of 50%. The output clock of 15 MHz must have 25% duty cycle. How the following code needs to be modified to vary duty cycle?

entity clkgen is
    Port (
        clk_in  :  in  STD_LOGIC;
        reset   :  in  STD_LOGIC;
        clk_out :  out STD_LOGIC
    );
end clkgen;

architecture Behavioral of clkgen is
    signal temp: STD_LOGIC;

     signal count : integer range 0 to 1 := 0;

begin
    Clock_out : process (reset, clk_in) begin
        if (reset = '1') then
            temp <= '0';
            count <= 0;
        elsif rising_edge(clk_in) then
            if (count = 1) then
                temp <= NOT(temp);
                count <= 0;
            else
                count <= count + 1;
            end if;
        end if;
    end process;

    clk_out <= temp;

end Behavioral;

update:

@Dave this is what i got. Clk_out is not changing it's value


texts: Calculating Component Values for MIDI synth

texts:
I am reasonably new to this, and I am trying to find the calculations used to choose the component values in this circuit.

Concerning the Optocoupler, from what I can work out:

6N139 Forward Voltage = 1.4V
Supply Voltage        = 5V

so:       5-1.4/220= 16.36mA through the optocoupler.

But the MIDI standards state that it should be 5mA current loop?

Also, how was the other values calculated? Thank you


texts: How to properly snub transient spikes from a transformer and prevent switch mode power supply burn out

texts:
I've received a failed switch-mode DC-DC step down converter (part# LTC3631 from Linear).  This circuit was driven by a 24VAC transformer which is rectified on the circuit:

simulate this circuit – Schematic created using CircuitLab

The leads from the transformer to the circuit are quite long (>5m).  Apparently the 110V side of the transformer was switched off somewhat frequently lately which likely caused a spike on the secondary (24V) side.  The input pin of the LTC3631 has a visible mark where the blowout occured (gas escaped).

What's the proper way of preventing this from happening again?

this question is possibly related.


texts:
I have a small circuit with an ESP8266, a DS18B20 temperature sensor and a DHT22. I prototyped everything on a breadboard, and it worked fine. I then moved to soldering everything. My input Vcc is 5v, so I am using it to power the DHT22 and the DS18B20, and the same 5V are also going to the LM1117. Problem is, the LM1117 outputs just 0.65V instead of 3.3V, which is too low to power the ESP8266. I also tried to unsolder everything and just leave the LM1117 alone, and it still outputs 0.65V. Moreover, I changed the LM1117 with another one to check whether it was a malfunction, but it didn't solved the problem.

Any idea on how can I investigate this issue? Where is it possible that I am losing so much voltage?


texts: Matched biasing transistor compensates for temperature changes

texts: I fail to see why this circuit compensates for temperature changes with both transistors at the same temperature. If I understand correctly, the current through both transistors is the same, but I don't get why it is also independent of temperature. Can someone please clarify this to me?


texts: Double contact amps w/ SPDT latching relay

texts: I've been trying to source a latching relay with a 5VDC coil and a 12VDC, 30amp contact rating. It's easy to find latching relays up to about 16A... but beyond that most are non-latching and the rest are astronomically expensive. So... if I were to use a DPST or DPDT latching 16AM relay, could I just split the current by using both switching contacts, effectively creating a 32A relay?


texts: Is hot melt glue suitable as potting compound?

texts:
I need some small/cheap waterproof junction boxes for some 12v garden lighting. I am considering using little (25mm x 25mm x 15mm) potting boxes and after soldering the wires, then filling the potting box with hot melt glue.

However I am not sure how good hot melt glue is at protecting against water. I understand glue sticks are typically a thermoplastic - so should be waterproof.

The best information I can find in a datasheet is "Water Resistance: Good":

http://www.farnell.com/datasheets/1504158.pdf


texts: Amplitude stabilisation of LC oscillators

texts: Like diode stabilisation and FET stabilisation in RC oscillators, what methods are used for the stabilisation of amplitude in LC oscillators? I have found it very difficult to obtain a clean sinewave for Amateur radio purposes.


texts: How to connect generic smartphone LCD screen to take HDMI input from e.g. laptop?

texts:
For a certain project that has a specific screen size requirement, I want to use a phone-sized screen (6") to take HDMI from a laptop. Here is an example product:

https://www.amazon.ca/Digitizer-Display-Tactile-Compatible-Samsung/dp/B07P5CWXFB/ref=sr_1_6?keywords=6+inch+lcd+screen&qid=1589071330&sr=8-6

However it's pretty bare bones, and so I'm not sure how I could output a computer's video onto it via HDMI (or similar means). I don't understand the electronics needed to make this work.

What connectors/parts/modifications/whatever would make a display like the above be able to display the screen of my laptop?


texts: Use pack of 8xC size Ni-MH wired for 5.6v as power supply for Raspberry Pi

texts:
I've wired up a 4xC cell battery box in parallel with another of the same to give me about 5.3v (2200mAh Ni-MH).

I'd like to use it as a power supply for a Raspberry Pi (so normal USB voltage).
Is there a little something I can add to make sure the voltage to the Pi is correct? I'm guessing a step-down thingy?


texts:
i am new to the whole VHDL/FPGA thing, and i am trying to import a simple AND gate to my FPGA, but i get the failed message everytime, any idea how to fix it?

P.S : For some reason the device it detects is EP4CE15E22, instead of EP4CE6E22C8, which i tried to change to the correct one, but then when i would try to choose the file i want to import, it would roll me back to the wrong one.
Any ideas?


texts:
I'm trying to use JFET as resistor.

For use it as a resistor DS voltage need to be less than Vp. Vp from datasheet of 2n4391 is equal to -VgsOff and equal to 4.0V. How I can to set scheme to view that my JFET works as a resistor?

Datasheet link: https://www.centralsemi.com/get_document.php?cmp=1&mergetype=pd&mergepath=pd&pdf_id=2n4391-4393.PDF


texts: wanted to design a sweeper circuit to change a triangular wave into sawtooth wave. Is there a schematic for this to design a circuit?


texts: When are meanders necessary? and how to calculate timing differences

texts:
I've found that meanders are used for high speed traces like RAMs wires and are also used for coupled wires like in the usb.

My question is, how I know when I should use meanders to keep track lenght equal?

For example, should I use them for a 5Mhz SPI? and for 50Mhz SPI? or 100Mhz SPI?

If there is no generic answer, how can I calculate timing difference between two signals using their lenght? Can I use this information to know from datasheet if I should use them or not?(sometimes on datasheet, for example on SPI charts, there is indicated timing difference between CLK rise and MISO/MOSI change).


texts: LC Power filter not achieving modelled attenuation

texts:
I am testing an LC power filter and my real world measurements of high frequency (~1.5Mhz) switching spikes show that the attenuation is not remotely close to what my design model suggested.
Situation / Requirements
I have a 6A 7.5V Mean Well SMPS. GST60A07-P1J
It powers ~250 WS2812 addressable RGB LEDs
It's noisy, but an otherwise excellent supply. Even with only a small resistive load of 22 Ohm at ~300mA, (without the WS2812 attached, which run PWM internally so that would be worse) the output looks like this - AC coupled, so zero centered:

The main control loop of the SMPS is rippling at ~ 1Khz. This part is fine because we can clean that up with an LDO. What is not fine, is those switching spikes. They are about 400mV+ peak-to-peak and have very high frequency content which an LDO will not filter. Here is one of those spikes:

Just a visual estimate says that fundamental oscillation of that spike is about 1-2Mhz. My rudimentary FFT capability says there is content above the noise floor up to 5Mhz, which seems about right.
The challenge is that this same power supply needs to also supply the micro controller which runs the WS2812s and also includes some relatively simple analogue circuits and some rudimentary single channel audio. So I am trying to clean this mess up before feeding it to the uC and the analogues. I only need about 200mA of clean supply for the "brains". During testing I am using a 5V LDO, but the final design will be 3.3V.
Attempted solution
The only solution I know how to filter such high frequency content in a power line is a passive LC filter. Semiconductors can't keep up. LDOs PSRR drops quickly. "Capacitor multiplier" type circuits suffer from the same issue - the BJT can't keep up.
I am using the highest HF PSRR LDO I know of downstream of my LC filter: The slightly dated LM2931. This deals with the 1Khz SMPS loop ripple just fine, but it barely touches those spikes.
So I attempted to design and test such an LC filter. I loosely followed this process.
I selected a corner frequency (fc = 1/(sqrt(L*C) * 2pi) of ~1kHz by chosing this RLB0712-101KL 100uH inductor this 100uF Tantalum Capacitor. Note these are through hole components, the final design will be SMC.
I modelled the filter in ngspice with this model circuit (parasitic model components calculated from datasheets, according to that article):

The AC sweep simulation shows this:

Which is as expected from design and shows Vload / Vinput = -52db down (~ 66 - 14) @ 1Mhz and better up to 5Mhz. That would be a great result indeed, as the 400mV spikes would be squashed by factor 400x ( 10^(52/20) ) to ~ 1mV.
Reality
I built a simple test rig on vero board. I kept all leads super short and the whole circuit is just 15x15mm including LC filter and LDO stage with 2 more caps:

So what's the result? Quite disappointing really. I get this:

The yellow channel is the input from the SMPS, and the blue channel (note the scale is 10x less) is the "FilterOutput" node on above schematic - equivalent to Vload in simulation. The peak-to-peak averages in that screenshot show at best a 10:1 attenuation. Not 400:1.   (The LDO does fine in getting rid of the 1Khz ripple, that's not the focus here, but it barely further improves the spikes).
Questions

Is my approach "sane"? Did I miss a trick?
Why am I getting 40x less attenuation than the design simulation suggests? Component model? Through hole? Vero board construction ? 1-5Mhz is not very HF, really?
What can I do to squash the spikes? Use a second stage LC filter? Recommended approach to design equations? 4th order Butterworth? Link to article?

Many thanks


texts: Which is the suitable toroid ring to wind the gate drive transformer of a SSTC?

texts:
I found this “ferrite” (i’m not sure if its ferrite) ring from a SMPS. A choke, to be specific. It’s made of black- grey, very hard, brittle material. Lower density than a solid iron ring. Is it OK to wind a GDT with it? If not, what would be suitable?
Edit: large resistance, in the tens of kilo ohms scale


texts:
Ok, so I reinstalled my development enviroment on the mac using the latest build of avr-gcc (4.4.2), avr-libc and avrdude from the Fink project.

Problem is when compiling I keep on getting a linker issue "multiple definition of ...".

I have narrowed it down to a floating point issue associated with "libm.a" (using strtod()). All indications says to just include this library, but i'm unsure of how to do this in my Make file (below).

DEVICE     = atmega128
CLOCK      = 8000000
PROGRAMMER = -c stk600 -P usb
OBJECTS    = main.o a2d.o buffer.o gps.o nmea.o uart2.o vt100.o rprintf.o timer128.o tsip.o
FUSES      = -U hfuse:w:0x99:m -U lfuse:w:0xC2:m

AVRDUDE = avrdude $(PROGRAMMER) -p $(DEVICE)
COMPILE = avr-gcc -std=gnu99 -Wall -Os -DF_CPU=$(CLOCK) -mmcu=$(DEVICE)

all:    main.hex

.c.o:
    $(COMPILE) -c $< -lm -o $@

.S.o:
    $(COMPILE) -c $< -lm -o $@

.c.s:
    $(COMPILE) -S $< -lm -o $@

flash:  all
    $(AVRDUDE) -U flash:w:main.hex:i

fuse:
    $(AVRDUDE) $(FUSES)

install: flash fuse

load: all
    bootloadHID main.hex

clean:
    rm -f main.hex main.elf $(OBJECTS)

main.elf: $(OBJECTS)
    $(COMPILE) -lm -o main.elf $(OBJECTS)

main.hex: main.elf
    rm -f main.hex
    avr-objcopy -j .text -j .data -O ihex main.elf main.hex

disasm: main.elf
    avr-objdump -d main.elf

cpp:
    $(COMPILE) -E main.c


texts:
Waveguides can transmit very high powers, isolating the signal from external noises and interferences. Besides, waveguides have a very low loss. These capabilities make them an interesting candidate for signal transmission between two cities. Why are rectangular waveguides not used for inter-city transmission?

I guess it may be because rectangular waveguides have a narrow bandwidth, and therefore it is necessary to use many of them for signal transmission which is impractical. Am I right?


texts: Can't identify this component from a Lancer Monitoring System DW101E

texts:
I'm trying to reverse engineer this system to try to read an adressable transducer.
In this amp op configuration I don't know what this yellow component is supposed to do.

The component label is:
605
16 k
601

Any information or idea would much apreciated.


texts:
The above problem was asked in my test. I marked option D. But the solution says it should be option C.
Can any one please explain me what is y12' in the solution and from where it is coming ?


texts: Separating ground planes with different potentials?

texts:
Im currently building a signal generator and have a problem with placing multiple different ground planes which have different voltages.

The system is powered off of USB, so all my digital logic signals are referenced to the usb ground. I also have a virtual ground generated at half the voltage in order to power my analog circuitry. This means that all my digital signals are referenced to digital ground (0V) where as all my analog signals are referenced to virtual analog ground (2.5V). The analog signals consist of ~8MHz precision sine waves and their signal integrity takes priority.

Im developing this on a 2 layer board so I don't know if the bottom layer should be entirely digital ground, entirely analog ground, or a combination depending on the sub-system it's directly under.

Thanks!!

Ive placed a simplified block level diagram of my solution, but let me know if you wish to know any finer details!


texts: Power and RS-485 signal inside shielded CAT5 cable

texts:
I'll use a shielded CAT5 cable for RS-485 line. The simplified bus structure is drawn in the picture.

LDO is AP2204RA-5.0TRG1 with a 22uF electrolytic and a 1uF ceramic capacitor at the input. RS-485 IC is ADM2483BRWZ.

I have 130 slaves and their isolated part of RS485 IC is supplied from the supply placed at master. The cable length between slaves are about 0.5 meter. I tried it for 4 slaves and I'll increase it up to 130 slaves in the end. Is there any problem in this structure?


texts: Is this measured rise time inaccurate because of limited oscilloscope bandwidth?

texts:
I don't have an LCR meter and wanted to learn how to use a fast edge pulse generator and an oscilloscope to do capacitance measurements as an academic exercise.

In W2AEW's videos, he builds a simple fast edge pulse generator using a 74AC14 hex Schmitt trigger (inverting) and demonstrates how to use it for capacitance and inductance measurements as well as a time-domain reflectometer.

I've built this up on a breadboard, but am getting some different results.

I am measuring the input and output of the first Schmitt trigger with a 100MHz digital oscilloscope, with the same value components (6.8kΩ resistor; 0.047μF capacitor) at 5V DC.

First, the frequency is about 2.5 kHz, not 6 kHz as in W2AEW's example. I'm not sure what is causing the substantial difference. But for this application, the frequency is not as important, so I haven't worried about it.

Second (and what this question is about), when I look closely at the rise time of the square wave output, I am measuring something like 60ns, instead of <5ns as expected.

I realize that measuring something as fast as 2ns with a 100MHz scope is not ideal (I assume I would want something like 500MHz to obtain more detail), but I didn't expect such a difference.

W2AEW's edge, measured with a 350MHz analog scope is quite different looking:

Is it possible there's something wrong with my circuit, or do I simply not have a fast enough scope to measure such fast edges?

Edit/Update:

Per Oli Glaser's answer, the reason for the delay is that the probes were set to 1x rather than 10x, and limiting bandwidth, possibly as low as 10MHz. By setting the probes to 10x, the waveform immediately starts to resemble what it should (~13ns). The extra delay and capacitance is probably because I am using a breadboard and some unshielded jumpers to connect to the oscilloscope probes.

Here's the resulting improved display:


texts:
I've been playing around with an arduino and a few sensors when I came across this amazing communication protocol I2C with which a master can communicate with all of the sensors (or slaves in a more general term) on the bus. So far so good. I was wondering is it safe and convenient enough to build the whole hardware around I2C given that all the devices on the I2C bus need to have a unique address?
Let's say there's a product line where multiple slaves can connect to the bus (emphasis on CAN and not MUST). How shall I/we solve the problem of assigning a unique address to each slave individually?
I found out this thread where the same problem is addressed but it lacks any working examples. More precisely, can someone add a working example where a setup involving arduino(s) is using SMBus ARP protocol to assign address to all the slaves.
EDIT: I found this thread as well but not just it lacks any working example but requires a lot deeper understanding of the circuit which did not make sense given my use case is not to get into the design of the circuit at this micro-level.


texts: What does Construction and Standard/Alternate within the PCB Fab Industry?

texts:
In the Constructions Column, it indicates AxB.

By the looks of it, B is referring to the woven glass material.See pg 7.

What is the A in Constructions (AxB) and why would anybody care ?
What does the Standard/Alternate column mean ?

Source of chart : Isola Group


texts:
I'm working on a budget simulator build, and I'm planning on have a selection of switches or devices that work in a "Toggle" manner, i.e. latches in the on position until moved to the off and vice versa.

The issue I face with this is that most of the commands I want to control are normally controlled by a keyboard, and expect a momentary input. I'm planning on using an old keyboard as my input device, taking it apart and soldering leads onto each of the key contacts. Im hoping for 2 functionalities:

1) When the toggle switch is flipped from off to on ONLY, allow a momentary connection across the keyboard contacts.

found this link but uses double pole switch, need to be able to use single pole

2) When the toggle switch is flipped from off to on AND from on to off, allow a momentary connection across the keyboard contacts.

The link above has a solution but same issue as above, plus it requires relays, hoping to do this with small, inexpensive components

This link i think has a solution, but I know nothing about logic gates and my electrical expertise is limited t best, trying to figure what connects to the 3 leads (assuming the arrow is ground, the left is the positive contact and the right is the negative contact?).

I tried simulating on falstad.com and only get an inital pulse on, nothing off or on subsequent flips. The voltage on the two comparator legs of the gate both read the same voltage.

Any help would be much appreciated


texts:
Problem: I own a home that I'm not always at, It rains there a lot and I need a way to monitor if there is rain by using a sensor so i can turn on a pump to move the water away from my house.

Solution: I'm using a raspberry pi to do all the heavy lifting. So I have a relay along with code that talks to everything. The raspberry pi is the easy part of this. I'm a CS not a EE.

My question: I'm looking for a sensor that will last outside without any maintenance, for up to 6 months. That will sense if it is wet and talk to the raspberry pi. I found a sensor.

http://www.seeedstudio.com/wiki/Grove_-_Water_Sensor

That I'm pretty sure i can hack up, but haven't found anything that looks a bit more "long term." For my application, i think im going to really test the hell out of this, if it breaks i would have to monitor my house physically with a web cam to see if its flooding. If i found a sensor thats reliable, i could save time by not worrying about it at all, and letting the sensors + raspberrypi + notifications to do all the "worrying" for me.


texts: Does a radio station main amplifier work at the speed of light?

texts:
I'm having an argument with a classmate and we can't agree.

He tells me that it's not possible for the amplifier of a radio station to amplify the input signal "instantaneously" (at the speed of light), because they work with very big powers (tens of kilowatts) and you can't accelerate the electrons that quickly.

I insist that since it's an analog device, it will work at speed of light, and that you don't need to accelerate the individual electrons, but only the electric/magnetic fields.

So which one of us is right in this particular case? Is there a delay in amplifying a signal for a high powered radio station? The radio station part is important. He agrees for example that a typical home audio amplifier is instantaneously.

It would be great if you could provide a reference link for an answer (if possible). Wikipedia would be fine. But don't waste your time searching for one.


texts:
I am solving a problem here that asks for average power across a resistor.... the resistor is 3k and V(s) = 1.897sin(500t - 71.6)...

I found 0.8 mW ....but the answer book says that it is 0.6mW ...

isnt it ... (Vrms)^2 over 3k ?
Vrms = 1.897/sqrt(2)?

***if A = 1.987 ... the power comes out to be 0.6mW ....I do not know if I am right or the booklet is


texts: Wiring Diagram Software for Open Source Projects

texts:
So, obviously, there are plenty of CAD software options out there for hobbyists and open source hardware folks to do PCB schematic capture and layout.

However, I'm having a really hard time figuring out the best way to draw up wiring and connection diagrams for assemblies. Auto Cad is waaaay to expensive for hobby work, but I'd like something reasonably professional. The closest I've seen is qelectrotech, but the documentation is mostly French, and it was pretty rough to learn. It also doesn't do system level cable connection diagrams.

Is anyone aware of a reasonable way to do this without using something nasty like Visio? Maybe misuse of KiCad in some way or something?


texts: Is this charger suitable for a 18650 battery?

texts:
I'm not really into Electrical stuff and this is the only place where I can ask this question and get a nice and described answer, basically I'm lookin for a good Charger/Discharger for a couple of 18650 3.7v Lithium batteries and I came across this:

AccuPower IQ338 Fast Charger and Analyzer Tester for Li-ion NiMH NICd Rechargeable Batteries

It looks good to me but I read that it apply a charge voltage of 4.13V, is this ok in my case?


texts: How to set phase delay for a three phase igbt rectifier

texts:
I have a three phase igbt rectifier like so.

three phase voltage = 690V. how to set the phase delay and DC link capacitor value(F) to get Vdc = 1070.

I have updated the complete simulation with the load.

I appreciate any help.


texts: Changing board shape in Altium: sliding the edge does not work

texts:
How can I slide this edge?

According to Altium documentation, I should:"Click anywhere along an edge, away from editing handles, and drag to slide that edge" but it does not work for me. What am I missing?


texts: Should ground be shared between MOSFET gate, draing and source?

texts:
I'd like make a voltage buffer with MOSFET STD12NF06L-1 IPAK - STMicroelectronics

Configuration of Gate and Drain is given below:
(Ignore disconnected Source. I will do it later.)

Yellow circle indicates SMA port, a pair of signal and GND. Red and black are Vcc and GND, respectively.

What I concern is, USRP and power supply may have different GND level.
And USRP consists of FPGA and daughterboards with ADC, DAC and signal processor.
I am worried that either USRP or power supply gets damaged if I connect both GNDs to meet each other.

Therefore, my question is, should they have shared GND? If yes, how do two different equipments share the GND?


texts: There is Hardware, Software, Firmware and ...FPGAware?

texts:
I think by this day and age we all probably have a pretty good understanding of the distinction between hardware and software. In addition it is widely accepted that firmware is software that is injected into an embedded system in a way that it is not readily changeable for each time you power up and run such system.

Many designs of systems use FPGA components that are "programmable" in the sense that they load an image from some non-volatile FLASH memory at power up that configures the FPGA to perform some intended functionality in the system. My question here is what is the generally accepted name for the FPGA data collateral that defines its functionality? As you can see in the title I have made up the loose term FPGAware but I rather doubt that it is the term really in use.

For purposes of this question let us consider that the FPGA consists of basic logic that includes gates, flip flops, registers, sequencers and state machines. The FPGA would NOT include a fixed or synthesized processor core that runs some "software".


texts:
I'm trying to understand the timing for the SPI analog to digital converter MCP3201 by Microchip.

What I understand is that I can clock it up to 1.6MHz, and the conversion takes 12 clock cycles.
So that should mean that the conversion, at that clock speed, takes (0.625uS * 12) = 7.5uS.

But then, how long does it takes to trasmit the data to the microcontroller?

The maximum ksps spec (100ksps) seems to indicate that the fastest conversion/acquisition that we can do takes 16 cycles (1.6MHz/100Ksps), so 10uS.

I may be totally wrong on that.

But if I'm right, then why the 2.5uS gap (10uS - 7.5uS)?
To be conservative, or because that extra 4 cycles are needed to trasmit data to the microcontroller?
Or other reasons?

There is a timing diagram (of course) on the datasheet that should give me the reply, but since I'm not an engineer I have some difficulty to fully understand it.

Link:
http://www.microchip.com/wwwproducts/en/MCP3201

Datasheet:
http://ww1.microchip.com/downloads/en/DeviceDoc/21290F.pdf

thank you
Dimitri


texts:
I want to build a smart locker using this part
https://www.aliexpress.com/item/32845920160/32845920160.html and a CD74HC4067 multiplexer. Essentially I need to turn on only one lock at time using a relay. I have seen that the lock draws 350mA @ 6 V. Am I risking to burn CD74HC4067 chip? Do you know if there is a multiplexer with higher currents than this?


texts: What is the Ohm measure value of this resistor?

texts:
Resistor Ohms Value?
In diode mode test, it will show continuity or sound. is fused or blown. It is in the negative line of Electrolytic 400volts 22uf capacitor, such capacitor in direct after the diode bridge rectifier. As I said the resistor is in the negative line direct current of 400volts line, the resistor is between the capacitor and the Source of the Mosfet SVF4N65(4A,650V N-CHANNEL)
I really cant apply the standard code color to figure what Ohms it is. It is part of a commuted power supply of a Chinese amplifier speaker. There is no diagram on earth to get information of. Just one poor picture from the manufacturer that I attach.
May you help guys to calculate of figure it out the value of this overseas resistor?
Black - Yellow - Violet - Grey - Brown


texts: Supercap charging circuit for RTC backup on STM32

texts:
I'm asking for a reliable/simple/cheap circuit for the VBAT section of a STM32 design, powered at VDD=3.3V, that will safeguard the built-in RTC (based on 32768 Hz Xtall) for like 10 days.

Based on C = t⋅I/ΔU, its looks like a 1F supercap will do (I'm taking t = 864000s, I = 1.2uA, ΔU = 1.1V, see below). I need a charging circuit that

does not fry the supercap;
does not fry the STM32 or prevent it from starting-up reliably (in particular: I do not see a specification for what happens when VDD=3.3V, VBAT<2V)
does not add significantly to the STM32 power drain on VBAT;
delivers proper VBAT quickly (0.2 s) including after full discharge, so that the RTC is always available soon after power-on reset;
brings the supercap to near full charge soon enough after VDD is applied (perhaps 80% after 50 s), so that testing leaves a decent reserve.

The simplest I can think of is

Any criticism? Suggestion on the diode (perhaps a Schottky would be better) or other component? Alternative?

A most relevant section of the STM32(F100) data sheet is:


texts: Is it OK to leave some part out of the schematic if noted?

texts:
When I make schematic drawings for my projects I tend to leave things like the power switch, fuse etc. out of the schematic. I do it because I don't feel it's an important part of the circuit, one might argue that it's not actually a part of the circuit at all. And I like keeping the schematics as clean as possible.

Is this OK? Or considered bad practice? I do make a note of that I have left out, like on the image below.


texts:
I am new to the whole Arduino thing and am having problems loading 'Processing'.

When I attempt to run the Processing program it says 'This Program requires Java Development Kit 1.5.0'.  When I go the the Sun site to load this, I can't find SDK 1.5.0.

Does anyone know the exact name of the app I have to load in order to successfully run Processing?  A web link to the correct app would be greatly appreciated.


texts: Can I splice a standard AC power plug onto a 2-pin DIN table lamp cord?

texts: I've acquired a table lamp with a 20W 12V bulb (possibly from IKEA?). The cord terminates with a female 2-pin DIN (41529) connector that I do not have an adapter for. Am I correct to assume that it needs an AC adapter to connect to my 120V wall socket, or could I simply splice a standard wall plug in place if the DIN connector?


texts: Background needed for a simple RF transmitter/receiver pair

texts:
Current background: I'm familiar with the very basics of linear circuits, and I've played around with microcontrollers a bit.

I'd like to make a simple radio transmitter and receiver for digital data. What books or other resources might guide me along the way? I realize it may take a couple years to learn enough to actually make something.


texts: USB B, mini B, or micro B for product design

texts:
I'm trying to decide which connector I should use for a USB peripheral I'm designing. Is there a guide for choosing one?

The device is a portable electronic scoreboard that's 16"x10"x1". It will be outside, possibly in wet conditions. It will not draw power from the USB. The only thing the USB will be used for is slow terminal serial data back and forth.


texts: Can I charge a 3.7v Lion with a 4.2v Lipoly charger?

texts:
I have some 3.7v (when fully charged) lion batteries that I would like to repurpose. All I have to charge these is a few chargers for some 4.2v lipo (when fully charged) batteries. The specific charger is here. It puts out 100 mA. Would this difference in voltage result in the harming of either my charger or the battery, or would it be safe?

Thanks for your help.


texts:
I am writing one AVR Mikrobasic Program which my Atmega32 flash memory is fulled.

Can I use EEPROM space for saving my functions routines instead of flash memory for releasing some space of flash memory?


texts: Turn off MOSFET with diode - PWM controller Maximal output current

texts:
Here is my circuit (and I know that this circuit does not cause any problems at least for the moment):

For turning on, the maximal current from the pin "OUT" is limited by the resistance Rgate and the voltage VDRV as a worst case. Nevertheless for turning off, the maximal current is only limited by the impedance of the diode and the internal resistance of the PWM controller. For the PWM controller that I am currently using the maximal output current is 1A. So the impedance of the diode plus the internal resistance should be at least equal to 13V5/1A, ie 13.5 Ohm. I would be surprise to have a diode with an impedance equal to 13.5 ohm. The diode used is the 1N4148 (CMS).

PWM controller datasheet :
https://www.ti.com/lit/ds/symlink/uc3843.pdf?ts=1593619118110&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252FUC3843
1N4148 datasheet :
https://www.vishay.com/docs/85748/1n4148w.pdf
What do you think about it ? Do you think that it may degrades the components over time ? Or do you think as the current exceed 1A during a very short time, it doesn't cause a problem as it probably depends on the junction temperature of the output stage of the output pin which probably does not have the time to exceed the maximal temperature ?
Thank you very much !


texts: Can we find potential difference of a P-N junction by connecting voltmeter?

texts:
Can we find potential difference of a P-N junction by connecting voltmeter across diode terminals?
I know the answer is no but i don't know how.


texts:
let's consider the following charge pump, which is used a lot in some PLL circuits (reference):

Let's focus on the left part of the circuit (until the Loop Filter Network): its aim is simply that of generating a pulse current which charges the Loop filter when UP is ON, and which discharges the Loop filter when Down is ON. This can be also done by using only two switches, but in this way 4 switches are used in order to compensate the charge injection problem, which is due to the gate - drain parasitic capacitance of each MOS switch.

This explanation is that I have read on my notes, in which there is also this scheme:

But I do not understand what exactly this charge injection problem is, and how the additional presence of two more transistors may reduce it.


texts: What is the y21 parameter for this two-port network?

texts:
As shown by the circuit diagram, this network contains a 10 ohm resistor in series with another 10 ohm resistor, which is in series with a current controlled voltage source (ccvs) of degree 4I2 that connects down to a t-shaped node. I1 runs through the first 10 ohm resistor and I2 runs through a short circuit node connected between the two 10 ohm resistors and an open circuit node. We are supposed to find the y21 parameter for the circuit. Upon exciting the open circuit between the top 10 ohm resistor and the bottom node below the ccvs and creating a short circuit between the open circuit node of I2 and the open circuit node below the ccvs, the branch of the circuit with the 10 ohm resistor in series with the ccvs is short circuited. From there we have a single loop circuit with a 1A current source (excitation) and a 10 ohm resistor. Since I2 is being measured in the opposite direction of the current source, I2 = -1. And the voltage across the current source is 10 V as shown by ohm's law.
Therefore y21 is -0.1 S. Am I correct?


texts: What are the possible shortcomings of using Arduino on a Raspberry Pi 3 rather than as typically on a desktop or laptop running Windows or Linux?

texts: Setting up a laboratory for kids and cannot decide on which to run Arduino, a Raspberry-pi which I can use for other maker projects, or a normal computer, like a desktop or laptop? Will I face severe shortcomings when running Arduino on Raspberry Pi (3)?


texts: Driving a 5-Phase / 5-Wire Stepper Motor

texts:
I have a penta-drive 5-phase motor with 5 wires that I'm looking to drive with a microcontroller and driver board.   I have a driver with 6 H-bridges that I was hoping to use.  If this was a 10-wire stepper where each coil is separate, its easy to connect and drive with 5 individual H-bridges.

How can I wire and drive this for the 5-wire setup properly?


texts:
I have a electric generator in my house which runs on petrol fuel and normally it takes 1 liter for running for 1 hour. It doesn't matter if I light up whole house or only single bulb when it runs for 1 hour it will definitely consume 1 liter fuel. Why is this so?
If fuel consumption doesn't matter on energy produced (it matters on engine running time?) like if only 9W bulb is switched on then where does other energy goes? because it is producing according to fuel input.
If other energy is stored in wires than why doesn't wires heat up too much after long time of generator power supplying?


texts: Simple solution for driving a large-ish RGB LED array with PWM

texts:
I'm working on a small toy-like device that has a 10 x 8 "pixel" array of RGB LEDs at its core; thus there are 10 x 8 x 3 = 240 individual LEDs to be controlled. I'd like to control the intensity of each LED individually, basically creating a 10 x 8 pixel full-color display.

The display will be driven by an AVR-series microcontroller. I'm looking for a simple solution to drive 240 channels while being able to control brightness (power) on each channel individually. As far as my research goes, there's no other way to do this efficiently than with PWM.

However, no AVR has 240 outputs, so some kind of expansion/multiplexing/serial-to-parallel conversion is necessary. Shift registers would be a solution, but in combination with PWM I've been told this will be too slow.

I've looked at dedicated LED driver chips with PWM that are controlled via a serial interface. (Texas Instruments makes several such devices, for example). However, they have a maximum of 12/16/24 channels, so I'd still need quite a number of these devices. As long as the drivers can be daisy-chained, this might work, but the device is going to be smallish, so I don't have space for a large number of components.

I don't need lots of resolution when controlling brightness. 8-bits would mean 255 levels per LED, which is plenty. Drive current would not be an issue either as I will be using low-power LEDs which should be driven directly from the outputs of a controller or driver. Speed won't be an issue either; the object will display "images" for consumption by human eyes, so I'd need 20-30 "fps" maximum.

While I've been doing quite a bit of research, I'm not sure I'm looking in the right places, so I thought I'd ask a question here. I'm looking forward to any hints and insights and thank you in advance for any pointers and ideas!


texts:
I have a board with a 50 Ω impedance controlled track. I have got the boards manufactured. The manufacturer has sent me 2 additional boards viz - test coupons. I understand that test coupons have the same impedance controlled design and are used by developers to test the impedance controlled track.

How can the impedance be tested on these coupons?
Can I use an oscilloscope?


texts: Can I replace a usb micro b connector with JST xh connector?

texts: I am working on a project where stm32 HID device is connected to a PC using USB cable. There is no need for unplugging on the product side, so can I replace a usb connector with JST one or directly solder it on board? Does the metal part of micro usb play a role in data transfer?


texts: 8051 I/O programming logic/ how it works

texts:
I'm new to microprocessors and trying to figure out how they work. I am quite confused about using the ports as inputs and outputs. It says that we should send '1' to the pin if we want to use it as input and '0' for output. What happens when a '0' comes to an input port as data? Will that port still remain as an input port? Will the output pin remain an output when '1' comes in?

I know that I'm missing something quite obvious but I couldn't figure it out, even though I have checked many different sources. I wonder how the pin circuit works and how it is affected by commands.


texts: SIM800L CREG AT command returns 0,2 when no SIM and 0,0 when SIM is inserted

texts:
I have an SIM800L module. It is connected up in the same way as this website shows,( i.e 10K resistor from Rx to Arduino data-pin and 20K resistor from Rx to ground.)

Only difference is I'm using an 18650.

I've checked the voltage and got the module to print out the battery status on the serial monitor, and everything seems fine. I put a SIM card in there (one that I used with my smartphone) which was Vodafone. T-Mobile network was the only one that was coming up as available operators for some reason.

The output that I get from the SIM800L is this below.

I can never get the SIM800L to register to a network, and I don't know what I'm doing wrong.

I'm a n00b and this is my first time trying something like this.


texts: N-mosfet low-side switch being turned on with no direct gate drive signal

texts:
I made a relay h-bridge by using two 40 amp single pole double throw relays.  I used this h-bridge, and another, to each drive a wheel chair motor fused at 20 amps each.  I control the direction of each motor via an arduino uno driving a few transistors that I use to drive the relay coils. Thus I am able to get four driving conditions(directions) by selecting the direction of the left and right motor.
*Forward(turn both motors clockwise in the same direction)
*Reverse(turn both motors counterclockwise in the same direction)
*Left(turn left  motor clockwise and the right motor counterclockwise)
*Right (turn left  motor counterclockwise and the right motor clockwise see image attached below.

This system worked fine, allowing me to drive a machine that the two motors propelled via each driving a wheel on each side of a four wheels cart. The two non driven wheels are caster wheels.

I then added N-mosfet low side switches to each motor relay h-bridge by removing the ground connection in the h-bridge and connecting these ground wires to the respective mosfet drains. See second image.

All worked well and I was able to PWM the motors for variable speeds. Now the last thing I wanted to add for this project was variable duty cycle, or different duty cycle, to each wheel. to run the motors at slightly different speeds so as to have the cart veer a little left or a little more right or to make larger arcing turns rather than the skid steer turns I was doing with the relay h-bridges.  No mater what I tried it seems that while I send each motor a different Duty cycle, both mosfets/motors sync up i.e turn on at the higher duty cycle being sent to the n-mosfet feeding one side of the system.

Even if I stopped sending the one side pair of mosfets a gate signal(grounding the gate at the gate driver board) while sending the other pair of mosfets their pwm pulses, the pair not being sent any signals still turns on in sync with the PWM. Also, now that I run the motors via sending them different PWM duty cycles,  I am getting mosfet failures every so often. I suspect that the driven mosfet is always inducing the non-driven mosfet side; how, I do not know. I am using 56 ohm gate resistors. Each motor is fused at 20 amps, I think the drawl per motor is between 10 -15 amps when riding on the ground. During this testing the cart is on a test stand free wheel spinning.

I have done everything I can think of via manipulation of the gates to no avail. The protection diodes are Shotcky diodes 30 amps each. I have a pair across each mosfet as they were dual anode single cathode 220 packages.

I suspect that I am losing mosfets when sending differing PWM signals because the induced turn on mechanism is not sharp or clean thus maybe sending the gate of the off mosfet into the linear region although all visually looks good with motors turning in sync, although each should be doing their own thing(turn rate.  I am using the Arduino Uno, PWWM is on pin 10 and 11(different timers), 500 hz.

I am looking a this as being a circuit problem. I am using a logic mosfet part number FKI06269 (60 volts, 24 amps). Two in parallel on the low side for each motor.

The motor drive protection diodes and mosfets sit on a solderable perf board about 2.5 feet from the arduino. I am using 14 gauge wire to this board for most connections but the gate drives feeds are 22 gauge. I use individual wire feeds for the left side motor protection components and the right side motor protection components as well as the left mosfet drivers and the right mosfet drivers. I am using 5 k ohm pull down resistors on each gate but have gone as low as 500 ohms when trying to eliminate my problem. While the drawing represents the circuit I understand the pull down resistors are not shown.

If someone can give me their thoughts on what the problem is, or may be, I would appreciate the insights.

Thanks, D


texts: Contactor/relay rating for bypass function of soft start circuit

texts:
I am designing a soft start circuit for a 70KVA, 70A, 480/230 delta/star transformer, since the fuses kept blowing without.

I've been using 3 NTC thermistors rated for 80A in series with the lines limit the inrush current, but obviously get very hot at nominal load current.

Now I want to bypass the NTCs with a contactor/relay after 100ms or so, in order to reduce the dissipation in the NTCs. The schematic below for reference.

Since I am not very experienced with high power systems, I have a couple of uncertainties:

What should the current/KVA rating of the contactor/relay be? It will not be switching on the full load, only sourcing when already energized. It can however be happening that someone switches the main disconnect switch on full load. Does this create a arc in the relay, or is this limited by the NTC's which are still in series?
Do the inrush current limiters need to be NTC's or can I use regular (i.e. 5 ohm) power resistors?
Is it important to have the relay rated for US 480V, or will a EU 400V version do?


texts: Power MOSFET (Smart HITFET) back-feeding and turning itself on

texts:
I have a BTS142D "smart" FET low-side switch driving a 12v load, all works great except when the logic (gate) side of the circuit is powered down but the 12v load is powered (Vbb = 12v), it back-feeds through the device (protection circuit presumably), pulls the gate pin (Vin) up to ~5v and turns itself on.

Is this as simple as just adding a stiff enough pull-down resistor to the input or have I missed some design criteria?
The data-sheet / appnotes say nothing about this behaviour.


texts:
I'm trying to get SPI communications working on a ATmega1284P. This is the code I'm using:

// clocked by external 12.000 MHz crystal, lfuse=0xce
#define F_CPU 12000000

#include <avr/io.h>

#define SPI_SCK PB7
#define SPI_MISO PB6
#define SPI_MOSI PB5
#define SPI_SS PB4
#define SPI_PORT PORTB
#define SPI_DDR DDRB
#define SPI_PIN PINB
//#include "spi.h"
//#include "serial.h"

void initUart()
{
#define BAUD 38400
#include <util/setbaud.h>
  UBRR0H = UBRRH_VALUE;
  UBRR0L = UBRRL_VALUE;
#if USE_2X
  UCSR0A |= _BV(U2X0);
#else
  UCSR0A &= ~_BV(U2X0);
#endif
  UCSR0B |= (_BV(RXEN0) | _BV(TXEN0));
  UCSR0C |= (_BV(UCSZ01) | _BV(UCSZ00));
}

void cOut(unsigned char c)
{
  while (!(UCSR0A & _BV(UDRE0)))
    ;
  UDR0 = c;
}

inline void spi_init()
{
  // set MISO as input
  SPI_DDR &= ~(_BV(SPI_MISO));
  // set MOSI and SCK as output
  SPI_DDR |= (_BV(SPI_SCK) | _BV(SPI_MOSI));
  // enable SPI, master mode, and SPI prescaler
  SPCR = (_BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0));
//  SPCR = (_BV(SPE) | _BV(MSTR));
}

unsigned char spi_transact(unsigned char c)
{
  cOut('t');
  // put byte to transmit into buffer
  SPDR = c;
  cOut('+');
  // wait until the SPI timer has overflowed
  while (!(SPSR & _BV(SPIF)))
    ;
  cOut('T');
  // return the byte transferred in via SPI
  return SPDR;
}

int main()
{
  // disable JTAG for full access to port C
//  register unsigned char regTemp = MCUCR | _BV(JTD);
//  MCUCR = regTemp;
//  MCUCR = regTemp;

  initUart();
  SPI_DDR |= SPI_SS;
  spi_init();

//  sOut_P(CRLF);
  cOut('\r');
  cOut('\n');

//  SPI_PORT |= SPI_SS;
  cOut('1');
  spi_transact(0xa0);
  cOut('2');
  spi_transact(0);
  cOut('3');
  spi_transact(0);
  cOut('4');
  spi_transact(0x12);
  cOut('5');
  spi_transact(3);
  cOut('6');
  spi_transact(1);
  cOut('7');
  spi_transact(1);
  cOut('8');
  spi_transact(0x13);
  cOut('9');
//  SPI_PORT &= ~SPI_SS;
//  sOut_P(CRLF);
  cOut('\r');
  cOut('\n');
  cOut('!');

//  sOut("Clock reset\r\n");
}

I currently have nothing actually connected to the SPI pins yet, as I'm trying to see if I can get it working before I connect the SPI slave to it.

My terminal outputs "1t+T2t+" from the UART, showing a stall on waiting for SPIF to be set, but if I touch the end of a lead connected to SCK it does eventually get past that and completes the SPI session. Why would loading SCK externally make it work, when the clock is supposed to be generated by the master internally?


texts: Why is Full-speed USB considered differential and what is its common mode?

texts:
I am reading USB 2.0 standard, particularly about High-speed part, and I can't understand why do we consider that HIgh-speed USB uses differential signaling. Or at least why it is balanced? For transmitting logic 0 or 1, USB transmitter drives either one line or another with 17.7mA, and if said differential, I would expect currents with the same intensity but opposite directions.
Because of my previous problems to understand this issue, i am not able to understand what is than a common mode on the USB bus in High-speed mode.


texts: How to use one H-bridge to control multiple latching solenoid irrigation valves?

texts:
I'm using Arduino Uno to operate a latching solenoid irrigation valve by using an H-Bridge to set the polarity of the 12V DC going to the valve. A 500 ms + pulse on a digital output pin turns the valve on and then the polarity is reversed and a 500 ms - pulse turns the valve off.

Now I want to operate multiple valves and rather than using a separate H-bridge for each want to know if I can connect the valves in parallel to the 12V circuit and switch them individually with output from different pins.

It seems this could be done with transistors or a chip. A project I built to switch a non-latching solenoid used a TIP120 Darlington NPN Transistor but that will send current from the emitter to the collector, correct? and I need to be able to have current go in either direction. Is there a way of doing this? Thanks.

Edit to add project description: My current design phase is to irrigate 6 almond trees planted in barrels, with control from soil moisture. The next phase would be to control irrigation, with multiple sensor types, to 270 plots. The "aspirational goal" is to irrigate each tree in an orchard individually so ~ 1,000-10,000 locations so cost and power efficiency are important.


texts: Analog filter -> cutoff frequency question

texts:
My "teacher" gave me the following filter circuit:

Then, asked me to find the cutoff frequency, when \$R_1=1000,R_2=250,C=100\cdot10^{-9}\$.
I did find the poles and zeros and they gave me \$\omega=8000\$ and \$\omega=40000\$,

but the \$-3\$dB point gave me \$\omega=\frac{40000}{\sqrt{23}}\approx8340\$

and \$-3\$dB above the limit when \$\omega\to\infty\$
gave me: \$\omega=8000\sqrt{23}\approx38367~~~\$.

So who is wrong and where?


texts:
\$C = 1 \mu F\$

\$L = 2.2 mH\$

\$r = 1.7 \Omega\$

\$f = 4000 Hz\$

\$V_{IN} = 2.6 V\$

I have this RLC circuit where I need to find \$V_{OUT}\$. I have tried it by finding the \$Q\$ factor and then multiplying it with \$V_{IN}\$ which gave me the value \$84.56427 V\$. However, when putting that value in as an answer in the system I'm using, I don't get the right answer, even if I round it up to \$84.6 V\$ or \$85 V\$.

What am I doing wrong?


texts: Buck converter with no datasheet questions

texts:
This is a charging ic/circuit from an iPhone and there aren’t any datasheets available for it.

I have a few questions:

What would the purpose of the series capacitor c2300 on the switching side be for?
What are PMID capacitors for?
Why would q2301 be used if it looks to always be on when 1.8v is at the gate which is basically all the time when there’s power to the phone

Sorry if the picture isn’t clear it’s a screenshot from my phone


texts: Meaning of certain symbols and labels in Circuit board PCB

texts:
I have a schematic of an electronic circuit board or PCB. I want to know the meaning of certain symbols and labels in the diagram. I have highlighted the diagram below with green, yellow and grey coloured boxes.

Question 1:
What is the meaning of symbols, >> , < <> > and << ?. See green box.
Question 2:
What is the meaning of n in HDMICLK_DISn? See yellow box.
Question 3:
What is the meaning of 6, 10, 11 in grey box?
Question 4: Why the resistors have values as zero at certain places? What does it signify? For example see the 2 resistors on top of the schematic. They have value 0.
I would appreciate answer(s) to any/some/all of above questions.


texts: I know next to nothing about PAL. I was wondering how one goes about programming a PAL (an old TIBPAL 16L8-25CN in my case) to drive a seven segment display, sort of like a HEF4511B. Right now I just have an arduino uno and a raspberry pi, do I have to buy an EPROM programmer? What program should I use?


texts: Can someone explain me how to see if a binary number is signed or unsigned and explain me about signed and unsigned numbers.


texts:
I'm trying to read values from a SCT-013-030 sensor that gives 0-1vac readings .
My board analog inputs are 0-10vdc,giving me a value from 0 to 65500 .
I need to know what is the best method of amplify this signal to be more accurate possible.

I read something about SCT sensors on Openenergy and Arduino (0-5v inputs) but i don't understand circuit..


texts: Can I use exp() function inside PIC877A?

texts:
I compiled this code successfully in mikrocpro. But I can't get output in proteus.

This is the hex file link HEX FILE:

          // LCD module connections
      sbit LCD_RS at RD4_bit;
      sbit LCD_EN at RD5_bit;
      sbit LCD_D4 at RD0_bit;
      sbit LCD_D5 at RD1_bit;
      sbit LCD_D6 at RD2_bit;
      sbit LCD_D7 at RD3_bit;
      sbit LCD_RS_Direction at TRISD4_bit;
      sbit LCD_EN_Direction at TRISD5_bit;
      sbit LCD_D4_Direction at TRISD0_bit;
      sbit LCD_D5_Direction at TRISD1_bit;
      sbit LCD_D6_Direction at TRISD2_bit;
      sbit LCD_D7_Direction at TRISD3_bit;
      // End LCD module connections

void main()
{

      char ch;
      double m,a;
      m=5.10;
      a=exp(m);

      TRISD = 0x00; // PORTD is output

          Lcd_Init();                      // LCD display initialization
          Lcd_Cmd(_LCD_CURSOR_OFF);        // LCD command (cursor off)
          Lcd_Cmd(_LCD_CLEAR);             // LCD command (clear LCD)

    while(1)
    {
          ch=sin(3.14/2.)+800/100;
          Lcd_Chr(2,1,48+ch);
          Delay_ms(1);
    }

}


texts:
In an FPGA code, if I have something like the following:

(* LOC="M18" *)   output reg      lcd_e;

where lcd_e is an input/output port.

Does this mean that I do not need to create a UCF file pointing lcd_e to M18?
What does "(*" and "*)" indicate?


texts:
Some Background:

I am working on an embedded c project for a samd21j18a MCU. The MCU communicates with 2 crypto eeproms on the i2c bus. All the data is encrypted with AES in CCM and additional authentication uses SHA256. It is safe to say that if the bus is sniffed, the data is secure. My question is that during some authentication checking it is possible that EEPROM can return a true/false value for authentication. This is an optional means of authenticating. It is possible that a device can sniff a bus and also spoof a valid response?


texts: Using a DC voltage as the base for a transistor to amplify AC Voltage

texts:
I'm a little new to electronics, particularly transistors, so I don't know a lot of the different types and inner-workings of them.

I have a diagram which, hopefully, will gradually increase the brightness of a light bulb over about 30 minutes.
I use a DC RC circuit to slowly increase the voltage at the base of the transistor from 0 to 35V DC.
The collector and emitter of the transistor are in series with the light bulb and a 120V AC power source.

I'm wondering what kinds of complications I might have with a transistor using DC as the base, and AC for the collector and emitter.

Edit: Here's my diagram

Sorry it's not the best quality, camra troubles today.


texts: Why are complex valued zero and pole not used in lead or lag compensation design?

texts:
Consider the compensation transfer function \$\frac{s+z}{s+p}\$ so that the inequalities \$0<z<p\$ and \$0<p<z\$ correspond to lead and lag compensation respectively. It can be seen that at very low or high frequencies, the lead and lag compensators correspond to the behaviors of high and low pass filters respectively.
If \$s=\omega j\$, then the complex plane positions of the numbers \$s+z\$ and \$s+p\$ will lie on the same vertical lie in the half plane corresponding to \$0<\omega\$.

If \$z<p\$, \$s+z\$ lies to the left of \$s+p\$, so that the phase angle of \$\frac{s+z}{s+p}\$ corresponding to the lead compensation is positive.
If \$p<z\$, \$s+p\$ lies to the left of \$s+z\$, so that the phase angle of \$\frac{s+z}{s+p}\$ corresponding to the lead compensation is negative.

Therefore, in general, a lead compensator trades phase margin for gain margin while a lag compensator trades gain margin for phase margin.

Is it accurate to say that although complex valued zero \$z\$ and pole \$p\$ can, in general, be used in compensation design, but are assumed to be real valued to avoid the complexity in design (due to the simple geometric interpretation of the argument of the complex number ratio i.e. the phase)?


texts: Help in understanding Audio line output stage

texts:
I was trying to understand the audio line output schematic shown below but couldn't make sense of it.

This circuit comes after the output of an Audio DAC PCM1725, followed by an active 1st order low pass filter (opamp partially shown in this picture - top, left), followed by the final stage circuit as shown.
There's nothing else between this circuit and the output connector.
I've never seen anything like this and don't understand its purpose.
Can someone more experienced help me understand it, or point me in the correct direction?
Thank you in advance for your time.


texts: How to interpret scope waveform of UART STM32

texts:
I have written the code shown below to generate a sequence of 0b10101000 in   115200 baudrate.
I have defined the code by the reference manual using the formula shown below.
I have defined it to be 8 bit with no parity bit.
115200HZ is 8.6us.
The problem is that I can't see my data in the scope waveform.  I have '1' at the beginning.
Where is it?
How can I see the baudrate from the waveform?

https://www.st.com/resource/en/reference_manual/dm00031020-stm32f405-415-stm32f407-417-stm32f427-437-and-stm32f429-439-advanced-arm-based-32-bit-mcus-stmicroelectronics.pdf

#include "rcc_config.h"
void uart2config(void);
void uart2_sendchar(uint8_t );

void uart2config(void)
{
   RCC->APB1ENR|=RCC_APB1ENR_USART2EN;
   RCC->AHB1ENR|=RCC_AHB1ENR_GPIOAEN;
   //why in EFR32 we haveoutput but in stm32 we have alternate function for GPIO
   //GPIO speed i did not use in EFR32 what is speed in GPIO
    GPIOA->MODER|=(1UL<<7);//pin A3
   GPIOA->MODER&=~(1UL<<6);//pin A3
      GPIOA->MODER|=(1UL<<5);//pin A2
   GPIOA->MODER&=~(1UL<<4);//pin A2

    GPIOA->OSPEEDR|=(1UL<<7);//pin A3
   GPIOA->OSPEEDR&=~(1UL<<6);//pin A3
      GPIOA->OSPEEDR|=(1UL<<5);//pin A2
   GPIOA->OSPEEDR&=~(1UL<<4);//pin A2

    //8.4.9 285 why we need
    GPIOA->AFR[0]|=(7<<8);
    GPIOA->AFR[0]|=(7<<12);
    USART2->CR1|=(1<<13);
    USART2->CR1&=~(1UL<<12);
    USART2->BRR=(7<<0)|(24<<4);
    USART2->CR1|=(1<<2);
    USART2->CR1|=(1<<3);

}
//bitwise and
void uart2_sendchar(uint8_t c)
{
    USART2->DR=c;
    while(!(USART2->SR&(1<<6)));
}

int main(void)
{
    uart2config();
    uart2_sendchar(0xF);

  while(1)
  {

        uart2_sendchar(0b10101000);
        delay(10000);
  }
}


texts:
I am trying to understand this application note from Microchip about using PWM and a low pass filter to generate an analog output. I have a few questions regarding to the article:

In the example they use a 20kHz PWM with K = 5 so we have a 4kHz cut-off frequency. Why choose K = 5? Is it a practical rule? Or is there any reason to choose K = 5?
Then, they calculate R and C, I understand that, but after that they calculate how many dB the 20kHz signal from the PWM is cut-off (I don't really understand what they mean) and they get -14dB but according to my math I get -10.43dB with:

F = 20kHz
R = 4K
C = 0.01uF


texts: How to replace a LED driver with a plug-able power adapter?

texts:
I'm trying to build a small table lamp with a 1 watt led inside. I've got this working with a matching LED driver, however, this driver is not nicely packaged and would require me to create some kind of additional housing:

I would like to replace this driver with a more typical power adapter. The one you plug into a wall to charge your cellphone.

The problem is, I don't really know how to make that work. I know enough to be dangerous, which is why I'm asking this here.

From what I read on the package, the LED driver is supplying a constant current (300mA). So you can connect up to 3 1 Watt LEDs in series.

A basic USB power adapter is, I think, supplying a constant voltage of 5V. So, using a LED calculator and assuming that the LED is 3.3V (see below). I would need to add a 6.8 Ohm resistor in series.

So my question:

Is it as easy as adding a 6.8 Ohm resistor or is there something more I need to worry about?

This is the only info I currently have on the LED (I'm using the top one):


texts: Microwave "power" vs "power consumption"

texts: I'm looking at the specs for this microwave and it lists Power -> Microwave as 1,100 W, but then lower down it lists Power Consumption -> Microwave as 1,440 W. Does anyone know the difference? The reason I want to know is that I'm trying to estimate the current when plugging this into a 120V outlet, so I want to know if it's 1100/120 or 1440/120.


texts: Electret microphone amplifier with analog MEMS microphone

texts:
I'm currently using an INMP401 MEMS microphone breakout board (https://www.sparkfun.com/products/9868) for the purpose of having a microcontroller read and sample the output. Now I also want to listen to sound picked up by the microphone through headphones, so I need to use a different amplifier. This MAX9814 amplifier looks good with automatic gain control, however it is described as being for electret microphones: https://datasheets.maximintegrated.com/en/ds/MAX9814.pdf

I connected the output of the MEMS breakout board to the input of the MAX9814 amplifier. There was a lot of noise. Could the MEMS microphone output be directly connected to the input of the MAX9814 (surpassing the MEMS breakout board op amp amplifier)? Is there a problem with using an analog MEMS microphone with this IC? I'm not sure why it specifically mentions electret microphones. I'm open to better suggestions too...