This video belongs to the openHPI course Wie programmiere ich meinen ersten Mini-Computer?. Do you want to see more?
An error occurred while loading the video player, or it takes a long time to initialize. You can try clearing your browser cache. Please try again later and contact the helpdesk if the problem persists.
Scroll to current position
- 00:00With our knowledge of engines we are now starting a project in which
- 00:03we build our own thermometer. For this you need your
- 00:07ESP32 microcontroller and the plug-in board.
- 00:11We also use the DS18B20 temperature sensor and a
- 00:16of your resistances, the approx. 5kΩ is big. There are, for example.
- 00:20which, the 4,7 and others the 5,1kΩ
- 00:23have. They'd both work.
- 00:25We also use two jumpers and extend with
- 00:283 Jumper cables the servo motor, so that we can
- 00:30you can put it in the motherboard.
- 00:33For the construction we put the microcontroller back to the topmost position.
- 00:37Series J and the temperature sensor left with the positive pole in 3.3V. The
- 00:42middle pin of the sensor is marked with Pin 26 connected and the last
- 00:46Pin of the sensor with ground. The Resistance is then between the
- 00:50middle data pin of the sensor and the
- 00:52Positive pole plugged in. The connections from the servomotor is so infecting,
- 00:56that the brown wire in GND, the brown wire in the orange in Pin 13 and the red in
- 01:005V is on. We have here symbolically indicated what we can expect from the
- 01:04I'm sorry I tampered with your servomotor. Now you can make your own
- 01:09Cut out the semi-circle and connect it to the Glue the housing of the servo. Afterwards
- 01:13you put a servo horn on it. The are the plastic parts, which mostly are
- 01:16are on the servo. Afterwards you can use duct tape to make a red
- 01:20Attach the clay paper arrow to it.
- 01:22For the scale, you can do it yourself. later determine what the minimum
- 01:26and maximum temperature will be, that you want to measure. We measure
- 01:31from 10 to 70 degrees Celsius. Important is of course, that the servo motor is
- 01:35only move between 0 and 180 degrees and therefore the scale here can be set to
- 01:39is arranged in a semicircle.
- 01:41In the previous lesson. you've seen the way you
- 01:45library for the servo. For this project
- 01:48the temperature sensor needs the
- 01:50OneWire and DallasTemperature libraries.
- 01:54Just search for these names in the library manager and
- 01:58install the appropriate Libraries. We're going to start
- 02:02Program again with our block for the basic structure of a
- 02:06Arduino program. For the use of the
- 02:08temperature sensor we need to in the setup part. The Block
- 02:14you can find under "Sensors" and wear there pin 26. In the main program
- 02:20we can then measure the temperature,
- 02:22through the measure block. To now Servo, we use the
- 02:28Servo block from the "Motors" category.
- 02:31Now the question arises, on which angles are between 0 and 180
- 02:35degrees we want to move this.
- 02:37For this we use the "Map"-Block from the "Math" category. This
- 02:44just needs to know what values he has minimum and maximum and to
- 02:50which he can use to define the minimum and maximum to be converted. Since we're not here
- 02:56Scale only temperature values between 10 and 70 degrees interest, say
- 03:00we that we receive only such and since the servo only moves between 0
- 03:08and can move 180 degrees, carry we'll enter this as a result. Well
- 03:13this block takes over for us the Calculation from temperature value towards
- 03:18to the degree value. Here you can see the Code again at a glance. If
- 03:25you the map block so much space you can use the mouse
- 03:30right-click and select Click "Inline Inputs". Thus
- 03:36the entries all in one line, instead of all of them together. To now
- 03:42to test whether the conversion
- 03:44we'll use a hair dryer.
- 03:46the sensor. When we first saw the thermometer have tried, were with us in the
- 03:51Room 30 degrees. The switched on
- 03:54Fön we quickly reach a Temperature of almost 70 degrees! If
- 03:58you turn off the hair dryer, cool it down. the air the sensor slowly
- 04:03again and the thermometer shows the room temperature again soon.
- 04:08So that the temperature sensor is correct
- 04:12it works, it's important, that the resistance has about 5kΩ
- 04:16The exact resistor size can be found in the documentation you can find in the
- 04:20can ergoogeln fast. Also with
- 04:23Special care must be taken when connecting!
- 04:25If you misread the sensor.
- 04:26he'll be very quick to come back and see you.
- 04:28very hot. So hot, you'd have to you can burn it. So go ahead
- 04:33best finish the circuit before you plug the power in. And
- 04:37you should notice that the sensor If the cable gets hot, pull the cable quickly.
- 04:40from the microcontroller and let it
- 04:41cool down before you plug it in properly.
- 04:43Less dangerous is the Servo. But make sure here that
- 04:47you connect the red cable to 5V. With 3.3V he doesn't do anything.
- 04:53That's it with this project. In the next lesson we will use
- 04:57project with the stepper motors.
To enable the transcript, please select a language in the video player settings menu.