User:Bastie

This is a draft and maybe it become a book and / with helper.

= DIY-IT =

Preface
Motivation

The sites, books, magazines with DIY-Maker-IT are countless. In result of other important issues in the real world, company changes and so on, the timeliness can be better. Sometime we can work content 1:1 and it runs, but a community in my opinion can it better as one person.

For example the german C´t Make magazine "ESP32 special" from 2019 comes with hardware ESP32 and articles how to use it. Of course this works also 2023 but we need modify some steps, change URLs who doesn't exist and so on.

Restriction This book doesn't restrict to microprocessor or single board computers because take ever the hardware who best performs for your solution. In result of my problem I switch between Raspberry Pi, ESP32 and also Mac and also between different operating systems.

The second reason is that sensor, motors and other secondary hardware is working with more than one platform.

Part I
My recommendation: first make it easy, take tools, hardware and software that works with a community.

Hardware
Hardware for DIY-IT can be from micro computer to single computer board (SCB) like ESP32 to Raspberry Pi and others. If you see a GPIO in the hardware specification you are right here, but also other hardware can identify DIY-Hardware.

If microprocessor hardware is your target you need a "second" computer to programming, compile and transfer you programs. On SCB you should have a second computer because software do what you program not what you want.

Software
If you have a single board computer you can coding directly on your system. Take your favorite IDE or text editor and compiler.

With micro processor you need also this and in extension a transfer program. Some IDE include the transfer like Arduino IDE.

Programming language
Not only one programming language can be the right choice.

If you have hardware a closer look into specification can help. Mostly C, Assembler or Python is working. But in some case you can also be free or you need to learn one specific programming language.

If you want to start choose your hardware from view of your favorite programming language.

I don't recommend C because it's easy, but because it works almost every time and helps programming from microprocessor to GPU. But be aware you can take different.

Part II - projects
In different to Part I this section is to take you on a journey to a specific project.

compass application
This simple compass application is explain how to create a digital compass. This sample use the QMC5883LCompass library without temperature sensor support.

temperature measures
Next simple application shows how to measure different temperature values:


 * onboard temperature sensor, the processor heat
 * GY-271 temperature sensor, only changes of temperature
 * KY-015 temperature module, external real temperature sensor

temperature changes with GY-271 (QMC5883L)
Other than compass application sample follow source code works more low code than API centric.

external temperature sensor with KY-015 (DHT-11)
The KY-015 contains a DHT-11 sensor. Other than example above next source code read the real temperature. This sensor can be have different labels for pins. Be sure + is the power, - is the ground and the other pin is for data, on board Hera is labeling with "out". Also the positions of pins can be different.

The example is using the DHT sensor library by Adafruit and the dependency Adafruit Unified sensor.

Appendix - Hardware
This is the section for project specific hardware.

GY-271 - Compass
The GY-271 is a compass magnetic module with QMC5883L chip. It contains also a 16-bit temperature sensor, but this temperature sensor is not factory-calibrated and so can only measure temperature changes.

Connections (based on my local hardware ):


 * VCC to power
 * GND to ground
 * SCL to I2C SCL
 * SDA to I2C SDA

Projects:
 * compass application
 * temperature measure (only changes)

KY-015 - Temperature
The KY-015 is a temperature module with DHT11 chip.

Connections (based on my local hardware ):


 * + to power
 * - to ground
 * OUT to GPIO

Projects:
 * temperature measure