Author Topic: Please suggest a suitable Raspberry Pi for data logging  (Read 1862 times)

0 Members and 1 Guest are viewing this topic.

Offline Jester

  • Frequent Contributor
  • **
  • Posts: 664
  • Country: ca
Please suggest a suitable Raspberry Pi for data logging
« on: January 15, 2022, 12:48:11 pm »
I want to put together a multichannel (6 channels max) data logger that will run for extended periods a month at a time collecting data from both GPIB and a couple of serial ports.

I have never used a Raspberry Pi. Assume my Raspberry knowledge == 0.

What minimum flavour of Pi would you recommend that will get the job done?

Thanks J

 

Online rstofer

  • Super Contributor
  • ***
  • Posts: 9156
  • Country: us
Re: Please suggest a suitable Raspberry Pi for data logging
« Reply #1 on: February 05, 2022, 12:46:35 am »
You might consider the Pi 4 Compute Module, it would be easy to integrate onto another PCB.  Otherwise a 4B will work just as well and I would buy the 8 GB version, not that it will be necessary.

The really nice way to do everything that needs doing is to use a Pi 400.  Add a monitor and mouse and you're ready to go.  I really like this platform.  Everything to do with a project is running on the project machine itself.

I assume you will be recording to a file on the microSD card and some other process is going to read the file and present the output.  You can add a printer to Ubuntu and print the data formatted by the program you write.  Or, you can send the stuff over a network connection to a NAS or whatever.

Ubuntu gives you a lot of power.

There is a problem, however.  There is only one accessible serial port.  There are devices that connect over USB to provide a serial port.  I used to use cable type converters.  There are also some more expensive hubs but I don't know if either of these work on Ubuntu.  You'll have to do some homework.  Take a Pi USB port, run it into a USB hub and use USB<->Serial cables to the devices.

https://www.amazon.com/s?k=usb+serial+cable

If everything else fails, use a compute module at every external device and network the whole project to the host Pi.  Berkeley Sockets is easy to use on Ubuntu.  Use the compute module to provide a single serial port and grab the data for transmission over TCP/IP.  I would probably start with this approach because it leads toward future proofing.  Only the host code needs to change if I need to add 1 or 100 additional devices.  Distance doesn't matter, I can record data from anywhere with an internet connection.

 

Offline mawyatt

  • Super Contributor
  • ***
  • Posts: 1747
  • Country: us
Re: Please suggest a suitable Raspberry Pi for data logging
« Reply #2 on: February 05, 2022, 02:05:33 am »
We've been using RPi for some time now as the main computer platform in various systems, ranging from single axis custom focus stacking optical system, to 4 axis stack & stitch focus stacking systems, and lately to a complex controller that is sort of a 15 bit 180VPP capable 128 independent channel AWG with Bi-Phase and Offset modulation capability. Even use the RPi as the overall system clock generator.

These RPi ranged from 3, 4, 400 and even Zero, although the Zero is somewhat slow. Agree having everything to do with the project running on the project machine itself, so everything is self contained is a really good approach and why we selected this method. With the built in Wireless, you can use VNC and operate from anywhere if desired.

Here's a couple images of the 64 channel system under test with RPi 400 and Zero.

Best, 
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 

Offline mawyatt

  • Super Contributor
  • ***
  • Posts: 1747
  • Country: us
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 

Offline Lindley

  • Regular Contributor
  • *
  • Posts: 106
  • Country: gb
Re: Please suggest a suitable Raspberry Pi for data logging
« Reply #4 on: February 05, 2022, 11:06:45 am »
Does it have to be a Rasp Pi ?

Depending on you needs you might find the humble Arduino or ESP32 module with an SD card are well able to do that data collection and in some ways easier to get going, eg No Linux
Heres just one of many such examples on the web, some even giving details of how to transfer to data to Excel etc.

https://maker.pro/arduino/tutorial/how-to-make-an-arduino-sd-card-data-logger-for-temperature-sensor-data
 

Online rstofer

  • Super Contributor
  • ***
  • Posts: 9156
  • Country: us
Re: Please suggest a suitable Raspberry Pi for data logging
« Reply #5 on: February 05, 2022, 05:48:28 pm »
There's far too little information to make any real recommendation other than in response to 'which Pi?'.  Even there, it depends...

