MT3608 & PWM from Arduino

Hello,
I am having hard times with a MT3608 step up boost converter.
I set the boost converter to output 12V from an input of 3.7 from a Li-ion battery.

This is the basic setup, arduino PWM output l, battery and load are connected to a 2N2222A.

I would like to control the voltage with PWM but even if I set it the Analog write to 0 I am still getting 10 volts coming out.

Do you know how can I control better the output voltage?

I also thought to make a custom pcb with a digital potentiometer but the ones I have seen can't handle more than 2 mA.

Thanks in advance for your replies.

Welcome to the forum

I do not fully understand what you are trying to do, but are you aware that the output from a PWM source will not vary in voltage only in duty cycle ?

Please post a schematic of your project

Yes I know, in fact the PMW should control a transistor. From what I understood if for example I give like 50% duty on an output of 12, I should get 6 volts. But for some reason it is not happening.

As previously requested

Thank you for getting back, should be this one:

The junction of R1 and R2 should be connected to the FB pin (pin 3) of the MT3608.
It is these resistors that set the output voltage.

Your transistor Q1 short circuits the output of the converter to GND.
That seems a rather odd thing to do.

Sorry my mistake.
Should be like this:

Hi, @jonnyret
Welcome to the forum.

Please explain what Q1 is supposed to do?

All it is doing even in your last schematic is shorting the output of the 3608.
Also you have no base current limit resistor in the base circuit of Q1.

Your circuit will not control the 3608.

How do you expect current to flow through the motor?

Can you please tell us your electronics, programming, arduino, hardware experience?

Have you got the 3608 and built the circuit, or have you the PCB module.

Some images of your project would help.

Thanks.. Tom.. :grinning: :+1: :coffee: :australia:

Yes sorry, I checked and I wired all like jim-p.
So this is the correct design:

Regarding my experience is very basic, I am following tutorials online.
The 3608 I am using is a module but it is all wired and working properly.
I just need to control the output voltage that is coming out from the 3608 and going straight to the motor.

It is all hooked this way,

My main problem is that I cannot control digitally the voltage output of the MT3608 module. It is possible I do it digitally with the signal I send to the transistor through the channel 9?

You can't control the output voltage 3608 module but you can control the speed of the motor using PWM on pin 9.
Is that what you want to do?

Yes exactly

What is your motor parameters?

First you need to put a 470 ohm resistor in the base connection of the transistor as shown in schematic below. Also,make sure that all the GNDs are connected to the UNO GND, this is important.

Then you need to write code using the analogWrite() function to output PWM to pin 9

With load I measure it to have a current of 0,4 mA.

and also a 3-5k resistor between the base and GND:
Screenshot from 2024-04-08 15-17-03

Did you mean 0,4A (400mA)?

Yes exactly

OK so make all of the connections I suggested.
How do you plan on adjusting the speed? Maybe with a potentiometer?