Sequential power supply circuit

k1ng 1337

Joined Sep 11, 2020
1,038
So its not suitable to power MCUs I suppose.

As k1ng 1337 suggested I could use this LM317 module here which comes with potentiometer, heat sink and a capacitor.

View attachment 325007

https://robu.in/product/lm317-dc-li...ep-down-power-module-adjustable/?gad_source=1
Most microcontrollers accept either a 3.3V or 5V power input. In fact, the Pico has a 3.3V on board dc-dc converter so it can accept 2-5.5V which is handy.

The LM317 is super easy to calculate, you don't need a fancy module. This schematic looks the same minus the heat sink so you might save a couple bucks if you have the other components. It's also a great IC for current regulation so I recommend learning how to calculate the outputs.

d744d3d19a88afb5905760412c2f7f33850dac5a.png
Edit: I just looked at the price of your module, if you can get it for $1 CAD, that's a decent price but it might be a fake IC. Real LM317 cost more than a dollar each from my local retailer and I always buy OEM power products.
 
Last edited:

Thread Starter

sab201

Joined Nov 18, 2023
297
I just looked at the price of your module, if you can get it for $1 CAD, that's a decent price but it might be a fake IC. Real LM317 cost more than a dollar each from my local retailer and I always buy OEM power products.
Actually its price is less than 1 USD, I suppose it couldn't be OEM. I also do not want to risk burning out the boards.

I understand that the Pi Pico has onboard dc to dc converter. I would like to know the maximum value of the PWM voltage signals produced by Pi Pico. Since Arduino can take 5 Volts could it produce higher value PWM voltages.

Thanks.
 

k1ng 1337

Joined Sep 11, 2020
1,038
Actually its price is less than 1 USD, I suppose it couldn't be OEM. I also do not want to risk burning out the boards.

I understand that the Pi Pico has onboard dc to dc converter. I would like to know the maximum value of the PWM voltage signals produced by Pi Pico. Since Arduino can take 5 Volts could it produce higher value PWM voltages.

Thanks.
I'm willing to pay a premium for piece of mind but that's my philosophy. There a lot of good components and modules that are essentially in the public domain which are copied by every Chinese manufacturer. If you are going to shop for boards like the one you posted, pay close attention to the markings on the circuit board and ICs. If they are misaligned or hard to read, there is a good chance they are fake, old or inferior quality.

As for the Pico PWM, it is 3.3V but it has more resolution than Arduino. Does this really matter? If so, I can show you how to use a level shifter to convert the PWM voltage to any voltage you like.
 

Thread Starter

sab201

Joined Nov 18, 2023
297
As for the Pico PWM, it is 3.3V but it has more resolution than Arduino. Does this really matter? If so, I can show you how to use a level shifter to convert the PWM voltage to any voltage you like.
Good to know that Pi Pico has more resolution. I am new to designing electronic circuits so I have these doubts. Irving gave a circuit in post #42 to produce pulsed voltage using ATTiny and a DMC4050 Mosfet from a 12 Volt supply.

I will first try to get the MCU stuff done and post a new thread on it.

Thanks.
 

Thread Starter

sab201

Joined Nov 18, 2023
297
I have decided to set up a Pi Pico and learn programming it with Micropython. Being a starter and a newbie I have decided to start with this since Arduino with C and C++ would get more complex than Micropython and once I get started and get used to it I would also learn Arduino and its programming along the run.
 

Irving

Joined Jan 30, 2016
5,136
I have decided to set up a Pi Pico and learn programming it with Micropython. Being a starter and a newbie I have decided to start with this since Arduino with C and C++ would get more complex than Micropython and once I get started and get used to it I would also learn Arduino and its programming along the run.
Fair enough. I shall follow this with interest, since I have not used MicroPython and only use canned Python stuff like esptool.py etc. I dabbled with Python 1.0 at the "Hello world" level but never went further since I've been writing C/C++/C#/Java for so many years its second nature and much of what I do involves embedded MCU that are too small to support the 60 - 100k interpreter, so I never really had a need.
 

Irving

