S-March / dEEbugger_Public

The dEEbugger is an ESP8266 based keychain swiss army knife for electronics
197 stars 18 forks source link

Graticule modifications, Int ADC reinstated, added HX711 interface #5

Open dagnall53 opened 7 years ago

dagnall53 commented 7 years ago

Hi and thanks for an excellent piece of kit. I have used this code as a staring point for a NODEMCU based tool for measuring force via a strain gauge and HX711 interface. I got a bit carried away whilst exploring your code and have made some modifications to the way the graticule is presented (so it shows integer graticules) and also reinstated the "Internal ADC". If you are interested in using my changed Graticule maths. I have placed my version in my repository as "patch 2".. (https://github.com/dagnall53/dEEbugger_PUBLIC/tree/patch-2)

All the best Dagnall

dagnall53 commented 7 years ago

An apology.. I have realised that since posting I have added rather a lot of additional mods into my "patch 2" version, making it difficult for you to see just the simple graticule modifications that I thought would improve your scope display.
However, I hope that they will be helpful to you you if you decide to do any updates to your code...

S-March commented 7 years ago

Hi Dagnall,

I just noticed all the changes you've made! I will start digging through them tonight. Looking forward to seeing what you've been up to.

dagnall53 commented 7 years ago

Hi, i have made rather a lot of mods, so it may take a bit! First, I changed the graticule to give integer graticules. this was mainly just for my personal taste, but the modified code ended a bit complex and got me started adding other bits.

I have more recently added the ability to read HX711 strain gauge sensor. This was the main reason for my adapting the code. As part of this I have changed the way you send data to the scope handler, using a scaling factor for each channel. I am sure you can see how this works. The HX711 can read 25 samples/second when in single channel mode, but changeover of channels takes about 250+ms, so this really limits how the two channel strain sensor can work. My current code defaults to 500ms single channel sample rate. Hoping to improve the sample rate I gave interleaved the two channel reads, With slow sample rates this then showed up badly on the screen, so I modified the screen display to try and time interleave the channel displays. In doing this I think I noticed a few left over variables you may have been using to try and do the same thing.. Currently, after settling down, the display updates each line as it receives the data. To make this display properly, I detect which channel is read first after a clear screen, and shift the display of the "second" channel half a sample period.. With faster sample rates this interleaving would not be necessary as you would not notice the slight shift.

Today I also added an On screen Display to show the channel readings. I have not tested this with faster sample rates and it may need to have some feature to only show one every n samples (or average of n samples) at a slower update rate for when the ADC is at high data rates?

For the strain gauge display there is an ugly (but functional) modification to the vertical axis to shift the display up one unit, and to change the display from V to kg.

If you want to try out the HX711, please make sure you use my modified HX711 library, as it works with the ESP!. The owner of the real library has not yet added my mod!.

I would be happy to explain any other changes.. Most are identified with "DAG", although in future I may just leave the Git compare function to show the changes...

Let me know if there are any explanations I can help with.. And thanks for some very impressive software Dagnall

dagnall53 commented 7 years ago

closed in error, now re-opened...

dagnall53 commented 7 years ago

One last thing.. I modified the default behaviour for selecting AP or "log in" mode on wake up.. I could not see exactly what you were doing, and wanted the deebugger to normally log into my network. I also use the WiFi Manager routine which loads an AP to ask for network address/ password if it cannot log in. I suspect that this may screw up your original intent to load in an AP mode when out and about.. I tried to sort out a pin to select modes on startup like I think you do, but have not progressed this.