modelHx711Serial
Extends from Modelica.Icons.Example (Icon for runnable examples).
Information
The circuit of Examples.Weighing.Hx711Read, plus a logic analyser probe on the two-wire link of the HX711: CH0 on PD_SCK (clock, driven by the microcontroller), CH1 on DOUT (data, driven by the converter).
The data channel is of kind SyncData: read on the falling edge of its clock channel (ch1ClockChannel = 0, ch1ClockEdge = Falling), in words of 24 bits, most significant bit first, in two's complement. In Hx711Serial.analyzer.txt, each conversion gives one line (068DB9 = 429497 + 1 extra clock pulse): the 25th, 26th or 27th pulse selects the gain of the next conversion (128, 32, 64). The timing diagram shows each burst of 25 to 27 pulses as a frame, and the 100 ms between two conversions as a single line of silence.
Components
| Type | Name | Default | Description |
|---|---|---|---|
| MCU | mcu | scriptPath = Resources/Scripts/MCU/hx711_read.py - imports the driver hx711_gpio.py placed next to it (robert-hh, unchanged) | |
| MicroPythonMCU.Peripherals.Display | display | Codes read by the microcontroller | |
| MicroPythonMCU.Peripherals.Weighing.Hx711 | hx | Converter, without noise: the codes read are exactly predictable | |
| MicroPythonMCU.Peripherals.Weighing.WheatstoneBridge | bridge | ||
| MicroPythonMCU.Peripherals.Weighing.LoadCell | loadCell | 5 kg load cell body | |
| Modelica.Mechanics.Translational.Sources.Force | weight | The weight of the mass placed | |
| Modelica.Blocks.Math.Gain | g | Weight = mass × g | |
| Modelica.Blocks.Sources.Constant | mass | Mass placed: 1 kg | |
| Modelica.Electrical.Analog.Basic.Ground | ground | ||
| MicroPythonMCU.Peripherals.Analyzers.LogicAnalyzer | analyzer | CH0 = PD_SCK (Logic, clock of CH1), CH1 = DOUT (SyncData: read on the falling edge, 24-bit signed words, MSB first) |