Code Libraries

Locked
kenntnisse
Member
Member
Posts: 16
Joined: December 2nd, 2022, 7:56 pm
Division: C
State: WA
Pronouns: He/Him/His
Has thanked: 2 times
Been thanked: 0

Code Libraries

Post by kenntnisse »

The rules say "The Device may not use any code libraries for calibration of the device."

Is that referring purely to the in-competition calibration/setup part, or are we not allowed to use code libraries when collecting data at all?

For example, if we want to collect data before the competition to make a graph, is using the LCD or the HX711 library prohibited?
knightmoves
Member
Member
Posts: 629
Joined: April 26th, 2018, 6:40 pm
Has thanked: 4 times
Been thanked: 108 times

Re: Code Libraries

Post by knightmoves »

I'm confused by your question.

I suppose you can do what you like collecting data at home, because nobody else will ever see the setup you use. But you're doing a calibration. This only actually works as a calibration if you apply known weights to your device, and see what voltage you read. If you use an hx711 in your calibration, but not in your competition device, then you're not actually calibrating your device, are you?

And unless what you have is a bare hx711 in a dip package on a breadboard, you probably have an illegal ic daughtercard.

The idea of "no libraries" is that you have to take voltage vs applied weight data, fit a curve, or combination of curves, to that data, and so produce a calibration function that converts voltage to weight, and implement that function yourself in your code. You have to write all this up in your design log.
kenntnisse
Member
Member
Posts: 16
Joined: December 2nd, 2022, 7:56 pm
Division: C
State: WA
Pronouns: He/Him/His
Has thanked: 2 times
Been thanked: 0

Re: Code Libraries

Post by kenntnisse »

Yes, I do have a bare HX711 chip implemented in a circuit on a breadboard.

But when I'm making the graph of voltage vs. applied weight, I'm using the HX711 library (to get voltage). My question is, is that illegal?

I'm assuming making the graph is part of the calibration process, and I'm using a code library to do so.

Note: I'm not planning on doing calibration during the in-contest setup time.
Last edited by kenntnisse on March 18th, 2023, 7:47 pm, edited 1 time in total.
knightmoves
Member
Member
Posts: 629
Joined: April 26th, 2018, 6:40 pm
Has thanked: 4 times
Been thanked: 108 times

Re: Code Libraries

Post by knightmoves »

kenntnisse wrote: March 18th, 2023, 7:46 pm Yes, I do have a bare HX711 chip implemented in a circuit on a breadboard.

But when I'm making the graph of voltage vs. applied weight, I'm using the HX711 library (to get voltage). My question is, is that illegal?

I'm assuming making the graph is part of the calibration process, and I'm using a code library to do so.

Note: I'm not planning on doing calibration during the in-contest setup time.
There is a FAQ that says that you may use code libraries for functionality, but not calibration, and specifically references the HX711. So if I believe that FAQ, then your use here is legal - you're not doing calibration with the library - you're doing data acquisition with the library.

However:

I'll confess that I'm confused about how any external ADC is legal under this year's rules.

Rule 3a defines a "device" as a microcontroller, display, LED/lights, and a participant-built sensor, and requires the "sensor" to produce a voltage that varies with the applied mass.
Rube 3b defines "sensor" as being participant-made from FSRs, strain gauges, electronic components, DIP package ICs, etc.

Your device uses a bare HX711 in a DIP package, which is legal under rule 3b, but it means that your "sensor" doesn't produce a voltage - it produces a digital output from your HX711, which makes it illegal under rule 3a. I don't see how you can interpret rule 3a in a way that allows you to not use the built-in ADC on your microcontroller board to digitize a voltage.
Last edited by knightmoves on March 19th, 2023, 3:24 pm, edited 1 time in total.
kenntnisse
Member
Member
Posts: 16
Joined: December 2nd, 2022, 7:56 pm
Division: C
State: WA
Pronouns: He/Him/His
Has thanked: 2 times
Been thanked: 0

Re: Code Libraries

Post by kenntnisse »

Why doesn't my sensor produce a voltage? I will use strain gauges in a Wheatstone bridge formation, which will produce a voltage, then measured by the HX711. I suppose the voltage produced isn't being measured directly by the Arduino, but is that a problem?
knightmoves
Member
Member
Posts: 629
Joined: April 26th, 2018, 6:40 pm
Has thanked: 4 times
Been thanked: 108 times

