PWM IDEA


okay im not electrical engineer im mechanical degree. im not programming expert. kind , patient. have idea control motor want vary specific analog input. using thermal couple 2 pin control duty cycle of pwm. think math right. if need compensate temperature 2 high can edit equation give desired voltage on mosfet via duty cycle. here current problem before math. via serial , ive never done , yesterday began read on arduino coding. bare me.
can read out of analog thermal input can them modify math. need sweet spot on duty cycle. whats occurring not exponential flat curve. im controlling fan , duty cycle either on or doesnt keep temperature.

1.serial readout of analog input
2.math

to elaborate understand maybe if statement help. analogread below 256 makes analogwrite = 0 0 duty cycle. 257-1023/3=min duty cycle of 25.2 133% (i know cant go on 33 % havent figured out exponential way have respond smaller area of analog input looking 255-400 out of whole 1023)id fan conserve power below critical point step in varying temp.

sorry long write trying hit birds 1 stone


int ledpin = 9;      // pwm mosfet gate resistor ground connected digital pin 9

int analogpin = 3;   // thermal couple connected analog pin 3

int val = 0;         // variable store read value



void setup()

{

  pinmode(ledpin, output);   // sets pin output

}



void loop()

{

  val = analogread(analogpin);   // read input pin

  analogwrite(ledpin, val / 3);

a thermocouple cannot connected directly arduino , generate useful data - voltage generated thermocouple miniscule , requires special chip read - these readily available , common on ebay , usual hobby vendors. thermistor 2-pin device used read temperature; requires appropriately sized external resistor (the details depend on specific thermistor) - set voltage divider thermistor 1 of resistors. need bit of math convert value temperature. there wide variety of temperature sensing ic's output data either digitally or linear analog voltage, may make processing easier.

your specific needs dictate type of sensor appropriate - considerations of accuracy , precision, things how mount sensor (for example, if it's inside oven @ couple hundred degrees, need thermocouple rated temperatures, if it's underwater, need waterproof sensor, etc)

generally speaking, idea looks feasible.


Arduino Forum > Using Arduino > Programming Questions > PWM IDEA


arduino

Comments

Popular posts from this blog

Error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode - Raspberry Pi Forums

class MPU6050 has no member named begin

missing filename after '-o'