Skip to content

Commit 6e733be

Browse files
authored
Update README.md
1 parent 162a4b6 commit 6e733be

File tree

1 file changed

+158
-30
lines changed

1 file changed

+158
-30
lines changed

README.md

Lines changed: 158 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
-->
4545

4646

47-
<!-- TABLE OF CONTENTS -->
47+
<!-- TABLE OF CONTENTS
4848
<details>
4949
<summary>Table of Contents</summary>
5050
<ol>
@@ -69,7 +69,7 @@
6969
<li><a href="#acknowledgments">Acknowledgments</a></li>
7070
</ol>
7171
</details>
72-
72+
-->
7373

7474

7575
<!-- ABOUT THE PROJECT -->
@@ -108,42 +108,186 @@ The design and shematics are made in Eagle. I aim to add universal data packages
108108

109109
<!-- GETTING STARTED -->
110110
## Getting Started
111-
First of all, you need to know basics of wheatstone bridge, and calculations. If you dont know where to start, HBM provides a good start-up knowledge [here](https://www.hbm.com/en/7163/wheatstone-bridge-circuit/). If you already have another source, you can use that as well, but be careful of resistor names, exitation points and reading points. They will vary.
112111

113-
There are several ways to use the PCB. It mainly depends on your budget and requried output quality. NO DOT FORGET that, HX711 is not an IC that a medium or advanced strain reader can be designed from.
112+
There are several ways to use the PCB. It mainly depends on your budget and requried output quality. NO DOT FORGET that, HX711 is not an IC that a medium or advanced strain reader can be designed from. With that in mind, if you want to use the bridge, you can simply produce it however you want, but do not spend too much money on this.
113+
114+
If you are going to use HX711 with load cells, this is not for you. This repo is basically for an adapter to use strain gauges with HX711. A simple extension.
115+
116+
If you are going to use strain gauges and would like to read the ADC data with HX711, please do continue.
117+
118+
After this point, every value, name or component will be reffered to the following image, if otherwise not stated. Take the image as refference.
119+
![Module](W01.png)
114120

115121
### Prerequisites
116122

117-
### Installation
123+
First of all, you need to know basics of wheatstone bridge, and calculations. If you dont know where to start, HBM provides a good start-up knowledge [here](https://www.hbm.com/en/7163/wheatstone-bridge-circuit/). If you already have another source, you can use that as well, but be careful of resistor names, exitation points and reading points. They will vary.
118124

125+
You are requried to know how ADC output works.
126+
### Choosing the Strain Gauge
119127

120-
<p align="right">(<a href="#top">back to top</a>)</p>
128+
In here, if you already have a strain gague, use that. However, if you do not have any strain gauges, there are 3 ohm values: 120, 350, 1000 ohms. Choose as you like, but remember you will need to buy resistors according to those values. So becareful if you will be able to supply resistors.
129+
Quality of the strain gauges is totally up to your bugdet. If this is your first time, buy the cheap ones. However, be careful to get EXACT gauge factor. Without exact factor, you can not convert ADC readings to meaningful strain values. This value is not SAME all over a single product from a single factory. High end suppliers measure and give exact strain gauge factor for every batch of gauges.
121130

131+
You will require following resistors for following strain gauge resistance values.
122132

123-
<!-- USAGE EXAMPLES -->
124-
## Usage
133+
Assuming quarter-bridge configuration with trimpot as zero-balancer;
134+
135+
| Strain Gauge | Required Resistors | Required TrimPots|
136+
| ------------- | ------------- | ------------- |
137+
| Ohm | NumberofResistorsxOhm | NumberofTrimpotsxOhm |
138+
| 120 Ω | 3x120 | 1x50 |
139+
| 350 Ω | 3x350 | 1x50 |
140+
| 1000 Ω | 3x1000 | 1x50 |
141+
142+
143+
Okay, I am gonna take a lot of heat from that table. Because most of the resistor values are not avaliable. I know that. This is IDEALLY. I will talk about the implementation as well.
144+
145+
Secondly, how we calculate the resistor values is this. Assume R2 to be your strain gauge, so 120 Ω, 350 Ω or 1000 Ω. For the PCB above, <b>(R4+RT/2)/(R1+RT/2)</b> should be equal to <b>R2/R3</b>. You can decide your resistor values like this, or you can use my implementation, which will be based on 350 Ω stain gauges and most common resistor values. BE CAREFUL your choose of resistors will effect the output. So you may need to do more calculations.
146+
147+
So if we chose 350 Ω strain gauge, and 330 Ω commonly found resistors for R1, R3 and R4, as a trimpot 50 Ω for RT, and set the trimpot to divide resistance 36 Ω to 14 Ω (which 36 Ω should be added serially to R1) system ALMOST balances. So balance equation becames;
148+
| Left Side | Right Side |
149+
| ------------- | ------------- |
150+
| 1.063953488 | 1.060606061 |
151+
152+
Remaining unbalance can be corrected with trimpot easily.
153+
154+
<b> As a final important note, DO NOT USE your strain gauges without properly gluing it to a proper reading surface. Strain gauges consists of a thin backing layer, which will not stand usage on their on. Find a piece of metal, plastic or anything, apply the strain gauge with a proper and strong adhesive, use strain gauge terminal to increase the cable dimension, and make sure your cables are not going to rip off. It is really easy to damage the cables of strain gauge.
155+
</b>
156+
157+
### Choosing Bridge Structure
158+
In here, the first thing you need to know is if you are going to need a manual way to zero balance the bridge. This depends on several things like resistor tolerances, ADC gain (PGA) and required reading range. Simply, if you are using high gain with high tolerances, your zero reading may be off scale already. In that case, your system will not work at all.
159+
160+
So, if you are using %5 tolerance resistors with the implementation given in the <b>Choosing the Strain Gauge</b> topic, due to resistor tolerances, there can be up to 0.25 V initial imbalance. However, at the largest reading range, (5 V exitation, 32 gain) HX711 will read voltages between +0.078125 V and -0.078125 V. As you can see, the resistor tolerances will shift your output to out of range. This is why a trimpot is used in the system to zero-balance the bridge.
161+
162+
The only case you can implement the given bridge without trimpot is if you have 0.1% tolerance resistors which are quite expensive. It would not be logical to dump so much money into a system of this quality. So, if you do not know better, use trimpot to zero balance the system, so you can use cheap solutions. Also, in this tolerance calculation, resistance of PCB pathways are neglected. If you include pathway resistances, tolerances and PCB quality becames much thighter, meaning even more expensive.
163+
164+
So, if you use
165+
166+
330 Ω resistors for R1, R3 and R4,
167+
168+
350 Ω strain gauge for R2,
169+
170+
and 50 Ω trimpot for RT
171+
172+
you will make the bridge work. However, this implementation will make things a bit harder later on, in calibration, but it will be nothing that a little math cannot solve.
173+
174+
### Choosing Shunt Calibration Resistors
175+
Shunt calibration resistors are used to apply a virtual strain to the system. Since the applied values of resistors are known and output can be obtained, system can be calibrated. [There](http://www.vishaypg.com/docs/11064/tn514.pdf) is an excellent guide on how to use and calculate shunt calibration. In this implementation, I am going to use 2 resistors, since we have much higher tolerances and not so sensetive bridge. Choosing the resistor values depends on your reading range. It is better to apply higher strains, which means lower resistor values on shunt calibration. However, it cannot exceed the reading range of the ADC. So ideally, if you apply 10 kΩ parallel resistor to system (as RS1 or RS2) you will cause 0.043005 V shift in ADC reading. Since 32 gain measures voltages between +0.078125 V and -0.078125 V, this will work. However, 128 gain and 64 gain will have a reading range of ±0.01953125 V and ±0.0390625 V, respectively. 10 kΩ shunt calibration resistors will not work for 128 and 64 gain, since it will shift the value out of range.
176+
177+
<b> If you do not know which gain you are going to use, 50 kΩ and 100 kΩ shunt calibration resistors will work fine.</b>
125178

126179
<p align="right">(<a href="#top">back to top</a>)</p>
127180

181+
### List of Components
182+
To use my implementation with 350 Ω strain gauges, you will need;
128183

184+
- 3 x 330 Ω resistor (prefer metal film, or as low tolerance as can be)
185+
- 1 x 50 Ω trimpot (prefer as much turn as possible. Usualy I use 20 turn)
186+
- 1 x 2 pin connector (to your preference)
187+
- 3 x DIP Switch
188+
- 1 x 50 kΩ resistor for RS1
189+
- 1 x 100 kΩ resistor for RS2
129190

130-
<!-- ROADMAP -->
131-
## Roadmap
191+
<p align="right">(<a href="#top">back to top</a>)</p>
192+
193+
194+
### Preliminary Measurements
195+
This step is the most important step. To have a proper measurement, you have to know your resistor values. You can use a simple multimeter, or anything more advanced. My procedure is as follows;
196+
1. Measure R1, R3, R4 and RT, and SAVE them somewhere you will not missplace.
197+
2. (optional) If you want more precision, you can measure the PCB pathway resistances and add them to proper resistor values.
198+
3. ONLY solder the RS1, RS2 and DIP switch that connects shunt calibration resistors to the main bridge.
199+
4. Measure the resistor values at the ends of RS2 (be careful R2 is not soldered yet.) in 3 possible states and SAVE them somewhere you will not missplace. 3 possible states are;
200+
- switch1 (RS1) on, switch2 (RS2) off
201+
- switch1 (RS1) off, switch2 (RS2) on
202+
- switch1 (RS1) on, switch2 (RS2) on
203+
5. You can now solder the remaining parts.
132204

133205
<p align="right">(<a href="#top">back to top</a>)</p>
134206

207+
### Soldering
208+
209+
It is assumed that the PCB is one sided and components are on the other face of the copper layer. However, since all the components are passive, you can switch sides, except HX711 pins.
135210

211+
BE CAREFUL to follow soldering order given in <b>Preliminary Measurements</b> to obtain best results.
136212

137-
<!-- CONTRIBUTING -->
138-
## Contributing
213+
There are 2 elements to every component at a wheatstone bridge, a resistor and a connector. Connector is to add strain gauge to system, and resistors are static componenets. So, if you are going to use quarter-bridge, DO NOT solder X1, X3 and X4 connectors, but solder R1, R3 and R4 resistors. To add the strain gauge, DO NOT solder R2 resistor, but solder X2 connector. For other bridge implemetations, logic is same. So, you eighter use a connector or a resistor.
139214

215+
## Calibration
216+
217+
If you are going to calibrate the system with any other method, or if you do not require a calibration, you may skip this step. But if you need calibration, we will conduct a Ax+B calibration.
218+
219+
To do so, it is required to know shunt calibration resistor values, bridge resistor values and virtual strain that is applied by shunt calibration resistors. Assuming R1, R3 and R4 to be static,
220+
221+
Epsilon_s = -R_G/(F_G*(R_G+R_S))
222+
223+
where;
224+
225+
Epsilon_s : Strain on the strain gauge (m/m)
226+
R_G : Strain gauge resistance value (Ω)
227+
R_C : Shunt calibration resistor value (Ω)
228+
F_G : Strain gauge factor (must be given by supplier)
229+
230+
By conducting the calculation for every state of RS1 and RS2 switch, you will have 3 strain values and 3 outputs from the ADC. You do not have to but you can also add your zero reading (not perfectly zero) to this data set, which makes 4 strain values and 4 ADC outputs (given as Parameters in <b>Usage</b>). Only remaining thing is to linearly convert ADC values to match strain values.
231+
1. First thing I suggest you to do is a chech of system. To do that, take your readings (4 strain, 4 ADC output) and calculate linear regression error. As an alternative, you can use Microsoft Excel (or any other related software) draw the diagram of data as scatter graph, then make Excel to calculate equation and R^2 value. If your R^2 value is realy close to 1, you have a good working system.
232+
2. By appling the calculations above, you should have 4 strain values (Epsilon_s).
233+
3. Take the values from ADC output that are designated as <b>Parameter: ADCout0, ADCout1, ADCout2, ADCout3 </b>
234+
4. Make a table.
235+
236+
| Strain values | ADC Outputs |
237+
| ------------- | ------------- |
238+
| Epsilon_s=0 | ADCout0 |
239+
| Epsilon_s RS1 | ADCout1 |
240+
| Epsilon_s RS2 | ADCout2 |
241+
| Epsilon_s Rs1 and RS2 | ADCout3 |
242+
243+
5. Calculate the number that you need to multiply and add with ADCout to match with epsilon values.
244+
245+
246+
For example,
247+
| Strain values | ADC Outputs | ADCout x A + B | Calibrated Output |
248+
| ------------- | ------------- | ------------- | ------------- |
249+
| 0 | 1000 | 1000 x -0.00001 + 0.01 | 0 |
250+
| -0.01 | 2000 | 2000 x -0.00001 + 0.01 | -0.01 |
251+
| -0.02 | 3000 | 3000 x -0.00001 + 0.01 | -0.02 |
252+
| -0.03 | 4000 | 4000 x -0.00001 + 0.01 | -0.03 |
253+
254+
255+
<b> Readings in this method are always gives results in compressive strain.</b>
256+
257+
258+
## Usage
259+
First of all, you need to select a channel, POSITIVE_CHANNEL_SELECT and NEGATIVE_CHANNEL_SELECT switches are made for that. I added this switches and I have not tested it. It is simply to direct signal to channels. This may not be necessery. If you are sure you do not need that, you can short the connections. However, if you are going to use;
260+
261+
If you are going to use channel A,
262+
- set POSITIVE_CHANNEL_SELECT, 1st to off and 2nd to on
263+
- set NEGATIVE_CHANNEL_SELECT, 1st to off and 2nd to on
264+
265+
If you are going to use channel B,
266+
- set POSITIVE_CHANNEL_SELECT, 1st to on and 2nd to off
267+
- set NEGATIVE_CHANNEL_SELECT, 1st to on and 2nd to off
268+
269+
Make sure switch of RS1 and RS2 are open (is not connected to system) (off).
270+
271+
Then power-up the system and take ADC readings. Turn the trimpot RT untill you get a zero or near zero reading. Take a several second stable reading, take the average and save. <b>Parameter: ADCout0</b>
272+
273+
<b>IMPORTANT NOTE: DO NOT use any code that has in-code zero function (tare). Make sure that you are seeing the direct output of the ADC</b>
274+
275+
After you have your zero level;
276+
- Close switch that is connected to RS1, take a several second stable reading, take the average and save. <b>Parameter: ADCout1</b>
277+
- Close switch that is connected to RS2, take a several second stable reading, take the average and save. <b>Parameter: ADCout2</b>
278+
- Close switchs that is connected to RS1 and RS2, take a several second stable reading, take the average and save. <b>Parameter: ADCout3</b>
279+
-
280+
<b> While calibrating, DO NOT change the strain of the material your strain gauge is placed. Make sure there are no external loads on measured part.</b>
281+
<b> While closing and opening switches, please wait for system to converge.</b>
282+
283+
After this step, open the switches of RS1 and RS2. Now, you are ready to take your strain reading. In this method, you will convert your readings into meaningful strain values after you completed strain readings. However, after calculating necessary calibration values, you can input those values to your code that reads ADC as well.
140284

141285
<p align="right">(<a href="#top">back to top</a>)</p>
142286

143-
<!-- LICENSE -->
144-
## License
145287

288+
## License
146289

290+
This is not licensed. You can steal it.
147291
<p align="right">(<a href="#top">back to top</a>)</p>
148292

149293
<!-- CONTACT -->
@@ -157,22 +301,6 @@ Project Link: [HX711_SimpleBridge](https://github.com/maviterlikli/HX711_SimpleB
157301

158302

159303

160-
<!-- ACKNOWLEDGMENTS -->
161-
## Acknowledgments
162-
163-
Use this space to list resources you find helpful and would like to give credit to. I've included a few of my favorites to kick things off!
164-
165-
* [Choose an Open Source License](https://choosealicense.com)
166-
* [GitHub Emoji Cheat Sheet](https://www.webpagefx.com/tools/emoji-cheat-sheet)
167-
* [Malven's Flexbox Cheatsheet](https://flexbox.malven.co/)
168-
* [Malven's Grid Cheatsheet](https://grid.malven.co/)
169-
* [Img Shields](https://shields.io)
170-
* [GitHub Pages](https://pages.github.com)
171-
* [Font Awesome](https://fontawesome.com)
172-
* [React Icons](https://react-icons.github.io/react-icons/search)
173-
174-
<p align="right">(<a href="#top">back to top</a>)</p>
175-
176304

177305

178306
<!-- MARKDOWN LINKS & IMAGES -->

0 commit comments

Comments
 (0)