FlyinFlynn Posted April 22, 2020 Share Posted April 22, 2020 Chris..I went looking for ASC712 modules.. I assume you meant ACS712.... Dyslexia rules K.O. I would stick with 3v3 or 3v0 for the backlight...it gets hard to read if the LED fails..... Quote Link to comment Share on other sites More sharing options...
Chris Bott - Moderator Posted April 25, 2020 Author Share Posted April 25, 2020 Good news - the PCBs turned up. Bad news - How many rookie errors is it possible to make in one PCB design? Let's get those out of the way. Then back to the good news. So, I've no idea "where my head was" when drawing up this design. In and out are swapped on the screen print. We know about that one. I've got the screen printing well mixed up between top and bottom. It's all correct but some of each side should be on the opposite side. Capacitor hole spacing doesn't match my capacitors. No Biggie. Trimpot hole spacing is for smaller trimpots. I went ahead and trusted the screen print when soldering in the first components and they were intended to be mounted on the other side. Back to the good news then, it has built up and is electrically correct. The current sensing tracks work a treat, I've put links in to use both in parallel. I'm now tweaking the software now that I have a PCB unit to play with. Photos to follow Quote Link to comment Share on other sites More sharing options...
Chris Bott - Moderator Posted April 25, 2020 Author Share Posted April 25, 2020 Quote Link to comment Share on other sites More sharing options...
Chris Bott - Moderator Posted April 25, 2020 Author Share Posted April 25, 2020 As you can see, I'm experimenting with 2 decimal places in the last pic. I'm not sure if this gives an impression of greater accuracy than we actually have? There's also another couple of things to attend to. Filtering could be better, especially when measuring at part throttle settings. I'm not sure if wecan fix that in software or whether to try bigger filter capacitors? Grabbing of Max amps and Min voltage are triggered by whether amps are bigger than previous "max amps". This works fine as it shows what both readings were at the same time. The downside is that if I then run the battery down, "max amps" is not triggered at a later time, but the battery voltage can easily be run down lower than the reading that was taken for "min volts". At the end of the test the live volts can be lower than that recorded as minimum volts. Quote Link to comment Share on other sites More sharing options...
Danny Fenton Posted April 25, 2020 Share Posted April 25, 2020 Well done Chris that's brilliant. I really appreciate all your effort to give us a tool we need. I know a few fellow indoor flyers who are eagerly awaiting kits Cheers Danny Quote Link to comment Share on other sites More sharing options...
Chris Bott - Moderator Posted April 25, 2020 Author Share Posted April 25, 2020 Here, I'm sharing the current version of the arduino sketch. Please be aware that I'm a real bginner at this. Those that know what you're doing, once you've stopped laughing at the naivety of it, please be gentle with suggestions for improvement. Hopefully this link will allow downloads OLEDPwrMtr V0.4.ino Edit - to change link to later version Edited By Chris Bott - Moderator on 02/06/2020 21:32:54 Quote Link to comment Share on other sites More sharing options...
Peter Balcombe Posted April 25, 2020 Share Posted April 25, 2020 Brilliant Chris. The link works to enable the sketch to be grabbed from Dropbox & it compiled ok once I had updated my Adafruit libraries to the latest on Github. I will try to knock up a test breadboard over the next couple of days. Quote Link to comment Share on other sites More sharing options...
Chris Bott - Moderator Posted April 25, 2020 Author Share Posted April 25, 2020 Great news, thanks Peter. Would it help if I pop a PCB in the post? Bearing in mind it's minor issues, of course. Quote Link to comment Share on other sites More sharing options...
Peter Balcombe Posted April 25, 2020 Share Posted April 25, 2020 Hi Chris, Yes please. Let me know how much & I will settle up. Do you still have my address from the previous Opensensor PCB supply? Edited By Peter Balcombe on 25/04/2020 21:59:00 Quote Link to comment Share on other sites More sharing options...
Chris Bott - Moderator Posted April 25, 2020 Author Share Posted April 25, 2020 That's fine, send me a PM with your address and I'll stick one in the post box tomorrow. I'll send a handful of others out too if anyone wants one. I'm too annoyed with the mistakes to charge for them at all. Quote Link to comment Share on other sites More sharing options...
Dennis Mulhair Posted April 26, 2020 Share Posted April 26, 2020 Hi Chris, I would like a PCB too but am happy to wait if not available Dennis Quote Link to comment Share on other sites More sharing options...
Toni Reynaud Posted April 26, 2020 Share Posted April 26, 2020 Just a thought - there appears to be a part of the thread the suggests making this self-powered using a voltage boost board. Given that the unit is for testing small 1S lipos for indoor models, would this give rise to the current draw for the unit being a noticeable percentage of the load (motor) current draw? Would you therefore be getting false readings as to load power consumption? Quote Link to comment Share on other sites More sharing options...
Denis Watkins Posted April 26, 2020 Share Posted April 26, 2020 You are right Toni, all test probes added to a circuit affect the performance of the circuit. But what is more important is that circuit is affected the same way each time so the changes in the readings are what helps us Even up or down, red to green give us a good idea of what is going on Edited By Denis Watkins on 26/04/2020 10:01:36 Quote Link to comment Share on other sites More sharing options...
Chris Bott - Moderator Posted April 26, 2020 Author Share Posted April 26, 2020 Posted by Dennis Mulhair on 26/04/2020 08:49:43: Hi Chris, I would like a PCB too but am happy to wait if not available Dennis Hi Dennis. Yes no problem, PM your address to em and I'll pop one in the post. Chris Quote Link to comment Share on other sites More sharing options...
Chris Bott - Moderator Posted April 26, 2020 Author Share Posted April 26, 2020 Posted by Toni Reynaud on 26/04/2020 08:52:48: Just a thought - there appears to be a part of the thread the suggests making this self-powered using a voltage boost board. Given that the unit is for testing small 1S lipos for indoor models, would this give rise to the current draw for the unit being a noticeable percentage of the load (motor) current draw? Would you therefore be getting false readings as to load power consumption? Toni you're absolutely right, that was just another reason that I ended up going for a separately powered unit. Others can of course modify as they see fit. The draw can be compensated for in software, I'd think, too. Quote Link to comment Share on other sites More sharing options...
Chris Bott - Moderator Posted April 26, 2020 Author Share Posted April 26, 2020 I've had a rather good idea sent in by PM. Thanks Paul. Paul asked if it would be possible to add a discharger function that would take the little 1S cells down to discharge level. Well it's a very interesting idea and wouldn't take much extra hardware at all. Of course it will take some time, effort and testing and a new PCB. If we go that way I'd rather not do a complete redesign of the case to accommodate more hardware so I'm already thinking of a 3 position switch to give "ON", "OFF, "DISCHARGE" functions. The display would continue to give live readings but also show that discharging was taking place and discharge would cut off at, say, 3.8V. Obviously it would be useful, but is it worth extra time and effort? Quote Link to comment Share on other sites More sharing options...
Peter Balcombe Posted April 26, 2020 Share Posted April 26, 2020 Toni, if any voltage buck/boost converter -ve supply was taken from the input -ve (circuit 0v) then the converter load current wouldn’t be included in the load amps/watts measurements. However the extra load may affect the supply terminal voltage & would cause the supply battery to discharge quicker, although as Chris says, this would be a constant load & could probably be compensated for in software. Note that the load sense resistor causes a voltage drop in any event, which would need to be subtracted from the measured supply voltage if you are looking for really accurate load side measurements (within the limits of the hardware used). Edited By Peter Balcombe on 26/04/2020 11:28:13 Quote Link to comment Share on other sites More sharing options...
FlyinFlynn Posted April 26, 2020 Share Posted April 26, 2020 I get this Chris Quote Link to comment Share on other sites More sharing options...
Chris Bott - Moderator Posted April 26, 2020 Author Share Posted April 26, 2020 Hi FF, that's as expected. Then click the download button. Ah, is that when you get the download error message? Edited By Chris Bott - Moderator on 26/04/2020 12:32:40 Quote Link to comment Share on other sites More sharing options...
Toni Reynaud Posted April 26, 2020 Share Posted April 26, 2020 Understood. Thanks for all the replies about the possible extra loading of the battery under test. Quote Link to comment Share on other sites More sharing options...
Chris Bott - Moderator Posted April 26, 2020 Author Share Posted April 26, 2020 I thought I'd have a quick go a personalisation. There's just room. Quote Link to comment Share on other sites More sharing options...
Danny Fenton Posted April 26, 2020 Share Posted April 26, 2020 Nearly as nice as mine Quote Link to comment Share on other sites More sharing options...
Mike Blandford Posted April 27, 2020 Share Posted April 27, 2020 I built myself a wattmeter many years ago. I just looked up the logic I used for reading the analog values. Two analog values are read. Every 4mS a single read is done, alternating which channel is read. 16 values for each input are accumulated. The average of these is calculated (add 8 then divide by 16). Four of each of these averages are then accumulated and averaged. These resulting values are then used to calculate the voltage and current. I did this in two steps because I'm using an external, 12-bit A2D chip and accumulating more than 16 values would overflow a 16-bit storage. In summary, every 512mS, I read each analog input 64 times and use the average value. This gave a good, stable display. My wattmeter also included an optical tachometer input and a pot used to generate a servo pulse for the ESC, so I could use it "standalone". It could also measure the receiver pulse width, and integrated the current to give used mAh. Mike Quote Link to comment Share on other sites More sharing options...
Chris Bott - Moderator Posted April 27, 2020 Author Share Posted April 27, 2020 Using a suggestion from Peter Balcombe that improves the averaging a lot and using Mike Blandfords numbers from above, I've altered the measurements section in the software. So now, having delcared the following integers: int Vtemp = 0; int Atemp = 0; int loops = 16; int loopdelay = 4; The replacement section reads like this: //Measure Volts and Amps Vtemp = 0; //reset cumulative total Atemp = 0; //reset cumulative total for(int i=0; i<(loops); i++) { //Loop "loops" times Vtemp += analogRead(A3); //adds each value to Vtemp Atemp += analogRead(A2); //adds each value to Atemp delay(loopdelay); } Volts = (Vtemp/(loops))*(1.1/1023.0)*((R1+R2)/R2)*TrimV; Amps = (Atemp/(loops))*(1.1/1023.0)*45*TrimA ; Next will be to give this a good test. I may well still alter the value of C1 Quote Link to comment Share on other sites More sharing options...
Chris Bott - Moderator Posted April 27, 2020 Author Share Posted April 27, 2020 OK - thoughts about this section? //Save new Maxes whenever live values are more than previous Max if (Amps > Max_Amps){ Max_Amps = Amps; Min_Volts = Volts; } if (Powr > Max_Powr){ Max_Powr = Powr; } This overwrites the value of Max Amps if Amps is greater than the saved value of Max Amps. That works fine. At the moment I use the same trigger to save a new value of Min Volts. This is because I'm assuming that Min Volts will co-incide with max amps. If I try to write a separate trigger for volts, then it always saves a value of zero volts. Alternatively I tried capturing the first time current was sensed, then once that was true did a if (Volts < Min_Volts) trigger. This worked, but of course as the battery ran down, it kept saving lower and lower voltages which had no relation to the voltage nearer the start of the when we were also getting Max Amps. So - what do we actually want it to do? Would it be better if I just trigger all 3 saves of Max/Min parameters from if (Powr > Max_Powr) ? Discuss... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.