texts: ATMEGA168 (P/V/ 10/20 AU?) + Arduino Booloader Flashing via AVRDUDE?

texts:
I bought about 10 ATMEGA168V's (which I thought were P's) and tried to flash with TinyISP via the Arduino IDE with the arduino mini pro board selected.  Well this fails for the obvious reason that the mini does not use the ATMEGA168V.  The lilypad actually uses the V.

Now when I try to:

avrdude -c tinypisp -p m168

I get an error that tells me to recheck the connections.  However I know the connections are fine since I was able to get the fuses set msg with this very same command BEFORE I tried to flash it with the Arduino IDE.

I applaud you for getting this far into my rambling back story.  The question is are these chips now dead?  Is there something I can do to get these guys talking to avrdude again?

Thanks,

Ril3y


texts: Damage logger by removing LED from circuit?

texts:
I have this data logger that we are using for temperature and rotation measurements. Unfortunately it came with an LED, which we need to get rid of for our study.

I really don't know much about circuits, so I was wondering:

Can I just remove that LED by breaking it off, without damaging the other parts in the circuit?
What is there to consider doing it?
Could removing it, in any way, influence the sensors on the board?

Also, I know that those logger can be equipped with light sensors. Is there any way that this Led is in fact one of those sensors? In that case I really don't want to loose it.

Thanks!

Edit: Here are better pictures

Unfortunately, I don't have the schematic.


texts: Interfacing multiple rotary encoders to a microcontroller

