texts: Hacking a cheap DC-DC buck converter module (LM2596 chip) into a CC LED driver

texts:
On the Internet you can find plenty of dirty cheap DC-DC buck converter modules like the
following:

which is based on an LM2596-ADJ SMPS IC and follows the schematic in the application notes of
the manufacturer:

On the other hand, switching constant current LED driver modules are quite more expensive, on average.

Therefore I thought that would be nice, from an hobbyists' POV, hacking that module to convert it into a constant current switch-mode LED driver. Although I don't expect it to be an optimized design, if it works it should deliver much better efficiency and flexibility than a CC linear driver.

The hack I'd like to do came to my mind looking at the internal schematic of that chip; here is the fixed voltage version, which embeds R1 and R2. On the real module R1 and R2 are external, implemented as a trimpot (Note: the image below was excerpted from the 2013 version of the datasheet, which is no longer available on TI site):

That R1-R2 voltage divider samples a portion of the regulated output and feeds it back to the FB (feedback) pin of the IC, which is internally connected to a classic error amplifier, which compares it to a 1.235V reference. So, at least in theory, I thought, if I sampled the current in the load with a low-side resistor and fed that voltage drop into the FB pin, with a suitable choice of the sampling resistor, maybe the circuit would work as a CC driver. For example, with a 10ohm resistor, I could get a 123.5mA output current.

Is my reasoning correct? Would that design work? Could there be problems such as possible oscillations due to the modification of the feedback path topology? Any comment or advice is welcome!

Note: I'd like the hack to be simple and cheap. Adding more active circuitry, like additional opamps, would defeat my initial goal. Anyway, I still value meaningful design advice, even if it doesn't fit my bill.


texts: Single Die Roll Counter Wrap Around Nested Ternary Conditional

texts:
I have to emulate a single die roll, therefore it needs to wrap back to one at 6.
`D1 and `D6 correspond to my 3-bit state encoding of the die at value 1 an 6, respectively.
in corresponds to the switch roll, if the switch is on then the dice is rolling and value increments if not then it simply equals the last value given. I need equal probability so no I can't just ignore any values.

My problem is this:
I am trying to use a ternary conditional within one.
I'm hoping to stop the roll at `D6 and just wrap to `D1, if not then `D6.

