Jump to content

Microcontroller & single board computer technology suggestions


dnb

Recommended Posts

I am about to embark on a little project for the new house (details to follow - they are relatively unimportant for this, but you can consider it as reading some sensor data via ADC, doing some simple calculations and toggling 2 or 3 outputs as required, then reporting the data and output state to some other device) and I was about to get out my old STK500 and an ATMega16A I had kicking around gathering dust when I considered that the 8 bit technology is at least 20 years old and runs with very functional, but antique comms devices. The AVR microcontrollers have served me well over the years in everything from tank level sensors to automotive engine management, so in many ways it's the easy option to use it again. They are still in production and development seems to be happening. But I wonder for how much longer? What is the controller of choice that will be supported for the next 5 to 10 years?

 

What I think I need is a solution with plenty of ADCs (6 off 10 bit, but 8 off 12 bit would be better) a few general I/O pins to drive 5v 15mA (max) loads and read a few logic level inputs, and 100base Ethernet (but Gigabit is OK too). The Ethernet is the difficulty here - no AVR I have seen yet appears to have it as a single device solution. The Ethernet port is only to accept simple commands and return logged data so there may be a better choice of interface. I am put off a RPi based solution because the startup time is a bit too long and it feels a bit of overkill for this particular very simple job (besides, I'm not keen on Python!)

 

I am planning a Pi based home automation solution for some other tasks so there is nothing stopping me (for instance) using RS485 to communicate between the Pi and two of the devices discussed above. Their data can be packaged up on the Pi and served to anything that wants it on the home automation network, and the Pi can act as a command "postbox" where required. But again, it's using old comms technology.  Wireless probably won't work in this application since there is likely to be too much metal and distance in the way. Unfortunately this rules out a number of otherwise easy options.

 

So, having bored you all, what tech are you using for your projects, and is it current and easy to work with? Or what would you like to use if you were starting again?

Link to comment
Share on other sites

Still using a lot of AVR (328P) and RPi (2/3/4) over this way.  I'm not sure that I'd consider RS485 'old'; it continues to do a particular job, reliably.  I'm hoping to buy a new piece of kit post-lockdown with an RS485 interface, for example.

 

Rgds

 

Damon

Link to comment
Share on other sites

2 minutes ago, DamonHD said:

I'm not sure that I'd consider RS485 'old'

It's definitely old. But I wouldn't yet call it obsolete. That said, I work in an industry that supports installations for 30+ years, so I routinely use a lot of older tech and often forget how old it has become.

 

Thanks for the AVR & RPi support.

Link to comment
Share on other sites

Have you considered the Arduino, it has 6 x ADC's and supports things like RS485. It's got a good help community and plenty of project examples. Good bit of kit for glueing things together. My son used one in a university project and I was pretty impressed with it. I've no experience of the Pi.

Link to comment
Share on other sites

4 hours ago, dnb said:

I am put off a RPi based solution because the startup time is a bit too long and it feels a bit of overkill for this particular very simple job

Never tried the other OS options for the RPi, but some may be quicker startup than the others.

 

"There's also a particular emphasis on programming. RISC OS is home to one of the best and most flexible/capable versions of BASIC (BBC BASIC 5/6), and RISC OS Direct makes it easy to start coding. Also included are many other popular programming languages such as Python, C, C++, Perl, PHP, Lua and more."

Link to comment
Share on other sites

Arduino is good and if you're using 1 wire sensors then you're not limited really on the inputs. Adding in an ethernet shield is plug and play, and also gives you the option for PoE if you wanted to go that way too. Dead easy to programme tbh

Link to comment
Share on other sites

Arduino brings nothing to the party. It is an AVR chip (like I already use) with some additional components on a stack of pcbs supplied with a load of libraries to make it accessible to the general population. Excellent marketing though.

 

Regarding RPi start up time, it is never going to be faster than a microcontroller. And I don't want it to take even 30 seconds to restart after a power cycle.

Link to comment
Share on other sites

25 minutes ago, dnb said:

Regarding RPi start up time, it is never going to be faster than a microcontroller. And I don't want it to take even 30 seconds to restart after a power cycle.

How about a PIC, I think they are fast.

Link to comment
Share on other sites

1 hour ago, dnb said:

Arduino brings nothing to the party. It is an AVR chip (like I already use) with some additional components on a stack of pcbs supplied with a load of libraries to make it accessible to the general population.

 

My impression is that the "load of libraries" is exactly what it brings to the party - after all it's not just this 'general population' that benefits from reusing already working code. Admittedly I don't have much experience with Arduino per-se, but I also thought it is fairly chip-agnostic these days? e.g. ESP32  seems is also supported as an optional 'core' in arduino https://github.com/espressif/arduino-esp32

 

I'm becoming quite a fan of ESP32 - I've used them more with tasmota, platformio and mostly esphome.  Even if you don't need wifi for a given current project, they're nice and very cheap little boards, and they're so pervasive I feel they're going to be about for a good while, and I was surprised how handy the wifi interface can be useful for maintenance & debugging tasks even if not needed in the core application.

 

Link to comment
Share on other sites

Reusing "already working code" is precisely the reason why Internet security is such big business!! Admittedly that argument is not applicable to my case, but it colours my desire to use other people's homework... Besides, if I need 3rd party libraries to make an avr do a couple of adc conversions and report it over rs485 (ethernet is on reflection not necessary) then I am not doing it right.

 

I do take your point that it speeds up getting something working.

 

I will have a look at the esp32. I could find uses for a good wifi device for other jobs.

Link to comment
Share on other sites

2 hours ago, SteamyTea said:

How about a PIC

Maybe. They are now made by the same people as AVRs and do similar jobs. Do they have a longer time before obsolescence?

Link to comment
Share on other sites

6 hours ago, dnb said:

Reusing "already working code" is precisely the reason why Internet security is such big business!!

 

It's not that clear cut.  If every application had to, say, roll it's on SSL/TLS implementation you'd have several orders of magnitude more zero day exploits. Sure, shared libraries can often be infuriating to work with, and doubly so when it turns out to be the cause of a vulnerability, but some things should not be rewritten lightly. 

All depends on the libraries in question of course; due diligence certainly pays off.

 

 

Link to comment
Share on other sites

@joth It's never clear cut... That's why it was in quotes. I like to copy the clever kid's homework where I can as much as the next person for exactly the reasons you illustrate so well. (CPAN is a favourite for me when not doing microcontrollers.)  I suspect if we did more rolling our own, there would indeed be more exploits, but there would be less incentive to find and exploit them.

 

In the case of Arduino for my usage this time it's best summed up by this: https://xkcd.com/801/  I understand I was less than specific about my intentions, but what I want to do isn't going to be difficult - apart from the now removed Ethernet requirement (the TCP overhead is orders of magnitude larger than the data, and it saves precious little complexity in the system as a whole, so better to do something simpler)

 

@Dan Feist Those look interesting for some other ideas I have.

 

On the whole, I think I'm safe sticking with AVR chips, especially if I move to the newer devices with the better pinouts (e.g. the idea of a single voltage supply and have it do the separation of analog and digital domains is quite nice.) and it's a good excuse to think about a new programmer board. Mine is so old it was probably made with leaded solder!

  • Like 1
Link to comment
Share on other sites

Ready built would be good, but I can usually convince someone at work to help out with bargain price PCBs. As long as it doesn't need anything other than the basics - a few PTH, silk screen and solder mask.

Link to comment
Share on other sites

10 minutes ago, SteamyTea said:

why a few seconds boot time is critical

That's easy - it's because I'm impatient with technology. ?

 

The boot time is not the critical issue, but it is a factor in the design choice. Robust and quick recovery after a power cut is another design consideration - we get a lot of power cuts. (Enough that I am considering a small generator backup once the house is built, but that's for another thread.) Fundimentally I want as simple a solution as possible to the problem. My toaster (to quote a joke example from the early internet) does not need to run Linux!

 

14 minutes ago, SteamyTea said:

what it is for

All will be revealed in a different thread. It's not a single project and is best presented when I have the whole system sketched out - I have a set of things I want to implement that would have improved functionality if they can communicate in a simple way. Complexity and extra processing power doesn't give additional benefit. They need to be supportable (by me) for 10+ years or until we stop wanting to pay "eco tax" (a thread in its own right) on energy and resource saving equipment in our houses.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...