Advice on micros for a data acquisition system

Thread Starter

ziqquratu

Joined Mar 29, 2017
10
Hi all,

I’m a researcher, looking at the effects of various parameters on flow through a system. The process is pretty simple - the lines will be set up with, say, different lengths and diameters of tubing. Then I’ll inject a bolus of fluid and look at how long it takes to pass through. This is repeated at intervals, looking at robustness over time.

Because I have a lot of variables to test, I’d like to set up multiple lines in parallel. They don’t have to all run simultaneously (one at a time is fine), but I can’t really have just one set up for a week, then the next for a week…

The thing will be controlled via a PC interface (probably in python), which will turn on a camera to watch the flow, open a valve, wait until the end of the process is detected (openCV motion detection), then save the results (time, and the video file - possibly more, but that’s a software issue, not the concern here). I’d prefer a USB interface versus WiFi.

The IO for triggering valves and such is fine. It’s the camera that has me stuck. I don’t need much - QVGA should be more than fine (maybe even less, I need to test the limits to be sure), I can probably even live with B&W. But I need one camera per line, and around 25 fps. Duration is typically up to 5 min.

I found the OV7670 modules, thought they’d be awesome. Even found some hints on setting them up so more than one can share data pins, by only turning one on at a time. But it looks like getting the video over to the PC is a problem, limited by microcontroller transfer rates.

I’m not a total newb at this sort of thing - I can cobble together sensors and controllers to get things done (and communicate data across to process it) but this camera thing is a new challenge. Arduinos, which I’m most familiar with, seem obviously out. I thought of a Pi or similar, but I’m not so familiar with them, and couldn’t see much on hooking up multiple cameras. I stumbled on the Teensy 4.1, or a Feather ESP32-S3, thought one of them might work - but lack the depth of knowledge required to figure that out.

Any advice anyone might have on a microcontroller that could be suitable, or pointers to a way to set up a pi or similar, or any other suggested platforms (I’m willing to learn, within reason!) would be really helpful.

Thanks!
 

Ya’akov

Joined Jan 27, 2019
10,226
Welcome to AAC.

I don't know what your physical setup looks like but since you said "one at a time is fine" my immediate inclination would be to use a single camera directly connected to the PC and mounted to a linear rail.

I would allow the MCU doing the test to position the camera and to tell the PC to start and stop recording. That way you don't have to deal with a multiplicity of cameras, you can probably use something with better specifications, and you don't have to transfer the data.
 

Thread Starter

ziqquratu

Joined Mar 29, 2017
10
Hi Ya’akov,

Thanks for the response.

I should have mentioned. For various reasons, moving the camera is a last resort. I probably can make it work, and will go that way if forced, but I’d rather each “module” have its own if I can.

The cheapness of the cameras is also a selling point - there may be times when they may get damaged, and since I know I only need low-ish res video, that’s a fine trade off. That said, I’m in no way wedded to those days ones - they just fit the specs!
 

Ya’akov

Joined Jan 27, 2019
10,226
In that case, is it feasible to use a Rasperry Pi Zero for each module? It has a connector for a camera, and much better throughput. It can be programmed in Python with access to the GPIO, and it can stream the video in realtime as one way to record it.
 

Thread Starter

ziqquratu

Joined Mar 29, 2017
10
In that case, is it feasible to use a Rasperry Pi Zero for each module? It has a connector for a camera, and much better throughput. It can be programmed in Python with access to the GPIO, and it can stream the video in realtime as one way to record it.

Quite possibly! I’m unfortunately not familiar enough with those systems to know.

How would I go about connecting the multiple Pi Zero’s to one PC (any good tutorial you could recommend)? Would it mean connecting each one via USB to the PC? Or could I have a central “hub” that manages that? I feel like having multiple USB connections is asking for confusion (I had considered USB webcams plus an arduino to control the valves, but rejected that as likely to get messed up and have cam 2 recording while valve 4 was open), and is also tricky running multiple cables out of my workspace.

(I know, adding problems at every step - can you tell I don’t know enough to know what I’m missing? )
 

Ya’akov

Joined Jan 27, 2019
10,226
Quite possibly! I’m unfortunately not familiar enough with those systems to know.

How would I go about connecting the multiple Pi Zero’s to one PC (any good tutorial you could recommend)? Would it mean connecting each one via USB to the PC? Or could I have a central “hub” that manages that? I feel like having multiple USB connections is asking for confusion (I had considered USB webcams plus an arduino to control the valves, but rejected that as likely to get messed up and have cam 2 recording while valve 4 was open), and is also tricky running multiple cables out of my workspace.

(I know, adding problems at every step - can you tell I don’t know enough to know what I’m missing? )
I would use Ethernet. This tutorial has information on the module and using it. By using Ethernet you will have an effectively unlimited capacity for modules and much higher transfer rates than most other options.
 

Thread Starter

ziqquratu

Joined Mar 29, 2017
10
Hi Ya’kov,

Thanks for the suggestion. I hadn’t considered Ethernet - that could work well.

I’m going to give that a try. Cheers!
 
Top