Sequential power supply circuit

Thread Starter

sab201

Joined Nov 18, 2023
297
OK, I am guessing that the sequential control portion of the question has been either answered or set aside. Certainly a small PLC would allow it to run 24/7 without any problems, and program changes could be made and loaded easily. And timer settings could be changed while running.
Yes you are right I looked into the PLC option, but I could be changing the control circuits depending upon how findings are made on that case and I will need to change the programs and I have more knowledge on MCUs than PLCs I suppose I would go on with the microcontroller option over the discrete component option after setting up everything and learning programming.
 

MisterBill2

Joined Jan 23, 2018
27,587
From Automation Direct, at least with the less expensive PLC packages, you get free programming software. And the beauty is you can program in ladder logic, which is so very intuitive for those who understand how relays work. AND it has timers and counters and that allows an incredible amount of stuff to be done.
 

Irving

Joined Jan 30, 2016
5,138
From Automation Direct, at least with the less expensive PLC packages, you get free programming software. And the beauty is you can program in ladder logic, which is so very intuitive for those who understand how relays work. AND it has timers and counters and that allows an incredible amount of stuff to be done.
All of which is true to some extent, though I find 'ladder logic' less intuitive than the simple Setup/Loop of Arduino or the main.c/main.py task orientation of bare metal C/Python. And the cost still massively higher than an MCU and minimal support circuitry.

In this screenshot I ran the script then stopped it after 9 seconds. The script is named app.py and the command via Thonny to run it is %Run app.py which executes almost instantly. I'm not showing a microcontroller in this example but the same idea works with the Pico code. It can be uploaded directly to the device or run on the fly via Thonny. If it's run on the fly, the script isn't permanently saved to the device. I really like this feature because you can start and stop the program (and edit) with little to no wait time. It basically runs the program from memory as opposed to mass storage.

View attachment 324764

Not sure of your point here. On the Arduino IDE you compile the code, CTRL+R then upload CTRL+Shift+U. This takes under 5sec. The program runs from flash memory on the chip itself.

Admittedly you don't get inline debug with Arduino IDE (yet) but the chip supports it as does the much more powerful PlatformIO IDE though that has a marginally higher learning curve.

But on a program this simple, inline debug isn't really necessary.

Attiny84 series not big enough to run MicroPython, but Pico is arguably overkill for this requirement, as current code (including OLED display library) takes just 70% of 8kbytes FLASH and 34% of 512 bytes RAM.
 

k1ng 1337

Joined Sep 11, 2020
1,038
All of which is true to some extent, though I find 'ladder logic' less intuitive than the simple Setup/Loop of Arduino or the main.c/main.py task orientation of bare metal C/Python. And the cost still massively higher than an MCU and minimal support circuitry.




Not sure of your point here. On the Arduino IDE you compile the code, CTRL+R then upload CTRL+Shift+U. This takes under 5sec. The program runs from flash memory on the chip itself.

Admittedly you don't get inline debug with Arduino IDE (yet) but the chip supports it as does the much more powerful PlatformIO IDE though that has a marginally higher learning curve.

But on a program this simple, inline debug isn't really necessary.

Attiny84 series not big enough to run MicroPython, but Pico is arguably overkill for this requirement, as current code (including OLED display library) takes just 70% of 8kbytes FLASH and 34% of 512 bytes RAM.
Maybe this calls for an experiment. I certainly save time but this is probably inconsequential for most. It drives me nuts sometimes how long it takes to compile and run a C++ program when Python is nearly instant. It isn't often I need the speed increase from C++ so when I put everything together (ease of use, minimal learning curve, etc.), Python is the clear choice for most of my needs. By extension, Pi and Pico are my go-to because they offer the most out of the box. Part of my philosophy is also about suggesting alternatives, not simply the "best fit".
 

Irving

Joined Jan 30, 2016
5,138
Maybe this calls for an experiment. I certainly save time but this is probably inconsequential for most. It drives me nuts sometimes how long it takes to compile and run a C++ program when Python is nearly instant. It isn't often I need the speed increase from C++ so when I put everything together (ease of use, minimal learning curve, etc.), Python is the clear choice for most of my needs. By extension, Pi and Pico are my go-to because they offer the most out of the box. Part of my philosophy is also about suggesting alternatives, not simply the "best fit".
TBH I've not used a Pico, only its bigger brother, the full blown Pi but that's a different ball game. My go to is the ESP32 for anything high-end; I buy them in 10s at sub-$4 and the module has a small footprint. I'm happy with C++ and have never found the compile/'upload time to be an issue but then I use OTA programming by default so I can remotely program in-situ. To me, this is a major plus for many commercial projects to support field-patching and clients seem to like it too. On more than 1 project I can provide direct code tweaks from home without wires or downtime. However, I digress.

