Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

My own engineering handbook

1st Topic: PWM

Mosfets would block the current and only start allowing current once given the voltage apply to the
3rd leg. The more voltage applied, the more current will be able to flow.

Pin 3 of the 555 timer will do this job.

We’ll should only apply voltages, not current for the gate of the mosfets. Now to stop the current
built up on the mosfet gate pin, we apply a resistor and connect to the ground.

Back EMF in iductors can break an LED, that’s why we’ll need a flyback diode (in parallel or in series
work fine)

Inside a 555 timer, between pin 1 and 8, there are 3 resistors which has the same voltage drop
across each.

Two sides of the resistor will be connected to two different signs on 2 different comparators, thus
for pin 2 to be on, V2(-) must be lower than V2(+); for pin 6, V6(-)=V2(+) + V(R2) must be lower than
V6(+)

Pin 2 for Set, pin 6 for Reset. This is the truth table:

S R Not Q
High Low High
Low Low Low
Low High Low

The not Q will then connect to pin 3 – the inverter, where the timing interval begins.

1st Topic: Finished!!!

2nd Topic: Data storage

We have an Arduino library for data storage, named SD. And to communicate (read, write,…) with
our SD card, we use SPI library.

To create a file, we use SD.open(), with its name in the beginning and FILE_WRITE to enable reading
and writing. Then name the instance of the opened file using variable referring technique as usuals.

In case of checking if the file is running okay, use if (FILE_NAME). To write to the file, use
FILE_NAME.println(). Then close the file with FILE_NAME.close().

FILE_NAME.available() is to check if anything is available to read, the using technique is the same for
checking if opens normally. Then close the file again.

All of the things above should happen in the setup section.

To upload a random file from your computer, link to its address.

2nd Topic: Finished!!!


3rd Topic: Connection to a website

For 2 softwares to interact with each other, we use API. Different types of API are Web API, Database
API, File API.

For a device to access to an API, it uses an API key. API key can authenticate a request to an API, to
keep the API away from unauthorized access.

To create your API key for Google Maps, you get to Google Consoles for Developers, then choose
Credentials -> Create Credentials -> API key -> Create. And for your program, create a constant char
for your API key, then declare it together with the beginning of the software you want to
communicate with.

Having API isn’t enough for a website and our system to really communicate, since it doesn’t satisfy
the needs of methods, in another way of saying, path for data transferring. API itself doesn’t do any
data transferring. They just allow it.

So, for websites, to communicate, the best way is usually to use WiFi connection. Arduino has a
library for it, named WiFi.h, we’ll then use that to get WiFi-related things done.

Wifi has a unique indentifier called SSID. Create a constant char for SSID and password, and if you
want to connect to WiFi, begin with both.

That’s enough for a connection to be made between 2 softwares(with Web API).

Chapter 3: Finished!!!

4th Topic:

A client is the one which sends requests, and a server is the one which responds to the clients’
commands. An analogy for this: the client is the customer and the server is the bussiness service.

In this case, a client is a web browser. For a web browser to connect to the desired target as a client
want to connect to a server, it must ensure that the server listened to a specific port, then find its
way to connect to that port, using the client’s IP address. For example, if the client listens to port 80,
which corresponds to HTTP, then the connection would be made once the web browser enterred
the HTTP format together with the client’s IP address.

A set of key-value pairs that described responses or requests is called a header.

Chapter 4: Finished!!!

5th Topic: Boost/Buck converter

Boost/buck converters are devices used to adjust the voltages, boost - to increase and buck – to
decrease.

Boost converters consist of capacitors, inductors and mosfets. We supply voltages to the mosfets
simply by PWM, allowing current to flow. Once the current flows, the inductor builds up a magnetic
field around it, which then collapses when the mosfet switch is ‘off’. Since the on-off duration for
the mosfet is too small, the inductor can never fully collapses. Together with the ‘on’ input voltage,
they add up, and the voltage are now higher than the input.

Buck converters are like boost converters but they use the the back emf property of the inductor.

Chapter 5: Finished!!!
6th Topic: Communication

UART (Universial Asynchronous Receiver Transmitter) is the communication between 2 connected


sides: TX and RX (using only one wire). Both must have common configuration to work together:
same transmission speed, data length, start and stop bits.

Both I2C and SPI are synchronous, thus the SDA and the SCK are in sync with each other, so when we
send the data, we also create a clock pulse that has the exact same duration, so the system knows
exactly when the transmission ends.

In case there are many slaves, I2C uses slaves’ address to send data to a targeted slave, but it’s half
duplex. SPI is full duplex and it uses the pulse 0 of the master to call the targeted slave.

Chapter 6: Finished!!!

7th Topic: FlowchartFun exploration

You might also like