Hello!
Could anyone please help me find where is the problem ?
I did some photos and one video of the circuit to help and make it easier to find it out.
The objetive is simple: control via PWM (Arduino->L298n) a 12V motor fan.
It seems i'm having problem with ground. But i have tried all possible combinations and none went fine.
I do already checked the 12v font supply and it's fine, also the 5v (from arduino to the l298n driver) is fine too.
My arduino model is Freeduino - Freeduino is a collaborative open-source project to replicate and publish Arduino-compatible hardware files. - http://www.freeduino.org/freeduino_open_designs.html
Motor Driver 2A Dual L298 H-Bridge: Motor Driver 2A Dual L298 H-Bridge [L298N] - US $4.00 : HAOYU Electronics : Make Engineers Job Easier
My code:
#define ENA 5 //enable A on pin 5 (needs to be a pwm pin)
#define IN1 2 //IN1 on pin 2 conrtols one side of bridge A
#define IN2 4 //IN2 on pin 4 controls other side of A
void setup()
{
//set all of the outputs
pinMode(ENA, OUTPUT);
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
}
void loop()
{
int duty=255;
//setting IN1 high connects motor lead 1 to +voltage
digitalWrite(IN1, HIGH);
//setting IN2 low connects motor lead 2 to ground
digitalWrite(IN2, LOW);
//use pwm to control motor speed through enable pin
analogWrite(ENA, duty);
}
The problem is no matter what i do i never get an output of more than 5V. I tried to make an variation of this main scheme and i got 2V but when i touch with my hands in the metal parts of ARDUINO it goes up to 3.5 or 4 Volts..
All photos and video can be found here: Dropbox - Error - Simplify your life
The circuit that is stable and have low output is that one:
the variation that have voltage variations when i touch it witg my hands is that one:
I have recorded a video of tha circuit too, as you can find here:
Does anyone have any idea?
Thank you!