Yes, I agree, there are always alternatives and, to be fair, the Pico looks a great piece of kit for the price. I suppose my driver is always to drive cost down as an industrial designer and the 8-pin MCUs are great for this. Indeed for this I would probably end up with the sub-50c 6-pin SOT23 version if I was doing it commercially.
 

MisterBill2

Joined Jan 23, 2018
27,587
OK, the little micro devices may be able to do it as well initially but the PLC will keep running in it's industrial strength package a very long time. Ladder logic has the benefit of being intuitive rather then a language to be learned.
 

Irving

Joined Jan 30, 2016
5,138
It's a hobby project Bill. :rolleyes:

I've got projects that have been running continuously for over a decade... on early MCUs. Its how you build it that counts...
 

Thread Starter

sab201

Joined Nov 18, 2023
297
Yes, I agree, there are always alternatives and, to be fair, the Pico looks a great piece of kit for the price. I suppose my driver is always to drive cost down as an industrial designer and the 8-pin MCUs are great for this. Indeed for this I would probably end up with the sub-50c 6-pin SOT23 version if I was doing it commercially.
Irving,

An 8 pin MCU is good to make the control unit compact when compared with the pi pico. But the more input pins the better it gets for future use. Incase I need to skip certain frequencies cycling around and needed others to run. I could incorporate push release buttons to the input pins which in case of 8 pin MCU it wouldn't be possible.
 

Thread Starter

sab201

Joined Nov 18, 2023
297
I like to know about the Regulated Power Supply to the MCU that Crutschow was talking about in post #7. These MCU boards and chips can't be powered by normal dc adaptors? Do they need buck converters or some other supply sources.

Thanks.
 

AnalogKid

Joined Aug 1, 2013
12,143
I like to know about the Regulated Power Supply to the MCU that Crutschow was talking about in post #7. These MCU boards and chips can't be powered by normal dc adaptors? Do they need buck converters or some other supply sources.
Yes, they can be powered with a DC adapter, IF it is the right kind of adapter.

They need a stable, regulated source. That can be an old, sloppy, linear 12 V adapter regulated down to a tight 5 V or 3.3 V with a switching buck regulator or a linear regulator, or a USB wall-wart that produces 5 V with a known minimum performance. The details of voltage, current, and temperature help decide which approach is best.

Crutschow is talking about the fact that a uC requires 5 V or 3.3 V. In a system that has only 12 V, there must be a step-down regulator. This can be switching (buck) or linear. Linear is more simple, but produces more heat. A buck regulator produces less heat but more noise (EMI). His point was that if you use CD4000-series CMOS logic gates to do the job rather than a uC, that logic family runs on anything from 3 V to 15 V. Power supply decoupling capacitors for each chip are a standard logic design technique. Other than that plus a noise filter cap where the power enters the system, you don't need an additional voltage regulator.

ak
 
Last edited:

MrChips

Joined Oct 2, 2009
34,829
MCU circuit or any other should not require much current (Atmel ATmega8 takes 1mA/5V @ 4MHz). Go with a simple 3-terminal linear voltage regulator.
 

Irving