texts:
What, in your opinion, would be the most efficient way to interface muptiple (let's say, >20) incremental rotary encoders to GPIO-limited microcontroller (for example, ATxmega128A4U, 44 pin)?

Requirements:

It should be possible to operate multiple encoders at the same time.
Encoders have integrated push switches.

What I have tried:

To search for multi-channel quadrature decoder IC. No luck.
To search quadrature decoder to serial IC (Encoder-to-SPI, I2C, etc). No luck.
To build a multiplexer-alike logic that would allow to connect as much encoders as possible while saving GPIO's. No luck.


texts: How to estimate the required PCB surface area for SMD power resistors

texts:
I am migrating a design from through-hole parts to use as many SMT devices as possible.

There are 7- 2 Watt power resistors in the current design.  These are metal-oxide resistors that have crimped and formed leads so as to raise the body of the resistor about 0.2" above the surface of the circuit board.  This current design has been reliable and trouble-free for many, many years.

I'm now looking at replacing those axial-lead resistors with multiple SMD resistors in parallel.  There would be 3- 1W resistors (2512 package) in parallel to give the required resistance and power rating.

However, I don't know how much PCB copper surface area that these three resistors are going to require.  Each resistor will dissipate about 250mW under normal line-voltage conditions but the dissipation increases to about 900mW under worst-case high-line-voltage conditions.  That's a total of about 2.7 Watts for each of the resistor clusters.

Because the PCB material is FR-4, I want to keep the maximum PCB temperature under 75C.  Assuming ambient temperature of about 30C, that gives me a temperature rise of only 45C.  That suggests that I'm going to want an awful lot of surface area - but I don't know how much.

The boards will be in an enclosure with only natural convection currents inside the enclosure.

Guidance is much appreciated.

[Edit]

Based on the document link provided by John Birckhead, it's not feasible to increase the resistor current as originally desired.  If I stay with the total resistance near 680R, I'll need to dissipate about 1.3 Watts in each resistor cluster with worst-case high-line-voltage input.  This drops to about 0.5 Watts with nominal line voltage.

The customer has asked me to increase the size of the PCB from the current size - this will allow more room for descriptive text near the terminal blocks as well in blank areas on the board surface.  I should be able to eek out darned near 3 square inches per resistor cluster - solid copper fills on both top and bottom layers as well as lots of large-diameter vias (0.036" holes) scattered all over the area.  The vias will fill with solder when the board is wave-soldered

All that said: I have the option of have the copper fills on the bottom of the PCB either covered with solder-mask or left as bright solder finish.  I'm inclined to have it as bright solder finish so as to increase the radiating qualities.  Opinions requested.


texts: Is there a requirement for Electrical Design Engineers to show all his/her design computation/analysis used on electrical plan?

texts: There was a Terms of Reference requiring to provide 100% back-up Power on all residential units of a building. However, I noticed that the design-in-charge do not include provisional loads on his/her total computation.  I am concern that it may result to insufficient supply later-on or design is not 100% ready, since he/she already excluded loads before arriving on total computed load and before the application of demand factor etc.


texts: Options for Differential transmission of digital signal

texts:
I have a setup in which several (3 or 4) microcontroller boards (locally, they are within 3 to 5 meters away from each other) need to be "perfectly" synchronized, so we're broadcasting a "master clock" signal;  a very slow clock (in the order of 1 Hz).

Since we are pretty sure that we'll have to deal with noise, ground loops and related nasties, I'd like to send out that signal differentially (possibly just two wires, and then all of the boards' grounds going to a common "earth" point).

My first thought was: designate two GPIO pins of the processor (we have lots of available pins), and drive them from a timer-interrupt procedure such that they are always the complement of each other.  That way, we get a differential signal that swings from -3.3V to +3.3V.  For the receiver, I'm thinking an analog differential circuit --- a rail-to-rail op-amp powered with 3.3V and GND (single supply) driven to saturation so that it produces a digital signal.

Then, there is the option of using a line driver / receiver such as the DS90LV019, or the combo SN65LVDS1 + SN65LVDS2;  then, I notice that these all produce a differential voltage in the order of 300 to 500 mV.  I'm a little bit paranoid, and such a low level, even being differential, scares me.

I thought of a hybrid:  I could transmit with two straight outputs from GPIO pins that are always the complement of each other, and at the receiving end I use an SN65LVDS2 receiver --- but this (and a couple other receivers I'm seeing) specify as absolute maximum ratings a differential input voltage of +/-1V (i.e., not to exceed +/-1V).

Am I over-complicating things?  My guess is that I should trust the driver/receiver combo;  but I get this bad feeling that I'm going to regret taking that route (plus, devoting two pins and keeping them as the complement of each other seems soooooo easy).

Any experience with these? Any tips or advice on what you think should work best?

Thanks!


texts: Securing electrical cables to holes in enclosures?

texts:
Suppose I would like to insert data-cables of varying diameters -- e.g., a cable of 5 mm diameter -- into the 6 mm diameter hole of a plastic enclosure. The wires within the cable are terminated via soldering to a PCB inside the enclosure.

What methods are used in the industry to ensure that pulling the cable won't make it slide in and out of the enclosure (thus preventing damage to the wire connections to the PCB inside)?

Some options that I have considered:

Two small lengths of thick heat shrink tubing placed around the cable, both just inside and just outside the wall of the enclosure. If the tubing is wide enough, then it will block the cable from sliding. This could work but may have to use too many layers of tubing and also the fit just by friction alone may not be strong enough.
Apply a thick layer of rubber-compatible adhesive in a circle around the cable, both just inside and just outside the wall of the enclosure. The glue blob would act as sort of a bolt/washer. This is too messy in practice, and probably not usable professionally.
Use rubber-and-steel-compatible adhesive to place two bolts around the cable, one just inside and one just outside the wall of the enclosure. The problem with this is that it is hard to find an adhesive that bonds well to both rubber and steel.


texts: Help diagnosing problem with multimeter voltage readings

texts: I pulled out my digital multimeter (RSR 1007) that I hadn't used in a while. It measures the resistance correctly, but the voltage reading is odd (note I've correctly set the range, DC/AC, it has a new battery, etc). For example if I hook it up to a 9v battery, it will take about 5 minutes to slowly drift from 0 to 9v. It seems to measure the voltage more or less correctly, but it takes a really long time, and doesn't seem very accurate, fluctuating more than it used to. I'm just wondering if this is a known/common failure mode, and if so I'd like to understand it and know if I can fix it.


texts: Orientation of switching elements in PLA

texts:
In a PLA, the switching elements in the wired-OR array are oriented as shown on the right of the figure (from Fundamentals of Logic Design, Roth/Kinney, 6th Ed, p.264). A logic 1 current appears to flow in the direction of the arrows, from word line to bit line.

However, the switching elements in the wired-AND array (left of figure) are oppositely oriented, so that a logic 1 current from an input line to a word line seems to need to flow against the direction of the switching element.

No explanation is given for this in the text and I've been unable to find any discussion online. Can anyone explain the reason for, and working of, the oppositely-oriented switching elements in the wired-AND part of the PLA?


texts: Significance of V < 50V for US certification purposes

texts:
In the EU 2014/35/EU requires increased producer diligence and formalities when an electronic device used voltages greater the 50V ac either as input or as output.

Can somebody explain to me whether a similar rule exists with regard to putting a device on the US market? If so, does it make a real difference in practice? I.e. is the certification process significantly easier or cheaper? Or is product liability insurance significantly easier/cheaper to obtain?


texts: 555 and transistors: using a transistor to ground the reset pin of a 555 and how to drive a MOSFET with a 555

texts:
Parachute Deployment Timer

I am busy trying to build a parachute deployment timer for an amateur rocket using 555 ics

What have I done thus far

I have a switch that closes temporarily while the rocket accelerates. I am trying to use a Bistable 555 to latch the acceleration switch and a "delay before on" 555 to drive a MOSFET which will sink current for a piece of nichrome wire.

Basically I am trying to combine the two circuits shown below

bistable 555

delay before on 555

I have "breadboarded" both of these circuits individually using LEDs to test the output and they both did what they were supposed to do. When I try combining the two circuits things go skew.

Below is schematic of what I am trying to do with the two 555. my problems begin at Q1 and M1

simulate this circuit – Schematic created using CircuitLab
I assume this schematic is fundamentally flawed

So here are my questions

1. How do I use transistor Q1 to ground the reset pin of U2 or is there an easier way to place Q1 so as to stop U2 from starting the delay sequence?

2. How do I drive a power MOSFET with the output U2


texts: Wattage of LED based growth light not consistent with LED usage

texts:
I have ordered a growth light for my plants. Only later did I realize that it said its a 2kW light, which seemed quite excessive as it is only the size of a small keyboard and not that densely populated with LEDs. So I did some digging and figured out that it is using 2835 model LEDs. I found a website where I can buy those "by the meter". The website states that with 120 LEDs/meter it will use 24W/meter. My growth light has 216 LEDs. Lets round that up to 240. This would mean it uses 48W and not 2kW. What could be the cause for that difference? Is this related to the equivalent for a non-LED based growth light?
I looked up some generic LED light I can buy in a store near me and there you can also find some weird wattage conversion:

The 4.6W = 35W is what I am talking about.


texts: How to calculate resistivity from this cell design?

texts: I was wondering how/which area and distance values are calculated for a concentric 2 electrode conductivity sensor (below) when trying to calculate the bulk resistivity of a fluid. The blue is the outer electrode and the green is the inner electrode and the space between is where the fluid would be. Thanks in advance.


texts:
What I'd want to do is to use cheap disposable temperature sensors and to read the temperature data wirelessly. The sensors would be set in a medium such as reinforced concrete. Right now I'm using wired thermistors, but since I need to read the data from a range of 2-3m then eventually the wire cost would get fairly large.

I've looked into passive RFID tags, but as I understand it, one would need expensive equipment in order to reach such a distance.
Now my question is that are there any alternatives to RFID that would reach a range of 2-3m and would be cheaper to implement. I'm not really keen on using a battery in the sensor chip as they wouldn't be recovered after the experiments.


texts: Selecting an NTC for inrush current limiting

texts:
I am building a small TRIAC valve for ON/OFF control of a 300W heater. The current design problem is as follows. When the heater is cold, it's resistance is low (15Ω @ 220VAC) and the initial current is large.

Is an NTC the right way to tackle this problem? If so, what guidelines should I observe in selecting one? If not, what would be a better idea?


texts: How to get the CMOS inverter's open-loop gain

texts:
In 74LVC1GU04's datasheet, section: 13. Application information

The equation to get close loop gain need the loop gain \$G_{OL}\$, but i've no way to get this value from the datasheet. Can this value be acquired from the digits given in the datasheet, or i need to measure it by myself?

Any suggestion is appreciated.

Update:

In NXP's another CMOS inverter: 74HCU04's datasheet, i find this (thanks to MarkU):

So maybe it's a typo of 74LVC1GU04's datasheet. That is, \$G_{OL} = A_{OL}\$. Anyone can conform this?


texts:
I made this circuit yesterday using normal logic gates and chips:

$$(AB)+(A\bar BC)+(\bar AC)$$

Now I have to remake it using only MUX but Im having some trouble. From my understanding I should use a 3:1 MUX, because I have 3 different combinations that light up that bulb.

How could I replace all this circuit logic gates with MUX?

EDIT: Truth Table


texts: Noisy signals with 2-layer PCB - What's wrong with my design?

texts:
For my master's thesis in computer science, I need to read out a TCD1304AP linear CCD sensor. A STM32 microcontroller with the circuit laid out on a breadboard gets the job done, but in order to make my project more portable, I designed and ordered a PCB from elecrow. Unfortunately, with the manufactured PCB I get a lot of noise on the ADC when reading out the sensor.

Here is the link to the datasheet of the linear CCD sensor, you can find the schematic of the necessary circuit on page 12: link

I have the layout of my PCB attached with some important remarks:

As you can see, the input from the IO pins gets inverted at the Logic Inverter and then goes on to the pins of the TCD1304 sensor. Some pins are clocked at a high rate (e.g. masterclock @ 4MHz). The resistors and transistors are placed like the schematic excepts them, there is also a LT1761 added for voltage regulation. The output reading I get from the ADC looks really noisy, much worse than the output I get from the breadboard circuit.

Hopefully some of you can tell me the major mistakes in this PCB, as I'm pretty much a newbie in electronics and PCB design!

EDIT:

Here is the full schematic:


texts:
What is the consensus on using super capacitors to power a 500w electric bike motor?

Cheap and innovative alternative to li-po batteries, or explosion between thighs waiting to happen?

The plan is to create something like this.

I will use a 24V 500W motor like this.

The super capacitors will have a volt meter assigned to them and when they drop to a certain voltage, I will charge them using 2X 12 v batteries and a switch.

I am by no means wise in this area, just trying to find my way to fun with electronics, so any advice from those who know will be very much appreciated.

P.S. I can draw a terrible diagram if anyone is still unclear, but be warned, i have very limited knowledge and so a diagram from me may not be too enlightening!


texts: 12VAC to 12VDC Converter Requirements for RGB LED Controller

texts:
I have an outdoor lighting transformer (operating at the usual 12VAC) that I want to add a strip of LED lights in a new run. The transformer has two legs, each supplying up to 300W of load at either 12V, 13V, 14V, or 15V (4 contacts per leg). The strip light controller takes 12VDC at up to 12A, but I will only be connecting a single strip that consumes 5A (+1A margin).

I know that to convert the power source to DC I will need a bridge rectifier and then something to smooth the ripple. I'm not sure what the tolerance of the RGB controller is (guessing 0.5V, I might be able to confirm that tonight). Based on my research over the past few days it sounds like the BR will boost the output DC voltage (due to RMS vs peak) so I will need some resistors or diodes to drop the voltage back down to 12VDC. As this converter will be living outside my intent is to keep things compact enough that I can weather proof it without much effort (either small enclosure, or epoxy and heat-shrink tubing).

I have a reasonable understanding of how the circuit design should look, but where I am not confident is on the specs of the components. For the BR, is at least 6A If reasonable or should I pad that with at least 12A If (especially if I want to add another 6A run on the end of this run)? A 20A If BR is only about $2.00 so no big deal on price. All BR's in this range seem to support very large peak reverse voltages (usually 600V+), are there any minimum specs I should take note of?

For capacitance, I am using the C = I / (Vdrop * Ifreq * 2) formula. In my case that is C = 6 / (0.5 * 60 * 2) = 100 mF which seems very high, but perhaps necessary for this type of circuit (with load this high)? Is it more reasonable to use multiple caps instead? I know that I will need 25V caps to handle the 12VDC coming out of the BR. I can pick up a cap with these specs for about $6.00 so again, no big deal price wise.

Are there any other considerations that I should be aware of? I am certainly not a professional electrician, but I understand the general concepts. Building the circuit and soldering the parts together is no problem for me, it's just some of the finer details that I would like some feedback on to make sure I'm on the right track.

Finally, what I am attempting to recreate is a product available on Amazon but not available in Canada (where I live). Based on it's size and shape I'm almost certain that it is composed of a BR and (at least one) capacitor. Possibly some other parts to regulate the voltage?

Here is a (very basic) circuit diagram that I am expecting to build. I just put 1kOhm for the controller as a reasonable amount of load resistance for the LED strip (not sure what the actual value is, but maybe I can figure that out later).

simulate this circuit – Schematic created using CircuitLab

Thanks for any help.


texts: Epoxy Resin Molded vs Hermetically Sealed Metal Can Packaging for LEDs and Photodiodes

texts:
Between epoxy resin molded vs hermetically sealed metal can packaging for photodiodes and LEDs are there any relevant functional differences I should be aware of when selecting between otherwise seemingly identical photodiodes or LEDs?

The can offers potential flexibility for lens/filter options while the molded packaging is obviously lower cost. It seems to be a toss up which is actually more mechanically rugged and environmentally stable since one case is entombing/encapsulating in a more permeable material while another is being placed inside an impermeable material. I guess the metal can packaging would also handle higher temperature. Are these the only significant differences?

LED Example:
https://dammedia.osram.info/media/resource/hires/osram-dam-5580407/SFH%204550_EN.pdf

https://dammedia.osram.info/media/resource/hires/osram-dam-5723400/SFH%204851_EN.pdf

Photodiode Example (not quite as identical as the LED example):

https://www.marktechopto.com/pdf/products/datasheet/MTD5010N_2011_07_20.pdf

https://dammedia.osram.info/media/resource/hires/osram-dam-5488355/SFH%20213_EN.pdf


texts:
I was toying around with an idea for a digital musical instrument with breath control. I've successfully experimented with pressure sensors and they are probably the right way to go, but my first idea was just using a plastic sealed microphone. I never got very far with it, but I think it still has potential for the kind of response I want.

The idea was that a stream of air directed to the hit the microphone would generate white'ish noise (just thinking blowing on a mic) and I could use the loudness of this noise to create the ADSR envelope for my sound. Covering the mic with plastic sheeting still allows this to work and protects it from the moisture in your breath.

However, most of my electronics experience is digital (from discrete digital in college to microcontrollers now) and I'm more of a programmer. I got as far as looking at the noise signal on my 'scope and verifying that it had the characteristics I wanted (to use the smoothed, positive magnitude of the noise as the loudness of the synthesized tones) and I know that if I can get it to a wide enough analog range I can use an ADC to get a digital magnitude. What I lack is the analog knowledge to take the noise waveform and transform it to a varying analog signal representing the average positive magnitude at a fairly high sampling rate.

Any ideas or links to get me started?

P.S.
I won't really know which answer is totally correct until I get do some experimentation, but the responses have been great so far. The VU meter is pretty close that what I need and the reminder that loudness is logarithmic is useful as well.

It may have been easier to state my problem this way: I want to control a digital tone (either generated or via MIDI) where the "loudness" of the tone is proportional to the intensity of the sound generated by blowing on the mic if that makes any more sense.


texts: Suitable switching/buck regulator - Vin = 24V and Vout = 5V and max current = 0.4A

texts:
Due to a sudden change in design requirements with regards my circuit supply voltage I'm looking to change my voltage regulation on my circuit from the classic LM7805 linear voltage regulator to a switching/buck regulator.
This is my first time attempting to use switching regulator so apologies if some bits of my post sound trivial. In saying this I've gone through this DC-DC Converter Tutorial by Maxim for the theoretical aspects and understood the basics of how the switching regulator works.
My circuit
My new supply voltage requirement is +24V from +6V and I need a Vout of 5V to be supplied across the circuit. My max current is 0.4Amps. I can't utilise my LM7805 as the heat dissipation is just too much. See calculations based on the calculations below using help from this Power and Thermal Dissipation Tutorial by SparkFun.
$$Power\,dissipation = V \times I = (24V - 5V) \times 0.4A = 19 \times 0.4 = 7.6W.$$
7.6W is too much heat.
Hence my question: which switching regulator (possibly available in the eagle libraries) would be suitable to take in a Vin of 24V or below and deliver a Vout of 5.0V?
Here's my schematic (developed in Eagle):

EDIT:
I've looked further into the use of the switching regulator specifically the LM2575-N to deal with the heat dissipation problem as outlined in my first post. Please see my proposed approach here (Apologies if bits of the diagram are not that clear. I drew my approach by hand before committing time into finding the components in Cadsoft Eagle and subsequently updating my schematic).

I also took the approach as seen here in order to supply +3.3V to the Zigbee module as seen in my schematic above.
The LM2575 on the LHS is for the stepping down of +24V to 5V and the Vout from this LM2575 is to supply +5V to the second LM2575 for stepping down to +3.3V which is supplied to the zigbee module. The +5V from the first LM2575 is also supplied to the rest of the circuit as seen in the circuit diagram above.
Does anyone foresee any problems with the approach e.g. with the selection of the input capacitor, inductor, output capacitor and catch diode? I came up with the approach by following the design procedure as per pages 12, 13, 14 and 16 of the LM2575 datasheet.


texts: How to take my differential filter and design it for a different frequency and impedance?

texts:
I have a board with this differential PI filter:

simulate this circuit – Schematic created using CircuitLab
Say it's designed to pass signals with frequency X and bandwidth B1, and now I want to redesign the filter so that it stays with the same configuration but change it's values so that it will pass signals with frequency Y and bandwidth B2.
Luckily, I have a program that allows me to input the desired filter type (lowpass, highpass, bandpass), configuration (PI, T), frequency, and impedance. It provides me the values of the inductor and capacitors. Unfortunately, it provides me the filter as a single ended PI filter, like this:

simulate this circuit
My questions:

How do I change the values of the inductors and Capacitors that are given to me on a single ended basis (if at all), to transform the filter to a differential one?
How do I make sure my new differential filter has the same impedance I want it to have (the single ended filter has that impedance, not the new differential filter).
If I am limited in my choice of inductors (say I don't have the value I need L1, but I have L1+150 or L1-200), is there a way to compensate for it, for example by changing the values of the capacitors? (I can't put inductors in parallel or series).

Bonus question - how do I measure the impedance of the filter, using either ADS (advanced system design) or LTspice?


texts: Can anyone explain why I get these results in OrCAD?

texts:
I am new user of OrCAD , and I have a problem in understanding the voltage shown in the red circle.

By logic, the voltage of this point should be:

$$3.3 \mathrm V \times \frac{5 \Omega}{5 \Omega + 5 \Omega} = 1.65 \mathrm V$$

Why do not I get this value in OrCAD ?


texts: Converting a 4 to 20 mA signal to 0 to 5V

texts:
I am trying to convert a 4 to 20 mA signal to 0 to 5V.

Till now I just used a 250 Ohm resistor to convert my signal to 1V to 5V.
Now I am trying to increase the resolution by adding a OpAmp.

When applying a constant voltage it will function but adding my sensor fails.

The first picture fails, whereas the last picture works. Is someone able to tell what I am doing wrong?

Thanks in advance!

EDIT: Final Circuit


texts:
So, for my own eccentric reasons, I want to build an honest-to-gosh condenser microphone like they did back in the 1930's (only not as good, I'm sure).
My basic thinking is to use a sheet of aluminum foil or aluminized mylar suspended about 1mm* away from a big pad on a PCB.
Aluminum foil is good because I know it's conductive, but I can just imagine the problems I'm going to have because of its fragility trying to stretch it over a frame.
Aluminized mylar is good because of its mechanical properties, but I'm not sure if typical aluminized mylar from a space blanket or a balloon is going to have a continuous sheet of aluminum on it, or just enough aluminum to make it shiny.
So:

Does anyone know if "typical" (in the sense that if it's mirror-bright on one side) aluminized mylar is conductive?
If such "typical" stuff can't be counted on to be conductive, does anyone know the right key words to search for to get stuff that is?  A brief Google search didn't help me out, but I'm quite capable of having awesomely bad Google Fu.

* Or less, limited by my machining abilities.


texts: Technical term for smooth scrolling digital volume encoder

texts:
I am making a bluetooth volume control from a machined aluminium billet.

I cannot find a technical name for the digital volume encoder that would provide that smooth rotation.

Or am I approaching this wrong and should be looking at smooth analog pots and then convert the signal to digital?


texts:
I am looking to set up a test jig to test radiation susceptibility.  This is to do a small in house test to check if my board is susceptible to radiation.
The tests frequencies are the standard test frequencies covered by FCC guidelines.

Now, to do this I want to build a circuit to do that. How do I proceed for such a thing ?
Any tutorials that I can look into ?

Are there any test circuits ?


texts: PIC18 xc8 compiler : how to resolve warning (335) unknown pragma "code"

texts:
I'm trying to compile this code to blink led with button interrupt, using xc8 compiler and PIC18F4550. I got those warning, so the code lines are ignored and the program doesn't work properly (by clinking on button nothing happens)

newmain.c:45: warning: (335) unknown pragma "code"
newmain.c:46: warning: (335) unknown pragma "interrupt"
newmain.c:65: warning: (335) unknown pragma "code"

program code

#define _XTAL_FREQ 4000000
#include <pic18f4550.h>

// BEGIN CONFIG
#pragma config OSC = HS

static int cpt = 1;

void IntExternal_INT(void) {
    TRISB0 = 1; // PORT B0 as input
    INT0E = 1;
    INTCONbits.PEIE = 1; //enable periphyrical interrupts
    INTCONbits.GIE = 1;
    INTEDG0 = 0; //: Interrupt Edge Select bit : 1 = Interrupt on rising edge of RB0/INT pin
    //  0 = interrupt on falling edge
    INT0F = 0;
}

void delay() {
    volatile int i, j;
    for (i = 0; i < 2000; i++)
        for (j = 0; j < 10; j++);
}

#pragma code isr = 0x08 // Store the below code at address 0x08
#pragma interrupt isr  // let the compiler know that the function isr() is an interrupt handler

void iscr(void) {
    cpt++;

    if (INT0IF) //If External Edge INT Interrupt
    {
        LATDbits.LATD0 = 1; // RD-0 to High
        LATDbits.LATD1 = 1; // RD-1 to High
        delay();
        LATDbits.LATD0 = 0; // RD-0 to LOW
        LATDbits.LATD1 = 0; // RD-1 to LOW
        delay();
        INT0IF = 0; // clear the interrupt
    }
}
#pragma code // Return to the default code section

void main(void) {
    IntExternal_INT();
    TRISD = 0xF0; // PORT B Setting: Set all the pins in port D to Output.
    while (1) {
        if (cpt % 2 == 0) {
            delay();
            LATDbits.LATD0 = 1; // RD-0 to High
            LATDbits.LATD1 = 1; // RD-1 to High
            delay();
            LATDbits.LATD0 = 0; // RD-0 to LOW
            LATDbits.LATD1 = 0; // RD-1 to LOW
        }
    }
}


texts: How do you "shrink" electronic components, such as transistors, resistors and diodes?

texts: I realize that these components have been shrinking in size. How is this process done? Should all electrical engineers know this?


texts:
I made a prototype to test a few logic gates and found out that

My AND gate (7408) Works like an OR Gate.

My OR Gate (7432) is always on

My XOR Gate (7486) is always off

My NOT Gate (7404) works.

This is my test setup -

The grey and Brown hanging wires are inputs, the LED up top is output.
The current chip is the 74HC08N AND by TI.
Sometimes, the gates randomly work too.
EDIT
Adding Resistors and pulling to GND fixed all but the XOR (74F86PC) Gate, which still does not respond (With bypass capacitors, etc)
I Am Running at 3 V
So, help?
Thanks!
These are my first circuits, so a bit dirty, sorry.


texts: I/O Capture Time (Interrupt's I/O Changing Time Reaction) of MCU

texts:
I am searching an information from the datahseet about how fast MCU's INTERRUPT can detect the I/0 change on the I/O ports for PIC12F609 (also it can called as I/0 capture time). I have found a chart in the datasheet's 158 page and there is a parameter as "GPIO interrupt-on-change new input
level time" Do you think that this value is the my parameter? I need this value for PIC24F16KL402 and ATTINY4-MAHR MCUs. Thank you so much.


texts:
I am using an AT24C32 I2C EEPROM device as a simple storage unit for recording slow analog voltages. I am writing the data byte-wise, no pages. Every write cycle takes 10ms to complete.
The data sheets state an endurance of 1M write cycles.

I would like to know if this figure relates to a single cell or for every single write?
Eg, if I completely fill up the EEPROM-memory (4096 bytes) with byte write commands, do I consume 4096 cycles, or only one (as every single cell is only written to once)?


texts:
Specifically how well can an ATX PSU and in turn the Computer it is powering cope with power loss for x miliseconds during the changeover from Grid AC to offline UPS inverter AC
Can I use offline UPS for a PC? Will the delay affect my PC if it is running when the power goes out?
is an interesting conversation on the subject and opinions are expressed about european regulations for ATX design specifying that it should cope with full load for half of a cycle or 10ms of power loss.
I have however been unable to find the regulations that state this as a requirement
really i am just looking for some concrete indication that ATX AND OR general purpose CE certified PSU's can cope with half cycle power loss
it is a bit easier to find out the UPS transfer time in ms as its usually well published
i am specifically interested in offline UPS compatibility and not concerned with other benifits of other UPS tolologies.
thanks in advance
please advidse if i need to repost this elsewhere.


texts:
I would like to major difference between these ICS.

Max 485 Low power Slew rate limited
SN75176 :Differential Bus Transceiver
ADM 2483  Differential Bus Transceiver

ADM 2483 is Isolated type power supply. I could not able to differentiate  functionality

I read in forums all are same but difference in functionality. I could not able to find difference .


texts: Using the wires in an HDMI cable for carrying power?

texts:
Could I use an HDMI cable in conjunction with a breakout board on  both ends to drive several stepper motors all through one cable? Or do the wires have special properties that would make them unsuitable for this purpose? My current setup is rat's nest :D

(Assuming of course that I don't exceed the limits of the 24-gauge wire or whatever it is)


texts: Why when I apply a firing angle alfa with a thyristor controlled regulator the current is zero in the red line drawn in the figure? I think that the thyristor opens the circuit, but why it does so? How can I understand when the thyristor stops the conduction and then restart it? I know that the thyristor stop the conduction when there is a zero cross point of the voltage, but in that point the voltage is not zero.


texts: How to wait for '>' in SIM900 message format

texts:
Hello all I am trying to send sms using SIM900 and PIC18F2520. I have button attached to pin of MCU. So whenever the button is pressed, sms should be sent.Following is the code I am using to send SMS:

if(PORTCbits.RC1==1)
{
  DelayMs(10);
  if(PORTCbits.RC1==1)
  {
    UARTsend("AT+CMGS=\"99********\"\r ");
    DelayMs(100);
    UARTsend("Hello World");
    DelayMs(10);
    UARTsend("\x1A ");
    DelayMs(10);
 }
}

Now when I run it in debug mode, I receive sms. But when I program the device, what happens is it send AT+CMGS command and then send Hello world and \x1A. After sending all these things, then it shows >, that means now it wait for the message content. I dont know why it is happening. I have given the proper delay after AT+CMGS. I tried increasing the delay but again no changes.
How to wait for > while sending sms. Please help


texts: Low pass filter cutoff frequency calculation

texts:
The cutoff frequency is defined as the frequency where the amplitude of \$H(j\omega)\$ is \$\frac{1}{\sqrt{2}}\$ times the DC amplitude (approximately -3dB, half power point).

I wish to understand why it is \$\frac{1}{\sqrt{2}}\$, and not \$\frac{1}{\sqrt{3}}\$ or some other value. Can we derive the cutoff frequency in any other way?


texts:
I am trying to power an SSR opto coupler, and need a maximum 1.6V supply, so that I don't blow the LED. However the main voltage supply is between 0V and 4V, and the minimum zener diode voltage I can find is 1.8V. The regulation needs to be very low current, and not distort the waveform in any way. Any help would be great!

SSR Datasheet: https://www.mouser.co.uk/datasheet/2/307/en-3gvm_ar_dr-1771733.pdf


texts:
I've a solar panel of 5.5 V and 100 mA. Could I use it to charge LiPo batteries using the MAX1555?

Of couse that the voltage will drop due to the the Schottky diode.


texts:
Looking at a datasheet of an inverting regulator, I found something peculiar:

I've never heard of a Pin-Package called "Dice" before, and it doesn't even specify the pin-count. On the package information site of the manufacturer, this package isn't mentioned either.

What does "Dice" mean in this context and why would I want to use it?


texts: NOR and NAND flash memory on the same chip

texts:
I've been researching booting and flash memory as found in embedded devices like smartphones, tablets, and boards. There are numerous schemes and an equally numerous amount of obscure terminology. I understand NOR flash allows for XIP. Some NAND chips seem to have special "boot areas" or "boot partitions", and even "boot modes" (though that only makes sense in the context of processors to me).

Setups can utilize boot ROMs embedded in application processors, have separate chips for boot code (on NOR) and system code (on NAND), use U-Boot stored on the internal memory chip as an IPL, or use eMMCs that are boot code-aware with configurable ranges for "boot areas".

Are there memory chips that have a NOR portion and a NAND portion combined into a single address space. That way, say, addresses 0x00000000 through 0x0000FFFF contain a bootloader that can execute in place while addresses 0x00010000 through 0xFFFFFFFF correspond to NAND flash?


texts: required power supply for nichrome heating element?

texts:
I am very new to electrical power math.  So please be friendly.  :-)

I am getting 28 gauge nichrome wire to make my own heating element.  Here are the specs and numbers of what I am attempting to do and what I know.  I would appreciate a second pair of eyes confirming my numbers and also help recommending the correct power supply.

A.  10ft of 28 gauge wire, straight  = Ohms Resistance 42.52.  I plan to coil the wire myself and then loop the coil through ceramic insulators
B.  I need to reach temperatures of 450 F (I don't need over, but I def need to consistently hit this temperature.

Using the above info, an online calculator has provided me the following:

Volts = 55.276

Required Amps.  1.3
Required Watts: 71.85
Resistance per foot: 4.252
Total Resistance: 42.52.

Questions:

Is 55.276 volts the amount of volts needed going into my power supply, or the amount of volts coming out of my power supply?
I have a spare (universal) HP laptop power supply with the following specs, is this power supply sufficient for my needs? :
 Input: 100-240v,  50-60Hz, 2.0A
 Output: 18.5v --- 6.5A, 120W
When I cut the laptop connector off I assume I am going to see at least 2, probably three wires.  black, white and green (maybe red).  Do I connection both black/white to one end of the nichrome wire or do I connect black to one end and white to the other end?

A quick diagram:

110      Power Supply (PS)          PS split      Nichrome Wire
     _________________________
3]---|>>100/240v | 18v/120W>>|____/---black---o---{Wire EndA}--\
     -------------------------    \---white---o---{Wire EndB}--/

I may have to get 26 or 30 gauge wire...knowing the above, will my power supply still be sufficient with those gauge wires for what I am looking to do?
Lastly, what, if anything am I missing or possibly not understanding?

Thank you in advance.  This is all to make my own homemade plastic vacuum molding device.


texts: How to make a USB receiver for the wireless mouse?

texts: I have a Microsoft Wireless mouse but the USB receiver is long lost. Is there anyway I can make the receiver myself?


texts: How can I understand a servo well enough to build one?

texts:
I am trying to understand exactly how a servo works, so that I can build one.

I bought and built a small robot arm kit, and it has five geared DC motors to actuate it. I would like to control the robot arm from a computer, but in order to do that, I need to make the actuators smarter, essentially turning them into servos.

I opened up a couple of inexpensive analog RC servos, and the design looks simple. It has a dc motor, a potentiometer on the output shaft, and circuitry to turn the PWM signal to a position for the output shaft.

My problem is that after opening a couple of servos, I got a range of controller chip models ranging from KC2462 to KC8801. These all seem to be made by the same Chinese company. Unfortunately, I can't find the data sheets, and even if I did, I do not understand any Chinese dialect.

My question can be summed up as this:

Is there another servo control chip datasheet that I can read?
Is there a website with enough information to learn how exactly a typical analog servo does what it does?
Is there perhaps a book with the above information?

Please understand that I already understand how I could hack a servo motor together - I can reprogram an ATtiny45 to take some kind of positional input from one pin, an analog input from a potentiometer on the output shaft, and then output direction and speed to the DC motor. Speed accomplished with PWM in this case. Maybe with a huge cap on the supply to ensure the DC motor doesn't cause too big of a voltage drop when it starts moving.

However, I don't know if the above would damage the chip with inductive feedback from the motor, or if there's a different way to do the speed control.

I would like to understand how the problem is solved in a real-life professionally designed and built servo motor.

As for my background, I did some electronics in school, and I've been playing with Arduino and ATtiny45/85 microcontrollers for a few weeks.


texts:
I was reading the book Analogue electronic circuits and systems, by Amitava Basak, when I stumbled in this level shifter circuit that uses BJTs instead of the usual mosfets. See the below picture. Please disregard transistor models.

I am puzzled by Q2, the middle NPN transistor: is it always off?

Q5 is connected in diode mode, and its Vbe is fixed at 0.7V
Adding Q2 Vbe plus the voltage drop in R2 should then give 0.7V again
The above imply that Q2's Vbe is less than 0.7 OR the voltage dropo on R2 is zero.

Discarding the null voltage drop on R2, how is it possible that a transistor switched on has a base to emitter voltage below 0.7V?


texts: Damages to ICs done when cleaning boards with IPA

texts:
I have designed a PCB and soldered some SMD components on to it. When I check it, it doesn't seem to work. It was my very first SMD soldering experience and I think I used too much hot air. While investigating the issue, I found out a moisture level factor in ICs. So I read this article ICs with humidity or moisture sensitivity - bake recommendations and found out that water vapors can reside damaging the ICs from inside.

I had the ICs weeks before soldering and they were also the very first time I experienced a TQFP44 brand new IC (PIC24EP256GP204). I was careful enough not to touch the ICs by hand but to use an anti-static tweezer. Now all that is done and the ICs not working, I found out about this MSL(Moisture sensitive level) factor.

My problem is, when we're cleaning the boards with IPA, prior to soldering, does that affect the MSL as IPA could go inside the IC package damaging it when heat is applied? (Popcorn effect?)

Thank you very much in advance!


texts: How to pass string for EEPROM write for ATMega32? (in the following code)

texts:
How could I pass a string for EEPROM write first and read in the code as:

int main()
{
    char display[30];
    EEPROM_writedata(display);
    LCD_senddata(0,EEPROM_print(1));//this wont work
    LCD_senddata(0,display); //this works fine
    return 1;
}

void EEPROM_writedata(char* name)
{
    eeprom_update_block((const void *)name,(void*)1,20);
}

char* EEPROM_print(int i)
{
    char* send;
    eeprom_read_block((void*)send,(const void*)1,10);
    return send;
}

LCD_sendata(int, char*)
{
    //codes for LCD initialize upto print
}

I may have a lot of mistakes here because of less knowledge. Please specify if you get them. My problem is mainly pass string to EEPROM_write() and pass it to main from EEPROM_print(). Any help is appreciated.


texts: What kind of Modulation? Who transmits on 850 MHz (LTE-Uplink or GPRS?)?

texts: Hey, I found an interesting Signal on 850MHz (in Germany). It is not symmetric and very strong (relative to many others due to bad antennas). On the right side the bandwith is permanently used, on the left side the bandwith is temporaly used and devided into many slots. Anybody also see sth comparable? I have already looked at sigidwiki. Kind regards.


texts:
I am designing a PI voltage and current Controller (Cascaded Control for Buck Converter with LC filter) and I am confused about what is the perfect phase margin to choose for the application.
I read and found out that the recommended phase margin is between 45 to 60 degrees for stable operation but I do not know which would be the optimum value for my application. I just know that 45 degrees might give a good transient response.
Is there a specific calculation using which I can decide which phase margin would be good for my application? Is comparing the settling time one of the criteria with which I can judge the optimum phase margin?
For Phase Margin = 60 (Stable)

Voltage Controller Gain = 5.6398 A/V
Voltage Controller Reset Time = 82.699μs
Current Controller Gain = 5.1322e+04 V/A
Current Controller Reset Time = 13.783μs

For Phase Margin = 45 (Stable)

Voltage Controller Gain = 16.0719 A/V
Voltage Controller Reset Time = 23.734μs
Current Controller Gain = 7.2580e+04 V/A
Current Controller Reset Time = 7.9577μs

For 45 degrees I do get lower reset time but the higher gain requirement. How do I find the optimum phase margin?
Requirement : Overshoot = 5 to 10%
Low settling time and lower voltage error.


texts: How dangerous are magnets to common electronics?

texts:
I'm working on a fun little personal project, an electronics knickknack I'm hoping to fiddle with, like a fidget spinner. I want to use reasonably-strong magnets in the design, capable of holding around 3 kg (6.6 lbs) against gravity. I'm worried these magnets might pose a danger to the types of electronics I have lying around, namely phones, speakers, laptops, etc.
To what degree do I have to be concerned about using magnets around common household electronics?
Edit
In response to a very reasonable request from Mattman944 for the strength of the magnets I'm looking for, something around 0.2 tesla, two of them each on the left and right of this device. It seems there's no easy way I can share with you the design of the device, so I'll describe the magnets and their placement. The magnets would be encased in around 2 mm of PLA plastic, and would be separated from each other by about 1 cm of space. The goal is for the magnets to not pose a danger to typical consumer electronics I (or anyone else) am likely to have lying around. To be specific, I'm concerned about speakers, laptops, cellphones, and monitors, but I'd also love to know about any other devices to which these knickknacks could cause particular harm.
If you've got any questions or concerns about this question, definitely feel free to comment. I'm a bit new around here, and I'm all ears for suggestions! Thanks in advance!


texts:
Connecting an ammeter directly across the terminals of a battery reads a current.
Is this possible, or is my ammeter broken?


texts: Storage for High Power High Current Pulse

texts:
I am currently developing a high voltage, high current amplifier for an EMI test pulse generator. I have been able to generate the pulse in 5V level so far and I am now trying to boost the pulse (in voltage, power and current) with an amplifier circuit using discrete components.
I've used the search function and got a direction pointed towards the amplifier circuit here:
High power pulse generator

But I still have a remaining question. I've done the Math and I am pretty sure I have to buffer the energy for such a pulse.
The pulse is:

t: maximum 300ms
V: 0-90V
R: 2 Ohms

What do you guys recommend? A large battery? Any ideas on that? Could someone point me in the right direction? Thank you very much for your help and looking forward to your opinions!


texts: How does the function inside the rectangular function work?

texts:
I'm looking at a Signals and Systems problem, and the question asks to show the inverse fourier transform of \$f(w)=\operatorname{rect}(\frac{w-10}{2\pi})\$ is:

$$\mathcal{F}_{t}^{-1}[f(w)]=\operatorname{sinc}(\pi t)e^{10jt}$$

I can see that \$\operatorname{rect}(x)\$ becomes \$1\$ over the interval \$-1/2\$ to \$1/2\$, but how is it affected by a more complex function? In the solutions we were given the bounds become \$10-\pi\$ to \$10+\pi\$. How did they get to these bounds?


texts: How the Depletion Region is shrinked when Diode is in forward biased?

texts: I would like to know why does the depletion region gets shrinked when a potential is given to a diode(Forward Bias).Is it because we have given a higher voltage than the voltage of the depletion region?But still how does that voltage turn out to break the depletion region?Could anyone help me.


texts: Why does no current flow when GND of one battery is connected to VCC of other battery?

texts:
I have enough experience with electronics to design and solder working circuits. I never quite understood though why circuits must be closed for current to flow.

I alway understood electrical current as the movement of charged particles (free electrons usually in circuits), from a ‘high pressure’ region to a ‘lower pressure’ region.

But by that analogy I never could comprehend why no current flows when the - pole of one battery is connected to the + pole of another battery?

Please don’t say “because the circuit isn’t closed”. It’s exactly what I’d like to understand - on a physical level - why the circuit must be closed (especially when understanding electrical current as the flow of charged particles from high-density to low density)


texts:
I am looking for some suggestions on how to handle switching between two, hi-power LC circuits that provide an AC drive source for dynamic loads.  The LC target frequencies are ~1MHz for one application and ~2MHz for the other, but both are driving loads of up to 10A.  The existing setup requires two different circuits depending on the load and I'm trying to figure out how they could be combined into a single circuit that could drive either load.  The catch is that I need to do this without having to physically swap boards or components.

Anyone have any suggestions on where to start or general advice?


texts: magnetometers: do they work all over the globe?

texts:
Are there any places on the globe where magnetometers won't work?

For example, if you took a Honeywell HMC5843 to the North or South magnetic pole, would they fail to function properly?


texts: Can I power multiple devices from a single power supply?

texts:
I'm planning on building a device that has the following requirements:

4x devices that are rated as 5v (1.5 amps normal load, however during high loads can require upto 2 amps)
1x raspberry pi

I've sourced a power supply that takes 240 AC mains supply and provides 5v @ 8 Amps.

My plan is to connect all the devices in parallel.

My questions are as follows:

Is this power supply a good idea?
When the system is idle, will this be an issue, i.e. the devices are not drawing maximum current?

Please advise!

EDIT

This is the kind of power supply I'm planning on using, I don't know if that helps?

http://www.ebay.co.uk/itm/DC-12V-24V-5V-Universal-Regulated-Switching-Power-Supply-for-LED-Strip-CCTV-UK-/291087849273?var=&hash=item43c6301739:m:m6INReCcQQadil-AVWF6qsQ


texts: What is the ISR for the comparator change interrupt on a dsPIC33F?

texts: I'm asking for the ISR name for the comparator interrupt for a dsPIC33F. I've tried _CompInterrupt, _CMInterrupt and _CMPInterrupt. All three bring up warnings about non-existent ISR names. I can't find it anywhere in the datasheets.


texts:
First of all, I know I should not use a varistor at a DC level higher than its clamping voltage, but I want to do it for a test (destructive or not). What I want to know is what is the maximum current allow in a varistor at DC, and what will happen will increasing the current in the varistor? Will it burn? Explode? From the power dissipation of transcients, I calculate that the maximum current allow should be :

I = 0.6W/220V = 2.7mA

I already tried the varistor I want to test at 3mA, and it wasn't to hot to be touched. So i'm now a bit confuse about this. Is someone have any clue for me?

The varistor I want to try is V130LA10CP. Here's the most important data :

And the complete datasheet is here.


texts: LED with built-in resistor and voltage drop

texts:
I accidentally bought 12 V LEDs, so an LED with a built-in resistor (you can see it as a black dot on the anode).
Now I measured the voltage and get after the LED still a voltage of 11.3 V, when the LED is supplied with 12.5 V from a power supply.
I find this strange, because usually the resistor will drop the voltage so far that the LED gets its 1.7 - 2.0 V. So after the LED should be only 1.7 V or am I wrong?
Where is my thinking error or are the LEDs with series resistor internally connected in parallel?
Shouldn't that be the same circuits, just one had the resistor inside the LED and the other one has the resistor before the LED?
Edit: Of course I'm measuring this way, I'm sorry


texts:
How do people / companies deal with compliance testing (CE, UL, FCC, etc.) what I would call "platform-oriented and modular" products?

The idea being that a family of products might exist, where a lot of the electronics and firmware are shared among them, but each variant has different modular sub-systems integrated, and corresponding differences in firmware. Let's assume the product is an intentional radiator,  using an FCC registered Wi-Fi module to keep things concrete, and that the product is powered by a UL marked 5V AC/DC USB wall-wart.

What strategy do you use to certify for compliance all modular combinations of the product family of products. It feels like modularity is a good design goal,  but if it implies hundreds of variations each having to be independently tested for compliance,  it seems untenable financially for real products. Is there a nuance I'm missing that makes the economics of modular design work from a compliance standpoint?

In 2018 it's also not uncommon to have field upgradeable firmware. This gives rise to the question of what exactly is tested for compliance? Does updating firmware in the field invalidate compliance marks?

Do the institutions that govern product safety and electrical compliance have allowances for these types of concerns,  or are they just becoming dated? I want there to be a method to say: I tested the product in these configurations,  and they represent a superset of all possible configurations,  and they all met the regulatory standards; therefore other hardware configurations and firmware updates in the same family are compliant, no more testing required.  Is that possible? Do product test labs support that sort of thing?


texts: PIC16F877A reprogramming failure using PICKIT2 programmer

texts:
I wrote a program to upload to my PIC16F877A. Initially it uploaded correctly using the PICkit2 programmer and the microcontroller worked fine, but when I tried to change a piece of code and reprogram the same PIC the program was successfully uploaded but when I tried to test the chip it didn't work.

I tried several times without success. What is the possible solution? The code was written on MPLAB XC8 IDE v3.5. Configuration is #pragma config FOSC = HS ,WDTE = OFF ,PWRTE = OFF,BOREN = OFF,LVP = OFF ,CPD = OFF,WRT = OFF,CP = OFF. I'm using an external 8 MHz crystal.

After failure in MPLAB I tried to write a simple "Blinking LED" in MikroC but no success, it still didn't work.


texts: Check if the slave is receiving data from microcontroller and transmitting back successfully, I2C?

texts:
I have this project where I have to communicate MPR121 touch sensor keyboard with 8051 microcontroller via I2C, I've implemented the code and when I execute it I don't really know whether slave is receiving data or communicating at all with the microcontroller, how can i know it? Here is a piece of code to help you with your answers..

org 0000h

    SDA     BIT p3.6
    SCL     BIT p3.7
    IRQ     BIT p3.2

    addw    equ 0B4h
    addr    equ 0B5h

i2cinit:
    setb sda
    setb scl
    ret

rstart:
    clr scl
    setb sda
    setb scl
    clr sda
    ret

startc:
    setb scl
    clr sda
    clr scl
    ret

stop:
    clr scl
    clr sda
    setb scl
    setb sda
    ret

send:
    mov r7,#08
back:
    clr scl
    rlc a
    mov sda,c
    setb scl
    djnz r7,back
    clr scl
    setb sda
    setb scl
    mov c, sda
    clr scl
    ret

ack:
    clr sda
    setb scl
    clr scl
    setb sda
    ret

nak:
    setb sda
    setb scl
    clr scl
    setb scl
    ret

recv:
    mov r7,#08
back2:
    clr scl
    setb scl
    mov c,sda
    rlc a
    djnz r7,back2
    clr scl
    setb sda
    ret

      ;seinding data
        lcall i2cinit
    lcall startc

    mov a, #addw ; master
    lcall send

    mov a, #2bh ;register address
    lcall send

    mov a, #00h  ;data written in reg
    lcall send
    lcall nak
    lcall stop

   ret

 end


texts: Do we need any kind of protection for AC relay coil?

texts:
I have seen and dealt with mostly DC relays until now I have a circuit that involves AC relays. In most of the DC relays we use a diode(like in the pic below) to protect the components like transistors, MOSFETs etc from the high voltage back e.m.f spikes.

My question is do the AC relays also need some kind of protection across its relay terminals to prevent arcing when its turned off? The relays I'm working on are 120VAC ones.


texts: Would analog multimeters measure correct dimmer's output?

texts:
Because I decided to regulate 230VAC with a dimmer (or SCR chopper), I want to measure the outcome (which is very big noise!) with a voltage and current meter.

I know I am supposed to take true RMS instrument, but would analog work too?

I don't find it logic for NOT to work, because the voltmeters are actually just a non-spinning motors, which could be interpreted as: "I use dimmer to regulate speed of motor, which is in this case a voltmeter".
And the same could be said for current meter.

edit:

How about, if I add a Graetz bridge and measure DC component there? I don't actually need to show actual AC, if I can do it with DC. (In case I even do get something near a proper voltage value.)


texts:
I am a beginner working on my Arduino-based proximity sensor array project, like this one. I have already tested the functionality with single HC-SR04 transmitter/receiver and now I would like to build an array with, let’s say, 9 columns and 3 rows (27 transmitters, 27 receivers to connect to 54-pin Arduino Mega).

That HC-SR04 has a measure range from 2 cm to 400 cm with precision up to 3 mm (could be even higher with thermistor) and I want all of this to be downscaled: measure range from ideally 0 mm (3 mm are acceptable) to 30 mm with precision of ideally 0.1 mm (acceptable is 0.3 mm).

And I need these T/R merged into one casing – like this and much smaller, let’s say 3 mm of width, but smallest available transceivers are about 8 mm wide.

Is there some physical limitation? Or is it because there is just no need for it?

Thank you.


texts: How hard is it to make an USB-powered toothbrush charger/power supply?

texts:
I've got an Oral-B/Braun electric toothbrush and was wondering how hard it would be to make charger that would be powered via USB (I guess 1A should be enough).

The needed amount of windings on the coil could easily be calculated when measuring the voltage on a coil with a known amount of windings when put onto the charging station while the toothbrush is charging (I got 0.035V with 1 winding which would mean that around 143 windings would be required to charge on 5V). Another requirement would definitely be a DC-AC converter with the right frequency (could be obtained in the same way as the voltage/windings).

So what else should be considered?


texts: Safe to use a common return for multiple DC power supplies?

texts:
I have four 12V DC power supplies powering four separate loads (12V LED light strips). Is it safe to use a common return path for all four loads?

simulate this circuit – Schematic created using CircuitLab


texts: Make a circuit that indicates an odd number of ones using a 3-8 Demux and two logic gates

texts:
Using 3-8 Demux and two logic gates, make a circuit that received 4 bits and returns 1 if the number of 1's is odd and else returns 0.

My try:

Using truth table, we get that the desired function is:
$$f=a'b'c'd+a'b'cd'+a'bc'd'+a'bcd+ab'c'd'+ab'cd+abc'd+abcd'$$

Please any help or  direction.


texts: Is it possible to have a MCU work at -55 degree, with specification of -40 to 85 degree working environment?

texts:
I heard that someone mentioned the method of screening: to have 10 MCUs working at -55 degree, and find out the ones which can work properly, throwing the broken ones away.

Is the method applicable? I am worried that the MCU may work properly at -55 degree at my screening test and fail at the real working environment.

If not, what could be the possible solutions? We are using stm32f4, due to its very good DSP performance. The MCUs working at -55 degree we found do not have DSPs and can only work at low frequencies around 20MHz.


texts:
I am completing my first official PCB project.  I am outsourcing the PCB fab to Seeeed Studio.  I was wondering if any of you might be able to shed some light on my issue.
I am using their PCB assembly service with OPL parts.  I am using Eagle cad with Seeed Studio's eagle cad OPL parts libraries.  Upon uploading the gerbers I was asked to also upload (or fill out their online form) a BOM file for the OPL parts.
My issue is the eagle cad OPL parts libraries do not seem to match up perfectly with there online listings of OPL parts, or at least it is nearly impossible to find any relation among about 50% of the parts.

Has anyone dealt with this before?

Here is the link to their main wiki page regarding this
http://www.seeedstudio.com/wiki/Open_parts_library#Connector
and also their main home web page regarding this
http://www.seeedstudio.com/depot/OPLopen-parts-library-catalog-c-136_138/?ref=side

I am specifically having trouble with figuring out how to fill out there BOM file with the specified parts and values because I cannot relate the parts in the eagle cad libraries with the parts I am finding in there physical listings.

Thanks in advance guys!


texts: Detecting velocity in a specific threshold

texts:
I have three velocity sensors that are axis in 3D.
I would like to know the best method to do basic ON/OFF trigger..
I'm thinking of a hystersis control, is there a method that can detect if the velocity from all the three sensors exceed a specific range like 10 m/s?


texts: What is the difference between first order, second order and third order phase locked loops?

texts:
What does PLL order represent?
What are the disadvantages in order 1 & 2 PLL comprared to order 3?
How to choose the pll type for an application like QPSK demodulator?


texts: Switching high voltage in a buck regulator from an awkward ground reference

texts:
I am making a HV buck regulator for driving 50W or 100W LED COBs in series, they have about 33V forward voltage each so I should be able to do up to 7 or maybe even 8 in series. 1.5A for the 50W COBs and a bit over 3A for the 100W ones.

The problem I am having is designing a switching topology from the ground reference that the control circuitry needs to monitor the output current and voltage since this ground reference can be more than 300v from either input and I would like to switch at a fairly high speed to reduce ripple to keep a stable PWM feedback loop. I would like to use the TL494 but I am open to other controllers if they make the switching easier.

It would be convenient to use PMOS since the source would be at the ground reference and I can use a small negative voltage rail to switch it but I am still trying to find out from the IC designer whether the TL494 can have a negatively biased output emitter or if that would prevent it from turning off.

I do have an idea for using NMOS, but it is a bit ugly though since the pnp will be supplying the gate with a voltage up to the line voltage for a short period before the mosfet turns on, the fuse is present in case it does not turn on fully to protect the zener and the rest of the switching circuit. It will also be a fair bit slower due to the high voltage BJT. The voltage source is a small transformer that also powers the controller. Is this a good idea?

Here is the full circuit so far using PMOS, the BJT helps a lot since I can't find any PMOS switches that get under under 5 ohms from my preferred supplier:

I am also considering either lowering the switching speed to use a full BJT switch and just dealing with the high ripple and it's effects on the PWM control, or abandon PWM altogether by just having a simple output comparator turning on and off an oscillator by an optoisolator, which will require a second LV power supply and make for somewhat poor regulation but that is not a huge concern for the application, especially since the load is fairly constant. If only this was not a current regulated supply I could use a FOD2742 or such  which doesn't need a supply.


texts: Oscilloscope amplitude reading depends on cable length? Reflection help

texts:
Suppose I have an RF source with 50 Ohm output impedance. First lets imagine the RF source outputs a low frequency 10 kHz signal (electrical wavelength is about 20 km). Suppose I have a 50 ohm coax that is a few meters long. Now I plug this cable into a high impedance input oscilloscope. Suppose I read 1 V peak-to-peak. If I now 50 ohm terminate the oscilloscope (by putting a 50 ohm resistor in parallel with the scope input or using an internal 50 ohm mode) then I know the signal reading on the oscilloscope will drop to 0.5 V peak-to-peak.
I understand that in the first case (high impedance input) that the signal reflects off of the scope and the sum of the incident and reflected wave causes the measured voltage to double relative to the 50 ohm terminated case in which there is no reflection. There are no cable length effects because the cable length is much less than an optical wavelenth so it is the same circuit analysis as if the signal were DC.
Now, suppose the signal frequency is increased to 100 MHz and we consider the high input impedance scope. Now the electrical wavelength is about 2 m so cable length matters. Here is my question, given that the source is 50 ohm terminated, will the amplitude that I measure at the scope depend on the length of the cable? My intuition seems to say it should be I can't work out why. It seems to me that the first signal will hit the scope and then reflect and this will cause the signal to double relative to the 50 ohm terminated case. however, the reflected signal travels back to the source where it is dissipated in the 50 ohm terminator which is there. So the wave doesn't bounce back multiple times. Without these multiple bounces I don't see how you can get these sort of interference affects at the oscilloscope.
So my question in a nutshell:

If you output a high frequency signal from a 50 ohm output impedance generator and put it through a long cable, will the signal amplitude that you measure on a high-impedance oscilloscope depend on the length of the cable and why or why not?


texts: Board structure relative to ground plane

texts:
I'm sorry if this question has already been asked, but I did not reach a full understanding of this subject area.I have read several guides for PCB layout, including the articles on this site. And now I want to consult with you to make sure that everyone understood correctly.

I plan to design pcb that will have onboard set of components. I'm worried about the performance of the pcb, since the board based on STM32 microcontroller will communicate with digital IMU ( MPU-9250 6 dof accelerometer + gyroscope ), drive BLDC using MOSFETs and measure set of ADC signals ( back-emf ) as feedback from BLDC.

Based on this explanation: http://sa.nxp-lpc.com/docs/an10897.pdf
Here is picture:

I plan to use 3 ground plane with ground plane bridges to pass signals:

Digital GND above which I will place Microcontroller and IMU IC which will communicate using I2C protocol.

Power GND above which I will place voltage regulator and set of MOSFET to drive 3-phase BLDC. That MOSFETs will be driven by MCU's PWM signals.

Analog GND that will receive back EMF from BLDC and pass them to MCU's voltage comparators.

1) Does this structure is correct? Or it is completely wrong?

STM32 has onboard ADC and voltage comparator.

2) If I have to use them did I should consider MCU as a mixed signals IC? And accordingly place a MCU between digital and analog ground as here:


texts:
I designed two boards that contain an FT232RL FTDI chip.
The difference between two boards is only in the USB data lines.
One of the two PCB designs (Image A) does not recognize the FTDI chip. I noticed that when I unplug and again plug in the USB cable very quickly the FTDI chip gets recognized. However, if I do not do this quickly enough, the problem still remains.

The schematic is identical for both PCBs.

.

I upload photos of the pcb. Second design on the right (Image B) recognized.


texts: External Memory IC which increments data on a clock pin

texts:
I am searching, with no success, in multiple categories of the external memory IC market for a chip that can do the following:

Store 1MB of data of 16-bit data
This data is stored at specific addresses
When I put it into read mode it uses it's 16 output pins to display it's 16-bit values in memory    i.e. if the value at address 0x0000 was 0000 0000 0001
0010 this value would be on the pins in +V/0V.
When I increment a pin with a clock it will change to address 0x0001 and display that value on it's pins.
Preferably has unlimited write cycles like SRAM.
Data can be volatile

I can find sram which matches the address on it's input pins and then displays the value at that address to it's output pins. but it won't clock automatically to increment and requires specific reconfiguring of the address pins.

An example that is close is the CY62256NLL-70ZRXIT. but it will not auto increment its address with an external input on its display pins.

Anyone got any suggestions?
I suspect it's maybe a type of ram that I am not aware of.


texts: I've seen two cases now with dsPIC 30F4013 where the controller was resetting due to an undefined trap. Why these traps were getting raised in the first place is still a mystery, but that's not my immediate question. I'm starting to think it would be a good programming practice to always define all traps, even if traps should never occur, so I get at least a clear error message instead of a random reset. Is this a standard practice that I'm unaware of? Are there disadvantages to this practice I should consider?


texts: If wire size correlates with Amp, and if Voltage correlates with Amp reversely (?), why do we have electric lines (for transmission) with high voltage, but also wires with big radius? I remember reading somewhere transformers "carry" power, so the power is constant -- but, I get confused when it comes to transmission. Don't conductors still carry power even if it is lost?


texts: Move embedded programming from Keil to Linux

texts:
I'm currently using Keil to develop for an STM32 discovery board. My project is close to finished, and I'd like to move to a Linux based building environment. I've been using the preconfigured flashing tool and the STLink drivers for windows to flash the board, and I got keil to export a bin file, which I managed to flash on my Linux machine using qSTLink2. So far, so good.

Now I'm stuck on moving the process of building the entire project. Specifically:

How do I port my .uvproj to a makefile, while taking things like the 'startup_stm32l1xx_md.s' startup file into account?


texts: Control System - Changing damping on-the-fly?

texts:
I'm trying to implement a PID algorithm on a microcontroller that controls an actuator with a hard physical limit. In MATLAB, there's no consequence to large overshoots/hitting saturation at high velocity - the graph just flattens out. In application however, hitting saturation very fast will eventually break the actuator. I would like to decelerate before this happens so that the actuator doesn't max out at full force. Going critically or overdamped will avoid this problem, but for reference values that are less than saturation, I can accept overshoot (max 10%) for the sake of speed so long as the peaks never cross this hard limit. In other words, if my reference value changes to 50%, an underdamped response is okay, but if my reference value goes to either extreme, it needs to be critically damped so I don't slam into anything mechanically.

Implementing this seems straightforward enough - create gain functions as a function of reference value and linearly interpolate between the sets of precomputed values as necessary. But I have to ask, is dynamically changing damping crazy or something that's actually used in control systems? Is this a naive approach?


texts: Active band pass filter that looks like a sallen–Key topology filter

texts:
I was using the Analog Devices design Wizzard in order to design a band pass filter with theese characteristics:

Gain : 23 dB

Passband: -3dB at 15 KHz

Stopband: -40dB at 40 KHz

The filter has 4 stages (order 8), the first two stages look like a common Multiple feedback Band-pass Filter, the problem is that the last two stages look diferent:

Does anyone knows what is this topology?, for me looks like a sallen–Key topology for low pass filters, but I was not able to find any reference on Internet about multiple feedback band pass filters that use resitors (R4C R3C and R4D R3D) on the positive input of the operational amplifier.


texts: Controlling a mechanical doorbell with an Arduino UNO

texts:
I'm trying to control a mechanical doorbell (a small white box with two chimes) using an Arduino UNO. The UNO uses a relay (a 5V relay module something like this) to switch a 12V power supply attached to the doorbell. The Arduino and the 12V side of the relay are powered from the same 1A/12V power supply: the 12V side of the relay is powered directly, and the Arduino is powered through a step-down converter.

Everything works great in theory (running under simulation) and in practice, as long as power isn't connected to the doorbell.

The problem is that when the doorbell is actually powered, triggering the chime resets the Arduino.

I figure there are three possibilities here:

Feedback from the relay, or
EM pulse from the doorbell coils when the chime triggers, or
Voltage drop when the chime triggers

To rule out the feedback issue, I stuck an optocoupler (an FL 817) between the Arduino and the relay. With this in place, I'm still experiencing the problem.

To rule out a voltage drop, I attached a meter to the 5V output of the step-down converter and triggered the chimes. I saw a 0.01 volt drop (from 5.1 volts to 5.09), so that doesn't seem to be the problem, either.

Does this mean it's an EM issue, or could it be something else?

Update

Here's a diagram of the major part of the circuit. There is a button, some LEDs, and an input signal from another uC that I haven't shown here.


texts:
I am trying to power a Raspberry Pi from a 12v power source in a car. I have tried half a dozen different step-down boards and they all behave the same way, which I don't understand. From a bench power supply set at 12v, the system works perfectly. It produces 5.08v and when I hook it to the Pi it maybe drops .01v, the Pi boots up, everything is great.

When I hook this same hardware to a 12v source in the car, some of the regulators will immediately drop to 1.8-2v in no-load conditions, and all of them definitely drop to that range under load. I've been doing this purely off the car battery at the moment, so isn't any fluctuation in the system voltage.

I'm not sure even what to search for to describe this condition but my understanding of how these step-down circuits work is limited. Clearly this is a thing that is possible because there are 12v USB chargers and those work just fine in this car. The 12v source I am using would normally power the CD changer, and I have metered it at 12v +- 1%.

Any guidance would be appreciated.


texts: Total power from 2 different solar panels

texts:
I was thinking about solar panels for a while and a question popped into my head which i still can't answer nor test it, and i want to know if this would actually work:

If I get a 2x12v solar panels and connect them in series i should get a 24v output, that's stright forward.
What in thinking though is, lets say:

I get a 15w solar panel and a 150w solar panel
So:
15w = 18V 0.8A
150w= 18V 8A

If I connect them in series i will definitely get 32V, but how much Amps would I get?

At first I thought that it would divide and supply around 4.4A, but after a little thinking i thought that won't happen..
it should actually supply 8A if you follow the Ohms law

So if it puts out 34V and the resistance is nearly 1 Ohm or less then it should provide over 30A of current, but the max the panels can provide are 8A and 0.8A, but since they are in a series the Amps won't add up.. so it should stay at 8A since that is the peak?
It's a generator and not a load so the current should not be divided by them?

So the final output should be 38V 8A?which would be 272w?
It doesn't add up but it makes sense that it would push 8A out..

Am I right here?
Searching online did not give me anything back.. and I'm not well knowledged in electricity, I only started learning it as a hobby not long ago.

If you know the answer please explain it and what are the implications here and what would the actual output be if my conclusion os wrong.
would be a valuable knowledge!

Thank you in advance


texts: What's could be the impact of the internal resistance of an inductor on a series LR circuit?


texts: Allegro: How do I view the identifiers of all my components?

texts: I'm using Allegro PCB editor to layout a board for a circuit that I'll be cutting out on a board router. In allegro PCB editor I just imported the netlist and I used quickplace to automatically place the footprints on the screen. My problem is that I can't see the identifiers on all the components, such as U1, U2, Q1, L3, C9, etc. Is this a problem with how I named things back in OrCAD or there some way of showing these identifiers in allegro?


texts:
The AM26LV31E datasheet, a differential line driver, states this (on page 4):

and this (on page 10):

At best, this seems ambiguous and, at worst, contradictory. Is the logic of this statement (8.1) clear to any of you?


texts:
I made a mistake when I designed my PCB and a lot of P-MOSFET are placed with wrong orientation:

As you can see, I inverted the drain/source and in this way Q1 is actually by-passed by the built-in DS diode. The package of BSS-84 is SOT-23.
Because I have dozens of these MOSFET in my PCBs I'm looking for a solution to save the prototypes.
I searched for a P-MOSFET with inverted D-S but I find nothing suitable.
Any idea?


texts: Transformer Coupled Class A Power Amplifier

texts:
I have seen in some books, in the transformer-coupled Class A amplifiers

The transformer is connected between the collector and the VCC.
The transformer is connected between the emitter and GND (emitter follower configuration).

If use the emitter follower configuration, we can get a high input swing and for the collector connected version, we can obtain a voltage gain.

Now, my question is what is the best practice or the correct way?


texts: Correct USB to RS 3.3 / 5.0 logic level cable

texts:
I am starting with electronics / arduinos / atmegas here. For a couple of recent days I've played with USBasp programmer, atmega328P MCU as well as with 7805 and LM317 voltage regulators. Now my next step is to try to talk with DS18B20 temperature sensor and then with RF 434 / 868 module.

I was thinking how can I see the data  read from temperature sensor without having any LCD and the simple answer is using RX/TX pins. The problem is I've stuck on choosing the right cable to do so. I found THIS great stackexchange post about UARTs and RS232 and it narrowed my problem to THAT data cable - which ish FTDI's DS_TTL-232R.

Now, I've also read this datasheet and I do see it's "USB to UART, 3.3V TTL logic level, Raspberry Pi compatible flying leads" but it also states "5V safe TTL inputs make
the TTL - 232R easy to interface to 5V MCU’s".

Do I get it right that this cable will allow me to:
- connect PC via USB to atmega328 RS pins (which have 5V logic level AFAIK)
- connect PC via USB to RaspberryPi's RS pins (which have 3.3V logic level)

Also I do guess basing what I've googled that I will need some other part (logic level / voltage shifter) to connect atmega328 MCU to RasPi directly, right? Or.. is it enough to supply 3.3V to MCU so it has up to 3.05 V ouput high, and not up to 5V, which I again guess would cause damage to my RasPi?


texts: Read MIDI data from Akai MPK mini mkII USB MIDI controller to AVR

texts: I have experience with AVR controllers and now I am developing analog synth like sound module. I would like to be able to connect a USB midi controller to my sound box. I would like to use an AVR microcontroller and I think my option is either to buy a USB to MIDI adapter for the keyboard and build an AVR MIDI interface or use something like an FT232RL chip for USB and code for reading MIDI commands. I would like to hear suggestions from more experienced engineers.


texts: How to calculate current into GPIO pin after voltage division

texts:
I want to use my Raspberry Pi as a remote power management device to turn my  home server on and off. I would also like to monitor whether the server is on or off by using the power LED pins on the server's motherboard which I have measured provides about 5V when the server is on.

Since the Raspberry Pi GPIO pins work with 3.3V I am using a simple resistor voltage divider to bring the 5V down to 3.3V as suggested here: https://elinux.org/RPi_GPIO_Interface_Circuits#Voltage_divider. The article suggests using a 33k and a 18k resistor.
(I have calculated the ratio between the resistors should be 17:33, but the article uses a 33k and a 18k resistor since I think 17k resistors are difficult to come by)

My question is how I can be sure that the resistor values used in the article will not allow more that 0.5mA (as suggested here https://raspberrypi.stackexchange.com/questions/3209/what-are-the-min-max-voltage-current-values-the-gpio-pins-can-handle) to flow into the GPIO pin  of the Pi since the voltage division relies only on the ratio between the resistors and not the actual sizes of the resistors.

simulate this circuit – Schematic created using CircuitLab

I was thinking of applying Kirchhoff's current law at Node 1 in the schematic above which would yield:
$$
i = \frac{3.3V}{18kΩ} - \frac{3.3V}{33kΩ} = 83.33μA
$$
which is well within the current limit of the GPIO pins, but I am unsure whether it is applicable in this case.


texts: Using multiple external interrupts in PIC

texts:
I've used PIC16F877 (datasheet) for several projects. For a single external pin change interrupts, you can use PORTB0 interrupt. But now I need to support 8 independent external pin change interrupts, in a single circuit.

In the datasheet it says there are 15 interrupts in PIC16F877, but i guess those are counted including timer overflow interrupts etc... which are useless in this case.

This is what datasheet say about INTCON register.

Can I have 4 independent interrupts using bit0, RBIF? It represent change in PB7:PB4. How can I identify which pin changed, is it by reading the port value in the interrupt routine?

Even I get positive answers to above, I need 8 interrupts? of course I can still use INTE, for PORTB0 change. Then 4 + 1 = 5, but what about other 3? (However being all the 8 interrupt events are of same type, the 4 + 1 + 3 = 8 thing seems ugly, isn't it?)

There's no other heavy tasks expected from the micro-controller other that monitoring 8 pins. (Talking about the other tasks, it'll have to maintain a set of separate counter variables and frequently transmit about 4 bytes to PC serially)

Any suggestions are welcome. Even if it's about changing the micro-controller for more suited one (but uh.. don't tell me to go away from PICs).


texts: High current bus bars on PCB controlled with mosfet and Raspberry Pi

texts:
I need to be able to switch up to 100 amp @ 48v DC with a Raspberry Pi.
I came across this video which is what I am trying to emulate:
https://www.youtube.com/watch?v=dhIbZa6yg5k
at 1:15 in the video it shows how they have the mosfet connected to 2 busbars to control the current flowing through both sides of it. This is what I need with the added twist of having logic level voltage to be able to control the mosfet.
Here is a quick and dirty schematic I came up with that I would like to know if this is the correct way to go about this:

The 10 V on the logic level switch will come from a voltage regulator connected to the main 48 V battery (same batter that that SCC connects to).
My biggest concern here is how to attach the high current mosfet to the bus bars just like in that video posted above (shown at 1:15).
Any advice on this would be greatly appreciated!


texts: ARM Cortex M4f microcontroller on a breadboard

texts:
I recently bought an ARM based microcontroller from Texas Instruments (MSP432P401R). However I found out too late that it is not a in a Dual In-line Package and so I cannot use it on a breadboard. What do I do in order to use it on a breadboard?

Additionally, can I use USBASP to program this microcontroller?


texts:
I have a 24 VDC 5A motor. I wish to power it with two 12V motorcycle batteries in series for about one hour. Can I hook the batteries up directly or will I fry the motor? Does the CCA of the batteries matter?  What gauge cable should I use between the batteries?

I have not acquired the batteries yet. I'm looking for guidance.  The max distance between batteries and motor 2ft max. I do not know the amps under load for the motor. It has a 5A rating on the motor.


texts: Antenna Design Filtering Out UnWanted Frequencies

texts: I was wondering if someone could explain to someone with no electrical engineering background where would one place the resonator whose sole responsibility is to amplify sine waves at a particular frequency while ignoring other sine waves. Would this resonator be located by the antenna itself or at a location once the signal has passed through the transmission line to the receiver for example ? I hope I have not confused the technology and further hope that I've explained the question clearly. Please correct me wherever and ask any questions for further clarification.


texts: Can I cascade the boost converters, each converter input connected to input solar panel (48 Voc and 9A Isc), and the converter output is 110 V? What should I do to connect them in cascade?


texts: Why do you need 2 resistors when hooking up a transistor as a switch

texts:
What is the point of R2 in the following diagram:

I get that R1 controls the current to the Base, but what does R2 do?


texts: Using capacitors for ethernet isolation?

texts:
The standard for ethernet says you should use a transformer for isolation.

It seems like a cap-based solution would be smaller, more versatile, and a better fit for my application.

Is there any reason why a (capacitor-based) highpass filter couldn't be used instead?

EDIT: This question is different from others because it references a specific alternative, rather than asking the generic purpose of ethernet magnetics.


texts:
I'm trying to figure out how to prevent over-charging a single AA battery off of a 1.5V / 200mA solar cell.

I guess this comes down to asking how to determine whether or not a battery is fully charged.

Also, which type of battery would be better for trying to keep a single battery alive for 3-4 months via trickle charging and a ~5mA pull?  NiCd?


texts: Is my voltage divider calculation OK? Can I use it to power an LED?

texts:
I am planning on wiring 4 pin momentary push switch button that has a LED as well. The switch itself is fine with 20V, but the only problem is that the power source input is 20V and the LED requires 12V.How should I lower the voltage?

I was thinking of a voltage regulator, but I thought it is easier to work with color coded resistors, since I will be working on tight space. Now I salvaged the resistors and found 47Ohm and 33.4Ohm resistors.

When I did the simple math

$$
V_{DIV} = 20V * {47 \over (47+33.4)} = 11.6915V
$$

which is \$ 0.3V \$ lower than \$ 12V \$. Is this okay to be used?

Bear in mind I'm a newbie.


texts:
I'm having trouble with a comparator from TI (LMH7322). I use it in the circuit shown in the attached image "Comparator_1".

Outputs go to an FPGA. The circuit is supposed to take a single ended input signal (VG2), which is between +/- 1V at up to 80MHz, and turn it into an LVDS signal. The TINA simulator gives a constant output in the configuration shown (1.4V on VoutB and 1.0V on Vout). In reality, both Vout and VoutB are at 1.8V, with noise at a frequency matching the input (VG2) frequency. I thought the simulator was wrong and I found that shifting all voltages up by 1.6V (as in "Comparator_2") makes the simulator work (note the "false_ground" net and VS6 voltage).

I therefore think the simulator has a problem.

The outputs QOUT and QBOUT The datasheet for the part (LMH7322 datasheet) states that QOUT and QBOUT should have levels VCCO-1.5V and VCCO-1.1V or VCCO-1.1V and VCCO-1.5V. Note that my setup is as per the datasheet's Figure 11 with VCCI and VEE set to +/-3.4V respectively.

So I have two questions: Do you agree that the issue shown by the simulation is really a problem with the simulation model? Why would the outputs of the comparator be both at 1.8V rather than 1.0V or 1.4V?

Edit:
The outputs go straight to the FPGA pins and the termination resistor (R3) is close to these pins. The FPGA is an Altera Cyclone IV. The FPGA pins are on a bank whose I/O voltage is 2.5V (as required for LVDS on this FPGA) and the pins are set as LVDS inputs.


texts: Step Response of an RC Circuit (Problem)

texts:
I have this example below from "Fundamentals of Electric Circuits", example 7.11.

simulate this circuit – Schematic created using CircuitLab

The question goes like:

  The switch has been closed for a long time and is opened at t=0. Find i and v for all time.

What I want to ask is about the second part, which is t>0.

For t>0, the circuit becomes:

simulate this circuit

From this circuit above we find V(∞) to be 20V. We have V(0) as 10V.
Inserting in the equation, we get :

$$
V(t) = 20-10e^{-0.6t} V
$$

Then the solution says, to obtain i, we notice from the figure above that i is the sum of the currents through the 20 ohms and the capacitor that is,

$$
i = \frac{V}{20} + C\frac{dV}{dt}
$$

Then from this we get i to be:

$$ i(t) = 1+e^{-0.6t} A$$

My question is that,

Is there any other way to find the i?
If I would consider the capacitor to be an open circuit and then
calculate the i by dividing 30V with 30ohms, would I be wrong?


texts: Design Asynchronous State Machine using T flip-flop

texts:
There is this question that i don't really get the solution:

Design a pulse-mode circuit having two input lines x1 and x2, and one output line z. The circuit should produce an output pulse coincide with the last input pulse in the sequence x1-x2-x2. No other input sequence should produce an output pulse.
Use T-FF: T = 1, C acts as input

this is the solution that the book gives:

First, I don't really get the part in step 4 and 5 where do they get the table with Transition and C?

second,I don't really understand step 6 where you implement the equation, Why do we have to use negative edge triggered T flip-flop? why not positive edge triggered T flip-flop?

thank you in advance :)


texts: Suppressing noise and ESD from relay into microcontroller

texts:
I'd like to read from a relay on a CNC machine with a microcontroller running at 3.3V, the wire will be 1-1.5m twisted pair from the micro to the relay and screwed in to a terminal.
There's a lot of noise in these machines as there's 3 phase servo drivers and lots of other stuff going on.
I'd like to ideally just be able to read a rising or falling edge to count the number of times the relay activates.
Having read around the subject:

Pullup resistor is recommended
MOSFET is used with flyback diode

Trying to keep it simple (No mosfets) I think there's reasonable noise suppression in this design. Since most of the time the Normally Closed(NC) switch will leave the input pin HIGH I think this is fairly robust. I'm wondering if you could help with the following questions please:
A) If I need a series inductor to deal with larger current spikes?
B) I won't be installing this unfortunately, and I can't guarantee someone won't short the GND (V+ should be OK since there's a current limiting resistor) to a positive voltage somewhere, or cause some kind of Electro-Static Discharge (ESD). I'm wondering if maybe a Resettable Fuse (PTC) in series with the GND return would be sensible? Or maybe a TVS to V+?
Relay:

