Skip to content

Latest commit

 

History

History
76 lines (36 loc) · 2.25 KB

experiment_box_case_04.md

File metadata and controls

76 lines (36 loc) · 2.25 KB

case 04 trimpot

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.

Products Link

ELECFREAKS Experiment Box Kit

Hardware Connect

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

Principles of Circuits

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

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Ω.

Software

Step 1

Click makecode https://makecode.microbit.org/#

Click on "New Project" and set a new Project.

Step 2

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

Program link:https://makecode.microbit.org/_VewWgwe8HVT1

You also could directly download program by visiting website as below:

<iframe style="position:absolute;top:0;left:0;width:100%;height:100%;" src="https://makecode.microbit.org/#pub:_VewWgwe8HVT1" frameborder="0" sandbox="allowpopups allowforms allowscripts allowsameorigin"></iframe>

Result

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

think

Is the trimpot could be a fixed resistance?

Questions

More Information