Measuring and logging 24v DC

Hi,

After some reading around I just ordered an Arduino Giga R1 Wifi and an Arduino Giga Display (yes, I know this is total overkill for what I want to do with it, but want to tinker around with other stuff aswell).

I want to use the analog inputs to measure and log a 24v DC feed to look for fluctuations in voltage to try and isolate an intermittent issue we have with a machine. From the reading I've done this should be possible by sinking the voltage with resistors and smoothing it with a cap to be able to read it on one of the analog pins. I would like these values saved to an attached USB-stick to later be able to upload and convert it in excel or something or the like.

For funsies I would also like the screen to display a graph with the current voltage with X being time and Y being voltage, displaying maybe the last 10minutes of readings on a rolling basis - mostly just to learn how to use the screen so should be a good starting project.

I have a lot of experience with industrial automation from the hardware side, but not much on the software side unfortunately - so I see this as an opportunity to start diving down a bit into it without bruteforcing myself to learn Beckhoff or Mitsubishi PLC programming for example.

So my question - can you point me towards the correct path on where to read up about all of this?

  • Where to find info about how to store and export these values from the unit?
  • Where to find info about how to program the screen for my purpose?
  • Best rules to follow when tinkering around in Arduino?

Sorry if it's a bit much, I'm just a bit excited and want do dive in to this... :slight_smile:

Wouldn't that dampen the fluctuations?

If you have absolutely no experience with Arduino then I would stifle your impatience and start at the beginning!

As a quick search of either this forum or a broader one with Google Search will show, there are hundreds of resources accessible! Online or in paper book form. For a gentle start consider Simon Monks ‘“Programming Arduino; getting started with sketches“. Or the hefty “Arduino Cookbook”

1 Like

It is indeed quite a project to use an USB stick, try some tutorials and smaller projects before. And I heavily recommend you to buy an Arduino uno as well. That is the platform with the most help and tutorials about. But this could work too.

Oh yea, now that you say it the cap is a bad idea, thanks!

Thank you! I know I might be asking for a bit too much to start off with - but I will follow your advice and check out those :slight_smile:

Thank you! Didn't know exporting would be a huge ordeal so I'll get into reading about it.

Is there a big difference between the usage of the Giga and Uno? I might have jumped a bit ahead then - they way I understood it is it's basically the same unit but with more I/O and functionality, but the basics from the Uno should still be the same?

yes, the basics are the same, but out of experience I know that if you have to soon too many options and ports it becomes confusing really fast. So you can learn everything with the giga, but I would suggest that you stick to only 10 digital ports and 5 analog, just to learn also pin managing and extension. I would also consider trying to stay under the memory limit of the uno also for learning to try and limit the memory of your programs. And if you have all the basic than you can expand and try to reach the limits of your giga.

Not to mention, if you damage an Uno, it is cheaper to replace than a Giga.

1 Like

Aha, gotcha!

I will heed your advice and try to keep to the memory limit of the Uno, great idea! These are the small things that would probably end up with me having a Arduino spontaneously catch fire in my office otherwise :monkey_face: Totally new to memory management and such, so thanks a lot for the advice!

1 Like

That is very true. Although my employee pays for it and my budget is basically unlimited I'd very much prefer not waste money for the sake of wasting money :melting_face: I'll get my hand on an Uno aswell I think!

If you are ordering already, consider an Arduino kit. It looks a bit stupid, but often has interesting components and boards in it.

Great idea! Think this kit would work? https://www.kjell.com/se/produkter/el-verktyg/elektronik/utvecklingskit/arduino/arduino-kit/arduino-startpaket-p87875

Employee is very open to me learning anything I want to learn (work in technical development/process development) since it always brings some new knowledge to the table that can be used somewhere - so I will probably bring it home aswell to tinker around with.

I might be starting to think that since I'm very vested in the hardware side with some occasional PLC stuff that I was trying to start off a bit on the deep end :laughing: (egocentric?)

Perfect set, I think it is the same as my first one. I have to warn you, though. PLC and Arduino are totally different. The logic behind some code could be the same, but the tinkering and making process nothing alike. I have some teachers who tried to make the step without much help. I can say one thing, they used more tutorials than I have ever seen, I think.

If you are prepared and start with an open mind, it is going to be a lot easier.

Back to the main question (or part of it), since I don't care which Arduino you use, to measure that 24V voltage you mention, why not try the INA228, for example? It's a 20-bit power/energy/charge monitor with an I²C interface. You can use it to measure just the bus voltage.
INA228: Connection when using bus voltage only

1 Like

Oh, I dont have to deal with analog and resistors!

I'll have to look in to this one - and +85v on the bus? COOL, I can also use it for some of our 48v DC circuits!

Thanks stranger! I'll dig into this tomorrow!

Edit: Also noticed they have suppliers in Sweden, perfect!

The person that works for you tells you what you can and can't learn and spend money on?

Oh sorry, I meant employer ofcourse :grimacing:

Which ones, besides Elfa Distrelec?

You might like to consider using one of these Data Logging Shields with a Uno.

Saving your data to an SD card is relatively easy. It also has a real time clock making time-stamping easy.
:sweden:

2 Likes