Circuit Design:

Thanks in advance!


texts: Spark Gap Circuit Creating Unpredictable Current Spikes, What is Causing This?

texts:
I have recently been messing around with bug zapper / spark ignitor circuits as a way to learn more about high voltage electronics (This is my first foray into high voltage territory other than a few simple Solid State Relay projects, but I have pretty extensive professional experience with low voltage DC design: https://www.hammerheadaudio.com/designs).
I'm working on modifying a bug zapper circuit for continuous discharge, ie, creating continual loud bright sparks on demand: https://www.instagram.com/p/CDnQEWfFiHX/?utm_source=ig_web_copy_link. I have everything working pretty well and things seem stable (no components burning out, can run sparks continuously), except that I'm getting really unpredictable high current spikes while the circuit is running. When this happens it will be running fine and drawing a steady 2A at 9V from my variable supply, when all of a sudden the current draw will shoot up and throw my supply into overcurrent protection mode. This dips the supply voltage which in turn browns out the microcontroller I'm using to generate a PWM waveform to control my transformer, and I have to power-cycle the whole circuit to restore proper operation. This seems to happen randomly: I can have the sparker activated for as little as 1 second or for up to 30 seconds before it happens, but it happens consistently when I leave the sparker on. This breaks nothing and everything still works once I complete the reset. No components are getting especially hot, and certainly nothing beyond what would be expected through normal operation.
Here is the schematic for what I have on my breadboard. I'm using a PIC18F27Q43 (shown here as block diagram without full pin count for simplicity) to generate a PWM waveform at 26kHZ, 50% duty cycle. I'm translating this to 9V using a 2N3904 transistor in order to drive my IRF640 mosfet and create a 9VAC voltage across the transformer primary. Circuit is activated by closing switch from 9V to transformer pin. Transformer is an Aliexpress part found here: https://www.aliexpress.com/item/33032000591.html?spm=a2g0s.12269583.0.0.56165a16YK0g1W Transformer secondary runs into a voltage multiplier circuit harvested from a battery operated flyswatter racket:

Can anyone give some advice on what might be causing this? Anything I should modify to prevent this from happening? The interval this occurs at is very unpredictable and it shuts the whole circuit down, so it's pretty hard to debug (I only have access to variable supply, analog scope, and basic volt meter). I also fully realize that a lot of this circuitry might not be best practice, my intention is to use this a learning project so any input on things I could improve is much appreciated. Thanks!


texts: Using Oscilloscope So That Nothing Blows Up

texts:
I want to see the input current waveform of an LED T8 18W. An EM ballast is purposely placed in series with the lamp. I don't have a power analyzer. What's available is a GDS-2102 oscilloscope. So I connect 1 Ohm resistor in series with the lamp. The waveform of the voltage across the 1 Ohm resistor should match the waveform of the input current.

I put the oscilloscope probe and its ground probe across the resistor's terminals. And it works, a waveform I believe typical of input current of LED lamp is shown in the screen.

Then I open a switch connecting the grid to my experimental circuit with the probe still in their position. Suddenly the 1 Ohm resistor blew up. What is happening?