I enjoy your style of videos very much. Making errors, discussing them and getting closer to the solution step by step is very satisfying. I feel like I'm learning a lot from you. Thanks!
Awesome! I do find your "stream of consciousness" videos so much more pleasing and, possibly, more educational than the "here's one I prepared earlier" presentations that litter UA-cam.
@@JulianIlett Sure wish you would get back to this series, I still have dozens of unused Arduino's and ESP8266's, 32's and a blue pill laying around waiting for a great project!
Julian, when doing maths never trust the operator order but use brackets to enforce the order that terms are evaluated. As equations grow with the programs complexity, the use of brackets helps to minimise bugs later down the line.
I understand what you're saying, but the operator precedence rules are absolute and unambiguous. Brackets can help with readability, but aren't essential.
Not essential but in my professional life, I've seen too many program bugs introduced due to lack of brackets. So I always use and "preach" to others to use them. Even in simple 3 term equations (as they always grow in real life programs). It's like I will use the car's indicators even if it isn't strictly required by the Highway Code (when there is no visible traffic or pedestrians) as it's easier to do so than to have special cases. P.S. Hope this doesn't sound too preachy or worse as it was meant as helpful to others.
You'd be amazed at the number of people in my locality that think indicators are an option. As is using the correct lane on dual carriageways and being in the correct lane at junctions. Mind boggling some of the idiots on the roads today.
True. And it appears makers of larger cars now cater to such mentality and seem to offer indicators as prohibitively expensive add-on packages, and if they are indeed sold, they only work sporadically and can only be operated at great physical pain to the driver ...
So glad I'm not the only one who makes those odd doofus mistakes! Trouble is, I can spend hours looking for them (unless you did and edited that bit out :-) )
It is amazing what I just learned from this video. I was proud of myself. There were things I "guessed" before you did them and I was right and you were right. I love watching your videos, Julian. You are just great. I am eventually going to get the heater/furnace. I want to do more research as it involves fire. I want to make sure I understand it fully. I am sure it will be OK. A guy (Living the Van Life) put one in his VW Westfalia and did an awesome job. I think it is working great for him. Thanks Julian. And Yes! I now have a better understanding of how to make a working OLED Ammeter and Watt Meter. Awesome!!
While the jumping 'mA' ia annoying, the jumping value with negative/positive values is worse. Better than fix 'mA' display position, test for +/- values and display a leading Space Character for +ve values and a minus sign for -ve. Thenm there's no jumping on the screen at all.
You don't know how many times I've yelled at the screen to right-justify the whole thing! I'm thinking, ok, the next change will be, the next change will be.... And then believe it or not -- you put the units on the right but continue to leave the number jumping around!!!! Agggghh!!! It's okay, I really love your videos Julian!
Hi Julian, I have been experimenting, I can confirm the differential signal on CAN does not need a reference ground. It's quite neat. Lovely job on this, very cute meter. Always fancied building my own test gear. Closest I have ever got are building soak test rigs.
The INA219 actually calculates the load power internally, but the ability to read the power register was missed out of the Adafruit library. It was added in an update which you can download here: github.com/adafruit/Adafruit_INA219/tree/dff62cd6696762dfea615bd01b0074e4081ef2ca You'll see in the updated example that this library has an added function: ina219.getPower_mW() Of course using it still depends on grounding the other side of the load. I'm not sure there's any real benefit over calculating within the sketch, but if all you want to display is power then it saves a few steps.
Updating won't change anything... they never accepted the pull request, so it hasn't actually been added to the library. Wonder what the chances of it happening anytime soon since it's been languishing there for four years now... So for the moment, you'll have to manually edit the library to add that feature. github.com/adafruit/Adafruit_INA219/pull/16/commits
It's great when you shove a wire in and NO Bang all working as it should made me laugh LOL No idea what I am doing watching this at 01:46am UK time tho
What I like about the Videos of Ralph Bacon, Andreas Spiess, BigClive and Julian Ilett -besides being interesting- is that they speak very clear and civilised and don't start with 'Wassup guys'
a great idea is to modify this circuit adding only one high power resistor and some code to make it auto measure the internal resistance of any battery. i am trying to do that but your skills are better. i think everyone will find that usefull.
Why not use a smaller font for the units? And put it in the lower right corner. It does consume a bit more memory for the extra font, but will solve your problem and looks nice as well.
Off topic, but they noticed have another batch of those little clocks controlled from the DCF atomic clock in Lidl today. The one I bought picked up the signal and went to the correct time in about 2 minutes. The 'as the crow flies' distance is just about 550 miles from here to the signal site.
I've got a british (MSF) one that barely gets a signal in britain... be a worthwhile rainy day video to open it up and probe the rf end with the scope, could potentially also check the frequency meter kit build from January since the rf is derived from an atomic clock standard.
Julian, I'd recommend taking a look at the INA219 datasheet, especially sections 8.4.1 (filtering), 9.2 (typical application), and 8.5.2 (calibration). Adafruit's library doesn't support it (you'll need to access the registers yourself) but the INA219 chip actually supports doing the power calculation itself. Also, tuning the calibration to your application can help increase the precision of the values returned.
You could "cheat"; since you already have the reading in mA, and you know the value of the current-sense resistor, just use Ohm's Law, and the Power Law, and simply calculate (current^2)*resistance to get power, then divide by 1000 to convert mW to Watts (if desired). :)
Jilian, Please try to zoom in to your code so we can see what you are talking about. All your code modification videos are frustrating. So much white screen, for what benefit?
If you like the larger 32 font size then it might be more convenient to add a micro button to manually cycle through the display types. Automatically convert any value more than 999 milliamps to display as amps. I haven't tested this code I wrote it off the top of my head, it's just an example. void loop (void) { float current_mA = 0; u8g2.clearbuffer(); u8g2.setFont(u8g2_font_logisoso32_tr); // 32 denotes 32 px font size, change the number to change the font size. current_mA = ina219.getCurrent_mA(); current_A= current_mA/1000.0; if (current_mA > 999){ // If value is more than 999 milliamps display in amps u8g2.SetCursor (0,32); // Left aligned amp value u8g2.print(current_A,1); // Displays amps to 1 decimal place u8g2.SetCursor (85,32); // Right aligned A u8g2.println ("A"); u8g2.SendBuffer(); delay (200); } else { // otherwise display in milliamps u8g2.SetCursor (0,32); // Left aligned milliamp value u8g2.print(current_mA,1); // Displays milliamps value to 1 decimal place u8g2.SetCursor (77,32); // Right aligned mA u8g2.println ("mA"); u8g2.SendBuffer(); delay (200); } // close the if/else statement } // close the void loop The only way to change font size using the u8g2 library is to choose a smaller font. The font itself is the font size. github.com/olikraus/u8g2/wiki/fntlistall#16-pixel-height Hope this helps others with their projects. :)
I am attempting to put together some gear for fixing old radios on a shoestring budget (Forced upon me by the State who declared me, a 100 percent disabled cop retired. In their congratulations memo, they informed me that since I was retired, they cut my paycheck in half.) So, this should get me a nice watt/mA meter to test the power in the units I work on.
when in the Arduino ide working on small bits of code such as this one, could you not increase the size of the font (under file|preferences) so we can see the code on smaller screens with older eyes...
Julian, just a suggestion, change the font size for the W/mA/V to 1/3 size on the right hand side - have W top right, mA top right and centre right (above each other) and V bottom right. Also put a zero crossing point in the code - i.e. display "0" until a positive is detected (unless you want to measure -ve voltage etc.) and add a damping factor so the display only updates every 250ms or such like to prevent the display jumping (unless you like that?) - once you get beyond two decimal places how many people really care? If so - use a proper multimeter! Thx. for the vids.
I was thinking about how your 12v 5w light was not putting out 5w@12v. Then it hit me, it was actually designed for a vehicle correct? Then it probably puts out 5W closer to 14V because when a car is running it usually puts out just over 14v from the alternator. Anyways, I am no expert but I think that may be a case of just making it simple for the consumer. it goes in a 12v car, and should draw about 5w when in use. Love your stuff. I always look forward to your next video.
True, I don't know the specs, but I am rather sure that shunt resistors will never cause a voltage drop enough to drop 2v from 12. They are usually really really small values.
Crisan, the ina219 sense resistor is only 0.1R, so for this globe the burden voltage would only be about 40mV. The real reason is as others have said, nominal running vehicle voltage is 13.8v
How would you modify this circuit if you wanted isolation between the bulb and the wattmeter? How would you avoid connecting the grounds together? (I know that the INA219 doesn't provide isolation, but let's assume you were using something like the ACS712, which uses the Hall effect for measurement.)
Be careful when your playing with ground references that are not floating as you may have catastrophic failures that kill your equipment. EEVBLOG has a great video on this.
Nope, that would calculate the power being dissipated in the current sense resistor, not the load. No way of avoiding a third connection to measure the voltage across the load I'm afraid.
perhasp you could add a digital filter on your measure. I do this by make 8 acquisition , sum then divise for display average. Sorry for my poor english
Now let's put the output to a larger screen, perhaps one of those Nokia ones so you can display both Watts and mA one below the other for a full service meter.
You can improve the Amps resolution by calling ina219SetCalibration_16V_400mA() from your Adafruit_INA219 instance. But first you have to move ina219SetCalibration_16V_400mA() from the 'private' (dunno why they put it there) to the 'public' methods in ''Adafruit_INA219.h". There's also a ina219SetCalibration_32V_1A() method.
By using the voltage measuring trick, notice that you are probably making the ammeter input polarized. Imagine what would happen if you connected the 12v bulb supply backwards in the circuit... Wouldn't the voltage at the load connector be negative in respect to the arduino ground? How would the arduino behave in such a case? Hmmm.... Maye you can try this.
I was so close to doing that - I looked at the other sizes of this particular font. But I kinda knew it would all fit when converted into a Wattmeter :)
I am thinking about conditioning the signal that when the signal is equal or greater than zero to put a "+" char in front of the print, so that it will fluctuate with "+" or "-" char in front of the value .. or use the absolute value :)
can you remake this with 2 above displays in one promini and current module for showing watt and current in each display with change of i2C address and jumper position on back side of lcd
Hi iv seen you use a screwdriver tool on the plastic multi turn presets with the brass screw on the top. Could you please let me know what the tool is called so I can order one of ebay. Thanks jon
you can change the font size of the mA, nA and W if you want. i feel like those take up way too much space on the screen but might just be me. should be via u8g2.setFont(u8g2_font_7x14B_tf); you can pick different fonts from here github.com/olikraus/u8g2/wiki/fntlistall#all-u8g2-fonts-capital-a-height (they get bigger as you scroll down). just make sure you pick one that either has f or r as the last letter (so for example tf, tr or mr). ones with u will only have upercase available and ones with n only numbers and some special characters(those should work for your value though i'd imagine).
Was thinking the same, you could probably fit volts, amps and watts on screen all at the same time still with clear legibility due to it being a bright OLED.
You should be able to read it with this (stripped out of the library): uint16_t value; Wire.beginTransmission(INA219_ADDRESS); Wire.write(INA219_REG_POWER); Wire.endTransmission(); delay(1); // Max 12-bit conversion time is 586us per sample Wire.requestFrom(INA219_ADDRESS, (uint8_t)2); // Shift values to create properly formed integer value = ((Wire.read()
Lovely video as always, I was wondering if this "mA" module... how high does it go? Can it meassure say "30 amps" from a solar array if I wanted to build a little Arduino to monitor incoming power/voltage etc.
I recommend just disregarding anything below 1mA on your ammeter, it's mostly just noise anyway. I wouldn't bother rounding, I'd just throw the numbers away, because you're not getting any meaningful data at that resolution anyway!
I have 2 of these INA219, OLEDs and many pro minis and want to build one. I thought they have different font sizes! I have a USB doctor dongle, that uses one of these OLEDs and it has a few font sizes on the display when operating. They crammed a lot of info on to the display. I am sure you know which USB doctor I am talking about. You have a similar one. Is there different font sizes available using this library, or should I just give up now, before starting?
Inspired by your experiments I had a go at my own INA219+OLED meter. It occurred to me that there are additional perks to using a pixel display over the 7-segment ones in typical multimeters. I managed to graph the instantaneous readings to better see trends. Some results pictured here for interest: drive.google.com/open?id=0BysPaPg1T8JKS3gtOUZyNHBmUXc It displays a running min/max with the current reading in between and sweeps the graph display with a vertical bar showing where the update is happening. The main challenges are reduced text size and the refresh rate limitations using standard libraries. Still, why have less info up when you can have more no? Thoughts? Thanks for the entertaining thoughts and tinkering as always.
That's what UA-cam is all about for me. I don't often finish my projects (why would I?) but I love it when my ideas are used as inspiration for something bigger and better. Awesome picture - thanks :)
290 to 350 mA is a huge jump. You have a terrible noise coming from somewhere. I wouldn't use power bank for the arduino. They trend to have up to 1V p-p noise. Also some of the chinese DC-DC are like this. I measure each unit comming from ebay and if I can't achieve
It looks like I won't be watching any new videos. It seems that stupid YT has mucked up the format so my browser refuses to read it. Or something. Bye, Julian. It's been fun. Unless YT get off their collective arses and do something to fix it of course, which they probably won't.
HTML5. I think maybe other formats will become available over time as it's processed, but still this is what they want. This is not an error it's a monopoly. Google can suck it through a tube.
This one I really liked. I really liked the progressive programming/results with the arduino. Excellent!!
Thanks, I might do more like this :)
I enjoy your style of videos very much. Making errors, discussing them and getting closer to the solution step by step is very satisfying. I feel like I'm learning a lot from you. Thanks!
Awesome! I do find your "stream of consciousness" videos so much more pleasing and, possibly, more educational than the "here's one I prepared earlier" presentations that litter UA-cam.
+Michael Keegan Thanks Michael - that's good because I plan to do more in that style, at least for the next couple of months.
@@JulianIlett Sure wish you would get back to this series, I still have dozens of unused Arduino's and ESP8266's, 32's and a blue pill laying around waiting for a great project!
Julian, when doing maths never trust the operator order but use brackets to enforce the order that terms are evaluated. As equations grow with the programs complexity, the use of brackets helps to minimise bugs later down the line.
I understand what you're saying, but the operator precedence rules are absolute and unambiguous. Brackets can help with readability, but aren't essential.
Not essential but in my professional life, I've seen too many program bugs introduced due to lack of brackets. So I always use and "preach" to others to use them. Even in simple 3 term equations (as they always grow in real life programs).
It's like I will use the car's indicators even if it isn't strictly required by the Highway Code (when there is no visible traffic or pedestrians) as it's easier to do so than to have special cases.
P.S. Hope this doesn't sound too preachy or worse as it was meant as helpful to others.
It should be an unconscious reflex to use the indicator anyhow ...
You'd be amazed at the number of people in my locality that think indicators are an option. As is using the correct lane on dual carriageways and being in the correct lane at junctions. Mind boggling some of the idiots on the roads today.
True. And it appears makers of larger cars now cater to such mentality and seem to offer indicators as prohibitively expensive add-on packages, and if they are indeed sold, they only work sporadically and can only be operated at great physical pain to the driver ...
So glad I'm not the only one who makes those odd doofus mistakes! Trouble is, I can spend hours looking for them (unless you did and edited that bit out :-) )
'Hello!' and 'Cheerio!' is simpler, and uncontroversial! Thanks Julian.
It is amazing what I just learned from this video. I was proud of myself. There were things I "guessed" before you did them and I was right and you were right. I love watching your videos, Julian. You are just great. I am eventually going to get the heater/furnace. I want to do more research as it involves fire. I want to make sure I understand it fully. I am sure it will be OK. A guy (Living the Van Life) put one in his VW Westfalia and did an awesome job. I think it is working great for him. Thanks Julian.
And Yes! I now have a better understanding of how to make a working OLED Ammeter and Watt Meter. Awesome!!
Thanks Jim (or is it John)
While the jumping 'mA' ia annoying, the jumping value with negative/positive values is worse. Better than fix 'mA' display position, test for +/- values and display a leading Space Character for +ve values and a minus sign for -ve. Thenm there's no jumping on the screen at all.
If mA is
You don't know how many times I've yelled at the screen to right-justify the whole thing! I'm thinking, ok, the next change will be, the next change will be.... And then believe it or not -- you put the units on the right but continue to leave the number jumping around!!!! Agggghh!!!
It's okay, I really love your videos Julian!
Hi Julian, I have been experimenting, I can confirm the differential signal on CAN does not need a reference ground. It's quite neat.
Lovely job on this, very cute meter. Always fancied building my own test gear. Closest I have ever got are building soak test rigs.
+The Backoffice cheers Andrew :)
There's a nice convenient ground pin on the OLED connection.
The INA219 actually calculates the load power internally, but the ability to read the power register was missed out of the Adafruit library. It was added in an update which you can download here:
github.com/adafruit/Adafruit_INA219/tree/dff62cd6696762dfea615bd01b0074e4081ef2ca
You'll see in the updated example that this library has an added function:
ina219.getPower_mW()
Of course using it still depends on grounding the other side of the load. I'm not sure there's any real benefit over calculating within the sketch, but if all you want to display is power then it saves a few steps.
Thanks Paul - I'll give that a go.
Not sure why the Arduino library manager doesn't automatically update to that version.
Updating won't change anything... they never accepted the pull request, so it hasn't actually been added to the library. Wonder what the chances of it happening anytime soon since it's been languishing there for four years now... So for the moment, you'll have to manually edit the library to add that feature.
github.com/adafruit/Adafruit_INA219/pull/16/commits
Afternoon? It's midnight here in India!
P.S. It's worth missing sleep to watch this.
there's always afternoon somewhere...
Sleep is for... people who don't watch UA-cam!
yep and also early morning in Russia
helps me sleep sometimes
It's great when you shove a wire in and NO Bang all working as it should made me laugh LOL No idea what I am doing watching this at 01:46am UK time tho
What I like about the Videos of Ralph Bacon, Andreas Spiess, BigClive and Julian Ilett -besides being interesting- is that they speak very clear and civilised and don't start with 'Wassup guys'
Makes our task easier when you figure it out for us!
a great idea is to modify this circuit adding only one high power resistor and some code to make it auto measure the internal resistance of any battery. i am trying to do that but your skills are better. i think everyone will find that usefull.
Programmer trick: To round any number in C or C like languages, add 0.5 and assign it to and int.
Wow, Very educational video.
Why not use a smaller font for the units? And put it in the lower right corner.
It does consume a bit more memory for the extra font, but will solve your problem and looks nice as well.
Hi Julian
You should be able to use the built in Power Register to get the right power reading, there is no need to calculate it in the arduino
Off topic, but they noticed have another batch of those little clocks controlled from the DCF atomic clock in Lidl today. The one I bought picked up the signal and went to the correct time in about 2 minutes. The 'as the crow flies' distance is just about 550 miles from here to the signal site.
I've got a british (MSF) one that barely gets a signal in britain... be a worthwhile rainy day video to open it up and probe the rf end with the scope, could potentially also check the frequency meter kit build from January since the rf is derived from an atomic clock standard.
Julian, I'd recommend taking a look at the INA219 datasheet, especially sections 8.4.1 (filtering), 9.2 (typical application), and 8.5.2 (calibration). Adafruit's library doesn't support it (you'll need to access the registers yourself) but the INA219 chip actually supports doing the power calculation itself. Also, tuning the calibration to your application can help increase the precision of the values returned.
you could code it such that if current>100 then don't show the decimal
Would be handy to have a parts list in the description for anyone else who wants to do this.
Going to go and see if it was in the first video.
You could "cheat"; since you already have the reading in mA, and you know the value of the current-sense resistor, just use Ohm's Law, and the Power Law, and simply calculate (current^2)*resistance to get power, then divide by 1000 to convert mW to Watts (if desired). :)
That would only report the power in the sense resistor.
Jilian, Please try to zoom in to your code so we can see what you are talking about. All your code modification videos are frustrating. So much white screen, for what benefit?
I'll increase the font size :)
Hello Julian i know this is a older video but the mA you can also make the font size smaller and push it to the right to get it looking right.
I guess you can't easily reduce the size of the mA or W to a smaller font to take up less space?
If you like the larger 32 font size then it might be more convenient to add a micro button to manually cycle through the display types.
Automatically convert any value more than 999 milliamps to display as amps. I haven't tested this code I wrote it off the top of my head, it's just an example.
void loop (void) {
float current_mA = 0;
u8g2.clearbuffer();
u8g2.setFont(u8g2_font_logisoso32_tr); // 32 denotes 32 px font size, change the number to change the font size.
current_mA = ina219.getCurrent_mA();
current_A= current_mA/1000.0;
if (current_mA > 999){
// If value is more than 999 milliamps display in amps
u8g2.SetCursor (0,32); // Left aligned amp value
u8g2.print(current_A,1); // Displays amps to 1 decimal place
u8g2.SetCursor (85,32); // Right aligned A
u8g2.println ("A");
u8g2.SendBuffer();
delay (200);
} else {
// otherwise display in milliamps
u8g2.SetCursor (0,32); // Left aligned milliamp value
u8g2.print(current_mA,1); // Displays milliamps value to 1 decimal place
u8g2.SetCursor (77,32); // Right aligned mA
u8g2.println ("mA");
u8g2.SendBuffer();
delay (200);
} // close the if/else statement
} // close the void loop
The only way to change font size using the u8g2 library is to choose a smaller font. The font itself is the font size. github.com/olikraus/u8g2/wiki/fntlistall#16-pixel-height
Hope this helps others with their projects. :)
I am attempting to put together some gear for fixing old radios on a shoestring budget (Forced upon me by the State who declared me, a 100 percent disabled cop retired. In their congratulations memo, they informed me that since I was retired, they cut my paycheck in half.) So, this should get me a nice watt/mA meter to test the power in the units I work on.
when in the Arduino ide working on small bits of code such as this one, could you not increase the size of the font (under file|preferences) so we can see the code on smaller screens with older eyes...
Yep, I hear you :)
I'm 100% sure you can get a meter to do both, and display both on the screen at the same time that doesn't bounce all over the place.
Couldn't you change the font size for mA or W? Maybe consider changing it to an A scale to reduce space required for by removing "m"
Julian, just a suggestion, change the font size for the W/mA/V to 1/3 size on the right hand side - have W top right, mA top right and centre right (above each other) and V bottom right. Also put a zero crossing point in the code - i.e. display "0" until a positive is detected (unless you want to measure -ve voltage etc.) and add a damping factor so the display only updates every 250ms or such like to prevent the display jumping (unless you like that?) - once you get beyond two decimal places how many people really care? If so - use a proper multimeter! Thx. for the vids.
Automotive voltage runs nearer the 14 volts so the bulb wattage is about corrects.
Mike James True and commercial 24v vehicles around 28v.
I was thinking about how your 12v 5w light was not putting out 5w@12v. Then it hit me, it was actually designed for a vehicle correct? Then it probably puts out 5W closer to 14V because when a car is running it usually puts out just over 14v from the alternator. Anyways, I am no expert but I think that may be a case of just making it simple for the consumer. it goes in a 12v car, and should draw about 5w when in use.
Love your stuff. I always look forward to your next video.
kaos havoc that is because you also get a voltage drop on the ina219 module shunt resistor that is necessary to measure current
True, I don't know the specs, but I am rather sure that shunt resistors will never cause a voltage drop enough to drop 2v from 12. They are usually really really small values.
I agree, if you put 13.8V, which is standard 12V vehicle float charge voltage, across the globe it will be 5W.
Crisan, the ina219 sense resistor is only 0.1R, so for this globe the burden voltage would only be about 40mV. The real reason is as others have said, nominal running vehicle voltage is 13.8v
How would you modify this circuit if you wanted isolation between the bulb and the wattmeter? How would you avoid connecting the grounds together?
(I know that the INA219 doesn't provide isolation, but let's assume you were using something like the ACS712, which uses the Hall effect for measurement.)
Be careful when your playing with ground references that are not floating as you may have catastrophic failures that kill your equipment. EEVBLOG has a great video on this.
Great videos, I've built a few of these now. Also going to buy a solar panel and play with muppets :D
On the first challenge (displaying currents greater than 999 mA), perhaps the Arduino could shift from mA to A as it passes into the 1000 mA range?
You could use P=I^2.R because R is known at 0.1R to reduce code complexity
That would also mean I don't need the extra wire for the voltage measurement - can this possibly work? I must try it...
It kind of works, but the result is wildly inaccurate - maybe because I'm squaring such a small number?
Wouldn't that just give the power being produced across the resistor though?
Couldn't you tack a short wire onto the wire connecting the grounds of the Arduino / display / INA module?
Nope, that would calculate the power being dissipated in the current sense resistor, not the load. No way of avoiding a third connection to measure the voltage across the load I'm afraid.
perhasp you could add a digital filter on your measure. I do this by make 8 acquisition , sum then divise for display average. Sorry for my poor english
Print a "+" in front of your milliamps value if it's positive, so it doesnt jump around when negative...
That might be simpler but it would look cleaner if the spot was just reserved instead and the numbers moved over a tiny bit.
Now let's put the output to a larger screen, perhaps one of those Nokia ones so you can display both Watts and mA one below the other for a full service meter.
You can improve the Amps resolution by calling ina219SetCalibration_16V_400mA() from your Adafruit_INA219 instance. But first you have to move ina219SetCalibration_16V_400mA() from the 'private' (dunno why they put it there) to the 'public' methods in ''Adafruit_INA219.h". There's also a ina219SetCalibration_32V_1A() method.
By using the voltage measuring trick, notice that you are probably making the ammeter input polarized. Imagine what would happen if you connected the 12v bulb supply backwards in the circuit... Wouldn't the voltage at the load connector be negative in respect to the arduino ground? How would the arduino behave in such a case? Hmmm.... Maye you can try this.
Interesting.
Is it a coincidence the readings became much less jumpy once you connected the ammeter board ground to Arduino ground?
Why not just make the font smaller so you get minimal overlap that still makes the numbers very readable?
Plus no nA
I was so close to doing that - I looked at the other sizes of this particular font. But I kinda knew it would all fit when converted into a Wattmeter :)
Great experiments as usual, could you possibly add a tact button to swap between current and watts?
By the way, you can use more digits on your Watts since you are dividing by 1000.
True - you'll probably see that change next time I use the Wattmeter :)
Hi,
Why don't you take the protection film from the Old?
Great videos Julian
I am thinking about conditioning the signal that when the signal is equal or greater than zero to put a "+" char in front of the print, so that it will fluctuate with "+" or "-" char in front of the value .. or use the absolute value :)
Or just use a space:
if (current_mA >= 0) { u8g2.print(" "); }
Colin Jones that should also do it
but you can display both mA and W in the same display with in 2 lines. it's more convenient to watch also. :s
can you remake this with 2 above displays in one promini and current module for showing watt and current in each display with change of i2C address and jumper position on back side of lcd
Hi iv seen you use a screwdriver tool on the plastic multi turn presets with the brass screw on the top. Could you please let me know what the tool is called so I can order one of ebay. Thanks jon
you can change the font size of the mA, nA and W if you want. i feel like those take up way too much space on the screen but might just be me.
should be via
u8g2.setFont(u8g2_font_7x14B_tf);
you can pick different fonts from here github.com/olikraus/u8g2/wiki/fntlistall#all-u8g2-fonts-capital-a-height (they get bigger as you scroll down). just make sure you pick one that either has f or r as the last letter (so for example tf, tr or mr). ones with u will only have upercase available and ones with n only numbers and some special characters(those should work for your value though i'd imagine).
Was thinking the same, you could probably fit volts, amps and watts on screen all at the same time still with clear legibility due to it being a bright OLED.
My thoughts exactly, start counting time and mWH can be displayed as well.
I think I'd split the display into 2 lines and put all 3 variables on there at once
I may do that, but on a 128x64 OLED.
Julian Ilett sweet
Why not using an if - else - and change the mA, A automaticly how high the input is. Over 1000 mA kann show as 1A. Very easy to code.
The INA219 already has integrated power measurement. Isn't that in the library?
+superdau Not in the Adafruit library.
You should be able to read it with this (stripped out of the library):
uint16_t value;
Wire.beginTransmission(INA219_ADDRESS);
Wire.write(INA219_REG_POWER);
Wire.endTransmission();
delay(1); // Max 12-bit conversion time is 586us per sample
Wire.requestFrom(INA219_ADDRESS, (uint8_t)2);
// Shift values to create properly formed integer
value = ((Wire.read()
You could always code to display mA for 20 seconds the W for 20 seconds and you would have the best of both worlds
Would there be a way so you could cycle between both modes? Like a refresh or something so it states mA refreshes and states Wattage?
nice work Julian, one question, to reading the voltage the ina219 use the same 12 adc that use to read the current?
0:05 Look at that top OLED display PCB. Seems like The Matrix is just gettin bugged.
Ah yeah, that's my solar powered model wind turbine which sits on the window sill :)
Lovely video as always, I was wondering if this "mA" module... how high does it go? Can it meassure say "30 amps" from a solar array if I wanted to build a little Arduino to monitor incoming power/voltage etc.
Rather than refreshing the string portion ("mA" or "W") with every loop, put it outside, above the loop and only refresh the digits inside the loop.
Yes, it is a bit wasteful writing it over and over again.
For milliamps why not use a lowercase a for amps use a capital A
How' d you know I was shouting at the screen regarding your mA to A conversion. ;-)
Hi Julian, would you be able to list the components used ? i would love to have a go at making on of these for myself
Watch my previous videos on the Arduino Ammeter
Cheers Julian just found them :)
I recommend just disregarding anything below 1mA on your ammeter, it's mostly just noise anyway. I wouldn't bother rounding, I'd just throw the numbers away, because you're not getting any meaningful data at that resolution anyway!
Wow, So much space in comment section when you are here early. :)
mA has one decimal place but Watt since you're dividing by 1000, could have more decimal places.
char buffer[8];
memset(buffer,0,8);
sprintf( buffer, "%5.1fmA", value );
oled.print( buffer );
I have 2 of these INA219, OLEDs and many pro minis and want to build one.
I thought they have different font sizes! I have a USB doctor dongle, that uses one of these OLEDs and it has a few font sizes on the display when operating.
They crammed a lot of info on to the display. I am sure you know which USB doctor I am talking about. You have a similar one.
Is there different font sizes available using this library, or should I just give up now, before starting?
UFOhunter The U8G library has multiple font faces and sizes.
Thanks. I will give it a go then.
Inspired by your experiments I had a go at my own INA219+OLED meter. It occurred to me that there are additional perks to using a pixel display over the 7-segment ones in typical multimeters. I managed to graph the instantaneous readings to better see trends. Some results pictured here for interest: drive.google.com/open?id=0BysPaPg1T8JKS3gtOUZyNHBmUXc
It displays a running min/max with the current reading in between and sweeps the graph display with a vertical bar showing where the update is happening. The main challenges are reduced text size and the refresh rate limitations using standard libraries. Still, why have less info up when you can have more no? Thoughts?
Thanks for the entertaining thoughts and tinkering as always.
That's what UA-cam is all about for me. I don't often finish my projects (why would I?) but I love it when my ideas are used as inspiration for something bigger and better. Awesome picture - thanks :)
I like the font. What is it?
Now that you have divided everything by 1000 you could just add the digits in decimal places that you have removed before, couldn't you?
+Tommaso Morganti Good point, I'll try that :)
Is that feston bulb??
Why complicate things, already resistance value is known. Simply (I^2)R for Power
Why do you include SPI.h in your sketch?
+Marcel I was wondering that myself.
290 to 350 mA is a huge jump. You have a terrible noise coming from somewhere. I wouldn't use power bank for the arduino. They trend to have up to 1V p-p noise. Also some of the chinese DC-DC are like this. I measure each unit comming from ebay and if I can't achieve
Yesss, first
Proyectos LED Indeed.
I see that the fan stopped.
The sun went in :)
I am still shouting at the screen.
Me to!
what is the max current of that device?
Benjamin Crall +/- 3A
Use 10 logarithm, and you will know the number of digits, so you should be able to only show three digits.
Here is a Source for a 128x64 OLED Display.
pastebin.com/q2yGtykV
So MUPPET is coming
Muppet 2 is coming!
Dirty bugger!
Awesome Julian! but its only fair to be little fast so that peoples don't loose their interests in it.
It looks like I won't be watching any new videos. It seems that stupid YT has mucked up the format so my browser refuses to read it. Or something. Bye, Julian. It's been fun.
Unless YT get off their collective arses and do something to fix it of course, which they probably won't.
HTML5. I think maybe other formats will become available over time as it's processed, but still this is what they want. This is not an error it's a monopoly. Google can suck it through a tube.
Eh. I'll try again in a day or so, in that case. What a swindle.
Okay, now it works after waiting a day. But it's still no way to run a web site.