Digital Pot + 555 timer for pwm over mosfet.

Hey there, Hoping this is posted in correct section.

I'm starting a project which I'm having trouble executing/understanding.
I've build similar before using a 555 timer and standard potentiometer which worked flawlessly. I would like to do the same sort of thing but using a digital potentiometer (smd ic) and arduino for possibility of a oled display added in future.

The way I would like this to work is the circuit is driven by 2x18650 4.2v 25a batteries in series, the digital pot connects to the 555 timer which then connects to a mosfet and switch which is linked to the output device (a coil) with a voltage allowence of 4.2 min - 8.4v max. I would like to then control the digital pot via 2 push button switches (up and down). this will change the voltage pushed across the coil, including showing voltage on a multimeter/(oled display in future). the system also needs to be protected with a reset-able fuse.

Is this possible with a arduino? I would like to use an arduino chip without the whole board (I understand this can be done) I would also like it reprogrammable (is this possible without the board?) is it possible to control a 555 timer pwm with a digital potentiometer?

apologise in advance for my poor structure. I tent to write as I think. I will clean up if hard to understand.
note, I'm not asking for anyone to do the work for me, as I wont learn, I just want a point in the right direction?

Why the 555 and/or digital pot.
An Arduino can do the same as a 555, and much more.
You only need a pot and/or buttons to generate/control PWM and/or drive a mosfet.
Tell us more about your project.
Leo…

The Arduino Uno chip (mega328) has 6 PWM outputs.

Building a stand alone 328 board.

You can reprogram a stand alone board with Serial if a bootloader is installed or with ISP progtamming with another Arduino or a ICP programmer.

Wawa:
Why the 555 and/or digital pot.
An Arduino can do the same as a 555, and much more.
You only need a pot and/or buttons to generate/control PWM and/or drive a mosfet.
Tell us more about your project.
Leo..

See this is where my knowledge of the arduino fails me. I didn't realise this. here is a sample circuit of the current system.

The project is a custom vape box chip (many on market but want to build my own). The coil acts as resistance across the batteries and heats up juice to turn it into vapour. In case it needs stating I'm over the legal age to vape in my country.

So am I correct in saying, I can eliminate the pot and the 555 and run the mosfet off the arduino's pwm and software control it? with buttons direct to arduino as control? would this all be able to handle the 4.2/8.4 25/30a power input?? I worry that the circuits will over heat or the lipos vent

angelus0w:
See this is where my knowledge of the arduino fails me.

Then buy an Uno and start with the basic examples of the IDE (programming software).
You soon will find out that you only need a pot to generate a varying PWM signal.
Leo..

Wawa:
Then buy an Uno and start with the basic examples of the IDE (programming software).
You soon will find out that you only need a pot to generate a varying PWM signal.
Leo..

Thank you, I have purchased an arduino uno rev3 kit from amazon. I shall dig it out and start where you have suggested.

Test sketch with comments.
Leo..

// 10klin (10kB) pot connected to 5volt/A0/ground
// LED/resistor (or logic level mosfet) connected to pin 9

const byte potPin = A0; // wiper connected to A0
const byte pwmPin = 9; // pin 9 is a PWM pin
int potValue; // holds A/D value

void setup() {
  Serial.begin(9600); // for debugging
  pinMode(pwmPin, OUTPUT); // set the PWM pin to output
}

void loop() {
  potValue = analogRead(A0); // read pot
  Serial.print("A/D value is: ");
  Serial.println(potValue); // for debugging
  analogWrite(pwmPin, potValue >> 2); // write to pin 9 after converting 10-bit (0-1023) to 8-bit (0-255)
  delay (500); // update twice a second, so humans can follow it
}

Wawa:
analogWrite(pwmPin, potValue >> 2); // write to pin 9 after converting 10-bit (0-1023) to 8-bit (0-255)

Thank you very much for help!

I have built the circuit and ran the code, works perfect, although I don't understand this part.. the debug shows the pot ad going upto 1023 (assuming before the conversation) but why is there a conversation to 8bit?

Sorry if a daft question

The analogWrite() function will only take values from 0 to 255 (8 bits).

If that's a P-channel MOSFET in your diagram it really should go above the load (J1 in this case); its source should be at 12V, its drain on the J1 pin.

If you want to use the P-ch FET you'll need to be careful about driving it with the Arduino output. To turn that FET off you need to pull the gate up to the source. In this case, that'd be 12V. The Arduino pin won't have any of that so you'll need a "translator" -- a simple BJT (collector connected to the gate & pullup resistor, emitter to GND and base to the Arduino through a ~2.2K resistor.)

This will also correct the "sense" of your PWM; a 100% duty signal will turn the FET on 100% whereas a 0% duty will turn the FET off.

Blackfin:
If that's a P-channel MOSFET in your diagram it really should go above the load (J1 in this case); its source should be at 12V, its drain on the J1 pin.

If you want to use the P-ch FET you'll need to be careful about driving it with the Arduino output. To turn that FET off you need to pull the gate up to the source. In this case, that'd be 12V. The Arduino pin won't have any of that so you'll need a "translator" -- a simple BJT (collector connected to the gate & pullup resistor, emitter to GND and base to the Arduino through a ~2.2K resistor.)

This will also correct the "sense" of your PWM; a 100% duty signal will turn the FET on 100% whereas a 0% duty will turn the FET off.

Hello there, yes it is a P-channel MOSFET/ Thank you for this advice, is this how you mean?

Or like this?

Or other?

It's connected to pwm on Arduino chip.
thank you.

Third diagram on this page is the correct way of high-side switching with a p-channel fet.
Leo..

Yep, the last image in post #10.

You might also want to check your PFET's Vgs rating. Make sure it's at least +/-20V.

Excellent, thank you, now would an n-channel pulled down eliminate the need for a bjt?

A logic-level N-channel on the low-side would eliminate the intermediary transistor, yes.