for the logging you can use an CSV file and open it with format and it's pretty easy to create for example per each line you can have: TIME,VOLTAGE,CURRENT just use comma (, ) as separator between you values and excel should be able to put them in column for you
A smart engineer with a German accent makes his own power meter/logger but when not satisfied with just an oled screen, adds a data logger too, Great Job!!!
The best part about this video for me was the project file on easyeda. Not because I want to build this myself, but because I kept searching for a website like that and it is really useful for me. Thanks.
I know that this is very old, but one suggestion I have, for future use, is instead of having all those raw numbers flickering due to rapid, minor changes, is to create averaging routines for each number. That is, you grab a bunch of numbers as they change, for a field, and create a new variable that represents the "average" of a bunch of raw numbers. Then only output, to the LCD, that averaged number. This makes things a lot more stable. I started doing that long ago for any project that has number fields that could have minor changes. Things look much more professional without all that flickering. Hope that helps.
I love the INA219 module. I once used one to replace an expensive stepper motor with a far-cheaper and more powerful 12VDC gear motor. I had a n arm on the shaft of the motor, and I just blocked it so that it could not turn past the points where I wanted it to stop. Then I would start the motor turning and monitor the current. When the arm hit the block, the motor would start taking more current, and I would know it was time to shut it off. It was self-calibrating! It worked perfectly once I thought to drop a little super glue on the flange and motor shaft, because the motor was so powerful the flange set screws were not enough. Hint for your data logging: Have your Arduino log all data to a .csv file. Each line is a row of data, separated by commas, and you can even have the Arduino do some of your calculations for you and include them on the line. Stick the SD card into your computer, double-click the .csv file, and it opens up in Excel, each data point in it's own cell, nice neat rows and columns. Select a column, select "Insert", and insert a graph of the data, easy-peazy. Lastly, I know this video was created four years ago, but we now have some data logger modules. I got two of the ones you just plug an Arduino Nano into, and I got one of them working yesterday. The module gives you everything pre-wired, including a real time clock module. So you can time-stamp your data in the .csv file, you just need two more commas and columns, and you can see when that spike occurred. I like this data logger. I intend to program it to accept a string from another Arduino and log it, with a time stamp, to a .csv file. The string will be a pre-formatted string sent via SoftwareSerial.h. That way I have the complexity and memory requirements of the RTC and SD card set aside from the Arduino doing the real work, leaving precious memory for other things.
GS, This is one fantastic project. Made one and even added a few mods to the code. I didn't have to buy anything new or substitute. I had everything already and was going to design and code this exact design from scratch, but you did all the hard work for me, and I thank you for it. Also, thank goodness for these cheap modules. This and many other projects would not have even been possible only 5-10 years ago, without these cheap and wonderful modules from China.
I needed this last year and just abandoned the project, (cause I'm a beginner and couldn't find how to do it) will resume it in a few weeks when I have time. Thank you!
instead of writing it to a file and graphing via excel, i would rather send all data via UDP to influxdb and have real time graph using grafana, apart of this part, awesome video, thanks a ton !!!! Helped me so much
Thank you so much for this video and saying to use SdFat library. I have lost a lot of time, not knowing why I could not open a file on a SD card with a Chinese SD module and the SD library. I found nothing about it on many forums. Now it works ! GREAT !!
Great video. The resolution of the OLED display is not set correctly though. It is not set to the maximum resolution. Edit the library file in order to set the correct resolution 128x64 pixels .
@@ChoudryArif it's not hardware. I thought the same, and after 5 hours of troubleshooting I finally found the solution. You need to change a line of code from the library itself. Either way the display will work at half resolution, even if you change it from de IDE
@@BnMroGaming I don't know if the memory has been upgraded on the current models of the arduino, but from what I saw on the instructables site, they ran in on the 128X32 because of memory limitations. The 128X64 used too much.
A newer version that would support maybe 50V and 10A would be cool. That would cover not only the current USB standard but also those weird fast charging phones that use 10A.
I just started a similar build some days ago using a Pro Mini, ACS712 current sensor and the same OLED. Since I mostly record to my PC anyway my unit is powered using a USB port (thats not the input-port but a dedicated one) which also sends current values to the connected PC for display and recording. I opted to use the internal 1.1V reference instead on VCC, so changes in the PCs supply voltage don't offset the ADC that much. You might want to check this on your build if you connected the battery directly to VCC - afair VCC is used as the default reference for the ADC so your measurements might get skewed with falling battery voltage. Using the 1.1V also allowed me to dynamically scale for
Your OLED library is set on 128×32. Check the library (.h file) comment the line that defines (#define) the 128×32 resolution mode and uncomment the line with 128×64 :)
Awesome video, I really like how you created the data logger for power consumption, this will prove really useful for evaluating and diagnosing battery life.
You should modify the sketch to create a single CSV file (current, voltage and time separated by comma or semicolon), so you wouldn't have to copy the 3 txt files to Excel, but you could easily open with it, and create diagrams out-of-the-box. :)
There is an issue with the energy calculation in the sketch. The value being added to the total energy consumed has to consider the interval at which measurements are made. The interval is set in milliseconds, so a variable or constant for "measurementsPerHour = 3,600,000 / interval" has to be used as the divider when adding to the energy displayed in mWh. To provide an example using the 100ms interval used in the sketch: measurementsPerHour = 36,000 Now given 650mW for example, each interval adds 0.0186mWh to the energy total.
It's strange that it's only comment like that, a lot of people made this project and no one noticed wrong calculations. I had 6 wh instead 1.5 when i dig in i found that it's doesn't correspond to the time
I appreciate this comment was a long time ago, but my code is based off this video and I found the same problem, although i've found even though the interval is set to 100ms I only get an accurate wh reading if I divide by ~410ms intervals: (energy = energy + (power / 8780.4878);) is there a limit to the sample rate of the INA219? I thought it was supposed to be capable of ~14 samples a second (~every 71ms)
If you wrote a single text file in CSV format, you would save processing time and also time manually converting it to an Excel format afterwards as excel can open CSV (Comma-serperated variable) by default :)
Nice video! Tips: Output it into a csv formatted file instead and you can directly open it into any program suitable. Then you dont have to copy paste the rows :)
This is a very good project for measure DC power comsumption, and have a better estimation of how long a battery powered circuit will last. But not to calculate how much will cost you to charge your smartphone, for exmaple (0:25), because you are not measuring the AC power comsumption and you can't even estimate it because you don't know the power factor of your charger.
Dude, you are legend. One question from someone who has just seen this 7 years later.................IF you were to build this today but make it a self-powered version that logs data on any power generation projects (wind energy, harvesting vibrational energy, and other alt-energy projects) that can generate up to 50V, then how would do it? Would LOVE to see a remake of this one to be brought current.
You will probably increase the longevity of the SD card significantly by writing the 3 values as a CSV into a single file. For true long-term use, saving up the writes and writing them once every few minutes is probably advisable.
Currently I'm working on a similar project, but with a different approach. I try to use an ESP8266 and a Raspberry Pi, to build some kind of distributed power measurement system, for festivals, camps, larger installations an so on. Your video really helped with suggestions regarding the use of an SD-card and a LiPo-Battery, thanks a lot! Greetings from the "Lipperland" in Germany :)
Insane. I had to design a similar power meter for a project at my university and without ever having watched this video I basically designed the exact same system, using the exact same components !
greattscott you forgot to edit the adafruit library from the oled display. That is the reason why every second line of the display is blank as the library thinks youre using 128x32 and not 128x64 display.
Very impressed with your video. I would like to know if you can make or discuss about a project to battery monitoring for charging and discharging of lipo batteries and also discus about the best ways of using them with out over discharging them
Nice...I wonder how to learn electronics and really understand it...like when to use a capacitor or resistor or when to use this or use that in a circuit
Sweet. And already have two LCDs from cellphones that I took apart here. I don't really know if they are compatible with Arduono, but.. When I start studying it, I'm going to have it waiting for me. :)
For those who don't wanna buy or can't get the SD module, you don't need it. You can simply do a level shift with resistors (2.2k + 1k works for me) in the comunication pins (SCK, CS and MOSI). For the MISO of the SD card you can connect it directly to the Arduino as 3.3v it's logic HIGH. Of course, if you are using a 3.3v microcontroller (like the Arduino DUE) you don't need the level shift.
For writing values to a SD card it would be easier to separate them with a "TAB" Serial.print(value1); Serial.print('\t'); Serial.print(value2); In this way you can keep them in one file and copy them to excel. Tab will put them in a separate cells
continued... 1. replace the TimeFile, VoltFile, and curFile with DataFile = SD.open("PowerData.csv", FILE_WRITE); if (DataFile) { DataFile.print(currentMillis); DataFile.print(';'); DataFile.print(loadvoltage); DataFile.print(';'); DataFile.println(current_mA); DataFile.close(); } and 2. replace definitions with File DataFile; Hope it helps someone
Very nice Video again! Your OLED shows the line interleaving problem, I have as well with some of the SSD1306 I own. Never figured out the problem. The working ones are great displays, I love to use with u8glib.
Jens Fröbel Text looks stretched vertically, wonder if the oled library is set for 128 x 32 displays. Iirc I had to comment out a line somewhere in the library to adjust for 64px height displays.
I'm working on an expanded version of this for a project I'm working on :) Tracks a whole bunch of statistics for lithium ion battery management, coulomb counting, battery capacity over time, voltage cut off etc. I've been toying with the idea of adding an OLED display and SD card reader (this primarily so I can avoid writing to EEPROM too much). After watching your video I may just add these :D
Ross Bishop sweet have a very simple version of a power meter for a 10S battery on a skateboard. I used a bunch of zener diodes but in hindsight it burns quite a bit of power so thinking maybe voltage divider first then measure, any thoughts/ideas?
To measure the current? A hall sensor if you can grab one, I'm using one of the ACS712 jobbies you can get on eBay for a few quid. The 20A version outputs 100mV/A above about a 2.5V float voltage (I'm using a 5V Arduino Nano like in this video) and you can get down to 50mA resolution with the 10 bit ADC. There's a readily available 30A one too, 66mV/A so not quite as nice to work with and I think you might lose a bit of resolution, but yeah, works pretty well. I'm actually looking into oversampling or using an external ADC down the line to massively increase my accuracy of measurement.
Nice haven't used hall sensors before but sounds pretty straightforward was really just looking at voltage for now to get a rough percentage used but would be nice to measure current without a big shunt. I've been playing more with the ADC on the Arduino lately and hear you on getting a higher resolution external ADC, maybe will integrate that as well. Been just dipping into at home PCBs so fun tinkering with the components.
Shaun Husain The issue is voltage readings for battery charge are pretty terrible, at least with Lithium Ion. The voltage of Lithium Ion cells sags the more you load them. The voltage for a certain capacity @ 10A is much lower than for the same capacity at 1A. You'll get a very low percentage reading which when your system says "it's empty" will then bounce back up a bit and you realise you actually have 20%. What you can do is find a discharge graph for your cell type and create a look up table in long term storage of voltage against capacity for different load levels then use linear interpolation to work out an estimation of where you might be on those curves based on your average current load. It's kind of difficult to explain in a pinch, but if you drop to 4.1V for a 1A load and drop to 3.5V for a 10A load right at the beginning of a discharge cycle from 100%, you can use a formula that takes into account the load current, time and battery voltage to guess how charged or discharged it is. This becomes more difficult the more you vary the current over time so it's not very reliable overall, but better than a straight up single curve. You're better off doing coulomb counting like my system does but it does get difficult to keep track of the charge which has entered and left the battery. Just be careful with Lithium cells, they're pretty dangerous, make sure you have an alarm or other means of a sure thing cut off voltage so you don't go too low and permanently damage the battery. Use a reliable balance charger to charge it too.
Ross Bishop Yup so far I used a circuit simulator to show a 42-37V input and figured out what resistors and zener diodes to put in there ahead of a row of LEDs and then printed the corresponding board and wired it up and works fine for the moment. Like you said the voltage dips might be a problem I haven't actually tested it under load yet but I really just want a round about idea of how much charge the board has. Thanks for pointing out LiPo safety, I have a decent balance charger and the speed controller I use automatically starts dropping power draw at a set voltage (believe i have it at 38V right now for the 10S battery) and cuts off entirely well before the cells would be down to 3.3V. What I have as is isn't ideal cause it is draining 3W of power when the batteries are fully charged so gets quite warm (everything is rated to deal with the wattage but in a plastic container so without air cooling of motion could be a problem). Nice thing with the current setup is it's all simple components with no microcontroller. I may hook the board up to a momentary push button to get around the problem or may end up just giving in and using another micro controller :) Thanks also for the idea about accounting for the current draw while checking the voltage great idea if I end up going the micro controller route too (already an arduino in there actually).
Actually you can combine simply the INA219 boardwith a regular Arduino, and send the measured data through the serial port, then read it on your PC with a program like SerialPlot. After some tweaking I got about a 3k sps out of it, measuring current. Great and cheap homemade, lowend oscilloscope like thingy. :)
if i were you i would save the 3 files into a single csv file. you can read up on them, but here is the format you save them in. The file name should be "Your_csv_file" ".csv", and the inside of the file should be: val1a,val2a,val3a, (carriage return) val1b,val2b,val3b, (carriage return) the commas separate each value and the values are not limited to numbers, further csv files can be opened and edited by any spreadsheet program such as csv, this can make working with the data far easier.
Rock on! I have several of those little OLEDs - Watch out for cheap clones out of china... quality control is generally non-existant... Plus shipping incidents can easily cause damage. I have created INA219+ESP8266 based solar power / environment monitoring / logging / controlling devices. Slowly building my own smart house :) #iot
Great video! BTW, I saw a few videos of people creating an 18650 battery capacity tester, much like what you did here. Looks something you should definitely make! :)
I see that you are using the 128x64 OLED in 128x32 mode too! I built the same thing but I could not fit evrything in the Nano and still have enough RAM for the OLED so i though WTH, lets try at half the width and it worked! In another project I used 2 Nanos and some interesting i2c communication between them to share the load and have the OLED working properly!
Actually calculation of energy is bitt wrong, if you divide power by 3600 which is 60 * 60 then the interval must be 1 sec or 1000 ms but in this case interval is 100 ms so we also have to multiply by 10 because 100 ms is 10 times smaller than 1000 ms
Wayne Johnson agree also for live graphs can send the data over serial and parse and display a graph with processing.org pretty easily. Serial library there is basically the same and similar setup and loop code structure.
the sdfat32 library he was using should be able to write any simple text based file type, a csv file is a simple text based file type. and by simple text based i mean if you were to change the extension to .txt you would be able to read the contents of the file without parsing anything.
I really like your projects - and your videos too :). But maybe you could talk more in the end what might be coming next or include your audience actively. Maybe yo could ask something like "what shall we do next time?" - you get the point
Use the u8glib instead of "Adafruit_SSD1306". There are no more empty lines in the displayed text, so it looks a lot better. Also... it works with a lot more types of displays.
*Build or Buy suggestion Jeremy* I just came across a comment by someone on one of Julien Iliett's videos where the commenter said he tried to graph the output of an INA219. He said the readings were all over the graph and useless/none repeatable. He mentioned that he had achieved stable performance using an ADS1115 ADC (or maybe it was '16 or '17). He also mentioned he was using it in differential mode on 2 channels. That kind of characterization and comparison would probably be easy for you, especially with this video's project...if you still have it around. -Jake
You are so creative :o all of your projects are hightest quality, and I learned more about electronics watching your videos! Thank you for inspiring me be better electrican! ;)
I always love the ideas you bring up on CZcams and instructables! Rather than buy a power meter, I think I will build based on your design. I can assume you will be publishing another 'ible for this?
@GreatScott, I'm really enjoying your Arduino tutorials. When I am just a little better, I will start my own channel to share with everyone like you have. In this video, when you are using Easy,EDA ...how are you able to move a component and have the wires follow? When I make wires, the component moves, nut the wires stay! :) Thanks again!
I sometimes struggle to find the proper words to express how much respect I have for projects you so openly provide. Thank you!!
You're welcome
for the logging you can use an CSV file and open it with format and it's pretty easy to create for example per each line you can have:
TIME,VOLTAGE,CURRENT
just use comma (, ) as separator between you values and excel should be able to put them in column for you
Wow, I just realized how much time and effort it must take to make these videos.
And this is only 6-7 minutes long. Damn.
A smart engineer with a German accent makes his own power meter/logger but when not satisfied with just an oled screen, adds a data logger too, Great Job!!!
The best part about this video for me was the project file on easyeda. Not because I want to build this myself, but because I kept searching for a website like that and it is really useful for me. Thanks.
No problem ;-)
Perfect. This is exactly what I am looking for to experiment with small garden wind generators and other projects. Thanks for showing me the way.
I know that this is very old, but one suggestion I have, for future use, is instead of having all those raw numbers flickering due to rapid, minor changes, is to create averaging routines for each number.
That is, you grab a bunch of numbers as they change, for a field, and create a new variable that represents the "average" of a bunch of raw numbers. Then only output, to the LCD, that averaged number.
This makes things a lot more stable.
I started doing that long ago for any project that has number fields that could have minor changes. Things look much more professional without all that flickering.
Hope that helps.
I love the INA219 module. I once used one to replace an expensive stepper motor with a far-cheaper and more powerful 12VDC gear motor. I had a n arm on the shaft of the motor, and I just blocked it so that it could not turn past the points where I wanted it to stop. Then I would start the motor turning and monitor the current. When the arm hit the block, the motor would start taking more current, and I would know it was time to shut it off. It was self-calibrating! It worked perfectly once I thought to drop a little super glue on the flange and motor shaft, because the motor was so powerful the flange set screws were not enough.
Hint for your data logging: Have your Arduino log all data to a .csv file. Each line is a row of data, separated by commas, and you can even have the Arduino do some of your calculations for you and include them on the line. Stick the SD card into your computer, double-click the .csv file, and it opens up in Excel, each data point in it's own cell, nice neat rows and columns. Select a column, select "Insert", and insert a graph of the data, easy-peazy.
Lastly, I know this video was created four years ago, but we now have some data logger modules. I got two of the ones you just plug an Arduino Nano into, and I got one of them working yesterday. The module gives you everything pre-wired, including a real time clock module. So you can time-stamp your data in the .csv file, you just need two more commas and columns, and you can see when that spike occurred. I like this data logger. I intend to program it to accept a string from another Arduino and log it, with a time stamp, to a .csv file. The string will be a pre-formatted string sent via SoftwareSerial.h. That way I have the complexity and memory requirements of the RTC and SD card set aside from the Arduino doing the real work, leaving precious memory for other things.
I'm really glad you took your time to properly design the board and have it compact and neat
GS, This is one fantastic project. Made one and even added a few mods to the code.
I didn't have to buy anything new or substitute. I had everything already and was going to design and code this exact design from scratch, but you did all the hard work for me, and I thank you for it. Also, thank goodness for these cheap modules.
This and many other projects would not have even been possible only 5-10 years ago, without these cheap and wonderful modules from China.
I needed this last year and just abandoned the project, (cause I'm a beginner and couldn't find how to do it) will resume it in a few weeks when I have time. Thank you!
I really like this one, I managed to buy all the modules for less than 5 bucks. I already have an UNO lent to us by our teacher.
instead of writing it to a file and graphing via excel, i would rather send all data via UDP to influxdb and have real time graph using grafana, apart of this part, awesome video, thanks a ton !!!! Helped me so much
Thank you so much for this video and saying to use SdFat library. I have lost a lot of time, not knowing why I could not open a file on a SD card with a Chinese SD module and the SD library. I found nothing about it on many forums. Now it works ! GREAT !!
Great video. The resolution of the OLED display is not set correctly though. It is not set to the maximum resolution. Edit the library file in order to set the correct resolution 128x64 pixels .
@@ChoudryArif it's not hardware. I thought the same, and after 5 hours of troubleshooting I finally found the solution. You need to change a line of code from the library itself. Either way the display will work at half resolution, even if you change it from de IDE
@@BnMroGaming I don't know if the memory has been upgraded on the current models of the arduino, but from what I saw on the instructables site, they ran in on the 128X32 because of memory limitations. The 128X64 used too much.
@@BnMroGaming hey lets talk i need your fb
A newer version that would support maybe 50V and 10A would be cool. That would cover not only the current USB standard but also those weird fast charging phones that use 10A.
I just started a similar build some days ago using a Pro Mini, ACS712 current sensor and the same OLED. Since I mostly record to my PC anyway my unit is powered using a USB port (thats not the input-port but a dedicated one) which also sends current values to the connected PC for display and recording. I opted to use the internal 1.1V reference instead on VCC, so changes in the PCs supply voltage don't offset the ADC that much. You might want to check this on your build if you connected the battery directly to VCC - afair VCC is used as the default reference for the ADC so your measurements might get skewed with falling battery voltage. Using the 1.1V also allowed me to dynamically scale for
BitBastelei Hey
Gar nicht erwartet dich hier zu sehen👋
Your OLED library is set on 128×32. Check the library (.h file) comment the line that defines (#define) the 128×32 resolution mode and uncomment the line with 128×64 :)
Awesome video, I really like how you created the data logger for power consumption, this will prove really useful for evaluating and diagnosing battery life.
learned more from your channel in the past month than an entire year in school love your channel!
You should modify the sketch to create a single CSV file (current, voltage and time separated by comma or semicolon), so you wouldn't have to copy the 3 txt files to Excel, but you could easily open with it, and create diagrams out-of-the-box. :)
Wonderful approach to build a custom power meter
I like that little character/dot display you're using
I really liked the way he skimmed over the code, It's nice to see the code without downloading the file :D.
Just got all my parts in the mail today. I'm going to rig one of these up.
Thanks! This is exactly the type of system I need for monitoring battery charge and discharge times. I plan to use the larger 2.42" OLEDs.
There is an issue with the energy calculation in the sketch.
The value being added to the total energy consumed has to consider the interval at which measurements are made. The interval is set in milliseconds, so a variable or constant for "measurementsPerHour = 3,600,000 / interval" has to be used as the divider when adding to the energy displayed in mWh.
To provide an example using the 100ms interval used in the sketch: measurementsPerHour = 36,000
Now given 650mW for example, each interval adds 0.0186mWh to the energy total.
It's strange that it's only comment like that, a lot of people made this project and no one noticed wrong calculations. I had 6 wh instead 1.5 when i dig in i found that it's doesn't correspond to the time
I appreciate this comment was a long time ago, but my code is based off this video and I found the same problem, although i've found even though the interval is set to 100ms I only get an accurate wh reading if I divide by ~410ms intervals: (energy = energy + (power / 8780.4878);) is there a limit to the sample rate of the INA219? I thought it was supposed to be capable of ~14 samples a second (~every 71ms)
If you wrote a single text file in CSV format, you would save processing time and also time manually converting it to an Excel format afterwards as excel can open CSV (Comma-serperated variable) by default :)
Nice video! Tips: Output it into a csv formatted file instead and you can directly open it into any program suitable. Then you dont have to copy paste the rows :)
Danke für die Screenvideos beim Programmieren und PCB Layout, sehr angenehm
A german comment.
This is a very good project for measure DC power comsumption, and have a better estimation of how long a battery powered circuit will last. But not to calculate how much will cost you to charge your smartphone, for exmaple (0:25), because you are not measuring the AC power comsumption and you can't even estimate it because you don't know the power factor of your charger.
Dude, you are legend. One question from someone who has just seen this 7 years later.................IF you were to build this today but make it a self-powered version that logs data on any power generation projects (wind energy, harvesting vibrational energy, and other alt-energy projects) that can generate up to 50V, then how would do it? Would LOVE to see a remake of this one to be brought current.
You will probably increase the longevity of the SD card significantly by writing the 3 values as a CSV into a single file. For true long-term use, saving up the writes and writing them once every few minutes is probably advisable.
Currently I'm working on a similar project, but with a different approach. I try to use an ESP8266 and a Raspberry Pi, to build some kind of distributed power measurement system, for festivals, camps, larger installations an so on.
Your video really helped with suggestions regarding the use of an SD-card and a LiPo-Battery, thanks a lot!
Greetings from the "Lipperland" in Germany :)
CZcamsrs like you make me want to get a degree in electronics engineering!
For those kind of small oled screens, I would strongly suggest to use the Libgdx library rather than the adafruit one.
this is awesome, thanks for the sharing. especially the sdfat library.
Insane. I had to design a similar power meter for a project at my university and without ever having watched this video I basically designed the exact same system, using the exact same components !
The SD library works only with cards up to 2 GB. You used an SD card with 8GB. That's why it worked with the SDFat library.
greattscott you forgot to edit the adafruit library from the oled display. That is the reason why every second line of the display is blank as the library thinks youre using 128x32 and not 128x64 display.
Thanks for telling me. I will have a look at it.
sabes como se debe arreglar la libreria, no entiendo como hacerlo.. porfavor ayuda
Your SdFat really solved the same problem...Lot of thanks Great Scott!!
Awesome! I'm building an overkill volt amp meter for i2c debugging. Ina219 and ina3221. Also a 1115 16 but ADC for a WCS1800 Hall effect sensor module
Very impressed with your video.
I would like to know if you can make or discuss about a project to battery monitoring for charging and discharging of lipo batteries and also discus about the best ways of using them with out over discharging them
Nice...I wonder how to learn electronics and really understand it...like when to use a capacitor or resistor or when to use this or use that in a circuit
As always that you for you projects.
This is yet another class project.
Sweet. And already have two LCDs from cellphones that I took apart here. I don't really know if they are compatible with Arduono, but.. When I start studying it, I'm going to have it waiting for me. :)
This is a really great little project !
For those who don't wanna buy or can't get the SD module, you don't need it. You can simply do a level shift with resistors (2.2k + 1k works for me) in the comunication pins (SCK, CS and MOSI). For the MISO of the SD card you can connect it directly to the Arduino as 3.3v it's logic HIGH. Of course, if you are using a 3.3v microcontroller (like the Arduino DUE) you don't need the level shift.
Great vidio. Here is a suggestion for your next project: build a quad or make a wireless headphones with one of the bluetooth audio reciever
GreatScott! Nice explanation and a beautiful simple integration project.
I Like!
congrats on 420k subs
oh dank
I love his hand writing
That's awesome DIY project for your video list.
I will try this one. Thanks to uploaded it.
For writing values to a SD card it would be easier to separate them with a "TAB" Serial.print(value1); Serial.print('\t'); Serial.print(value2);
In this way you can keep them in one file and copy them to excel. Tab will put them in a separate cells
continued...
1. replace the TimeFile, VoltFile, and curFile with
DataFile = SD.open("PowerData.csv", FILE_WRITE);
if (DataFile) {
DataFile.print(currentMillis);
DataFile.print(';');
DataFile.print(loadvoltage);
DataFile.print(';');
DataFile.println(current_mA);
DataFile.close();
}
and 2. replace definitions with File DataFile;
Hope it helps someone
Thanks for keeping me creative and sure you will see me next time !
In a future video can you make a multimeter wich is like the Mooshimeter? It would be a really big help! :D
Dávid Illyés have you been watching ElectroBoom? 😂
Yapp :D
Very nice Video again! Your OLED shows the line interleaving problem, I have as well with some of the SSD1306 I own. Never figured out the problem. The working ones are great displays, I love to use with u8glib.
Jens Fröbel Text looks stretched vertically, wonder if the oled library is set for 128 x 32 displays. Iirc I had to comment out a line somewhere in the library to adjust for 64px height displays.
Nice device. I would recommend to use .csv format wchich can be opened via Excel. Also this format is easy to implement on arduino
slight correction, in order to measure current you need to be in parallel with the shunt resistor
I'm working on an expanded version of this for a project I'm working on :)
Tracks a whole bunch of statistics for lithium ion battery management, coulomb counting, battery capacity over time, voltage cut off etc. I've been toying with the idea of adding an OLED display and SD card reader (this primarily so I can avoid writing to EEPROM too much).
After watching your video I may just add these :D
Ross Bishop sweet have a very simple version of a power meter for a 10S battery on a skateboard. I used a bunch of zener diodes but in hindsight it burns quite a bit of power so thinking maybe voltage divider first then measure, any thoughts/ideas?
To measure the current? A hall sensor if you can grab one, I'm using one of the ACS712 jobbies you can get on eBay for a few quid.
The 20A version outputs 100mV/A above about a 2.5V float voltage (I'm using a 5V Arduino Nano like in this video) and you can get down to 50mA resolution with the 10 bit ADC. There's a readily available 30A one too, 66mV/A so not quite as nice to work with and I think you might lose a bit of resolution, but yeah, works pretty well.
I'm actually looking into oversampling or using an external ADC down the line to massively increase my accuracy of measurement.
Nice haven't used hall sensors before but sounds pretty straightforward was really just looking at voltage for now to get a rough percentage used but would be nice to measure current without a big shunt. I've been playing more with the ADC on the Arduino lately and hear you on getting a higher resolution external ADC, maybe will integrate that as well. Been just dipping into at home PCBs so fun tinkering with the components.
Shaun Husain The issue is voltage readings for battery charge are pretty terrible, at least with Lithium Ion. The voltage of Lithium Ion cells sags the more you load them. The voltage for a certain capacity @ 10A is much lower than for the same capacity at 1A. You'll get a very low percentage reading which when your system says "it's empty" will then bounce back up a bit and you realise you actually have 20%.
What you can do is find a discharge graph for your cell type and create a look up table in long term storage of voltage against capacity for different load levels then use linear interpolation to work out an estimation of where you might be on those curves based on your average current load.
It's kind of difficult to explain in a pinch, but if you drop to 4.1V for a 1A load and drop to 3.5V for a 10A load right at the beginning of a discharge cycle from 100%, you can use a formula that takes into account the load current, time and battery voltage to guess how charged or discharged it is. This becomes more difficult the more you vary the current over time so it's not very reliable overall, but better than a straight up single curve.
You're better off doing coulomb counting like my system does but it does get difficult to keep track of the charge which has entered and left the battery.
Just be careful with Lithium cells, they're pretty dangerous, make sure you have an alarm or other means of a sure thing cut off voltage so you don't go too low and permanently damage the battery. Use a reliable balance charger to charge it too.
Ross Bishop Yup so far I used a circuit simulator to show a 42-37V input and figured out what resistors and zener diodes to put in there ahead of a row of LEDs and then printed the corresponding board and wired it up and works fine for the moment. Like you said the voltage dips might be a problem I haven't actually tested it under load yet but I really just want a round about idea of how much charge the board has.
Thanks for pointing out LiPo safety, I have a decent balance charger and the speed controller I use automatically starts dropping power draw at a set voltage (believe i have it at 38V right now for the 10S battery) and cuts off entirely well before the cells would be down to 3.3V.
What I have as is isn't ideal cause it is draining 3W of power when the batteries are fully charged so gets quite warm (everything is rated to deal with the wattage but in a plastic container so without air cooling of motion could be a problem). Nice thing with the current setup is it's all simple components with no microcontroller. I may hook the board up to a momentary push button to get around the problem or may end up just giving in and using another micro controller :)
Thanks also for the idea about accounting for the current draw while checking the voltage great idea if I end up going the micro controller route too (already an arduino in there actually).
Actually you can combine simply the INA219 boardwith a regular Arduino, and send the measured data through the serial port, then read it on your PC with a program like SerialPlot. After some tweaking I got about a 3k sps out of it, measuring current. Great and cheap homemade, lowend oscilloscope like thingy. :)
You could have added a way for the display to display the battery's voltage (AKA battery percentage)
if i were you i would save the 3 files into a single csv file. you can read up on them, but here is the format you save them in. The file name should be "Your_csv_file" ".csv", and the inside of the file should be:
val1a,val2a,val3a, (carriage return)
val1b,val2b,val3b, (carriage return)
the commas separate each value and the values are not limited to numbers, further csv files can be opened and edited by any spreadsheet program such as csv, this can make working with the data far easier.
Your channel is amazing!!!! Thank you so much for being around!!
How come multimeter refresh rates are so low compared to this? This was cheap and fast, most high end multimeters measure a lot slower than this.
chems Hey, Osama!
What can I say , simply clever , thank you again Scott
Nice work. You build beautiful diagrams
Rock on! I have several of those little OLEDs - Watch out for cheap clones out of china... quality control is generally non-existant... Plus shipping incidents can easily cause damage.
I have created INA219+ESP8266 based solar power / environment monitoring / logging / controlling devices. Slowly building my own smart house :) #iot
Great video! BTW, I saw a few videos of people creating an 18650 battery capacity tester, much like what you did here. Looks something you should definitely make! :)
I see that you are using the 128x64 OLED in 128x32 mode too! I built the same thing but I could not fit evrything in the Nano and still have enough RAM for the OLED so i though WTH, lets try at half the width and it worked! In another project I used 2 Nanos and some interesting i2c communication between them to share the load and have the OLED working properly!
Happy holidays, always quality content here, nice project
Thanks :-)
Think your videos are great and I'd love to see your take on homemade automated blinds. Stay chill
Very Nice Work! Congratulations!
Actually calculation of energy is bitt wrong, if you divide power by 3600 which is 60 * 60 then the interval must be 1 sec or 1000 ms but in this case interval is 100 ms so we also have to multiply by 10 because 100 ms is 10 times smaller than 1000 ms
Easier to create CSV file DATA.csv and comma separated values.
That's what I came here to say :)
I thought exactly the same.
Wayne Johnson agree also for live graphs can send the data over serial and parse and display a graph with processing.org pretty easily. Serial library there is basically the same and similar setup and loop code structure.
the sdfat32 library he was using should be able to write any simple text based file type, a csv file is a simple text based file type. and by simple text based i mean if you were to change the extension to .txt you would be able to read the contents of the file without parsing anything.
nerds
I really like your projects - and your videos too :). But maybe you could talk more in the end what might be coming next or include your audience actively. Maybe yo could ask something like "what shall we do next time?" - you get the point
Very Nice , Thanks GreatScott!
I believe you have a plan with this in future
I think this is one of your best Scott. Thank you
Subbed only because of his great accent!!!
I'm building this many thanks for sharing
This one looks interesting , when i finally get off my arse and get some new batteries for my UPS i am so installing this into it :),
yes!! that's the great project
Thanks ;-)
It would be great if you do also AC measurement
Now this is an excellent project!
cant wait for wireless charging project 😀
Use the u8glib instead of "Adafruit_SSD1306".
There are no more empty lines in the displayed text, so it looks a lot better.
Also... it works with a lot more types of displays.
*Build or Buy suggestion Jeremy*
I just came across a comment by someone on one of Julien Iliett's videos where the commenter said he tried to graph the output of an INA219. He said the readings were all over the graph and useless/none repeatable. He mentioned that he had achieved stable performance using an ADS1115 ADC (or maybe it was '16 or '17). He also mentioned he was using it in differential mode on 2 channels.
That kind of characterization and comparison would probably be easy for you, especially with this video's project...if you still have it around.
-Jake
I think the comment mentioned was on this video:
czcams.com/video/8ikyp4lu45M/video.html
You are so creative :o all of your projects are hightest quality, and I learned more about electronics watching your videos! Thank you for inspiring me be better electrican! ;)
I apreciate all your work! Nice job! (And please make a walkie talkie or an intercom if you can. That is what i need around the house :). )
exactly what I've been looking for mate... awesome, will keep you posted
Man... I am happy to find your channel. Great videos!
This is what you call a real "DIY"
TP4056 gets hot when charging, so i do not recommend maunting it on the top of the battery, or near termo sensors.
you can just mod it for 500mA, or lower ;)
I always love the ideas you bring up on CZcams and instructables!
Rather than buy a power meter, I think I will build based on your design. I can assume you will be publishing another 'ible for this?
@GreatScott, I'm really enjoying your Arduino tutorials. When I am just a little better, I will start my own channel to share with everyone like you have.
In this video, when you are using Easy,EDA ...how are you able to move a component and have the wires follow? When I make wires, the component moves, nut the wires stay! :)
Thanks again!
GREAT SCOTT! ( I love that expression ) Another fantastic video.
Awesome video Scott!