Hey y'all
I'd like to make a tank circuit with a coil and capacitor in parallel. To power it i need a really frequent square wave. 1 mhz would be nice but maybe about a 500-600 mhz minimum. I was thinking of using a arduino directly interfacing the ports to produce the wave, using it to control a mosfet to power the circuit.
Yet the signal pretty much stays the same no matter how much i increase the voltage. I cant't check exactly want the value was right now , but i thing it hade about 1-2v voltage drop across the mosfet which seems like a lot, and like i said i cant get the voltage top much higher than 4.5-4.9v. It had peaks of about 5.2 i think.
Is this the wrong approach? How could you accomplish this for cheap?
Thanks in advance
//Benji
https://imgur.com/a/JjfIlp2
The Arduino pin voltage is not high enough to turn on the MOSFET if you have the load on the low side as you have it.
You want your tank circuit on the high side. Even so, you will need a logic-level MOSFET in order to fully turn it on.
Isn't FQP30N06L logic level? Also, with the voltages i measured i had no load connected, like in schematic, i had only the oscilloscope connected.
BTW, why do you use i resistor in series to the gate of the mosfet, isn't mosfets voltage driven unlike bjt's?
- I had not looked up your MOSFET. A quick look appears like it is.
- In your circuit R1 is the load. Which when the MOSFET is turned on the voltage across R1 rises and will turn off the MOSFET unless you raise the gate voltage to compensate. (The load is on the low side.)
- The series limits the gate current. A MOSFET gate has a capacitance which you charge when you apply a voltage. Also, you can have oscillations without the resistor.
Wow i didn't think of that! That makes sense, as i increase the voltage the more back flow i get. I'll have to try that tomorrow and post the result. Thanks for a great response!
Start with a series resistor of 100 Ω.
I expect 50 to 100 ohm will work best.
I think with a 16 MHz Arduino, your highest possible toggle speed is 2.67 MHz.
cli();
while (1) {
PORTD |= 0x8;
PORTD &= ~0x8;
}
Looks like that's 6 instructions.
A quick Google search yielded:
Entry #18 in this topic
https://forum.arduino.cc/index.php?topic=4324.0If you know the state of the other pins on the port, then you could do something like:
while (1) {
PORTD = 0b00001000;
PORTD = 0b00000000;
}
for a 4Mhz 25% duty cycle signal (1 tick ON, 3 ticks OFF) or
while (1) {
PORTD = 0b00001000;
asm("nop");
asm("nop");
PORTD = 0b00000000;
}
for a 2.6666Mhz 50% duty cycle (3 ticks ON, 3 ticks OFF)
Hey y'all
I'd like to make a tank circuit with a coil and capacitor in parallel. To power it i need a really frequent square wave. 1 mhz would be nice but maybe about a 500-600 mhz minimum.
What are the values of your capacitor and inductor?
And what exactly do you want to accomplish?
To get a tank circuit to ring you don't need to continually excite it. Once excited it will ring on its own at its resonant frequency. Also, you don't have to directly couple it to your signal source. You can excite the tank by just wrapping a wire carrying your square wave around the inductor a few times. Have a look at this page in the section "Measuring LC tank circuits":
http://www.giangrandi.ch/electronics/ringdownq/ringdownq.shtmlJust a fast rising edge is enough to transfer energy into the tank, so your signal source doesn't have to pulse at a fast frequency.
I think with a 16 MHz Arduino, your highest possible toggle speed is 2.67 MHz.
cli();
while (1) {
PORTD |= 0x8;
PORTD &= ~0x8;
}
Looks like that's 6 instructions.
4 instructions minimum. 2 ops to toggle pin on and off, 2 ops for goto. hence 16MHz / 4 ops = 4MHz maximum, but only in asm...
You could always unroll the loop and on a 16 Mhz atmega328 achieve 8 Mhz for about 2 milliseconds at a time with only a 100ns glitch between runs.
On a atmega2560 the 8 Mhz pulse train would last for around 16 ms.
Millihertz or megahertz? It matters, rather a lot.
You can still connect an Arduino to something that can make 600MHz, but it's going to be a frequency synthesizer chip, something fit for purpose -- nothing the Arduino has direct participation in, only setting registers. It's also not going to drive as much power as one of those transistors can, and you need special RF transistors to amplify it if you need to.
Tim
Maybe I missed something, but why is the OP trying to toggle a port pin as fast as possible through bit bashing rather than using a PWM output?
Millihertz or megahertz? It matters, rather a lot.
You can still connect an Arduino to something that can make 600MHz
He talking about 500-600 milliHertz (0.5 - 0.6 Hz)
I believe you have all missed the boat here.
If you read the words around his frequency numbers
"To power it i need a really frequent square wave. 1 mhz would be nice but maybe about a 500-600 mhz minimum.",
I believe he miss typed and would like to drive his circuit with a 1 MHz square wave and would settle for a 500-600 KHz frequency.
Really frequent does not indicate milliHertz.
And 500-600 mhz is not less than 1 mhz.
frequent is a subjective term, almost useless in engineering term. one can say he bought a DSO every day (11uHz), but damn thats "frequent"
frequent is a subjective term, almost useless in engineering term. one can say he bought a DSO every day (11uHz), but damn thats "frequent"
A little "common sense" goes a long way!
Assuming we are talking about a square wave in the 0.5 to 1.0 MHz region, let's look at the LC tank circuit. I suppose the purpose is to get a clean, low-spurious output (jitter, harmonics, etc), signal. This will look somewhat like a sinewave at the filter output. Will this be used directly, or will it be sent to a logic stage for squaring-up? This affects the design of the tank circuit. In fact, if the tank load impedance is relatively low, for maximum efficiency and minimal power dissipation in the MOSFET driver, a simple LC tank may not be the best approach. When using a square wave drive you usually want an inductive input impedance to allow the MOSFET to spend as little time as possible in the linear region. Look at "Class E" amplifier networks, or perhaps a simple "Tee" filter. These details will depend on the spectral purity and the power levels desired.
As for the Arduino loop, how many cycles do the bit-test and manipulation operations require? Something like this should give you a 50% duty-cycle:
while(1){
digitalWrite(OUTPIN, !digitalRead(OUTPIN);
}
Sorry for the radio silence!
To answer you questions:
1. I indeed ment 1MHz and kHz500-kHz600 minimum (was writing late)
2. I don't really need help with the coding bit, but thanks for the suggestions! (Although i believe you can achieve a 16MHz squarewave locked at 50% with a normal atmega328)
Unfortunately i didn't really have much time to try it out today (so the way i actually wired it might be wrong) but i'll include a picture of the dso (with a low frequency of about 490Hz) and a schematic. I think i have somewhat of an idea whats wrong, but i'd rather not say because it could extremely stupid haha. I'll try to answer some of the other questions you had individually.
PS. super impressed by the amount and quality of replies!
Accidentally used a 150ohm resistor, will a have to try a smaller value next time!
Start with a series resistor of 100 Ω.
I expect 50 to 100 ohm will work best.
What are the values of your capacitor and inductor?
And what exactly do you want to accomplish?
Sorry! Can't check what the value of the cap was right now, and I don't know the inductance of the coil, that was the start of the project, to observe the resonant frequency, to calculate the inductance. And that other stuff you said was pretty interesting, I'll have to try that out if i can't get this to work.
Assuming we are talking about a square wave in the 0.5 to 1.0 MHz region, let's look at the LC tank circuit. I suppose the purpose is to get a clean, low-spurious output (jitter, harmonics, etc), signal. This will look somewhat like a sinewave at the filter output. Will this be used directly, or will it be sent to a logic stage for squaring-up? This affects the design of the tank circuit. In fact, if the tank load impedance is relatively low, for maximum efficiency and minimal power dissipation in the MOSFET driver, a simple LC tank may not be the best approach. When using a square wave drive you usually want an inductive input impedance to allow the MOSFET to spend as little time as possible in the linear region. Look at "Class E" amplifier networks, or perhaps a simple "Tee" filter. These details will depend on the spectral purity and the power levels desired.
As for the Arduino loop, how many cycles do the bit-test and manipulation operations require? Something like this should give you a 50% duty-cycle:
while(1){
digitalWrite(OUTPIN, !digitalRead(OUTPIN);
}
Wow I'll have to read through your reply a couple of times to understand it. But really, i'm not looking for efficiency and exactness, i just want to get in the ballpark of the right resonant frequency, to calculate the inductance of the coil.
Wow I'll have to read through your reply a couple of times to understand it. But really, i'm not looking for efficiency and exactness, i just want to get in the ballpark of the right resonant frequency, to calculate the inductance of the coil.
In that case most of what I said is pretty useless. But you may still want to only lightly couple the FET to the tank circuit, otherwise the drain capacitance will effect the resonant frequency.