Re: Code Libraries

Post by knightmoves »

kenntnisse wrote: March 19th, 2023, 6:50 pm Why doesn't my sensor produce a voltage? I will use strain gauges in a Wheatstone bridge formation, which will produce a voltage, then measured by the HX711. I suppose the voltage produced isn't being measured directly by the Arduino, but is that a problem?
Well, that's the question. Your strain gauge wheatstone bridge clearly produces a voltage, but the combination of rules 3a and 3b define the word "sensor" to mean your strain gauges or FSRs, plus all of the supporting electronic components assembled on a breadboard. You're including your HX711 as a DIP package IC on a breadboard under rule 3b, which makes it part of your "sensor". Rule 3a requires that the output of your "sensor" is a voltage, but the inclusion of an ADC in your "sensor" means that the output of your "sensor" is a digital value, and not a voltage.

That's my concern with external ADCs. I would suggest you put in a FAQ request for this, because I don't think this is clear in the rules. The existence of one FAQ answer mentioning the HX711 by name might imply that an external ADC would be OK to use, or it might equally imply that the person writing the answer was only addressing the narrow question asked, and not thinking about the wider question of whether an external ADC was even legal under the rules.

I don't think using a bare external ADC is inconsistent with the spirit of the problem - the rules clearly want participants to do all the calibration work themselves (rather than using some library that comes with tare and calibration functions). Using a better ADC than the one on the microcontroller doesn't change the work you have to do, but perhaps it makes a better device than the onboard ADC. Different microcontrollers have different ADCs, so I don't really see that using an inexpensive external ADC would be getting an unfair advantage anywhere.

But the way I read the rules, I'd say that external ADCs weren't allowed. I have no idea whether or not that is the intent of the rules.
kenntnisse
Member
Member
Posts: 16
Joined: December 2nd, 2022, 7:56 pm
Division: C
State: WA
Pronouns: He/Him/His
Has thanked: 2 times
Been thanked: 0

Re: Code Libraries

Post by kenntnisse »

I came across this question regarding SOICs, which might render the HX711 useless. Since the HX711 is a SOP16 (I'm using a SOP to DIP adapter socket to put it into my circuit), will it be illegal because it says SOICs are not allowed?

It's a little confusing because it says SOICs implement daughterboards, but the HX711 is a bare chip...

I submitted a question to the FAQ, but thank you anyway for taking the time to answer my questions.
Last edited by kenntnisse on March 20th, 2023, 10:00 am, edited 2 times in total.
kenntnisse
Member
Member
Posts: 16
Joined: December 2nd, 2022, 7:56 pm
Division: C
State: WA
Pronouns: He/Him/His
Has thanked: 2 times
Been thanked: 0

Re: Code Libraries

Post by kenntnisse »

Oh wait, another question might have answered that: https://www.soinc.org/one-faq-says-stan ... nt-allowed

Is the bare HX711 considered a surface mount chip? And by "not connect to anything else", does that really mean I can't connect it to my circuit?
knightmoves
Member
Member
Posts: 629
Joined: April 26th, 2018, 6:40 pm
Has thanked: 4 times
Been thanked: 108 times

Re: Code Libraries

Post by knightmoves »

The FAQ answers aren't at all clear or consistent. There's one FAQ that says you can mill your own circuit board and one that says that you can't. Two opposite answers to basically the same question! You can't use an arduino shield with screw terminals, because it's a "daughterboard", but you can apparently use a SOIC to DIP adapter, which is fundamentally the same thing - it's just a bit of extra copper on a board that helps you connect a couple of things together.

And for your external ADC question, they answer "In concept yes that is allowed if you can find a way to wire it such that a voltage can be displayed and is used in the code for mass calculation." which just doesn't make sense as an answer. Your ADC returns a number of ADC counts. Your program can choose to display that as a voltage. This isn't "a way of wiring it" - it's just how ADCs work. There isn't another "way to wire it".

So I would interpret this FAQ as meaning that if your program reads raw ADC counts from the HX711, and applies a scale factor to report voltage, and then feeds that voltage to a calibration function that you have written (and documented in your design log) in order to produce mass, then your device would be legal.

But mostly I think the event rules are very unclear, and need a significant rewrite.
Last edited by knightmoves on March 21st, 2023, 2:42 pm, edited 1 time in total.
Locked

Return to “Detector Building C”

Who is online

Users browsing this forum: No registered users and 0 guests