Difference between revisions of "Lesson 31--Microduino & Buck Circuit"
(Created page with "Microduino & Buck Circuit {| style="width: 800px;" |- | ==Purpose== The tutorial talks about how Microduino D10 pin outputs PWM waveform and drive P-channel field-effect tran...") |
(→Debugging) |
||
Line 83: | Line 83: | ||
==Debugging== | ==Debugging== | ||
[[File: buck realConnect.jpg|600px|center|thumb]] | [[File: buck realConnect.jpg|600px|center|thumb]] | ||
− | *Make sure the connection is all right. | + | *Make sure the connection is all right. |
− | *Copy the program to Arduino IDE. | + | *Copy the program to Arduino IDE. |
− | *Compile the program and choose the right board as well as the related serial port. | + | *Compile the program and choose the right board as well as the related serial port. |
− | *Click Upload and open the serial monitor of Arduino IDE after the upload and watch the data. | + | *Click Upload and open the serial monitor of Arduino IDE after the upload and watch the data. |
− | *Change the value of OCR1B, reprogram and then open the serial monitor and watch the data. | + | *Change the value of OCR1B, reprogram and then open the serial monitor and watch the data. |
− | *Below is the data measured in real time, just for reference. (The value of OCR1A is 400.) Deviation between the actual output voltage and the theoretical value is a lot, because freewheeling diode exists pressure drop and the inductance and the load are inappropriate. When the duty ratio of Microduino’s D10 pin changes, the change trend of the output voltage is reasonable. | + | *Below is the data measured in real time, just for reference. (The value of OCR1A is 400.) Deviation between the actual output voltage and the theoretical value is a lot, because freewheeling diode exists pressure drop and the inductance and the load are inappropriate. When the duty ratio of Microduino’s D10 pin changes, the change trend of the output voltage is reasonable. |
[[File: buck comOutput.jpg|600px|center|thumb]]Duty ratio | [[File: buck comOutput.jpg|600px|center|thumb]]Duty ratio | ||
− | *Oscilloscope waveform measurement for reference. | + | *Oscilloscope waveform measurement for reference. |
D10 waveform OCR1B=300 OCR1A=400 10uS/div 2V/div | D10 waveform OCR1B=300 OCR1A=400 10uS/div 2V/div | ||
[[File: Modify OCR1B=300 10uS 2V D10 Output.jpg|600px|center|thumb]] | [[File: Modify OCR1B=300 10uS 2V D10 Output.jpg|600px|center|thumb]] |
Revision as of 01:32, 12 February 2016
Microduino & Buck Circuit
ContentsPurposeThe tutorial talks about how Microduino D10 pin outputs PWM waveform and drive P-channel field-effect transistor, showing us the basic principle of Buck circuit. EquipmentMicroduino-Core is the 8-bit single-chip development core board with Atmel ATmega328P as the core, which is an open and Arduino Uno compatible controller. Microduino-USBTTL is the program download module, capable of connecting with Microduino-Core or Microduino-Core+ and making the modules communicate with the computer. It uses MicUSB as the download interface, which is also the smallest part of Microduino. Microduino is just as small as a quarter. Besides, the downlaod cable is just like the USB cable of most smart phones, easy to use.
Filed-effect Transistor
You can check N-channel FET(AO3400) and P-channel(AO3401)’s PDF files below : N-channel FET(AO3400) file download:File:AO3400.pdf P-channel(AO3401) file download:File:AO3401.pdf Buck Circuit
SchematicProgramvoid setup()
{
Serial.begin(9600);
pinMode(10, OUTPUT);
TCCR1A =_BV(COM1A0) | _BV(COM1B1) | _BV(WGM11) | _BV(WGM10);
TCCR1B =_BV(WGM12) |_BV(WGM13) | _BV(CS10);
OCR1A=400;//change this value to get diff period OCR1A=400 F=40K
OCR1B=300;//this value need modify to get diff duty cycle
}
void loop()
{
int myAnaValue=analogRead(A0);
float myAnaVol=myAnaValue/1023.0*5;
Serial.println(myAnaVol);
delay(1000);
} Debugging
D10 waveform OCR1B=300 OCR1A=400 10uS/div 2V/div
ResultThe Buck circuit an change output voltage value when changing duty ratio. The example is only suitable when Microduino’s D10 pin outputs PWM rectangular wave, representing Buck circuit. In the actual application, you need to choose the right component parameters according to different load voltage and current as well as input voltage. Video |