How to Make Arduino Constant Load

by Maker Lab in Circuits > Electronics

1561 Views, 19 Favorites, 0 Comments

How to Make Arduino Constant Load

temp_-307064388.jpg
How to make arduino constant current load

Prepare Your Laptop and Arduino

20150908_214131.jpg
temp_-2076076305.jpg
Go to arduino.cc and install Arduino IDE i recomend you to download version 1.6.5. .

Put It Together

20150908_214152[1].jpg
20150908_214248.jpg
20150908_214200.jpg
temp_-1391656053.jpg
Source of mosfet goes to ground.Drain to 10W 15 ohm resistor other side of the resistor goes to + of supply what you need to load.Most left side of potentiometer goes to ground. Midlle terminal goes to A0 of Arduino.Most right terminal of potentiometer goes to 5V.Gate of Mosfet goes to pin digital pin3.

Program Your Arduino

20150908_214131.jpg
here is code its modified version of example code diming

/*

Analog input, analog output, serial output

Reads an analog input pin, maps the result to a range from 0 to 255

and uses the result to set the pulsewidth modulation (PWM) of an output pin.

Also prints the results to the serial monitor.

The circuit:

* potentiometer connected to analog pin 0.

Center pin of the potentiometer goes to the analog pin.

side pins of the potentiometer go to +5V and ground

* Gate of mosfet connected from digital pin 3

const int analogInPin = A0; // Analog input pin that the potentiometer is attached to

const int analogOutPin = 3; // Analog output pin that the LED is attached to

int sensorValue = 0; // value read from the pot

*/int outputValue = 0;

void setup() {

// initialize serial communications at 9600 bps:

Serial.begin(9600);

}

void loop() {

// read the analog in value:

sensorValue = analogRead(analogInPin);

// map it to the range of the analog out:

outputValue = map(sensorValue, 0, 1023, 0, 255);

// change the analog out value:

analogWrite(analogOutPin, outputValue);

// print the results to the serial monitor:

Serial.print("potenciometer = " );

Serial.print(sensorValue);

Serial.print("\t MOSFET = ");

Serial.println(outputValue);

// wait 2 milliseconds before the next loop

// for the analog-to-digital converter to settle

// after the last reading:

}

Test It

arduino constant load
I had 12volt battery pack for test

ATTiny Version

In my home country is attiny very expensive 3.50eur each. Coming Soon