PC based AVR multichannel datalogger - Page 1
Forum section: electronics / projects

author: JackP
author_rank: Regular Contributor
timestamp: May 26, 2015, 01:16:08 pm
content: I've been wanting to mess about with some PC based software to create GUIs, and thought of a cool project that seems doable. Before doing any preliminary design work, however, I wanted to verify my premise and check a few things (not easy for me to order parts whenever so I want to make sure I'm doing it right). To clarify, I'm not asking for help on the design as much as if my ideas are correct, and any suggestions are welcome.First of all, I'll say a bit about what I want to do. I'll have an ADC (more on this later), which is fed from some number of different sensor (as applicable); for example, temperature, light, humidity, voltage, current, resistance, which will be available as standalone modules, separate from the main board (for flexibility). The uC (some AVR variant since that is what I'm comfortable with, but I might try and port it to a STM32 at a later date as a challenge) will then send the data over the serial port (every second?), where it will be read by a Python program, and displayed in a GUI, with selectable devices (so it knows what sensor you are using, and displays the data correctly).So my main query was about the ADC. I am assuming (since data will only be sent over the serial port every second) that sample rate is not particularly important here. Thus, I can probably get away with a higher resolution ADC. However, is there anything else I've missed in this respect, or could I get away with the internal 10 bit ADC in many AVRs?Is there anything else I should think about? Is the 1 second data refresh acceptable IYO? Thanks a lot.

author: dom0
author_rank: Super Contributor
timestamp: May 26, 2015, 01:31:12 pm
content: Quote from: JackP on May 26, 2015, 01:16:08 pmThat will cost you and make the design quite complicated (multiplexing analog signals and having a backplane for them, also the additional cost of B2B connectors etc.).It will probably make more sense to use digital sensors for the environmental parameters. E.g. 1-wire sensors.To measure voltage, current and resistance it might make more sense to integrate an existing DMM (cost, reliability, isolated) into it. Alternatively, if you want/need many channels it might make more sense to only have one converter and multiplex the inputs with relays like it is done in some "traditional" DAQ systems.Quote from: JackP on May 26, 2015, 01:16:08 pmYou'll probably want an external reference for it. Otherwise you shouldn't have a lot of trouble with it, if designed correctly.Quote from: JackP on May 26, 2015, 01:16:08 pmOne second will be too fast for many applications, especially those involving environmental parameters. So you'll be fine, probably.Don't make the mistake of underestimating the large effort it will take to create the necessary software to go with the data logger.

author: JackP
author_rank: Regular Contributor
timestamp: May 26, 2015, 01:38:11 pm
content: Would it not be possible to do without multiplexing - Just use the six ADC channels on the 328 for example?

author: Kleinstein
author_rank: Super Contributor
timestamp: May 26, 2015, 02:13:22 pm
content: Analog multiplexing is not that difficult. The AVR and essentially all other µCs use an internal multiplexer to connect to one of the analog inputs. There are also higher resolution ADCs with integrated multiplexer to provide more inputs. The more difficult part is protecting the inputs. Whether one uses the µC internal ADC, an external ADC or only digital sensors depends on what is to be measured.The initial description is more like a DMM with PC interface. Its handy and readily available.A datalogger usually has the benefit that it can operate independent from a PC at low power, and write the data to some kind of memory - today this usually is a SD card. The PC is only used to program the logger to set which channels and how fast data are taken and later to look at the data. For some test one might even use the logger directly with the PC connected, but this is more like an exception.

author: JackP
author_rank: Regular Contributor
timestamp: May 26, 2015, 02:22:11 pm
content: The point of this project is to learn how to interface my uC projects to the computer. That's why I'm connecting it to the PC; I can learn to make Python GUIs, and have a cool way to monitor environmental factors. Yes, I did say things like voltage and current, but they were just a thing to add, to give it some added functionality specifically for me.