How far apart are the sources from each other and the host?
Is the code in the remote units changeable?  Could we scrap the serial port and substitute SPI?  I2C?  Gain control of the serial port so RS485 becomes practical?

How often are the remote units polled?  Milliseconds or hours?

What happens to the data when the host receives it?  Is it placed in a file on a USB Thumb Drive?  You certainly can't plan to interchange the microSD card although the host can provide access to the file.  Or is the data forwarded for storage elsewhere?  Perhaps it is massaged with LibreOffice  and presented as a spreadsheet and graphs.  Is this done on the host (certainly possible given Linux) or on some other machine?  How does the data get there?  Any opportunity to just stuff the data into a SQL Server somewhere?  Where?  On the local host?  Then the database could be queried from anywhere on the network for custom data analysis.

Grabbing data is the least part of the job.  Data without analysis is pretty much useless.

So many questions...  One thing Linux buys is future proofing.  Given a full OS with a complete network stack, anything is possible.  A small micro would have to shove all the work uphill to another host.

I have a couple of PI 400s and they're pretty slick.  I also have a large assortment of the other PIs but if I had to create a host for this project, I think I would go with the 400.

BTW, I could create an isolated network with DHCP and DNS running on the host.  It would be easy to use Ethernet for the remote sensors (hard wired) and WiFi to provide a link to some uphill network thus keeping the data network isolated.

The possibilities with PI/Linux are endless, the Arduino, less so.  It could still be workable, depending...



« Last Edit: February 05, 2022, 05:50:01 pm by rstofer »
 

Online rstofer

  • Super Contributor
  • ***
  • Posts: 9156
  • Country: us
Re: Please suggest a suitable Raspberry Pi for data logging
« Reply #6 on: February 05, 2022, 06:34:27 pm »
That GPIB device is going to be a hassle.  There is a workable Arduino project.  The video is just a small portion of the project and really deals with Brown Out Detection for the converter.



There are many other Arduino GPIB projects.  Like:

https://duino4projects.com/open-source-hardware-gpib-usb-adapter/

This project winds up as a virtual serial port under Linux so at this location, make sure the PI has USB host capability.  Again, the PI is just a network interface sending data to the upstream host.  Depending on location, it could also plug into the main host.

Remember that Linux is not exactly a real-time OS so sampling/scheduling is a more difficult problem.  Maybe the ESP devices are better for the remotes.

https://courses.engr.illinois.edu/cs423/fa2012/05-sched.pdf

This would take some experimenting.

 

Online eugene

  • Frequent Contributor
  • **
  • Posts: 346
  • Country: us
Re: Please suggest a suitable Raspberry Pi for data logging
« Reply #7 on: February 16, 2022, 06:50:48 pm »
The right Raspberry Pi would be whatever one you can acquire, which is none of them at the moment.  :'(

The Teensy 4.1 has a micro SD card slot to store data and might be either easier or harder to code than a RPI, depending on exactly what you need your code to do. You can add a small touch screen if needed and use the libraries from Adafruit, or just power down the Teensy, pop out the SD card, and read the data on your laptop computer.
90% of quoted statistics are fictional
 

Online ledtester

  • Super Contributor
  • ***
  • Posts: 2303
  • Country: us
Re: Please suggest a suitable Raspberry Pi for data logging
« Reply #8 on: February 16, 2022, 07:29:16 pm »
What kind of data logging do you want to do? Digital? Analog? How many samples per second do you need to log? How many inputs do you need to monitor?

Note that the Rpi doesn't have any ADC units so if you want analog you'll have to get an external ADC module. If 10-bit resolution is adequate then a simple Arduino Uni/Nano might work for you. For higher resolution you can get modules like the ADS1115 which give you 16-bits.
 

Offline Jester

  • Frequent Contributor
  • **
  • Posts: 664
  • Country: ca
Re: Please suggest a suitable Raspberry Pi for data logging
« Reply #9 on: February 18, 2022, 05:18:12 pm »
I picked up a used pi4 model B on Kijiji for cheap.

I want to use it to capture voltage measurements from 3x 34401As via GPIB perhaps every 10s as well as temperature.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf