Which microcontroller to use?

Thread Starter

enoob

Joined Jan 6, 2017
22
Hi guys,

So I have recently started tinkering with electronics and being from a biology background, I'm looking for some advice on the following project I have in mind.

I want to use to drive water through a thin walled flexible pipe by pressurising one end with a pump (filled with air as the forcing fluid). Also, I'm trying to create a kind of pulsed flow by wrapping a piezoelectric actuator around the pipe and during this entire process, I want to observe the pressure generated by the driving pump with a pressure sensor so that I can choose to maintain a particular pressure when required.

Overall, I want to create a PC application which will drive these according to my inputs (say push buttons on the user interface) such as setting the initial volume of air to be sucked into the pump (to be later used for driving the water), the signal to be supplied to the piezoelectric actuator for the pulsed flow (magnitude, frequency) and reading the pressure sensor output on the same application.

Which microcontroller would be best for such an application (ease of programming)? I'm open to getting a development board (I saw a few from Microchip) which is affordable. My PC is Windows 7 64-bit so I guess I will need something compatible for such a setting (not very sure how microcontrollers vary with these).

I would appreciate some guidance on this.

Thank you all!
 

MrChips

Joined Oct 2, 2009
34,810
First of all, most low-end microcontrollers are 8-bit processors. Some are 16-bit processors. All of these are compatible with Windows 64-bit machines. The number of bits on either end of the cable have not much to do with compatibility or incompatibility.

If you want one box to communicate with another box, you need a common communication protocol. Today, that is USB. You want a development board that has a USB interface. Another solution is to use a serial interface with a serial-to-USB adapter chip or cable.

Every microcontroller manufacturer supplies a dev board with serial or USB - Atmel, Microchip, Renesas, STMicroelectronics, Texas Instruments (some names that come to mind). You can select just about any dev board to do the job.

You also need to select a programming platform on your PC side. What are you familiar with? BASIC, C, C++, Labview, MATLAB, Python, Visual Studio? Do any of these ring a bell for you?
 

Thread Starter

enoob

Joined Jan 6, 2017
22
Thank you for your reply, MrChips!

Yes, I think USB would be the best since it seems to have come up universally for computer peripherals over the years as per my initial readings.
Since I'm embarking on something new, I would like to keep room for adding further elements to the system such as sensors, displays etc. So you say that 8-bit or 16-bit processors will make no difference when run from a 64-bit Windows 7 PC?

Question: Can I transfer parallel instructions with USB? For example, if instead of one pipe I have two with two different piezoelectric actuators and I want to drive them independently using the same pump but with different actuator signals at once, will that be possible? Or will it send a signal to pipe 1 and then to pipe 2 thereby leading to a delay between them (I can probably live with microsecond delays but not greater if serial instruction transfer is the only way for USB).

Programming: I know a bit of MATLAB and some rudimentary C but of course, I'm willing to learn. Which, apart from the two I mentioned, would you recommend to be the easiest to learn and program in for my application type?
 

John P

Joined Oct 14, 2008
2,061
If you haven't got microcontroller skills, get an Arduino. That system is designed to allow people with some ability to write code, but no experience in wiring up equipment, to get a working device as quickly as possible. Any other approach will lead to certain frustration.
 

MrChips

Joined Oct 2, 2009
34,810
Welcome to Systems Design Engineering 101.

You start with a blank piece of paper and pencil and draw a block diagram of all the items you want to connect to now, and all the possible items you might want in the future. This is called Top-Down Design.

Digital input devices - switches
Analog signals and sensors - thermometers, pressure sensors, voltage, current, resistance etc.
Output devices - pumps, solenoids, lights, relays

Next, design a communications protocol. That is, you are going to create your own text language to communicate with one or more controllers.
A simple protocol will be commands using two letters, for example,

RT - read temperature
RV - read voltage
RX - read switches
SO 255 - send output
SP 1234 - set pressure to 1234
SV 567 - set voltage to 567

Write out all the possible commands you might wish to create.
As for multiple actuators being activated simultaneously, you can create commands such as:

AS 1 - turn on actuator #1
AS 3 - turn on actuator # 1 and #2
AS 4 - turn on actuator #3 while turning off #1 and #2
These will control the actuators simultaneously without delay. The possibilities are unlimited.

You might also have multiple controllers connected to the same USB structure.
For example,
1AS 4 - turn on actuator #3 on unit 1
2AS 8 - turn on actuator #4 on unit 2