Joined Jan 30, 2016
5,136
Good to know that Pi Pico has more resolution. I am new to designing electronic circuits so I have these doubts.
Most small devices have 8-bit PWM. Only bigger 32bit devices usually have 12 or 16bit PWM. Does it matter? Well, as always depends on need and circumstance. PWM is mainly used for motor speed, servo positioning, and crude variable voltage generation. So, for a treadmill used for 100m sprint training, top speed is, say, 16m/s, then 8-bit resolution is 16/256 = 0.0625m/s, which is probably sufficient. But for generator testing say, top speed is probably 3000rpm = 50rev/s and you want to control to +/-0.05% (UK line spec is 50Hz +/-1%) that needs 2020 steps, or better than 11bits, so 12bit a minimum, 16bit preferred. An RC servo has a swing of 180deg and typically 0.9deg resolution which is 200 steps or 8-bit, a CNC servo will want 0.01mm resolution in say, 0.5m = 50,000 so 16bit resolution is a minimum (though rare to use PWM in this context).
 

Thread Starter

sab201

Joined Nov 18, 2023
297
Fair enough. I shall follow this with interest, since I have not used MicroPython and only use canned Python stuff like esptool.py etc. I dabbled with Python 1.0 at the "Hello world" level but never went further since I've been writing C/C++/C#/Java for so many years its second nature and much of what I do involves embedded MCU that are too small to support the 60 - 100k interpreter, so I never really had a need.
It was a very tough choice for me to choose between them Arduino and Pi Pico. Pi Pico would offer simplicity for a beginner that is the main reason I decided to start with it. But I also decided to learn how to program an Arduino along the run as I get used to it. Besides Pi Pico is inexpensive compared with Arduino and due to any inexperience if that board gets damaged it would reduce losses. Once I level up I would go into Arduino. Thanks for all your support!

I suppose the circuit in post #42 using DMC 4050 could be used with Pi Pico MCU.
 

k1ng 1337

Joined Sep 11, 2020
1,038
Another neat thing about Pico / Esp is they can run Arduino or Python code. It's a good way to see how different kinds of software interface with the same hardware. This isn't really possible on the aging Arduino chips which is why I tend to recommend Pico for getting started. And the only reason I don't recommend Esp to beginners is because there are many models whereas there is just one Pico (two if you count the wireless version). Some folks tend to get bogged down in these details instead of getting their project going which is where Pico excels imo.
 

Irving

Joined Jan 30, 2016
5,136
So its not suitable to power MCUs I suppose.
On the contrary, its perfect for the Pico or the Nano or any other MCU, on an MB102 breadboard. Its the wrong form factor for a standalone installation (though there is no reason you can't use a breadboard in your final build, albeit many don't recommend it for long term use).
 

Thread Starter

sab201

Joined Nov 18, 2023
297
You're in India I believe? Using the supplier posted above, like for like (Nano is 3.3v UNO R3 equivalent, in similar form factor to Pico)
Yes you are right there are a lot of suppliers here. Thanks, I checked the price of Pi Pico but didnt check the Nano. I read in the comparison that an original Arduino board costs much more than Pi. But here they both couldn't be original and the reason the Pi Pico is more expensive is because it has faster cores, higher speed and storage so the hardware costs much higher.

So when both are available at a reasonable price I could try both for learning purposes.
 

Irving

Joined Jan 30, 2016
5,136
And the only reason I don't recommend Esp to beginners is because there are many models
I always used to recommend the 30 or 38 pin version, now I recommend the 44pin S3-WROOM-N16R8, its not significantly more expensive than the base models and caters for all needs.

But here they both couldn't be original and the reason the Pi Pico is more expensive is because it has faster cores, higher speed and storage so the hardware costs much higher.
As both 'Arduino' family and 'Pico' are open-source the definition of 'Original' has little meaning, many fab houses were prepped pre-release by the originators to meet perceived market demand, so PCB & assembly costs would have been near identical. Chip cost is a driving factor, obviously yeild in early manufacture and setup costs play a part, but that's long gone, lost in the volumes, so its only marketing that truely defines the cost now, trying to get the right balance between marketing uplift costs and falling sales. The Pico chip is currerntly USD0.70 one off, under USD0.50 for a full reel of 3400, so in the 100,000+ volume maybe 35cents? The Atmel processor on the Nano is, oddly, USD1.13 one off, USD0.90 for 6000...
 
Last edited:

Irving

