6. case 04 trimpot

6.1. Introduction


The trimpot is a common pressure regulation component. In this case, we are going to read output voltage of the trimpot and show the voltage with a bar graph in 5*5 LED allay of micro:bit.

6.2. Hardware Connect


../../_images/LMsve7H.png

  • Connect circuit as above picture and put 2 AAA batteries to the batteries pack.

6.3. Principles of Circuits


../../_images/VFmWZkG.png

The GND of slot on micro:bit is into innards of batteries’ GND to generate current loop.

6.4. Introduction of Components


Trimpot

  • The trimpot is a pressure regulation component which included a resistance and a slide system. The resistance measured varies based on the movement of a knob or slider between the middle terminal and outer terminals.

  • There is a 10KΩ trimpot on the experiment box. When it turns left, it will be 0Ω; when it turns right, it will be 10KΩ.

../../_images/jHZQhOu.png

6.5. Software


Step 1

../../_images/t34k5Zb.png

Step 2

../../_images/3Ekc31T.png

  • Snap plot bar graph into the forever to show a bar graph.(A bar graph is a kind of table which can show number by diffrent lengths.)

  • “analog read pin” is to read a signal of a pin.(0~1023)

Program

---

6.6. Result


  • Rotate the trimpot, the height of the bar graph will change.

../../_images/WDagGas.gif

6.7. think


  • Is the trimpot could be a fixed resistance?

6.8. Questions


6.9. More Information