MATLAB is a good place to start. Have you used GUIDE on MATLAB?
 

Thread Starter

enoob

Joined Jan 6, 2017
22
Oh that's very helpful.....thank you, MrChips!
I guess the tricky part is the logic design.

Question: Is the communications protocol you mentioned something I can create by myself arbitrarily or are you referring to the programming language I use? For example, RT probably does not mean anything in MATLAB as of itself so is it up to the user to define these or are these commands constrained somehow by the programming language?

I haven't used GUIDE.....just watched a couple of videos on MathWorks though and it seems to be user-friendly. So can it "talk" to the microcontroller on the development board by itself or do I need to somehow convert the code generated into machine interpretable format?

Given my kind of application, I will most likely need to add another custom board (breadboard or PCB) to interface with the development board so that the specific microcontroller outputs can be modified (through amplifiers etc) to supply a suitable signal to a particular hardware element. Most microcontrollers that I have looked up have huge pin counts so I was wondering which ones I should be looking for in my case (as in, ones which set outputs to HIGH or LOW probably) since a lot of them may be for powering the chip itself, resets or stuff like that which make the chip work in the first place.
 

BR-549

Joined Sep 22, 2013
4,931
I would recommend the Arduino Mega 2560. It is very popular with other fields.......and you can probably find several hardware and software examples for anything that you want to do. It has plenty of auxiliary functions, I/Os, and a fair amount of memory. And you can't beat the price.

Once you get the feel for it, you can change to another, more industrial system if required.

Your gonna be surprised of what you can do. No matter what you use and study.
 

MrChips

Joined Oct 2, 2009
34,810
You are getting ahead of yourself. As I said, the first step is the conceptual design.
Forget about the details. Everything you want to do is possible. Just believe that there is a solution and you will solve it when you get to it.

You cannot skip the first steps which is laying out the big picture and writing down YOUR specifications. Forget about the details of implementation of software or hardware for now. Now is not the time or moment to choose any of those.

However, there is one caveat. You have to build everything yourself, hardware and software. If you are up to the challenge, the world is at your feet and it is a highly rewarding and exciting journey. Mind you, you are not alone. There are tons of very experienced members right here on AAC who will be happy to guide you along your journey.

If you are not up to the challenge, give up now and ask someone else to do it for you.

(One other caveat. What you are attempting to do could easily be a 1 to 4 year program in Electrical Engineering, Electronics, Computer Science, Mechatronics etc. in college or university. But that doesn't mean that you have to attend classroom lectures to learn how to do this. With the right attitude, aptitude and guidance you can be good at this in a year or two.)
 

Thread Starter

enoob

Joined Jan 6, 2017
22
Thank you everyone for your advice.
I'm hoping to get started soon and will probably keep asking questions on this thread since there are so many experienced people on this forum.

MrChips: Thank you for the motivation. Giving up is not an option so I would greatly appreciate your inputs as I move forward with this project.
 

MaxHeadRoom

Joined Jul 18, 2013
30,659
One source of applications and also the programs covering them in both C and Assembly, is the Microchip Picdem 2 Plus boards, they have on board facility for 18pin to 40 pin Pic's, they also have various examples of peripheral devices using the various modules used in Pic's.
Even if not using the board, the schematics and the programs are available for download on the Pic site.
Max.
 

Thread Starter

enoob

Joined Jan 6, 2017
22
Hi everyone,

So I have decided to start from a very basic level by interfacing an Arduino Mega 2560 with LabVIEW and my first target is to control a pump. I got hold of an old used one (Hamilton PSD3 syringe pump, part# 5175-01, 24 V, 1 A) and found its equivalent specifications here (https://www.artisantg.com/info/ATG3eyit.pdf). It has a RS232 cable (DB9.....it has 9 pins) although I'm not sure if it still works as it is probably as old as the pump. Also, I'm not sure where it goes.....I'm guessing the DB9-end can be connected to a microcontroller board somehow since the other end goes into one of the pump sockets. The valve type is the left-most one in the types list shown (fluid logic 3-2).

Can this be driven by the Mega 2560?
 

BR-549

Joined Sep 22, 2013
4,931
You will have to call Hamilton and get their protocol. This is the way they address and control the pump.

You will need a RS-232 "shield". You will need some extra voltages for the connector.
 

BR-549

Joined Sep 22, 2013
4,931
Everything will depend on the pump protocol and electrical specs. Some use a modified RS-232.......it all depends on the pump.
 
Top