Joined Jan 30, 2016
5,136
Somebody asked me why i dont recommend the Nano-ESP32 or whatever its called. On the face of it, an ESP32 in a Nano form factor is a good idea, but oh dear, the price premium for that is just crazy. I've not found it anywhere for less than around GBP8.75 inc shipping (AliExpress) and locally its over GPB15!
 

k1ng 1337

Joined Sep 11, 2020
1,038
Somebody asked me why i dont recommend the Nano-ESP32 or whatever its called. On the face of it, an ESP32 in a Nano form factor is a good idea, but oh dear, the price premium for that is just crazy. I've not found it anywhere for less than around GBP8.75 inc shipping (AliExpress) and locally its over GPB15!
Have you done any designs with esp32 processor modules? I've been thinking about buying a bunch of modules instead of complete development boards. I'm planning a paralleled processor project so the development board is a waste of space plus I may need direct access to all the pins to avoid conflicts.
 

Irving

Joined Jan 30, 2016
5,136
Have you done any designs with esp32 processor modules? I've been thinking about buying a bunch of modules instead of complete development boards. I'm planning a paralleled processor project so the development board is a waste of space plus I may need direct access to all the pins to avoid conflicts.
Yes, I use the modules extensively for dedicated solutions, though I have been developing my own 'dev board' with common peripherals (ADC, DAC, io-extender), input filtering/protection and pluggable screw terminals as a generic 'plc'-like' board.
 

k1ng 1337

Joined Sep 11, 2020
1,038
Yes, I use the modules extensively for dedicated solutions, though I have been developing my own 'dev board' with common peripherals (ADC, DAC, io-extender), input filtering/protection and pluggable screw terminals as a generic 'plc'-like' board.
Can you recommend a budget chip? The project is mostly proof of concept so I'm looking to get the most bang for my buck while focusing on a single model. The idea is to write a crypto hashing algorithm that is shared between the devices. You may have heard of "lotto miners" so I'll be building on the Esp32 github repos that are available. I might even go hardcore and write from scratch which is an extensive but worthwhile learning project.

Also, do you put your projects on the internet? I'd definitely take a look!
 

Thread Starter

sab201

Joined Nov 18, 2023
297
I like to post an update here. I was initially using this circuit to pass pulsed current through the electromagnet.sketch-1719231689679.jpg
In this method, the pulsing is done by connecting the 555 timer output to the Voltage pot of the buck converter.(Credit goes to Crutschow)

Though it produced the desired results in the magnetic field that could only impact the frequency and only a small amount of the magnitude of current and voltage. So for this reason I used a 12 Volts power supply to the 555 timers so they produce higher magnitude output pulses and higher currents.

I was also working on passing pulsing current directly through the electromagnet and now I succeeded. I got this MOSFET Switch Module.
sketch-1719232948469.jpg
https://zbotic.in/product/5-36v-swi...L7-DXSK7NUbNSbSbloIzSPcGeC61mCt4aAtzmEALw_wcB

Then when I used it with the old low power buck converter it ruined the buck converter. So I got a 300 Watt rated buck converter and used its output which is switched by this MOSFET module. As adviced by MisterBill2 in another thread I added a capacitor bank at the input of the load to reduce oscillations. Here is the new circuit.
20240624_195356_0000.jpg
Now I have replaced the 12 Volts supply to the 555 timer with a 5 Volt supply to send PWM signals to the MOSFETs. Its been two days and it works without any problem. So now things get simple I suppose. If I use an MCU I can use its output directly on the MOSFET module.

Incase of dicrete components I could use a CD4060 binary counter configured as a 1 hour timer as adviced by Crutschow in post #2, and clock a 4017 decade counter which controls two CD4066 switches to switch between the outputs of the 555 timers. The 555 timers would be ON all the time. I have checked at 5 Volts the Load current of 555 timer is 0.78 mA, so 4066 could be used. Also their power supply can be switched ON sequentially using ICs since 5 Volt and a load of 0.78 mA is lesser when compared to 12 Volts.

Thanks everyone for all your support I am learning a lot about circuits and electronics here.

Also I have another project. In this setup, the frequency is achieved but the magnitude goes to zero during the OFF time period. However there would be freewheeling current always present in the inductive load I like to discuss another circuit I will post a new thread on that.
 
Last edited:
Top