Joined Jan 30, 2016
5,138
MCU circuit or any other should not require much current (Atmel ATmega8 takes 1mA/5V @ 4MHz). Go with a simple 3-terminal linear voltage regulator.
We have to be a little careful here. Its true the chip only takes 1mA @ 5v (ATtiny84/85 is 100uA @ 1MHz: and in the original design was only using pull-down on outputs, so I used a simple resistor/zener diode regulator with a 10uF hold up cap.Cheap & cheerful. If the outputs need to source current then a 3 terminal 7805 reg is the way to go, max 20mA per output, 200mA max for the chip.

But we also need to consider the 12v supply. The TS stated that the solenoid takes 1.25A and its current limited by the buck converter, but we dont know if the converter is a true constant output or a crowbar, in which case the 12v, and 5v, will collapse to near zero and all bets are off! In which case we'll need to current limit the feed to the solenoid. Easily done but more scope creep!
 

Thread Starter

sab201

Joined Nov 18, 2023
297
But we also need to consider the 12v supply. The TS stated that the solenoid takes 1.25A and its current limited by the buck converter, but we dont know if the converter is a true constant output or a crowbar, in which case the 12v, and 5v, will collapse to near zero and all bets are off! In which case we'll need to current limit the feed to the solenoid. Easily done but more scope creep!
I am using separate adapters for the Solenoid and the control circuit. Control Circuit adapter gives out 12 Volts DC. Whereas the solenoid adaptor gives out 19 Volts DC. I have shown that in the circuit in post #27. The solenoid takes a current of 3.75 A at 6.3 Volt output of the buck converter. I am using two separate power supplies for control circuit and solenoid so there wouldn't be any issues and their grounds are connected together.
 

Thread Starter

sab201

Joined Nov 18, 2023
297
Actually I was wasting a lot of power using resistors to pass current of such value through the solenoid, thanks to BobTPH here he gave the advice to use the buck converter and that provides 3.75 A at 6.3 Volts at a very less power usage.

So thanks Analogkid for the description about the linear and regulated power sources and all others.

I could use this power supply adapter which is the official Rasberry Pi power supply unit for them.

https://rees52.com/products/officia...b19c81250437cd47a2f30330f0ed03551c4efdaf3409e

Or I could use this module if I am using Arduino and it can power the Pi Pico also. It gives output of 3.3 and 5 Volts using a jumper selection.

https://zbotic.in/product/3-3v-5v-m...g0OGyYqCYfBQ0bpCRmJuPyBBt1l1aLhcaAheOEALw_wcB
sketch-1718770253478.jpg
 

k1ng 1337

Joined Sep 11, 2020
1,038
Actually I was wasting a lot of power using resistors to pass current of such value through the solenoid, thanks to BobTPH here he gave the advice to use the buck converter and that provides 3.75 A at 6.3 Volts at a very less power usage.

So thanks Analogkid for the description about the linear and regulated power sources and all others.

I could use this power supply adapter which is the official Rasberry Pi power supply unit for them.

https://rees52.com/products/officia...b19c81250437cd47a2f30330f0ed03551c4efdaf3409e

Or I could use this module if I am using Arduino and it can power the Pi Pico also. It gives output of 3.3 and 5 Volts using a jumper selection.

https://zbotic.in/product/3-3v-5v-m...g0OGyYqCYfBQ0bpCRmJuPyBBt1l1aLhcaAheOEALw_wcB
View attachment 324928
LM317 is a good choice for a regulator. It can accept an input voltage of up to 40V. Just set the output to 3.3V or 5V to match your microcontroller. An Arduino or Pico draws about 20-40mA so you won't need a heatsink.

• Output Current in Excess of 1.5 A
• Output Adjustable between 1.2 V and 37 V
• Internal Thermal Overload Protection
• Internal Short Circuit Current Limiting Constant with Temperature
• Output Transistor Safe−Area Compensation
• Floating Operation for High Voltage Applications • Eliminates Stocking many Fixed Voltages
 

k1ng 1337

Joined Sep 11, 2020
1,038
TBH I've not used a Pico, only its bigger brother, the full blown Pi but that's a different ball game. My go to is the ESP32 for anything high-end; I buy them in 10s at sub-$4 and the module has a small footprint. I'm happy with C++ and have never found the compile/'upload time to be an issue but then I use OTA programming by default so I can remotely program in-situ. To me, this is a major plus for many commercial projects to support field-patching and clients seem to like it too. On more than 1 project I can provide direct code tweaks from home without wires or downtime. However, I digress.

Yes, I agree, there are always alternatives and, to be fair, the Pico looks a great piece of kit for the price. I suppose my driver is always to drive cost down as an industrial designer and the 8-pin MCUs are great for this. Indeed for this I would probably end up with the sub-50c 6-pin SOT23 version if I was doing it commercially.
Where do you buy your esp's?
 

Irving

Joined Jan 30, 2016
5,138
Where do you buy your esp's?
AliExpress mainly, many suppliers. Today I can get them for $3,89 ea in 10s inc shipping to UK. That's the ESP32-S3-WROOM SMD module with aerial connector, 16Mb flash and 8Mb RAM, which is massive overkill for most projects - don't think I've ever needed more than 10% of that capacity!

If I want the pinned Devkit-C dual-type C USB its $4.89 ea in 10s inc shipping to UK. Same spec but PCB aerial on a 44-pin carrier.
 

AnalogKid

Joined Aug 1, 2013
12,143
LM317 is a good choice for a regulator. It can accept an input voltage of up to 40V.
Hi. LM317 pedant here.

Actually, the LM317 can accept an input voltage of well over 1000 V. The nice thing about its design is that it has no max *input* voltage. It does have a max *differential* voltage. That is, the difference between its peak input voltage and its regulated output voltage. That is the value that must be kept below 40 V (2004 datasheet) or 60 V (HV version). It can be used as a 427 V regulator as long as the input never exceeds 467 V.

ak
 
Top