|John Haine||06/08/2020 10:07:49|
|3343 forum posts|
Several mentions have been made here about processor boards that use the Arduino IDE but aren't Arduinos as such. I.m thinking about my next clock and it would be nice to avoid a mains connection, so a low power processor would be useful. Any suggestions welcome please!
(I want to use the IDE because I'm used to it, and I will likely re-use some of my present software.)
|Martin Kyte||06/08/2020 10:46:45|
2061 forum posts
Low power PIC and make use of sleep cycles as much as possible.
|Roy Vaughn||06/08/2020 11:00:32|
|42 forum posts|
How about PICAXE, which is a low power PIC under the bonnet. Not programmable in C however, though some would regard that as a positive.
6330 forum posts
The Arduino Boards might be a reasonable place to start. They have a few on-board power guzzlers that can be attacked with wire cutters. Removing LEDs, not using or minimising the linear regulator and maybe disabling USB all save power. Also, keeping the outputs low-current by design.
Depending on the application might be possible to use the Atmel chip's various power-saving sleep modes, ie hibernate the chip until an external event or a timer event wakes it up.
This website looks at power-saving on the Arduino Pro-mini board. Not played with a Pro-mini myself but recall our learned friend Mr Duncan Webster of this Parish does.
Lots of boards can be programmed with the Arduino IDE, maybe one of them is a low-power specialist. Just tried to find out how power a Nucleo-F446 uses with the programmer/debugger removed. Failed!
|Andrew Johnston||06/08/2020 11:38:58|
5668 forum posts
Low power design is all about attention to detail, and a detailed understanding of the hardware. Some pointers are:
Remove any external hardware that is not needed
Run the processor at a low clock frequency, preferably using an internal oscillator if it has one - no external crystals or oscillators
Disable all processor peripherals that are not being used - especially analogue functions
Shut the processor down (not necessarily the same as a sleep mode) when it is not being used, including the clock oscillator - use a true hardware interrupt that will bring the processor up even if the clock isn't running to start with
Use small low quiescent linear regulators; they're much more efficient than switchers at low output currents
All external components need to be sized for the design; excess current/drive capability often comes with higher base current draw
Look at the current draw of every external component, including passives. It's suprising how many microamps can disappear in pullup and pulldown resistors
5473 forum posts
Not certain but I think these processors are designed to run on 3.3v because it is available from batteries without using a regulator.
Although not the same IDE, in fact does not need an IDE and is programmed in Basic, the Micromite is designed with low power features including sleep and clock slowing specifically for running off batteries.
|Nick Clarke 3||06/08/2020 12:49:38|
886 forum posts
If you don't need many i/o lines the Ardunio Trinket uses about 35µA in standby mode as against the Arduino Uno at 45mA - both figures as a result of Google searches.
|Maurice Taylor||06/08/2020 16:06:01|
|130 forum posts|
Use the atmega 328 chip on its own ,you only need a crystal and 2 capacitors and it works the same as a Uno.
It will work on a supply between 1.7 and 5.5volt
Edited By Maurice Taylor on 06/08/2020 16:19:54
|Bill Davies 2||06/08/2020 20:02:48|
|197 forum posts|
Unless things have changed, you would need to burn a bootloader onto blank atmega328 chips and the like. I've used a few with very few external components (crystal, ...) on veroboard, but not recently.
|Andy Stopford||06/08/2020 20:29:12|
|40 forum posts|
+1 for using a 328 on its own; if you set it to 8 MHz it will be stable at 3.3V with a usefully reduced power consumption. They come in a variety of packages, both DIP (solderable with a standard iron) and SMD.
Depending on how you are using it, you may be able to let it sleep, to be woken up up when required by an interrupt from some other device. Since you mention using it for a clock, then a Real Time Clock chip, e.g. an MCP7940N, could provide the interrupt, as well as providing your clock functions.
Also, you don't actually need the crystal, the ATmega 328 has a built in crystal, which is adequate for timing its own cycle, though not for external tasks, like making a stopwatch.
I would thoroughly recommend this guy's website if you haven't dipped into stand-alone ATmegas:
|John Haine||07/08/2020 09:21:05|
|3343 forum posts|
Thanks for all the input. The "naked 328" approach looks interesting, and the website Andy links to is very useful. I will look at that and see where it goes.
|Stuart Smith 5||07/08/2020 09:33:15|
|125 forum posts|
There is a lot of useful information on using a bare atmega328 on the Arduino website.
Another alternative would be a PIC micro, but you would need a programmer and different programming software. I have used PICs in the past and there is a massive choice depending on what you want to do, but there is no doubt the Arduino is easier to programme.
6330 forum posts
Are PIC chips more power efficient than the Atmega family? I doubt it!
Off the shelf Arduino Boards are the problem rather than the Atmel processor. They're designed to be beginner friendly, rating ease of use over power efficiency:
One solution is to go primitive with a bare board. But doing so ditches many of the friendly advantages of the Arduino, and may be overkill. My suggestion is to program an Arduino in the normal way, and - once it's working - to save power by disabling all the unnecessary electronics. Basically convert a bought Arduino into the equivalent of a bare board by cutting bits off physically and in software. Cheaper and less fuss to strip a working Nano back than to wire up and program a bare board from scratch.
I looked at various power saving Arduind clones, like the Seeduino Stalker. They seem to be aimed at portable RF applications and are consequently a bit pricey.. I don't think they help.
Otherwise spoilt for choice. Dozens of different microcontrollers available from tiny to powerful. All seem capable of low power operation, but the application has to be designed for it. Choice of chip isn't the main problem.
Edited By SillyOldDuffer on 07/08/2020 11:11:11
|Michael Gilligan||07/08/2020 18:16:25|
16389 forum posts
Given John’s parenthetic note in the opening post ... That seems an excellent idea !!
|Peter Bell||07/08/2020 18:30:50|
|320 forum posts|
I'm with Dave on this one.
My first venture into microprocessors was with Picaxe. These worked well but it was a construct job every time changes needed to be made but I gained enough confidence to try Arduino. The nano with its ease of use by being a plug in with a bulit in reg and status led 's was a great step forward at least for me especially at the price.
So I would remove bits of a working nano to reduce consumption and intend doing this some time in the future rather than start from scratch unless I've got to!.
|Donovan Kaardal||07/08/2020 18:59:12|
|22 forum posts|
I'm a big fan of the ATTiny range from Atmel (well, Microchip owns them now). The ATtiny85 is extremely popular, and you can get ones that people have made into Arduinos if you really want. You could make one yourself and flash the arduino bootloader, or just say to heck with it and program it straight. If you're not going to be changing the program very often, there's no reason to waste the space with the bootloader.
Power wise they can be very efficient, though as was previously said using sleep states or low power states helps with that as well.
Here's a pic of an ATTiny based arduino. I bought a bunch of these ages ago so there may be better ones out there now. This one was called the digispark? The purple board next to it is one I made that uses smd components - this is a wireless temperature sensor, but for this one I'm pretty sure I used the Arduino IDE to write my program, then programmed the ATtiny(s) with a second arduino.
Low power ATtiny info is out there - here's at least one page that is a good place to start: ATtiny low power
|Andy Stopford||07/08/2020 20:53:10|
|40 forum posts|
Just a couple of points:
You can program a bare bones ATmega using the Arduino IDE just as normal - if you've burnt in the Arduino bootloader it is an arduino, effectively.
But, you won't be able to do it using USB, unless you add a USB-UART chip (and socket) which of course complicates things a bit; if you go down this route it's worth designing a custom PCB and getting it made in China (£10-ish for 5 boards from a company called Elecrow - others available, but I've found Elecrow good).
A simple way to get round this is to use the DIP package with the appropriate socket. You can then swap it for the one in a standard Uno, program it, and return it to your project. It's not ideal, it's fiddly, the pins are easily bent, but OK for something where you've got it working how you want it using a test setup with an arduino, and now you want to complete the 'production' version.
Lastly, do yourself a favour and ditch the Arduino IDE - there are much better, easier to use alternatives, with full code completion, hints, colour coding, etc.
I use PlatformIO; it's available as a code editor plugin. I like the Atom editor, but you can use it with VSCode, and, possibly, others.
|Joseph Noci 1||08/08/2020 08:21:54|
|753 forum posts|
I just spent near 2 hours digging into 'PlatformIO'...I think its a little presumptuous to just tell folk to 'ditch' the Arduino IDE...
Admittedly the Arduino IDE is not the greatest ( I don't use it - in fact I don't use any IDE - straight to the heart of the processor with embedded code and no OS..just a fast scheduler), but that IDE is very popular, commonplace, and although a little 'maker orientated', it is supported by a huge user base. That means a lot to someone just starting and finding the whole Arduinio, or any small micro based board, a little overwhelming. There are MANY forums where users assist and provide comments, many MANY library sources and many applications, easily adapted by new users, to blink that first LED or say 'Hello World'...
After the 2 hours on internet, reading all I could on PlatformIO, I found a lot of bling, heavy on the advertising selling its virtues , no useful comparison with other systems to assist a choice, how colourful it is, etc...User base is not easy to find. A SIMPLE intro to install, select your system, edit and compile 'hello world', etc was non-existant. All the splurb is very sell oriented and does not really do much to attract the new user, in fact the opposite! My comments are presented as though from a naive newcomer to the Arduino ( and workalikes) world - I am not a total newcomer myself - maybe 20 million lines of (disciplined military) code under the belt over the last 40 years...I guess I would get PlatformIO to work for me with little issue, but NOWHERE is it made easy to understand why I should , over say the Ard.IDE.. Nowhere do I find indications of ease of use, benefits, how or why it will make my life easier, etc, or at least, not without spending hours digging..
I don't say it is a poor system - I don't know anything about it, but as with so many open source softwares, the creators are Geeks, experts schooled in the art, and assume the rest of the world also are, and if not, 'get with the program'...
I don't know what John's level of expertise is in this field and maybe he would find it easy to convert/use, etc, although he did say he wishes to stick to what he knows and is comfortable with.
We all balk a little when faced with the learning curve presented by tackling a new CAD package, a new CAM package, etc, and many find it easier to stick with what you know, because it is much easier and quicker to get the job done, esp. if it is your hobby, and the objective is to make an Arduino based Clock, and not to spend half the project time fighting a new environment. With that as a perpetual given, why on earth do the vendors of such systems not present the system in a manner that does not chase one away with the first look!
I think that most members of this forum are 'mechanical' model hobbyists, as opposed to electronics or software hobbyists - that line is blurred hugely these days, with the easy access to modules that allow extensions to our hobby - but I would still suppose that the use of an Arduino module and some software is with the intent of making a 'model' better, or with more features, etc. In other words, the aim is not to spend the majority of the project's time on fighting a voluminous IDE and its surroundings,and writing software, but to make the model.
When I made my ELS for my lathes, the objective was twofold - to make threading on the lathe a pleasurable experience, and to learn about the mechanism of sychronised threading on a lathe. I used an Arduino type module to implement this, and although the software is what makes it work, writing the software was NOT the objective, and anything that makes the software creation more difficult is simply an annoying distraction.
Of course, it's not all the same strokes for all folks, and those who enjoy more the software and its environment are welcome to that world, but would it harm the Open Source Geeks ego that much if they stepped down a little into the real world and sold their stuff in a manner that was useful to most??
Not everyone is a software expert, doing software for a living, or merely interested in the latest bling_IDE for the sake of it..
In the two hours I could not fine what the minimum software overhead is when running this system on 'my' board - is there a bootloader? What size is it typically? How does it affect run-time measurements?..
John, I'd say stick with what you know and do the fun part - make the clock! If your interest in the IDE is as much fun, then maybe PlatformIO is for you...
My Rant for the day..
Edited By Joseph Noci 1 on 08/08/2020 08:22:40
|John Haine||08/08/2020 09:42:46|
|3343 forum posts|
Well, thanks for all the inputs folks, on the whole it looks to me like my best course is to stick with the Arduino but when appropriate move to a "naked 328" to optimise power. I've no fears about working with the chips, I'd rather not perform surgery to remove LEDs etc from a working SMT board!
Thanks also for the "rant" Joe. The person who recommended using Arduino is an ex colleague, a very experienced embedded software engineer who has also developed probably millions of lines of code for mobile phones and other consumer products, as well as directing software programmes in various companies. He uses Arduino for various home projects. If it's good enough for him it works for me! I am an electronics engineer by profession but focusing on RF systems. My only "professional" use for computing has been for system calculations and simulation so I have no background in "proper" programming. For my clocks the Arduino is just a tool to control a couple of stepper motors and implement some simple compensation algorithms. As it's a tool I'm not going to change it for something different just because it might be better once I get up the learning curve, any more than I'd change my lathe or mill.
|Joseph Noci 1||08/08/2020 10:28:03|
|753 forum posts|
As it is said, do what floats your boat! I must always be careful to not generalise to much...Individuals obtain project satisfaction in their own way, so prescribing alternative approaches is always fraught with with the subsequent need to duck...If at the end you enjoyed what you did, and maybe even learnt something along the way, then you won!
looking forward to seeing the clock - Obviously it's not just going to be a digital display of time...
Edited By Joseph Noci 1 on 08/08/2020 10:28:20
Please login to post a reply.
Want the latest issue of Model Engineer or Model Engineers' Workshop? Use our magazine locator links to find your nearest stockist!
You can contact us by phone, mail or email about the magazines including becoming a contributor, submitting reader's letters or making queries about articles. You can also get in touch about this website, advertising or other general issues.
Click THIS LINK for full contact details.
For subscription issues please see THIS LINK.