assign next  = in ?((count == `D6) ? `D1 :(count + 1)) : count;

DFF state_register(clk, next, state);

I don't think my conditional is right. Any help on reading it properly?


texts: Open circuit test and short circuit test

texts:
The results I got are close to the required answer, but there is a question asking for drawing the open circuit and short circuit tests characteristics ..
I tried to solve it, but Isc and Vt (in open circuit) are decreasing with the increase of the field current , so I didn't get the right answer. Could someone let me know where is my mistake ?


texts: Why is the imaginary part absent in the BJT gain calculation?

texts:
The gain of transistor Q1 was previously calculated in this post

simulate this circuit – Schematic created using CircuitLab
It was found to have a gain of about 2.92.  Now I change the parameters as below:

simulate this circuit
The DC gain of both Q1 and Q2 is roughly 270.  When I calculate the gain calculated according to the formula in the above link, I get
$$A_v=\frac{R3||R7+R8||\beta_{Q2}(r_e'+X_c)}{X_c+r_e'}=28.65$$
However, my simulation gave a gain which is about 40.
After that I recalculate again by considering the real part and the imaginary part as below I get:
$$A_v=\frac{R3||R7+R8||\beta_{Q2}(r_e'+\frac{1}{jwC})}{r_e'+\frac{1}{jwC}}=\frac{R3||R7+R8||\beta_{Q2}(22.72-30j)}{22.72-30j}=\frac{1515-181j}{22.72-30j}=40.55$$
That is much closer to the simulation value.
Do we calculate in such a way or it just by sheer luck using the wrong method to get the value which is closer to the simulation value? After all, this is calculating the impedance as view by the AC signal right?
I also calculated the gain for the first diagram by considering the imaginary part and real part. I got the gain as 2.8 which is not far from the gain of 2.9


texts: How can I make a circuit that amplifies and mixes, at different ratios, the sound signals coming out of two different instruments

texts:
Do I need to use 2 sound sensors to detect the sound signals?
If yes, can the sensors be connected directly in the circuit? or do I need to use an Arduino card and program it?
Instead of the the sensors can I use small microphones and a loud speaker for the output?
The entry of the sound signals to the circuit is essentially what I cannot solve.

Please note that I am in 2nd grade of Licence in Electrical-Electronics Engineering and this is my first homework. So I think that it has to be a simple thing. We studied about OP AMP s too and I think I need to use 2 (a summing and an inverting). What do you think?


texts: Ideas for tracking individuals in a building

texts:
I apologize if this question is inappropriate for this forum, but I'm coming up short in my research.

The problem is as follows: I would like to find a network of devices capable of tracking people moving between key areas of a building, and capable of integrating with a REST endpoint upon proximity triggers. E.g. when any person passes a wall-mounted reader within 5-10 feet, an http POST can be sent to a local server.

I had envisioned being able to accomplish this task with RFID-tagged ID cards and large-proximity wall-mounted RFID readers with some kind of USB-ready software. However I was unable to find such a system with my google-fu.

Does anyone have any experience in this general area, or have an interesting thought on a potential home-brew solution? I welcome any and all advice, thank you very much for your time!


texts: Using switching to control load sharing of DC?

texts:
I'm not sure of the right terminology for what I am trying to ask about. Feel free to suggest a better question title.

Lets say that I have a fully charged LiFePO4 battery, which I do not want to charge any further, because it can damage the battery (e.g. float charging).

But the sun is shining, and the MPPT CC can provide 400w of energy, configurable at any voltage.

I want that the load draws as much power as possible from the CC, and the rest from the battery. I think the CC will drop the voltage when it doesn't have sufficient power, until it reaches an equilibrium voltage where the CC voltage is high enough to be the main source of current, but low enough that the battery provides the remaining current.

That solves the problem of load sharing with priority. I just set the CC voltage higher than the battery.

But because I don't want charging to occur, I either need to set the voltage lower (e.g. 12.7), or...?

I was thinking that perhaps I could set the voltage at 14.0V and switch the PMOS at a high frequency, and adjust the pulse-width so that current never flows into the battery (reverse polarity over the shunt).
Without load, the pulse-width would be zero. With full load, the pulse-width would be 100%, the CC would automatically reduce its voltage while providing as much current as possible.
But I'm also worried that some oscillation would happen, which would alternate between charging and not charging the battery. Perhaps I could program the controller, using averaging, so that an equilibrium state can emerge, with a pulse-width that doesn't allow any current to flow into the battery.

Is my thinking correct?

simulate this circuit – Schematic created using CircuitLab


texts:
I have the following question

My answers are

Please let me know if my approach and answer is correct to find the Cut Set Matrix.


texts: How to make a Karnaugh Map with "don't care" inputs?

texts:
I know that don't cares mean that it doesn't matter whether it is a 0 or a 1 and when don't cares are just outputs I can kind of understand how they work. But I am having a really hard time understanding how they work when they are inputs.

I have read that when an input is a don't care the whole input doesn't count. But if one or more of the inputs no longer count then how do you make a k-map? Don't k-maps use the first two and latter two in a longitude latitude sort of way when you mark down the outputs?

Here is what I am currently working on:

inputs    outputs
A B C D | Q R S
0 0 0 0 | x x 0
0 0 0 1 | 0 0 1
0 0 1 x | 0 1 1
0 1 x x | 1 0 1
1 x x x | 1 1 1

my first attempt at making a k-map:

  00 01 1X
0 X
0
0 0
1
1 0
X
X    1   1
X

Then I was theorizing that if they don't count that means that the bit length is either shortened or the don't cares count as 1's or zeros if it is shortened I was thinking it is like this:

1XXX=1'b1 = 1
01XX=2'b01=1

but if that is true wouldn't

0 1 x x | 1 0 1
1 x x x | 1 1 1

not be like that and instead the out puts would be identical?

Or perhaps it is what I first thought and it's like:

0 1 x x | 1 0 1 means put an output in 5,6, and 7? Or maybe just 7?

Finally how do you mark things as don't care in the test bench? Do you even mark them at all? Is there a specific mark?


texts: How to modify USB battery pack to function like a UPS?

texts:
I bought this USB battery hoping to use it as a uninterruptible power supply for a Raspberry Pi 2.

I researched it, and users said it could be charged while also powering devices...just what a UPS should do. However, when I tested it, I found a big problem. Even when the battery is fully charged, when I plug or unplug the input cable to the battery, there's a brief voltage drop on the output plugs that causes the Raspberry Pi to reboot.

Is there an easy way I can fix this? I've pried off the housing, and it's three of these cells wired in parallel onto a fairly large and complicated-looking control board.

Would soldering a large capacitor onto the VCC/Gnd pins of the battery's output plugs work? Or should I attach a capacitor the the RPi's power input pins? Or would I be wasting my time?

How would I measure the length of the voltage/current drop, so I'd know what size of capacitor to use? I tried measuring the DC signal with my DSO (DS202), but I could figure out how to detect the length of the drop.

Edit: Using an Arduino to measure Vcc with an ADC pin, I found unplugging it causes a 1-3 second brownout, while plugging it in causes a 1-3 millisecond brownout. I was able to fix the plugging-in brownout by placed a 4700uF capacitor across the Vcc/Gnd pins of the output USB jack. However, the unplugging-brownout time is too large to fix even with a supercapacitor. What other options do I have?

I also think I found a fault in the control circuit. When the pack is unplugged and running solely on the battery cells, the output voltage is 5V. However, when it's plugged in, even when fully charged, the output voltage is 4.7V.

Edit: It seems the plug-in-brownout was in part due to a bad external USB power supply and cable. I was using one of those cheap small cube wall adapters with USB jacks in them, with a long USB cable. It says it's rated for 5V@2.4A, but the voltage was measuring between 4.5-4.7V. When I replace it with a USB single-piece wallwart, the voltage measured 5V.

So now the only remaining problem is the 1-3 second brownout when the external power is removed, likely caused by the controller slowly switching circuits to the internal battery. How can I fix this?


texts: How do chopper driver work for stepper motor

texts:
While reading about motor drivers I'm getting somewhat confused on how commercial stepper motor driver actually work to regulate power going into motor windings.

Here's a few things that seems clear to me. H-Bridge drivers like l293d, l298 and others are constant voltage drivers in a way that if the motor try to pull 4 amps at 12v it will probably burn quickly those drivers.

A chopper driver should be able to keep a constant current to the motor. So if we use a 1.7A motor, the driver will regulate the voltage to the current is always around 1.7A.

I've read that one way to regulate the current would be to PWM the windings to regulate the voltage. I imagine a constant voltage power source of 50v could be regulated to 25v on average. Here I also read that the length of the PWM might matter so the motor doesn't flicker too much.

From what I understand, PWM is simply burst of 50v for a short period of time.

Now the thing I'm not sure is how the current is then regulated with PWM. If the voltage is sensed on an average. It might seem logical that Amps are also sensed as an average.

In other word, if a motor is pulling 6A but the motor if fed with a duty cycle of 50% we'd sense 3A.

Taking the l298 datasheet we can read this for the max current:

  Peak Output Current (each Channel)

  Non Repetitive (t = 100μs)  3A
  Repetitive (80% on –20% off; t on = 10ms) 2.5A
  DC Operation 2A

From my understanding, the shorter the burst are, the more amp we can feed into the the driver. So if we were to configure PWM for 100μs we could at most 3A. In other words, we could have burst of 6A with a duty cycle between 0-50% on a 200μs cycle and not break the l298 chip.

Now if this is right, we have to put some sensing device at the output to measure how much current is consumed by the circuit. When the current is measured, we can adjust the duty cycle of our PWM to fit the constrains we chose.

So how risky this constant current power source is is how fast you can regulate the PWM to not burn anything. If we can only sense current at 300us this could leave a 100us at which the current could too high. It's probably a good thing to keep a good margin to prevent disaster if the PWM adjustment aren't reactive enough.

Note:

In short, this is just the basic Ohm law at play. As the motor resistance may change on load and that we fix the current to I. We have to compute the voltage for a fixed R and I. So all we have to do is sense the resistance of the motor. For example, if the motor with no load had 4.5ohm, the voltage should be set at 7.65V for a 1.7A current but if the load increase the resistance, to say 10ohm the voltage could be set to 17V and then for a resistance of 50ohm it could be set to 85V.


texts: What are appropriate probes for use with a HP 54501A Osciliscope

texts:
I'm fairly new to hobby electronics, but when my office remodeled (I work on software in an EE lab) they were throwing out a HP 54501A scope that I was allowed to take. It didn't come with any probes, and I need to know what kind of probes I should look at acquiring. So:

Did the HP 54501A come with a default probe?

What is its part number if it exists?

Are there other compatible cheap probes out there for someone who is only currently looking at doing the simplest electronics? I am only likely doing Arduino type projects.

The scope is a 100Mz digitizing scope and the inputs read 1 M ohm = 16 pF  250V Max


texts: This parallel LC circuit, energized with a current source, is supposed to work as a low pass/high pass filter depending on the branch I take the output from. PSPICE simulation shows exactly that, EXCEPT there's a spike at resonance(157kHz) where the gain explodes. I did some googling and apparently this is what they call a ripple, am I correct? If so, why is there a ripple?


texts: Atmel printf formatting doesn't work, no formatting does work

texts:
We are running an Atmel AVR32 chip on our board, and recently discovered that printf with format/conversion specifiers doesn't work. A regular printf does work.

For instance,

printf("hello\n"); // works just fine
printf("number: %d\n", 12); // returns -1, nothing prints.

No format specifiers seem to have any effect, printf just returns -1.

We have tried linking in different versions of the vfprintf family of functions, e.g. adding -Wl,-u,vfprintf -lprintf_flt -lm to add floating point format capabilities (documented here), but to no effect.

Note that we are NOT looking for floating point capabilities, we are just trying to get ANY formatting for a regular decimal (int, uint_8, etc.).

Any help greatly appreciated.


texts: Why can't I make flip-flops in logic simulators?

texts:
I've been playing with a few logic simulators and don't understand why flip-flops are not working. I'm trying to implement a T flip-flop with NAND gates:

All the simulators I've tried give the same result. Either Q or Q' takes the state of the clock rather than toggling on the rising edge, depending on the timing of the internal updates. Given the symmetry of the circuit I'm not that surprised, but wonder how it's meant to work in practice.
Is this even possible, or do these imulators provide flip-flop components because it's not possible to do with basic parts? If so, why and what is missing?
Simulators:

https://logic.ly/demo
https://circuitverse.org/simulator
https://academo.org/demos/logic-gate-simulator/
https://simulator.io/board

NAND gate circuit compared to a provided T flip-flop (circuitverse.org):

The same in simulator.io (using AND+NOT as there's no NAND):


texts: What is the meaning of sizing a logic gate?

texts: I am confused with the meaning of sizing the logic gate. I need to size a logic gate using the logical effort method. I searched online that the meaning of sizing using the logical effort means calculating the delay, but I thought I need to find the measurement of the width of nmos and pmos transistors.


texts:
Can we consider Rs and Rd to be in series? That is, is the equation ID = (Vdd)/(Rd+Rs) correct?

What is confusing me is that they have the same current, but there's a voltage drop across the drain-source.


texts: Current drawn by a permanent magnet DC motor

texts: I have been working with PMDC motors for a while now. In these motors, as the load increases current drawn by the motor also increases. I was just wondering what is the theoretical reason behind this change in current?


texts:
I am currently trying to build a Regulated DC Power Supply for an electronic piano. I am trying to find the minimum capacitance that I need to able to reach the desired ripple voltage. To find my minimum capacitance I am using the following formula VDC = (1 - (1 / 2 x f x RL x C) x VPeak where:

f = Frequency, RL = Resistance of the load, C = Capacitance of Capacitor, VPeak = The Peak rectified voltage.

Before I can calculate the value of the capacitor I need to figure out the resistance of the load. With the current piano that I have I cant measure the resistance directly but I do have the maximum voltage and current ratings of the piano (12VDC @ 500mA). My question is:

Can I use Ohms Law to find the internal resistance of the piano? (12V / 0.5A = 24 Ohms)


texts:
I have a PCB with an Atmega328 and have been programming it using FTDI Friend (FT232RL Chip Adapter). The adapter connects to a 6 pin FTDI header on the PCB. I want to connect the FTDI Chip Adapter to the board using a USB-C Connector instead of the 6 pin header. This will allow me to connect through the housing via the USB-C connector to not only provide power but to also program it without having to take the assembly apart to accesss the 6 pin header.  I am not using any of the advanced capabilities of the USB-C, simply the reversible features of the pins.
Question:  Can I simply connect the 6 wire output from the FTDI Friend to the the USB-C as shown below?  Connecting opposite pins on the PCB to allow connector to be flipped?
It may be a simple question, but reading a lot about USB-C made me question myself.
I know it is overkill using USB-C, but being flippable will be a benefit to the user.
Cable to be used:Cable
USB-C to be used: USB-C Connector

UPDATE 8 Aug
Thanks for your thoughts. Yes, being incompatible with USB-C standard could cause damage.
The reason I want to use the USB-C for my product is not technical: The availability of high end power cables - cloth braided, colors, nice connectors. This plus the modern/reversible connector.
Reading the USB-C data sheet, could I avoid accidental damage by only using GND, VBUS, D-, D+ as shown Figure 4 page 7, USB 2.0 TYPE C Pinout?
USB Datasheet
I would not be using pins CC and VCONN connections. I would short the two D+ pins and the two D- pins on the PCB per paragraph 1.3.1 page 4.
I would not connect FTDI RTS used to reset, would have to reset with a button on the board, unless there is a pin I could use for RTS and be compliant with the USB C spec.
This is shown in updated graphic below.
Question:  Are FTDI signals RX and TX the type to be sent on pins D- and D+ ?  Would sending them on these pins be complaint to the standard?


texts: Is there a simpler way to create a variable voltage drop than a differential amplifier?

texts:
I am working on a preregulator circuit design (it's derived from the one in LTC AN32), and am trying to design the test fixture for it.  Two of the three components are clear:

I can use an AC-output wall transformer to provide a safely isolated AC supply for testing
A small optoisolated DC-output SSR (like the ones Ixys/Clare make for telecom work) can be used to add pulses wherever I wish with the aid of an isolated supply voltage (which can be obtained easily from a standard DC-output wall transformer).  Pulse generation itself is also a solved problem.

However, I'm trying to generate the DC input voltages for testing purposes, and while generating a baseline is easy (I can build a variable reference around a TL431, a LM334, and a pot), how can I go about generating a voltage that is X volts below it, for user-variable (via a pot) values of X (I can accept a range for X from say 1 to 10 V), in a simple way?  Output currents can be on the order of a couple of milliamps, as all this will be hooked to is an op-amp circuit's inputs, and the voltage accuracy doesn't need to be great either (if I can get within 5% or so at room temperature, I'll be fine).  See the behavioral schematic below.

simulate this circuit – Schematic created using CircuitLab

The easiest way to handle this I can come up with uses an op-amp differential amplifier to subtract the output of a second variable reference from the first, but it seems to me like there should be a simpler way to do this...


texts: Can I use an unmodified ST Nucleo-F303RE to develop USB devices?

texts:
I want to use my Nucleo-F303RE to develop firmware for a USB HID.

The stm32f303ve data sheet states in section 3.25 that for the USB peripheral to work, the MCU needs a HSE crystal oscillator.

According to the user manual UM1724 section 6.7.1, the board has a fixed 8Mhz clock from the ST-Link MCO (which, in turn, has a 8Mhz crystal installed).
I'm hoping to be able to use that clock for the USB device. Is it sufficient or will I have to get the parts to populate the X3 position?


texts: P channel mosfet as a switch different setups for USB and battery switching

texts:
Recently I came across the below 2 examples of using a p-mosfet as a switch. Running a simulation leads to the following observations.

Circuit 1

Reference 1
OUTPUT is 4.951

Circuit 2

Used this design in some previous circuits
OUTPUT2 is 4.379

The output needs to be 5v is 5v is available. If 5v is disconnected, the output has the be the voltage of the battery that is connected.

Could someone please explain the difference in both the circuits.

simulate this circuit – Schematic created using CircuitLab


texts: Simple lightweight high power amplifier circuit

texts:
I'm looking for a way to amplify a 12V sinusoidal signal to drive a set of transducers at ~120V with an overall power of 100W.

The quality of the output signal does not have to be good, simplicity and low weight are more important. In fact I would be happy for the signal just to go rail to rail, but obviously then the transistors would have to be able to handle a 240V swing.
I have studied basic BJT amplifier circuits and I have been playing around with basic circuit simulation software but I haven't been able find anything that would do this


texts: Different I/O pins of same PORT of ATMEGA8 not providing exact output

texts:
I have written code to switch ON/OFF some LED light connected different I/O pins of same PORT (i.e PORTD) of atmega8 microcontroller. This process is performed using android app by sending different byte through USART.
When a data byte is sent then the corresponding LED is ON.
When  two or more LED is ON by sending their corresponsing data bye then if to switch OFF a specified LED, a specified byte is sent ,the whole LED is OFF.
if i use two separate PORT (i.e PORTC and PORTD) then i get exact output but in this case i can use only one pin of PORTD and one pin of PORTC for two LED ON/OFF.
if i use more than two pin, the above fault occur.
My code is below.

ISR(USART_RXC_vect)
{
while(!(UCSRA & (1<<RXC)));
rec=UDR;

        switch(rec)
{

              case 65:{
              PORTD |=1<<4;

             }break;

              case 66:{
               PORTD |=1<<5;
             }break;

              case 67:{
                PORTD |=1<<6;
             }break;
              case 68:{
              PORTD |=1<<7;

             }break;

             case 69:{
               PORTD&=~1<<4;

             }break;

              case 70:{
               PORTD&=~1<<5;
             }break;

              case 71:{
                PORTC&=~1<<6;
             }break;
              case 72:{
              PORTB&=~1<<7;

             }break;

             }

}

please anyone help me to solve this problem.


texts:
Hello,

I am trying to make 120 (4 rows and 30 columns) LED's go on and off alternatively. (At every given point in time 60 LED's are turned on and 60 off)

Components and Parameters :
Function Generator : AFG 300;
Switch Dg202b http://www.vishay.com/docs/70037/dg201b.pdf;
Op amp-741Cn;
transistor (Using 8 transistors) : MJH6284 http://www.onsemi.com/pub_link/Collateral/MJH6284-D.PDF;
LED: BXRA-C0402  (Need a minimum of 7V to light up) http://www.leds.de/out/media/67920.pdf

I am using:
A square pulse from a function generator (1Hz and 5V)
A switch to control each row
An op-amp to invert the square pulse (resulting in the alternating On and Off)
The rows are connected in parallel (L1 to L3 to L5 to L7....L29 AND L2 to L4 To L6 To L8...L30).
The columns are connected in series (L1 to L2 to L3 to L4) and are controlled by switches as shown in the image

The switches are placed in so that either a row(s) or column(s) can be turned on and off

I am supplying 5V at the base of the transistor through the switch (and op-amp depending on the light,  L2 to L4 To L6 To L8...L30), +10 at the collector and -10 at the emitter.

The Problem: when I connect a single transistor to my circuit, the square pulse is 5V, as i increase the number of transistors the voltage given by the function generator reduces, which in turn reduces the luminescence of my LED's (some don't even light up).

I am using a 10 amp AC-DC power supply

I am not at liberty to change the components and the LED's are pre-wired, how do I get the maximum luminescence for all the LED's (at 9V and 15 Amp for the rows, and accordingly for the columns)

Where am I going wrong?? (NEED HELP ASAP)


texts: Datasheet/screw function on XY-MK-5V 433 MHz receiver?

texts:
I cannot find a datasheet for my 433 MHz receiver (which seems to be a XY-MK-5V), which looks like this:

Also, I was wondering what is the use of the screw (on top of the green box with copper wire circled inside)... just to open the green box or does it have some 'calibration/setting' function?


texts: Electronic wearing of a printed circuit board?

texts:
I was told that electronic components and printed circuit boards have a limited lifetime. This is backed by several questions and answers:

https://www.quora.com/Do-circuit-boards-have-a-useful-life
https://www.quora.com/How-long-do-circuit-boards-last

It is however unclear to me if this is because of electronic wearing of the components, or environmental influences causing the connections to break, parts to overheat, etc.

So, considering an average printed circuit board with several IC's, a bunch of resistors and some capacitors that is connected and working under ideal circumstances (controlled temperature, humidity, etc). Will this PCB or its components eventually break because of the electrons that are moving though it, or will it fail because of other reasons?

Does the same failure occur if the PCB is running in a less controlled environment like a regular office or is it likely to be something different? And is it in the same time span, or significantly earlier?


texts:
I've been looking around for an easy way to convert car battery 12v to 5v. I have seen some people saying that a simple resistor is all that is needed.

What I've tried so far is the DC to DC regulator. It works, but it's pretty expensive for such a cheap project. And not to mention it is twice the size of the project.

Following the ohm's law, it should mean that a single resistor with appropriate wattage rating should be fine to convert the car battery into a 5v supply. But the project used a max of 350mA, will the resistor or the project burn?

EDIT: The project will run even with ~100mA supply, but at some points it could go way up to ~350mA. Haven't tested it thoroughly but atleast 500mA would be sufficient. And yes, since it's a Microcontroller, a stable 5VDC would be preferred. And about destroying the OBD2 ports... Really I never had any thoughts about it.


texts: I have a question regarding bandpass filter. What is unbalanced port and balanced ports? I noticed that outputs of balanced ports are connected to RF_P / RF_N of Zigbee IC. What are RF_P / RF_N?


texts: Is a coil FM transmitter frequency affected by my body static?

texts:
I've built this coil FM transmitter  following these guides which are essentially the same:

https://maker.pro/custom/tutorial/how-to-make-an-fm-transmitter
https://www.instructables.com/id/The-Ultimate-FM-Transmitter (without the mircophone)

I'm able to easily find the transmitter frequency using an SDR and it works fine, the audio quality is good but as many other people I've got this problem: the frequency increases or decreases as I move my hand or my body closer or away from the transmitter.

What is causing that?
I think the coil magnetic field is affected by my body static.

How to fix or decrease this effect?

I tried making a shield with aluminum foil around a box and then I put the transmitter inside but the problem persists.

I think it's still there because the antenna which is connected to the coil is coming out of the box through a small hole thus affecting the coil magnetic field anyway.

I also tried removing the antenna so the transmitter is entirely inside the shield box but that only decreases the transmitter range, the problem is still there.

Any suggestion?


texts: What's the difference between these two capacitors "JNC-JN222M" and "222-1KV"?

texts:
I have these two ceramic capacitors shown in the image below:

It seems to me that both of them have 2.2nF capacitance and the first one has 400V rated voltage while the other one has 1000V rated voltage.

I wonder if there is any difference between them (except for rated voltage) and in case they are the same why is the first one twice as big (although it has smaller rated voltage)?


texts:
We know that any continuous time signal can be expressed as follows:
$$x(t)=\int_{-\infty}^\infty x(τ)δ(t-τ)dτ$$
I came across a certain relation regarding linear time invariant systems . Using $$x(t)*δ(t)=x(t)$$ we get , since it's an LTI system : $$x(t)*δ(t-t_0)=x(t-t_0)$$
How did we get here? Is there a property I'm not aware of?  I try to imagine the convolution graphically and since we have the x(t) how can  the multiplication with the dirac function give x(t-t0) for every point in the convolution integral?


texts: Inferring DC performance from a Sigma Delta ADC datasheet noise floor figures

texts:
So ive been playing with some Sigma Delta ADCs, for sampling low frequency (<2Khz) AC signals.

The ADC supports a differential input with a full scale value of about +-500mV at its inputs. I have constructed a reference design which consists of an input attenuation network that takes my input voltage, divides it by a factor of about a 1000 which then appears across the ADCs inputs; i also have an anti aliasing filter etc.

To play around with it, i decided to measure a few DC voltages far less than the usual full scale AC input (220v RMS) i would be using normally. What ive noticed is that there is some inherent noise from the ADCs outputs. For example, for an input of 30v DC verified to be stable, i see about 80mV noise (random, +- variations) in the readings.  The noise seems to have a fundamental of about 100-200Hz.

I think i understand concepts such as noise floor, quantization noise, spurs etc so I wanted to see if i could explain this; so i turned to the datasheets performance figures for the ADC and i found this:

I believe this explains my observations; I can see a spur about 80dB down from the reference input, around the noise frequency i observed.

Furthermore, I made a few calculations:

500mV is the full scale reference level shown in the graph, so the spur that is 80dB down, represents 50uV worth of noise at the ADCs input. As i have an attenuation network of about 1000, that translates to an equivalent value of about 50uV * 1000 = 50mV worth of noise in my input voltage. This is close to the 80mV noise figure i observed.

My question is: Is such analysis valid and could explain my observations?

PS: This question is a bit tricky to explain, please comment for additional information

EDIT 1:
Here is the ADC that im talking about: datasheet


texts: IC product lifetime as function of junction temperature

texts: If an IC is rated for an absolute maximum junction temperature of say 170 Celsius, obviously it is not recommended to operate there - but how drastically is product lifetime impacted if we are close, say operating at junction temperature of 160. How severely does the IC lifetime get shortened as we get closer to the maximum junction temperature ?


texts: What are the reasons behind marking neutral and line terminals on a power supply AC input?

texts:
Even though AC has no polarity, almost all the power supply AC inputs or most AC powered device input terminals indicate line and neutral terminals as L and N just like in the following example:

Is there a fundamental reason to wire line to L and neutral to N but not the other way around? Could you give an example what might go wrong if one connects neural to L terminal and line to N terminal?


texts: Drawing 132 watts of a 5Ah 12v motorcycle battery

texts:
My scooter is using a 4Ah 12v battery and has 4 LED headlights, 2 for low beam (5.2w), 2 for high beam (5.2w). By default, it’s using a 2.6w LED for each, so total would be 10.4 if I’m using low and high beam.

It’s getting dimmer now so I’m planning to upgrade to a 33w LED each. So that means if I’m running both near and high beam, I’ll be drawing 132w, although mostly it will be running at low beam which is 66w.  Will this be ok?


texts: Theoretical analysis of amplifier circuit

texts:
I have the circuit of the amplifier below. I want make the DC analysis and find the gain the amplifier produces and the cutoff freq(high-low).

My problem is that it's been 15 years since I was student and I remember nothing. I will appreciate any help provided.


texts: Cascading WS2803 LED drivers, each with different output current

texts:
I've decided on using WS2803 PWM constant current LED drivers. I'd like to cascade two of them and use the first one for 15mA output and the second one for 20mA output (each chip for driving different LEDs).

The output current is based on a resistor connected to each chip. So I thought this shouldn't be a problem, until I read this in the datasheet:

"In LED display and decorative applications, WS2803 provides nearly no variations in current from channel to channel and from IC to IC."

Does this mean I can't cascade two chips with differently set output current? Or is it just my misunderstanding, based on my fuc*ing poor english?

Also, the datasheet mentions resistors for impedance match, when cascading (up to 6 meters far). Do I care about those, when the ICs are just few centimeters far?

Thank you everyone!


texts: Killing an SD card by supplying 12 volts

texts:
I want to design a self-destruction circuit to destroy an SD card as a data protection procedure.
Will supplying 12 volts to an SD card  destroy it to a level that it won't be accessible again? (Can't access stored data any more.)
More details : at university we have robots competition, we have made a robot depending on Raspberry, the Python files which administrate the robot are stored in the SD card, other teams failed in the setup of their robots while we finished it successfully.. the rules of the university to leave all robots at the workshop room, a guard is locking it at the end of the day, we found later the robot is not normal and like someone tried to access it (maybe someone from other teams bribed the guard to access our robot)...
We were looking for securing the python files by killing the SD card if someone tried to get the Raspberry case out of the robot.
(I mean by "killing", "destruction" a physical or non-physical destruction, whatever at least nobody can access the stored files).


texts: FCC Specialized Oscillator - for low frequency exemption

texts:
According to the FCC:

  The following devices are subject only to the general conditions of operation in §§15.5 [Dealing with certification] and 15.29 [Dealing with power] and are exempt from the specific technical standards and other requirements contained in this part. The operator of the exempted device shall be required to stop operating the device upon a finding by the Commission or its representative that the device is causing harmful interference. Operation shall not resume until the condition causing the harmful interference has been corrected. Although not mandatory, it is strongly recommended that the manufacturer of an exempted device endeavor to have the device meet the specific technical standards in this part.

And one of the following items is:

  (h) Digital devices in which both the highest frequency generated and the highest frequency used are less than 1.705 MHz and which do not operate from the AC power lines or contain provisions for operation while connected to the AC power lines. Digital devices that include, or make provision for the use of, battery eliminators, AC adaptors or battery chargers which permit operation while charging or that connect to the AC power lines indirectly, obtaining their power through another device which is connected to the AC power lines, do not fall under this exemption.

My question is: Is there any 1 MHz (or low frequency oscillator ) that specifically is designed to not generate harmonic frequencies, so that the resulting device can fall under this exemption?


texts: How to control 8V over I2C from a microcontroller

texts:
I've got a microcontroller taling to a DAC MAX520ACPE over i2c. This DAC gives me 0V to 5V with 8bit presision. I neev to control 0Vto 8V. I think I can use a LM317 to regulate the output voltage but I don't know how to connect the output of the MAX520ACPE to the LM317.

Output:

Power:


texts: Will PCB board house accept this QFN thermal pad via design (KiCad)?

texts:
I am going to be ordering this board from JLCPCB which has some 0.2 mm hole diameter thermal vias on a QFN pad, and it says on their capabilities page that the smallest via hole size is 0.3 mm, BUT smallest drill hole size is 0.2 mm (2 layer board rules). It's a 2 layer board, they're actually not vias, they are pads which connect from front copper layer to bottom ground layer, I'm using the footprint from standard KiCad library "QFN-16-1EP_3x3mm_P0.5mm_EP1.75x1.75mm_ThermalVias". Do you think the board house will accept this? Or should I just make the hole diameter 0.3 mm? But if I do that will they be too large and will too much solder leak down through during reflow? I'll be soldering by hand with a heat gun, not an oven. Thanks for any advice.

--------------------------------------

UPDATE:

Here's the email response from JLCPCB:

"Thank you for your email.
So sorry to tell you that we don't make via in pad.
We make plated through via.(See pictures)
Also,i find an instruction about our company.
Instructions for ordering
Hope this will help you.
Thank you.

(END EMAIL)

So to me that sounds like they will make the vias in the pads but won't fill them with non-conductive material, which is all I wanted to do anyway. Although she didn't say specifically that they could do the bare via in the pad, which leaves me still a bit uncertain. I don't see why they couldn't though, just like a via anywhere else.

Also, I found this TI application note that recommends thermal pad vias be 0.3 mm or smaller, so should be good with the size.


texts: Measuring negative pressure with a raspberry pi and I2C Pressure Sensor

texts:
I want to measure negative pressure which is generated by a diaphragm / membrane pump with 0,5 Bar (according specification).

I am not sure if such a sensor as this https://sensing.honeywell.com/HSCDAND001BASA3-amplified-board-mount-pressure-sensors would work? Measuring range is from 0 to 1 bar. But my pump is generating negative pressure which I want to measure. Is this possible?

Can anybody help me please...


texts: How to drive a MOSFET with an optocoupler?

texts:
What's the proper schematic for driving  this MOSFET from a microcontroller pin through  this or  this optocoupler?
The MOSFET will drive a motor @ 24V, 6A.


texts:
What resistors do I need to get 5V on this chip? Sorry, I don't understand the reference to the Iadj in the formula. The section on the Iadj in Adjustable Voltage Design seems circular.
http://www.onsemi.com/pub_link/Collateral/NCP59302-D.PDF


texts: Why are 32.786Khz crystal cans soldered to PCB?

texts:
Every development board I have ever used that includes a 32.786Khz crystal has always had its can soldered directly to board.

What is the reason for this ? Is this to minimize radiated energy from the crystal during its operation (assuming that the pad its soldered to is ground) ?

If the can was not soldered to the board, what would be the effect ?

Added

If you look at this image, the crystal has 3 solder points. Two for the legs, and one for the case/shell/can (green arrow).

My question is about the reason for soldering the case/shell/can to the board.


texts: Circuit for a DC motor with 2 microswitches reversing direction

texts:
So here is what I am trying to do... have a DC motor wired to an on/off switch and 2 microswitches. Each switch will reverse the direction of the motor, so one switch tells the motor to go forward, the other tells the motor to go reverse. My goal is to have a track where the motor will pull a platform in one direction, then when it gets to the end of the track it will hit the switch and then cause it to go the other way down the track. And I would also like to include an on/off switch for the whole circuit.

I am just curious to know what the best circuit for this will be.

My initial thought is to use a DPDT switch but not exactly sure how to get that working, or what the proper circuit layout is for it.

This is the schematic for my basic idea, but (correct me if I'm wrong) the motor will only go in the forward/reverse direction if the switch is continuously pressed.


texts: Circuit of a Rotor on an Induction Motor

texts:
Here is an equivalent circuit of a rotor on an Induction motor:

Can someone explain How do we arrive at this circuit?

The rotor seems to be only a disc(made of a metal) with conductors embedded near the circumference like here: http://www.ece.umn.edu/users/riaz/animations/imwound.html


texts: How to pick MOSFETs and drivers for FPGA BLDC driver?

texts:
I am building a Brushless DC Motor driver based on an FPGA.
I need to pick the transistors and drivers.
Do I need an IC driver or can I use smaller transistors?
The motor runs on 15A/16V.
I am estimating 50kHz switching frequency.
To be able to use them without cooling i calculated a maximum Drain-Source resistance of about 4mOhm.
CSD17506Q5A seems to fit the requirements. Is this a good choice? How should I drive it?
Do I need external diodes?


texts:
Hello would anybody be able to find the spec's of this SCR Thyristor General Electric C50FX425 937

Thanks in advance.


texts: Dual gate driver inputs/outputs tied together

texts:
I'm using an IR4427 dual low-side gate driver to drive a single IXEL40N400 IGBT.  Since I'm not using the second side, I'm considering tying its input to the active input and output to the active output for higher current availability and thus, I hope, faster switching.  Does anyone foresee a problem here?  To me it just seems like I'm paralleling two (hopefully well-matched -- they're on the same die) MOSFETs, but I'd like to be certain.

Here's the proposed schematic snippet:

simulate this circuit – Schematic created using CircuitLab


texts:
I saw this simple schematic for an FM receiver:

https://www.mikroe.com/ebooks/radio-receivers-from-crystal-set-to-stereo/the-simplest-fm-receiver

Moreover, I saw some videos online where people have built it successfully:

https://www.youtube.com/watch?v=h_F3J4vyzNk

Starting at 2:58 on the video timeline.

I'm very puzzled as to how this circuit works. It's not mentioned in any electronic comm. texts, even as it's surprisingly simple for a circuit that successfully performs FM reception, filtering and demodulation.

I understand there is a Collpits oscillator at the heart of it that's tuned to the frequency of the station you want to filter, but that's where my understanding ends.

How does it turn frequency into voltage across the load resistor (R1) (schematic in the first link above) ?

I don't mind about the debiasing and audio amplification portion, as these I understand. What I don't know is how it's converting frequency into voltage at R1 ?

This circuit was demoed in several Youtube videos, but the operating mechanism is never simply explained. Maybe they understand it so well that they forget that an explanation is needful..

Here's an explanation for a different kind of FM demodulator, and it'd be great if this circuit could also be explained in the simple style of the explanation below:

My simple explanation for a FM Monostable Multivibrator demodulator:

  A multivibrator produces a voltage "tick" for every peak of the sinusodial waveform, so higher frequency produces more ticks and vice versa.
  When the voltage rectangles coming out of the multivibrator are loaded with a low pass filter, a greater voltage will be seen across the capacitor for denser multivib output and vice versa.
  So higher frequency --> denser multivib output --> higher voltage across lowpass filter, which is a biased form of the audio voltage behind the modulated signal.

EDITS

People kindly pointed out that the LC tank's amplitude varies with the frequency.

But why have an oscillator in the first place if all we need is a slope detecting LC tank ? (A slope detecting LC tank + a diode envelope detector to filter out the carrier). Why bother with a Collpits oscillator ? Moreover, what filters out the carrier after the LC tank varied the amplitude ?


texts: Please explain the details of cache circuit addressing

texts:
My cache can have 32 address bits with 2 bits for index and 3 bits for byte-offset.

Associativity 2, block size 8.

Of course, the the bits for index says which row of the cache the data is.

But how do I know which block when there are 2 blocks (associativity 2)?

The 3 bits byte-offset only tells which byte within a block and there are 2 blocks.

Is there a comparator that determines which of the blocks has the tag that matches the incoming request for data?


texts:
We have designed a system using STM32F405 CPU.

There is a problem when I give a Vbus (5V) I can see a leakage of 50mA prior from turning on the CPU meaning I did not give any supply to the CPU( 3V3_D and 3V3_A, 2V0).
I isolate the CPU circuit and confirmed that  the current is going to the CPU side so the leakage is going to the OTG_FS (PA9). I also removed the CPU and the leakage was gone.

Is this normal? How can I eliminate this leakage which is quite high for CPU.
Is there a possible problem with our design?

Appreciate if you can give an immediate response to this problem.


texts:
I'm learning the logic of cache memories. I wonder if you can verify that I understood correctly. If a cache memory in the tag field has 16 bits, the set field has 10 bits and the byte in block field is 6 bits, then I can deduce from only that information that the capacity is 128 kbyte and it is 2-way set associative with block size 64 byte because 2⁶ = 64 byte from the byte in block field. 2¹⁰ = 1024 but could some other capacity with some other associativity number satisfy the requirements?

I learn that the formulas are

number of blocks = capacity / blocksize

number of sets = number of blocks / #associativity

Therefore I could double both the associativity to 4-way but I could not satisfy the requirements with a 4-way cache because it would require another number of bits in the set field.

Did I understand correctly?


texts: For a current sense resistor, should I connect the high current terminals to the current sense terminals as shown in the picture?


texts:
The qeustion:

I would like to know what is different about the way JTAG treats the "step over" and "step into" commands.

Background:

I am trying to set a GPNVM bit on a SAM3N (ARM Cortex M3) chip by using the In-application programming (IAP) function in the ROM.

The code calls efc_perform_command(EFC, EFC_FCMD_CGPB, 1); which is a function in the Atmel Software Framework.

In essence their code looks like this (after removing all the macro magic):

uint32_t efc_perform_command(Efc *p_efc, uint32_t ul_command, uint32_t ul_argument)
{
    static uint32_t(*iap_perform_command) (uint32_t, uint32_t);

    iap_perform_command = (uint32_t(*)(uint32_t, uint32_t)) *((uint32_t *) CHIP_FLASH_IAP_ADDRESS);

    iap_perform_command(0, EEFC_FCR_FKEY(FWP_KEY) | EEFC_FCR_FARG(ul_argument) | EEFC_FCR_FCMD(ul_command));

    return (p_efc->EEFC_FSR & EEFC_ERROR_FLAGS);
}

If you want to have a look at their full code you can look up their reference here and the full source here.

It follows the process recommended in the datasheet (section 20.5.3 In Application Programming (IAP) Feature) correctly from what I can see.

When I am debugging the code over JTAG I step through this function. If I step through it using F10 (Step Over), or if I try to just run the code, it breaks and ends up executing from memory location 0x00000000.

However, if I'm debugging the code and step through using F11 (Step Into), the code works the way I would expect it to.

This suggests to me that there is something strange going on with my link register... Though I would like this problem solved this question regards the Atmel Studio behaviour. I would like to know what is different about the way JTAG treats the "step over" and "step into" commands.

Edit 1:

The problem was resolved and seems to have been caused by the FreeRTOS tick interrupt. Since I was modifying flash the requirement that I must not execute from it holds. It seems that I was either modifying the Stack Register in some way or executing an interrupt routine (in flash) causing me to get into an invalid state. Though this explains a little about what might be happening there are still two options:

The debugger disables the SysTick interrupt (or interrupts in general) when using F11 (Step Into), but lets them to run with F10 (Step Over).
The debugger tries to enter the code, realizes it cannot and then manipulates the link register, in some way, to return to the next line.

I suspect that 2 is unlikely and that 1 is the answer here but I would like someone who knows this as a fact to confirm it for me.


texts: Can I coil directly onto the iron cores of a stator for a basic generator?

texts:
I am constructing a very basic miniature generator (25mm diameter), the rotor has 8 bar magnets, and there will be the same number of coils, wired appropriately, in the stator.

.

I understand that the magnitude of the induced current is much bigger with iron cores to the copper coils. However, I have only very basic materials.  The cores will be short lengths of iron bar, similar dimension to the bar magnets, cut lengthwise to minimise the air-gap.

QUESTION 1: Can I wind the copper wire directly onto the iron bars?  Would this cause some kind of interference?

QUESTION 2:  The bar magnets are very powerful Neodymium type.  If the air gap between rotor and iron cores of stator is minimal, I don't see what prevents the alternate "N/S" polarity of the magnets basically locking onto the iron cores and preventing it from rotating!


texts:
Is it ok to connect a crystal (mine is 433.42MHz) to a breadboard and then to solder jumper wires from a PCB to the crystal on the breadboard? I have a strange problem in my project and I suspicious that maybe this is the problem.
EDIT:
I solved the problem. I listened to the great people here and soldered it directly to the PCB


texts: Alternative for 12V supply to short-circuit NTC bypass after a few seconds?

texts:
I have a 500VA toroidal transformer I am going to use with my UK mains outlet to step mains voltage down to 25V. I am using a 13A fuse with an RCD (30ma).

I only just realised that the inrush from my transformer will certainly blow the fuse in the plug if not trip a breaker.

I have searched and read some solutions on here where a thermistor is used in series to limit this inrush current, however I tend to frequently switch the power off when I am touching the circuit. So this method would require me to wait for the thermistor to cool every time I alter the circuit.

I have read a post where a user switches the thermistor out after a few seconds but he relies on a secondary 12V supply for this. Can anyone suggest an alternative?


texts:
I have an LED circuit built that requires 12V @ 6A (72W) to run at approx 80% max rating of the LEDs.  The circuitry works but all the power supply/adapters that I have been able to find with those specifications "pulse".  The voltage is constant but the amps vary from 0-6A which makes the LEDs pulse.

I am looking for information on how to look for a power supply/adapter that has constant power output (both voltage and amps).  I am in the US and plan to use the AC wall plugs at 120V 60Hz (15A breaker/wiring)


texts: Driving 16-segment displays with MAX7219

texts:
While the code for this in theory makes sense to me, I can't find any examples online so I wanted to check to see if the wiring actually works.

I've used the MAX7219 for both 7-segment displays, and 8x8 pixel grids, so have an fair understanding of how it works.

here is the datasheet

https://datasheets.maximintegrated.com/en/ds/MAX7219-MAX7221.pdf

If my understanding is correct, the SEG go HIGH, while the DIG function as Sinks. Normally it would allow it to run 8, common cathode, 7-segment displays.

The single digit 16-segment display characters I have have 18 pins total. 16 segments, the decimal, and the common cathode.

Would it work to wire the first 8 segments to SEG-A -> SEG-DEC and then the cathode to Dig 0. Then the remaining 8 segments to SEG-A -> SEG-DEC again, and then also connect Dig 1 to the cathode.

doing this would theoretically allow 4 16-segment displays per MAX7219.

I realize I would have to write my own bytecode patterns to send to the MAX7219 for each character. I also realize I won't be able to use the decimal points.

Does this work? Or Am I missing something? The part I'm most unsure about is if it is problem to use 2 digits on the same cathode.


texts:
How can I implement (or maybe there is an IC that already does that) a board whose input would be I2C and output would be analog voltage (0V - 5V) ?

Eventually I would like to connect a couple of those to the IO pins of an arduino effectively creating digital to analog outputs.


texts: in the image, 2 loops are formed, is it possible to form a loop for the last one? If so, what equation would arise?


texts:
I had issues with crosstalk (microphone picking up headphones sounds) and thought it was caused by headset.

So I removed headset's original cable, put 4 pole female 3.5mm jack on the headset and connected it with cable to pc through 4 pole to 2x 3 pole jack splitter.
Result: Even more cross talk.

So I have experimented with different connections and this is what I have found out about amount of crosstalk:

Front PC audio connectors > Rear PC audio connectors
Separate ground wires for headphones and microphone > Common ground wires

Front audio connectors have common ground wire from connectors to mother board. Rear audio connectors have also common ground. So shorter common ground means less cross talk?
From what I understood wire resistance and microphone impedance also affects amount of crosstalk, but I don't know what could I do about it.

What should I do to reduce crosstalk as much as possible?

Should I put up with discomfort of running 2 wires to rear PC audio?

Should I just slap USB sound card into headset and call it a day?

Is there an optimal solution? Thanks in advance for all advices.


texts: Reasonably priced laser cutting service in the UK?

texts: Has anyone had any experiences with laser cutting services in the UK? I've googled but most of the results seem to be for expensive industrial setups. What I'm looking for is someone who can do pretty much what the Pololu service here does but nearer to me to reduce shipping time and costs.


texts: Reversing a power supply with an spdt switch?

texts: I'm currently trying to turn a 12 rpm motor from clockwise to counter clockwise and vice versa, I just wanted to know if it was possible to do with 1 spdt toggle switch, Ideas?


texts: What's the DC voltage range typically tolerated by modern smartphones?

texts:
The modern USB charging circuitry of mobile phones is pretty sophisticated. For example they can negotiate higher charging voltages etc.

This question, inspired by a discussion on worldbuilding, is simpler: I suppose I can charge any phone by simply providing 5V DC on the VCC/GND pins of the receptacle without even connecting the other pins, let alone communicating with the device. Think of a replica of Volta's first battery or a potato battery.

If this is correct, the actual question is which voltage range the charging electronics typically support on the two pins without being damaged. We will roughly know the voltage of one battery cell and can stack them in order to get in the vicinity of 5V but we cannot actually measure it and may end up half a Volt or so high.


texts: Is a MOSFET's body diode different than an ordinary silicon diode at audio frequencies?

texts:
So a friend of mine asked me to evaluate how hard would be to build a guitar effect like the ones described in this thread. The pedal in question is a customization of the Ibanez Tube Screamer. The central part of this effect is providing overdrive (and, with more gain, heavy distortion) by clipping the audio signal with two antiparallel diodes in the feedback path:

MA150 are the diodes in question, ordinary silicon small-signal diodes.

The thread emphasises on the immense improvement of the effect's tonal qualities by replacing the diodes with MOSFETs (presumably by turning the MOSFETs into diodes, gate and source are shorted together).

As it could well be pure audiophilia (you know, the thread contains passages like

  If you're into overdrive pedals, you'll know that MOSFET-based OD's are all the rage, for their natural, tube-like response.

)... still you never know, and I'm not 100% how to answer my friend. Can a MOSFET's body diode be all that different from a small-signal silicon discrete one?

For completeness, here are the V-I curves of the devices in question:

MA150 diode:

BS170 MOSFET's body diode:


texts: Can I run DC voltage through RJ45 Connector with Magnetics?

texts:
I am designing a PoE (Power over Ethernet) application. My question is can I run 48V DC Voltage through a standard RJ45 Jack WITH Magnetics? or do I need one WITHOUT magnetics?

I am planning to use this one, would it work for DC Voltage? Amphenol: RJMG264413101NR, https://www.amphenol-icc.com/rj-magnetic1x1-rjmg264413101nr.html

My concern is that DC signals will not pass through with integrated magnetics.


texts: How to improve flash time on lights controlled by solid-state relay via Arduino?

texts:
My goal is to flash lights around the house on and off to the beat of a song.

When doing this with a mini LED and an arduino, it works perfectly with a "flash_time" of ~.1 seconds.

This means every .1 seconds a new signal (1 or 0) is passed from the arduino digital pin 3 based on a numerical analysis of the song data I preformed previously.

However, I tried it with a solid state relay and a strobe lights and its not working.

The problem is, I can't flash on and off the lights every .1 seconds. In fact, from testing it, the most I can do is ~every 1 second on and .2 seconds off. Otherwise, the "on" information is too late getting to the lights and finally turning on when it is supposed to be off, and this delay increments making the whole thing a mess.

Hardware:

Relay - Omron G3NA-210B-DC5-24 Solid State Relay, Zero Cross Function, Yellow Indicator, Phototriac Coupler Isolation, 10 A Rated Load Current, 24 to 240 VAC Rated Load Voltage, 5 to 24 VDC Input Voltage
Lights - LE Globe String Lights with Timer, 33ft 100 LED, Multicolor, Plug in Twinkle Light, 8 Modes
Arduino clone - Elegoo EL-CB-001 UNO R3 Board ATmega328P ATMEGA16U2

In regards to the code, I used Python through Pyfirmata:

from pyfirmata import Arduino, util
from time import sleep

pin=3
board=Arduino('COM3')
ledPin=board.get_pin(f'd:{pin}:p') #digital, pin, pwm
it = util.Iterator(board)
it.start()

for i in range(10):
    ledPin.write(1)
    sleep(1) #these values I adjusted and visually determined the minimum
    ledPin.write(0)
    sleep(.2)

Clearly, I am new to electronics. So please try to spell out all terminology and concepts the best you can.


texts: Controlling AC load from a microcontroller GPIO with triac

texts:
I have the above question and I don't know who to ask. I looked around here, while most have no answers but there are a couple that kind of applies but went a little over my head, like these:

Directly controlling an AC load with a power phototriac
Control AC load with microcontroller. TRIAC behaviour problem

I am trying to control various AC loads (240V, 1000W) with a microcontroller GPIO pin.
I found this tutorial online and I want to just follow it.
But I don't know how to find the right components, provided the circuit works.
(1) For U1, I want to use MOC3021 optoisolator, will that be OK?
(2) For U2, I want to use BT134-600 triac (600V, 4A), will that be OK?
(3) How do I size R1 and R2, can I use just those same values?
I apologise in advance if this question is too simple/stupid. Thanks.


texts: Switching between two parts of a circuit using basic components

texts:
I'm designing a circuit in which i need to temporarily switch between different branches of it. I know that it can be done using a relay with coil etc, but I'm wondering if there is a way to do it some other way?

I know that there was similar topic, but unfortunately it was not well answered.

Basically i want to do something like this, but instead of a relay I wanna use some basic components:

simulate this circuit – Schematic created using CircuitLab

Anyone got an idea?


texts: What happens if I parallel two somewhat different size transformer primaries?

texts:
I have a small toroidal power transformer, perhaps 20VA, about 7cm outside diameter; core cross-sectional area is about \$16 \times 22 mm = 350 mm^2\$. I expect it's a wound silicon steel core.

I got a handful of these for $3 USD each at the local electronics surplus store (Halted in Santa Clara, CA) and am using them to experiment with winding my own transformers. I want to reuse the primary if possible since at about 13 turns/volt it's liable to be 1500 turns or so and so far I'm winding toroids by hand.

It has two primary windings and three leads, labeled 0-115-220.

I'm not clear whether the design intent is to use the BK-OR winding by itself for US 120 VAC or the BK-OR and OR-BR windings are intended to be wired in parallel for that voltage.

Doing the arithmetic on the label specs, the OR-BR winding is for 105 VAC. The two windings do indeed have different resistance and different inductances, \$28.7\Omega\$ vs \$52.1\Omega\$ and \$13.0H\$ vs. \$11.2H\$ (@100 Hz) respectively.

I conclude from the difference in inductance that the turns of the two primary windings are roughly proportional to the voltage drop each is designed for (115 and 105 V respectively, considering \$L\$ proportional to \$N^2\$). I conclude from the resistance measurements that the OR-BR winding uses thinner wire; it must have fewer turns but has higher resistance.

So I guess I'm answering my own question in that the thinner wire seems to clearly indicate the OR-BR winding is intended to be used by itself and only when needed, and the 115V winding is just over-designed when used as part of the 220 V winding.

But just out of curiosity, what would happen if the two primary windings were wired in parallel across 120 VAC? I'm thinking it's not a particularly good idea but not quite sure what behavior one could predict.

Also I'm curious if this is a common transformer design practice. It seems like it would be more economical to wind a bifilar winding of the same number of turns, say for 120/240 VAC and then just use them in parallel or series depending. Why would a designer prefer this configuration instead?


texts: How bad is it to undervoltage a 12-volt lead-acid battery?

texts:
I had a heated discussion with a few colleagues today revolving around how low of a voltage was alright for 12 volt lead-acid battery; they were in the opinion that the low voltage warning buzzer and ultimate automatic shutoff was annoying and a safety risk.

I had one guy insisting that the batteries were 'fine' even when they had been seriously undervoltaged and you can throw pretty much anything at them.
Another guy insisted his car battery had at some point been as low as 2 (!) volts and hey, he had no problems with it.

I've always thought when boating that you never let your 12 volt battery drop under around 11 volts, so this very passive stance has confused me a bit. Is there data available to quantify a loss in lead-acid battery quality from low-voltage events?  How much do I lose capacity-wise from a low-voltage event? I'm fairly certain I'm right but I need some data.


texts: What do 2 pairs of three numbers separated by colon mean in SDF files when describing delays of cells?

texts:
OK here is an example:

(CELL
  (CELLTYPE "AND2")
  (INSTANCE top/b/d)
  (DELAY
    (ABSOLUTE
      (IOPATH a y (1.5:2.5:3.4) (2.5:3.6:4.7))
      (IOPATH b y (1.4:2.3:3.2) (2.3:3.4:4.3))
    )
  )
)

I think that we have 2 inputs a and b. We are trying to describe the worst case, typical and best case delays between them and the output? If this is the case why are there 2 pair of 3 numbers rather than just 1. I am looking for a straight-forward answer to this specific point but have not been able to get it from google.


texts:
I am trying to study the effects of false turn on due to dv/dt changes. Here is my partial circuit on Pspice.

The error I am getting on simulation is
ERROR(ORPSIM-15143): Voltage source and/or inductor loop involving X_U2.E_E158. You may break the loop by adding a series resistance.
I checked for any voltage source shorts, but I didn't find any. What is wrong?
Here is the second driver ic


texts:
I made the basic TPA1517 circuit as shown on page 11 of the datasheet. When there is nothing plugged into the input, there is a lot of static. When I do plug something in, there is less static, but it is still noticeable and is still there when I play music. What kind of circuit would I have to add to this to get rid of that static?

It is a constant and regular hum, so I know its not radio interference in the wires. All the grounds are connected together, so I don't think its anything to do with that.


texts: How to convert a RS-274D gerber to RS-274X

texts:
I got from a website some gerber files, I tried to have them printed, but they told me that the format is not supported and I need to convert to RS-274X.

I've tried using gerbv to open the gerbers and export to the 274x format, but after opening it still complains about some being 274d.

So I've tried a commercial application (gerbview), but which managed to convert them but totally screwed up the scaling and ended up with a 1mm wide PCB.

On last resort, I've manually edited the files with a text editor and manually changed the scale of every piece and I've to say KiCAD renders it correctly, but any other viewer (gerbv and the one used by the pcb printing website) does not and still show the scaled down layout.

EDIT: as suggested, here is the link to the origianl files I want to convert


texts:
I need to build a simple circuit to limit the current of a 22-25V input (from two car batteries) to 2 amperes - to avoid frying a battery charging circuit.
I found this one - "General Purpose" Current Limiter? which looks like it should do the job (though I was hoping from something MOSFET based).
I'm not sure on the calculations, however - i.e. to work out the values to fix at 2 amperes.
Could someone please advise?


texts: Comparing Responses for Linear and Non-Linear System in Simulink

texts:
I am going through and reviewing this unprofessional (I highlight a potential mistake in Section3.4) paper: Nonlinear Model & Controller Design for Magnetic Levitation System

Specifically, I am trying to compare the responses of the linear and non-linear model in Simulink, using the parameters provided in Table 1 of that same paper. I am to comment on any discrepancies.

I am having trouble comparing responses, since they are totally different from each other.I suspect that I may have a mistake/misunderstanding when it comes to plotting the non-linear model. A very brief summary of the paper follows.

System

Non-Linear Vector Format

Linear Model

Comparing Responses - Working

For the non-linear model I used a MATLAB function block, with the following script:

function y = fcn(u)

    % define your constants
    g = 9.81;
    m = 0.05;
    R = 1;
    L = 0.01;
    C = 0.0001;
    x1 = 0.012;
    x2 = 0;
    x3 = 0.84;

% nonlinear set of equations
x = [x2; g-((C/m)*(x3/x1)^2); -((R/L)*x3 + (((2*C)/L)*(((x2*x3)/((x1)^2)))))] + [0;0;1/L]*u;

y = x';

I then gave a step input to the system and got the following result. Yellow is the step input, green is the output.

Next, I proceeded with the linear model. I placed the matrices A, B, C and D inside a state space block.

To get the numbers you see above, I replaced the constants with the parameters given in the paper. I got the following output.

As can be seen, both responses are completely different, and I am unsure about what discrepancies I should comment about. Are my non-linear and linear model implementations correct? I can add further details or workings if required.

Simulink build

Parameters:

Any help would be appreciated.


texts: Optoisolator Clarification - Logic Output vs. Transistor/Photovoltaic Output?

texts:
I'm building a circuit to detect whether an AC line has been turned on by a triac. I'd like to use an optoisolator to detect when the AC is on, and send a 3.3v signal back to my microcontroller.

What's the difference between an optoisolator with Logic output and Transistor/Photovoltaic output? The logic output optoisolator I've found is an MID400, which is described as a power line monitor and costs a lot per sensor. The cheaper option is a photovoltaic output, TCLT1600 with AC input.


texts:
I need to power many 100w 32-36V LEDs... and building loads of 32V PSUs is costly and time consuming.

This is a bit of a crazy idea, and I'm aware that it's probably not the safest way to do this, but this circuit has just popped into my head:

The tiny detail that I'm not quite sure about is the DC voltage after the rectifier:

Should I calculate using 240V, so 7 LEDs connected in series across 240V would give 34.2V per LED.
Or, should I calculate using the peak, non-RMS voltage 340v, so 10 LEDs connected in series across 340V would give 34V per LED.

N.B. I'm aware the picture shows 8 LEDs, but it's just to visualise what I'm talking about.

If anybody has any other quick, easy, safer ways to do this then please let me know!


texts: Designing a Light/Dark Sensor with LDR 555 alternator LED and Motor

texts:
I am working on a project which I need to turn on LED alternately as well as motor turned on while it is dark. I managed to create an Electric circuit which can turn on the LEDs together. However Motor is not starting with darkness. Can you please help me with the circuit?
I am using PIC microcontroller software circuit wizard 3.

Here is my schematic of what I achieved so far. There are still two issues that need resolving. first is Motor needs to start after detecting darkness with LEDs. And LEDs need to start alternately not together. Any help in this regard is appreciated.


texts:
I have a question regarding to hardware signal. There is a rule says ["] Smaller is faster. [."], which in the link states that

  In high-speed machines, signal propagation is a major cause of delay;

Q: I don't believe this. I think this is just academia explanation. Or is there any diagram can show the details of this? e.g. the x-axis is number of registers/memory unit and the y-axis is the delay/time
Actually you may but you don't have to answer my Q1

  In most technologies we can obtain smaller memories that are faster than larger memories. This is primarily because the designer can use more power per memory cell in a smaller design;

Q: Why more power will make signal faster? Isn't that the speed of current the same regarding to the same medium?


texts: Need help calculating resistor values for IR LED Driver

texts:
I'm wiring an IR LED driver for an Arduino project I'm prototyping.

The Arduino will be run at 5V, and I'm planning on using it's 5V output to drive the transistor that runs the LED

The circuit I've found uses an NPN transistor with the gate controlled by a digital output from the Arduino. The digram has me wire the 5 volt supply through a current-limiting resistor, the IR LED, and into the collector of the transistor. I'll call that resistor R1

The emitter is wired directly to ground.

The base of the transistor is wired to the output from the Arduino through another resistor. I'll call this resistor R2.

The LED I'm using is one I bought from Radio Shack. The package says it's maximum current is 200mA, and the supply voltage is 1.2 volts.

A quick calculation with Ohms law tells me I should use a 50 ohm resistor to limit the current to 100 mA. (r = v/I, 5/.1 = 25).

I have no idea how to figure out the value for r2, the resistor from the Arduino output pin to the base of the transistor. If you look at the circuit below, it calls for R1 = 10 ohms, and r2 = 47 ohms. I don't know how those values were derived, or the rating of the components those values are intended for.

That circuit calls for a 4.5 volt supply to both the Arduino and to the transistor. I'm using an Arduino Mega, and it calls for 7-12 volts input if you're feeding Vin, or 5 volts regulated from a USB port. It has a regulated 5 volt output with enough current to drive my transistor and LED.

Can somebody help me figure out the values for R1 and R2? I'm using a scrounged-from-my-parts-drawer NPN switching transistor in a TO-92 package, either a 2222A or a C1740.


texts: Figuring out a substitute for an old amp capacitor - value and type

texts:
I'm new to the electronics.
I have this 60s amp and one leg of the component in the picture broke off. From this post:
Mullard tropical fish capacitors
I realized that it was an old capacitor. From what I've read its 220nF (or 0.22uF). Here is what I want to know:
1 - did I read the coding & values right (is the top red and red - like in = 22?) - is it red, red, yellow, black? And what is the one below black? Is it gold? Like in 100V?
2 - in the answer mentioned above it is said that I should go for a modern capacitor (not look for the old ones). What type of capacitor should I buy? I saw many different ones on aliexpress with 220nF.
3 - would it be a good idea to change all the capacitors I can on this amp?


texts:
i Finished my design and now im  trying to make it fully 3D with STEP 214 models formwww.3dcontentcentral.es however as you can see even when im gettign the right models they just look like this, when the preview of the terminal blcok and the other compoenets actually look like the 2nd pic, am i doing something wrong or is there any configuration i skipped?

looks like the colors are there however they become grey as sooon as the get near the PCB


texts: Microcontrollers (STM32) and GPIO with momentary buttons

texts:
I have six momentary buttons and an STM32 Discovery board.

I want to check the button presses.

As far as I understand, I create a continuous loop that will check each GPIO consecutively. (I am aware of interrupts, however, I want to use GPIO inputs.)

The momentary button sets the GPIO from low to high and low again after release.
I can see this as an issue if the GPIO pin is not being read at the exact time it is high.

Do I need to do multi threading to keep those pins constantly checked? or are interrupts my only alternative?


texts: DMX (serial first) over Xbee Pro Module with Arduino

texts:
I want to transmit a DMX signal over a Xbee RF module. I came to realize that sending 1 Universe of DMX can be problematic.

Looking at the Open DMX page we see that the computer's DMX information is sent via USB, then converted to Serial output(via the arduino) and then converted to DMX (via a driver block max485).

My question is, can't I just send the serial output of the arduino over the Xbee at 115200baud, and convert the signal to DMX at the receiving end using the max485?


texts: Online database of data sheets that isn't horrible?

texts:
When wanting to look up a datasheet for a random part number I encounter in a circuit, say an AD9862, my first action is just to type it into google. For about half of the parts I encounter, particularly ones made by big respected brand names (like the Analog Devices example I used above) this gives me as a first hit the official manufacturer page and datasheet. Happy.

But about half of the time, especially with commodity/generic parts, say a 7812, the top hits are all these garbage sites like alldatasheet, getdatasheet, or datasheetcatalog dot com (I'm not typing out their URLs, since I don't want to further increase the pagerank of these junk websites). These websites are ugly, crammed to the brim with ads, with bad search capabilities, lots of SEO to get them highly ranked by google, but often with very little in the way of useful content.

Do you have a favorite way to find datasheets online, that sidesteps these middle-man ad-crammed sites? Is there a nice, user-curated perhaps, clean, low-ad-content database of datasheets out there somewhere?


texts: How to know whether the bandpass filter is stable

texts:
I am designing a bandpass filter using MFB. However, I do not know whether my filter is stable or not. Can anyone give me some criteria or methods to evaluate the stability of the filter design?(still using bode plot and applying the Barkhausen stability criterion?)

Here is the schematic in Multisim and the AC analysis plot:

Thank you very much


texts: bidirecttional arduino-controlled motor. What do we need the diodes for?

texts:
I have designed a circuit of bidirectional motor (using the motor of computer CD).
I have very (very) little background in electronics but I managed to do it by looking at some examples I have found in relevant datasheets such as  this one.

My circuit works perfectly well, the problem is that I don't understand some of it.
I am attaching a picture of it.

My question is, what do we need the diodes for?
I know that they are good for turning AC to DC,
but in my circuit, The current should be bidirectional for the motor to rotate both ways. So what are the diodes for.
I attach another figure with the circuit without the diodes. I understand from examples I saw that it should not work.

My question is:

  why wont the circuit in the second figure work?

My other question is:

  What are the capacitors in this circuit for?

(Figure 3 is just a short description of the L298 part. It is designed to control 2 motors and I used just one of them, Motor B)

Thanks!


texts: Understanding LED driver circuit AC to DC conversion

texts:
I am recently working on mains socket outlet type LEDs lights. They all have very similar AC to DC conversion circuit.

simulate this circuit – Schematic created using CircuitLab

C1 is a X-2 type capacitor and I know it has Independence $$X_c= \frac{1}{2\pi fC} \approx 9.6 k\Omega$$
Thus, the AC current will be limited by this cap at 230/9.6k=23mA. But what the R1 does in the circuit?
R2 is a big through hole resistor, does it act like a fuse or something?
D1 is a Zener diode. I guess it is here to regulator the voltage to its breakdown voltage, like 5V or 12V. Am I right?
This circuit doesn't have a transformer like 230V to 12v before the rectifier， would it be safe in practice?

Thanks a lot!


texts: What is the best way to layout this ultra-low inductance capacitor with interleaved pins?

texts:
This TDK capacitor interleaves its pins to reduce inductance.  For a high-pass tee filter, wouldn't I need vias to bring the negative lines off separate from the positive ones?  But vias increase inductance!  Any hints on how to do this in a 1-layer layout?
Here's a pic of the pinout:


texts: Strange (flyback?) diode in a circuit with a transistor switching an inductor

texts:
Edit:  The following question is related to a perpetual motion machine, a "Selfrunning Free Energy Muller MotorGenerator powering a 20 Watt bulb"

The switching device shown on the circuit was originally shown in the notes as an A3144, but a footnote says that a US5781 can be used in its place. This is presumably quivalent to Melexis US5781 datasheet here.

The Melexis US5781 block diagram is :

The diagram below is copied  from the perpetual motion machines description document. It is either incorrect when  a US5781 is used, or the diagram is wrong. The proper way to connect this hall sensor in the diagram below, is to connect ground to ground, IC Vdd to diagram +12V and IC out via a resistor to TIP42C base. This would in fact switch the coil but this is not the best way to do it  in "normal" equipment. In a perpetual motion machine anything may be needed.

In this device the hall sensor is one of a pair which are triggered by magnets which are part of or included in the device rotor.

The device appears to act as a brushless DC motor with 2 hall sensor units as per the circuit below providing position sensing and control plus a number of other magnets and coils to control the rotor and help produce the perpetual motion.

The device is intended to operate as an alternator to produce the "over unity" energy which is what makes it a perpetual motion machine.

The action of producing free energy does explain the unusual orientation of the diodes which are correctly oriented if the device acts as an energy source. When producing unlimited free energy, having some diodes "backwards" is the least of one's challenges.

____    End of edit    _________________

I have a schematic of a circuit used to trigger an inductor (for a home-made motor):

edit: The component A3144 is US5781 (I have its doc along with this schema).
edit: try Melexis US5781 datasheet here - RM

Apparently, the 1000µF seems to be here to have a power source near the circuit, but I don't understand the diode 1N4007 ... Placed near the inductor, I'd think it could be flyback diode, but if it was, I would have placed it in parallel with the inductor.

Why is it here, according to you?

edit: suppose the inductor receives induced current. This circuit is to be used   in a motor and I imagine some configurations where the motor is turning using a mechanical force. In that case, can't the diode be useful so the motor can be used as a generator also?


texts: How can I calculate inductance in this page?

texts:
I have an inductor ring from Micrometals. T60-26

In this page what is Relative magnetic permeability? link

For my example is it 50.0?


texts: Low speed device is recognised as full speed (USB tiny-like AVR isp programmer)

texts:
I recently tried to replicate the setup proposed in this instructable.
Everything is fine until I hook up the device into (any of) the USB ports. Then, dmesg on Ubuntu complains that the device did not accept the address assignement (throwing an error -71).
I tried to replicate the schematic here:

simulate this circuit – Schematic created using CircuitLab
The only difference between this schematic and my actual set up is the R3 resistor which in my case are two series resistors of 1k each. (D3 was not present, but I thought it could be useful to see if the device was actually powered)
Why does Ubuntu recognise this as full speed rather than low speed? Do I need to use exactly the same resistance shown in the schematic, or do I have a completely different problem unrelated to this resistor value?
I'm a total beginner, so I may be missing something trivial, but I can't see it. Any help is appreciated.
P.S.: all components are SMDs


texts: Embedded C programming to interface ultrasonic sensor to 89s51 microcontroller

texts:
I am trying to interface an ultrasonic sensor HC-SR04 to a 51 family microcontroller like 89s51. After learning about how ultrasonic sensor works I wrote a program as per my knowledge about ultrasonic sensor but now this program doesnt seem to work. What the program basically does is that it detects any obstruction like wall in front of ultrasonic sensor and if the distance gets below 30cm it stops running both motors and runs only right motor for some time and again starts running both motors and when it detects wall within 30cm 2nd time it runs left motor for some time and again starts runing both motors 3rd time again only right motor and in this way cycle continues forever while ultrasonic constantly keeps detecting distance between it and wall. The program is as follows -

#include <reg51.h>
#include <stdio.h>
sfr16 DPTR =0x82                ;
sbit RM1_X = P2^0               ;    //Positive of Right Motors
sbit LM1_X = P2^1               ;    //Positive of Left Motors
sbit RM2_X = P2^2               ;    //Positive of Right Motorss
sbit LM2_X = P2^3               ;    //Positive of Left Motors
sbit US_E = P3^2                ;    //Echo pin of Ultrasonic sensor
sbit US_T= P3^5                 ;    //Trigger pin of Ultrasonic sensor
//function prototypes
void RM_F(void)                 ;
void RM_S(void)                 ;
void LM_F(void)                 ;
void LM_S(void)                 ;
void trig(void)                 ;
void MSDelay(unsigned int)          ;
unsigned char get_range(void)           ;
void main()
{ TMOD=0x09                 ;
  TR0=1                     ;
  TH0=0x00                  ;
  TL0=0x00                  ;
  P3=0x04                   ;
  P2=0x00                   ;
while(1)
{ unsigned char R=0             ;
   R=get_range()                ;
if(P0^0==0)
{if(R<=30)
 {P0=0x01;
  LM_F()                    ;
  MSDelay(4000)                 ;
  }
else
 {RM_F()                    ;
  LM_F()                    ;
  }}
else
{if(R<=30)
 {P0=0                      ;
  RM_F()                    ;
  MSDelay(4000)                 ;
  }
else
 {RM_F()                    ;
  LM_F()                    ;
  }}}}
unsigned char get_range()
{unsigned char range                ;
 trig()                     ;
 MSDelay(40)                    ;
 DPH=TH0                    ;
 DPL=TL0                    ;
 TH0=0xFF                   ;
 TL0=0xFF                   ;
 if(DPTR<35000)
 range=DPTR/59                  ;
 else
 range=0                    ;
 return range                   ;
}
void trig()
{TH0=0x00                   ;
TL0=0x00                    ;
US_T=1                      ;
MSDelay(0.01)                   ;
US_T=0                      ;
}
void RM_F()
{RM1_X = 1                  ;    //Make positive of motor 1
RM2_X = 1                   ;    //Make positive of motor 1
}
void RM_S()
{RM1_X = 0                  ;    //Make positive of motor 0
RM2_X = 0                   ;    //Make positive of motor 0
}
void LM_F()
{LM1_X = 1                  ;    //Make positive of motor 1
LM2_X = 1                   ;    //Make positive of motor 1
}
void LM_S()
{LM1_X = 0                  ;    //Make positive of motor 0
LM2_X = 0                   ;    //Make positive of motor 0
}
//Some delay...
void MSDelay(unsigned int itime)
{unsigned int i,j               ;
for(i=0;i<itime;i++)
for(j=0;j<1275;j++)             ;
}

What changes should i make to make this program work. Thanks for helping.
PS - I used this blog as a reference for my program http://homemaderobo.blogspot.in/2012/08/ultrasonic-sensor-interfacing-with-8051.html


texts:
I'm working on a circuit based on ADC and DAC.

I understand that keeping ground plane of analog and digital section different is crucial in many applications for reducing digital noise interference in analog circuit.

My query is: Is the same isolation important for positive planes too?


texts: Cascading voltage regs not working as expected

texts:
I was trying to hack together a power supply circuit with bits I had lying around but I didn't get the voltages I thought I would get, this is what I naively thought would happen:

But in reality the output from the lower (in the diagram) LDO goes up to around 22v as soon as the other one is connected. Why?

EDIT: In case it matters they are TI part no. LP2950-50LPRE3

EDIT2: I think one of my LDOs is failed to almost closed circuit. Thanks for the answers though!


texts: How to make two motors spin at the same speed?

texts: I am currently using two identical motors to drive a robot.  The motors are both controlled using relays but one of the motors is spinning faster than the other.  How can I slow down the faster motor to turn the same speed as the slow one?


texts: An alternative to microcontroller as a clock generator

texts:
I use ATTiny2313 microcontroller to drive a linear CCD imager. That's all it does - an infinite loop that toggles six IO ports at different times. However, it is only a 20MHz controller. I calculated that I need about 200MHz microcontroller. At these speeds they are 32bit and too big, and not made in DIP packages.

Does anyone have an idea of what I could use instead of microcontroller to get the same function? Unfortunately, not all the waveforms are 50% duty cycle:

I heard about XCR3256XL 256 Macrocell CPLD. Could someone tell me how I could use it?


texts: Why are communciation protocols presented as Stacks (vertical) rather than as a conveyor belt (horizontal)?

texts:
The OSI model and other models represent a communication system as a stack of multiple layers. In this case we get a vertical structure where "user" is at the top and the receiver of communication at the bottom. What I have wondered for quite some time now is why we can’t represent the same thing as "stages" in a horizontal manner. There are multiple layers that we talk of in the OSI model where each has a different purpose and basically translates its input to something that the next layer will use. Depending on the protocol and the application under consideration we may have fewer than 7 layers or may even merge multiple layers into a single one.

My question is, where did this concept of a "stack" originate from where things are piled up vertically when talking of communication systems? We can also think of this process as a production line where our message goes through multiple stages, finally producing something that can be transmitted on the communication channel right? In this case we can represent the same system horizontally. Why does mankind use the word ‘stack’ and talk of it is a vertical structure when abstracting it?


texts:
I recently designed a board and got them produced. I had specified plated holes at some locations. But the PCBs came without them (unplated). I decided to check the Gerber files to see if it was plated info. The design sure has plated holes.
How can I check in Gerbers the plating information ?


texts: STM32 controller: GPIO_SetBits doesn't seem to have any effect

texts:
I have some problem with a STM32F030F4P6 MCU. The circuit consists of MCU itself, 3V rail connected to VDD and VDDA pins, ground connected to GND and BOOT0 pin and an LED connected to each of PA0-PA3 pins. Here is a circuit diagram (lines drawn near SV1 and SV2 connectors means external wires going to LED/power/ground/SWCLK/SWDIO pins.

Here is my code in it:

#include "stm32f0xx.h"
#include "stm32f0xx_gpio.h"
#include "stm32f0xx_rcc.h"

const uint16_t PINS = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3;

int main(void)
{
    RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);
    GPIO_InitTypeDef GPIOa;
    GPIO_StructInit(&GPIOa);

    GPIOa.GPIO_Mode = GPIO_Mode_OUT;
    GPIOa.GPIO_OType = GPIO_OType_PP;
    GPIOa.GPIO_PuPd = GPIO_PuPd_NOPULL;
    GPIOa.GPIO_Pin = PINS;
    GPIOa.GPIO_Mode = GPIO_Speed_2MHz;
    GPIO_Init(GPIOA, &GPIOa);

    volatile uint32_t i;

    GPIO_SetBits(GPIOA, PINS);
    volatile uint8_t state = 1;
    while(1)
    {
        // Waste some time
        for (i = 0; i < 500000; i++) {};
        if (state == 1) {
            GPIO_ResetBits(GPIOA, PINS);
            state = 0;
        } else {
            GPIO_SetBits(GPIOA, PINS);
            state = 1;
        }
    }
}

The problem is - LEDs connected to pins doesn't light up. I have connected a voltmeter to the output pins and debugged a program and found out that voltage goes up a little bit (to about 0.1V) each time I do GPIO_SetBits or GPIO_ResetBits, but instantly drops down to zero afterwards. Also to rule out lack-of-current issues, I changed GPIOa.GPIO_PuPd to GPIO_PuPd_UP and all the LEDs light up, but doesn't light down.

I use STM32VLDiscovery board as a debugger and CooCoox IDE.

During debugging, I can see GPIOA_ODR register bits are changing (and no longer changing if I remove the first line of main()), so it seems to be some problem with the output.

Can anyone give me any advise of what am I doing wrong?


texts: USB to Serial Converter using the CDC/ACM specification

texts:
I try to use a Usb to Serial converter in a windows store application. As the windows store application does not Support SerialPorts i need to find a USB/Serial Converter that supports CDC/ACM.

Here is what i tried:

Create a customer inf file for a FTDI controlled serial converter (which didn't work   because i later found out that FTDI does not support CDC)
Find a serial converter that supports CDC (i didn't had any luck with that either)

Can somebody tell me where i can get a CDC compatible Usb/Serial converter?


texts: Difference between "|Z|" and "Resistance" in capacitor datasheet?

texts:
I'm shopping for capacitors, and I expect good capacitor datasheets to have a graph of |Z| (the magnitude of the capacitor's impedance) as a function of frequency.

I was confused when I looked at page 2 of this datasheet for a Murata 10nF ceramic capacitor. There are 2 different graphs for the capacitor's impedance as a function of frequency. One graph says it is displaying |Z|, whereas the other graph says it's displaying "R". Obviously the 2 graphs are different, but what's the meaning of the second one? Is it ESR?

I googled around, but all I can find are descriptions of impedance.


texts: Ling adder vs classic CLA adder what's the difference?

texts:
I'm practicing in designing vhdl unit with some "complex" computer arithmetic algorithm.
I've just implemented the following CLA unit below.

I'm reading through this book, page section 6.3 page 97, I want to implement the Ling adder. I'm not sure however whether I've understood correctly or not the problem.

With reference to the book notation, basically the idea is to compute instead of $$
\begin{array}{l}
c_{i+j} = \sum_{k=0}^{j} g_{i+k} \prod_{l=k+1}^{j} p_l + c_i\prod_{l=0}^{j} p_j \\
p_{[i,i+j]} = \prod_{k=0}^{j} p_{i+j} \\
g_{[i,i+j]} = \sum_{k=0}^{j} g_{i+k} \prod_{l=k+1}^{j} p_l
\end{array}
$$

I need to implement as basic block one who would compute the quantities

$$
h_i = c_i + c_{i-1},t_{[i,i+j]}, g_{[i,i+j]}
$$

and instead of "xoring" the propagation with the carries I'd have to compute a slightly more complex function, is this the only difference in terms of implementation? A similar hierarchical design I suppose could be applied.


texts: Assistance on values and components, photo-transistor switch for LED array

texts:
Yet another photo-switch question. Have done my homework, and searches but most non-specific circuits are beyond my learning curve, time to learn, and available wet-ram.

Have a 15 LED array being driven by a LM317 regulator set up for current regulation (shown below).  Schematic has been breadboarded and works as advertised. Supply voltage 12-15Vdc, Vf of LEDs 3V, current 20mA ea. LM317 output with 12 ohm resistor.. 20.8 mA.

Need to add (optional) photo-switch to this circuit (on at dark, off at dawn). Simplest I have found has been posted in these forums already.

Problem is, this circuit, components and values, were designed for a 3V coin cell, and my requirements are based around  available 12-15Vdc power. Additional constraints due to space for components (very small) and power consumption (least is best) require a solid state solution. This solution looks good if someone can help specify the proper value for the (now) 1K resistor
in a circuit such as below. Spec sheet for the 2N3904 shows a max current of 200mA so (I think) it should suffice.

As I said earlier, my knowledge of EE is extremely limited, and I am putting this together on the fly. I can read a schematic, and do a decent job of soldering but my theoretical knowledge is sadly lacking. I may need to build several hundred of these little suckers, so any input or pointers to a better path, or a solution to my specific questions are appreciated.