Make Authentic Turkish Coffee With Arduino Automation
by rirmak in Circuits > Arduino
35 Views, 1 Favorites, 0 Comments
Make Authentic Turkish Coffee With Arduino Automation


Turkish coffee is one of the world’s oldest coffee brewing traditions, cherished for its rich aroma, intense flavor, and velvety foam. It is prepared from very finely ground coffee, brewed slowly in a small, long-handled pot called a copper cezve. The coffee is never filtered — it is served with its grounds, creating a unique texture and flavor profile.
Authentic Turkish coffee preparation is all about heat control.
When brewing:
- At 60–70 °C, the first delicate aromas dissolve into the water. This stage releases floral and fruity notes that can easily be lost if heated too quickly.
- At 80–85 °C, the body of the coffee develops as coffee oils and soluble solids infuse.
- At 90–92 °C, the flavor reaches full intensity, and the characteristic foam begins to form.
- Above 96 °C, volatile oils begin to evaporate rapidly, and over-extraction can cause bitterness.
The goal is to slowly raise the temperature, allowing each flavor phase to fully develop, and stop just before boiling to preserve both aroma and foam. Traditionally, this requires constant attention from the brewer — one eye on the cezve, one hand ready to lift it from the heat at the perfect moment.
In this project, we’ll use Arduino UNO to automate this process with precise temperature monitoring and controlled heating.
Our smart Turkish coffee maker will:
- Gently warm the water through the ideal aroma-extraction stages.
- Detect the exact point before boiling to stop the heating.
- Deliver an authentic cup of Turkish coffee with traditional taste, made with modern precision.
The result is a perfect balance between centuries-old tradition and 21st-century automation.
Supplies
Electronics
- Arduino UNO R3 (or compatible clone)
- Relay Module – 4 channel (for controlling high-power devices)
- DS18B20 Waterproof Temperature Sensor (probe type)
- I²C 16x2 LCD Display (to show temperature and status)
- Prototyping Shield (for soldering or easy connections on top of Arduino, optional)
- 3 Momentary Push Buttons (Start, Stop, Settings – red, green, blue)
- 9V DC Power Adapter (for Arduino, e.g., 1A)
- AC Socket Module (220V) (to control the coffee brewing device)
- Jumper Wires & Multi-strand Cables
Electrical Hardware
- 220V Power Cord (with grounded plug)
- Terminal Blocks (for AC connections)
- Fuse or Circuit Breaker (recommended for safety)
Mechanical / Enclosure
- MDF or Wooden Board (for mounting the electronics)
- Plastic or Wooden Box (for housing the control buttons)
- Screws and Cable Ties (for securing components and wires)
Safety First

Safety is the top priority when working with this project. This build involves 220V AC mains electricity, which can be lethal if handled improperly. Always take the following precautions:
- Use a fuse or circuit breaker appropriate for your load.
- Ensure proper grounding of all metal parts and the AC socket.
- Keep all mains wiring inside insulated enclosures.
- Disconnect power before making or changing any electrical connections.
Most electric Turkish coffee pots on the market operate in the 1 kW to 2 kW range, which means they draw high current from the mains. Your wiring, relay module, and power socket must be rated for at least the maximum current of the appliance (e.g., 10–16A for 220V systems).
SAFETY - RELAY MODULE

The “10A 250VAC” label on the relay module means:
- Maximum current: 10 amperes
- Maximum voltage: 250 volts AC
- Maximum power capacity (theoretical):
P=V×I
P=250 V×10 A
P=2500 W (2.5 kW)
So, it can handle up to 2.5 kW (for purely resistive loads).
However, in practice:
- If the relay modules are of low-cost or generic manufacture (e.g., some made in China), running them at full load for extended periods can shorten their lifespan.
- For motors, inductive loads, or devices with high inrush current (e.g., some heaters), it is safer not to exceed 70–80% of the maximum rated load.
- This corresponds to a safe operating range of approximately 1.8–2.0 kW.
NOTES:
Since electric Turkish coffee pots typically operate in the 1–2 kW range, this relay can be used for the project — but proper wiring and adequate cooling (to prevent overheating) are essential.
Since I already have a 4-channel relay module, I chose to use it for this project. However, a single-channel mechanical relay or a solid-state relay (SSR) could also be used as an alternative.
Fuse and Circuit Breakers – Why They Are Important

When working with 220V AC mains power, protecting your circuit and appliances from overcurrent is essential. Two common protection devices are:
- Fuse:
- A fuse is a simple, single-use protection device. When the current exceeds its rated value, the fuse element melts and disconnects the circuit. Fuses are inexpensive and fast-acting, but must be replaced after each trip.
- Example: For a 1.5 kW coffee pot at 220V (≈ 6.8A), use a fuse rated around 8–10A for protection.
- Circuit Breaker:
- A circuit breaker is a reusable protection device. When the current exceeds its rating or in case of a short circuit, it trips and can be reset manually. Circuit breakers are more expensive but offer convenience and durability.
NOTES:
Always choose fuses or breakers with a current rating slightly above your device’s normal operating current, but below the safe maximum for your wiring and relay. This ensures protection without nuisance trips.
I use the system described in this Instructable by connecting it to a power outlet that has a built-in circuit breaker.
Mechanical Assembly
Secure the Arduino, relay module, LCD, and terminal blocks to the board using screws (M3 Bolts and nuts).
Place the buttons inside a small plastic enclosure and use cable ties or spiral wrap to organize the wiring.
Low Voltage Power Supply (9V 1A)

Plug the DC adapter into the Arduino’s barrel jack input.
Distribute the 5V and GND lines from the Arduino to:
- The relay module’s VCC and GND,
- The LCD’s VCC and GND,
- The common GND bus for the buttons and sensor.
LCD Connection

The LCD module usually comes with an I²C backpack:
- SDA (BLUE) → A4,
- SCL (GREEN) → A5 (on Arduino UNO).
- Connect 5V (RED) and GND (BLACK)
Adjust the contrast using the potentiometer (you will first see solid blocks on the screen → then the text will appear).
Temperature Sensor (DS18B20)

Red → 5V,
Black → GND,
Yellow (Data) → D2 (recommended).
Use a 4.7 kΩ resistor as a pull-up between the Data line and 5V.
When immersing the probe into the coffee pot, make sure the tip does not touch the bottom (to avoid incorrect readings).
Note:
There are many counterfeit DS18B20 sensors on the market, which can cause various issues such as inaccurate readings or unstable operation. Always source from a reliable supplier.
For more information abouth fake DS18B20 please read Chris Petrich's article
Button Box


Connect the 3 momentary push buttons as follows:
- One leg of each button goes to 5V.
- The other leg is connected both to a 10kΩ resistor to GND and to the digital input pins (D3, D4, and D5).
In the code, configure the pins as pinMode(pin, INPUT) (no internal pull-up, since an external pull-down resistor is used).
Suggested color coding: Green = Start, Red = Stop, Blue = Mode/Settings.
Connecting Relay Module Signal Inputs
The relay module’s VCC and GND should be connected to the same power source as the Arduino.
Since only one relay channel is used, its input is connected to pin D8 on the Arduino.
Wiring the AC Socket Through the Relay
Warning:
This step involves 220V AC mains wiring. Attempt this only if you have experience with electrical work. Always disconnect the power before making any connections. Never interrupt or remove the ground (PE) connection for safety reasons.
Ground (PE) and Neutral (N):
- Take the PE (ground) wire and the Neutral (N) wire from the mains and connect them directly to the AC socket via a terminal block. These lines remain uninterrupted.
Live (L) Line via the Relay:
- Take the Live (L) wire from the mains and connect it to the COM (Common) terminal of Relay Channel 1.
- From the NO (Normally Open) terminal of the relay, connect to the Live (L) terminal of the AC socket.
- This way, the relay will switch the live line on and off, controlling the power to the connected appliance.
Additional Protection:
- Place a fuse or thermal circuit breaker in series with the Live (L) line at the input, before it reaches the relay.
- Use heat-shrink tubing on all exposed connections and secure the wires with cable ties to prevent mechanical strain or accidental disconnection.
NOTE:
NORMALLY OPEN =THE CIRCUIT IS NORMALLY OPEN=THE RELAY IS PASSIVE
First TEST
Dry test (without connecting 220V AC):
- Before wiring the 220V AC input, test the Arduino and relay system to ensure they work correctly.
- Power the Arduino from its DC adapter; the LCD should show the splash screen and a temperature reading.
- Press each button and verify the on-screen state changes.
- Run a simple test sketch to toggle the relay; listen for the “click” sound from the relay module.
Connect the heater:
- Once the low-voltage test is successful, plug the electric cezve into the controlled AC socket.
- Immerse the DS18B20 probe in the water inside the cezve and secure the cable along the rim.
- Before brewing coffee, run a water-only cycle to observe the temperature curve and verify that the system cuts off just before boiling (≈91–92 °C). Adjust thresholds if needed.
Safety:
Keep mains wiring enclosed and do not touch any live parts during testing.
Always take precautions to prevent hot water from spilling onto yourself — use a stable surface, avoid overfilling the pot, and keep your hands clear while heating.
Temperature Control Logic and Brewing Routine

The temperature values shown here are for illustration purposes. They may vary depending on the type of coffee, roast level, and personal taste preferences.
Temperature Control Logic (Recommended)
- Multi-stage heating:
- Pre-infusion: Heater ON at the lower limit of 65 °C, gently warming up to 70 °C to allow initial aroma extraction without losing delicate flavors.
- Body stage: Maintain 80–85 °C with ON/OFF hysteresis to build coffee body and ensure proper extraction of oils and soluble solids.
- Final stage: Heater ON until reaching 91–92 °C, then switch OFF just before boiling to preserve foam and aroma.
- For a simpler approach, you can start with bang-bang control (e.g., ON when < 88 °C, OFF when ≥ 92 °C) and later upgrade to PID control for smoother temperature regulation.
- To detect the foam rise, use a combination of time + temperature threshold, ensuring the Stop button allows manual intervention at any moment.
Step 12 — Brewing Routine
- Add cold water, sugar (optional), and finely ground Turkish coffee to the cezve.
- Press Start (Green button) → the automated heating profile begins; the LCD displays the temperature and current stage.
- The system cuts power to the heater at around 92 °C, preserving the foam.
- Press Stop (Red button) for an emergency stop or to serve the coffee.
Final Assembly
When the design phase is complete and the system is ready for routine use;
Enclose all AC connections inside a sealed, insulated box.
Organize cable routes and secure any vibrating parts with cable ties.
For long-term use, replace the MDF base with an insulated panel or enclosure to reduce the risk of fire.
Arduino Code

In this code, I am sharing an example Turkish coffee brewing program using my personal preferred temperature thresholds. This recipe produces Turkish coffee slightly cooler than the traditional method. You can adjust the temperature values and timing to suit your own taste preferences.
Project Header and Libraries
What it does:
- Adds the necessary libraries for SD card logging, I²C LCD display, and the DS18B20 temperature sensor.
- SPI.h and SD.h handle the SD card.
- Wire.h is for I²C communication (used by the LCD).
- OneWire.h and DallasTemperature.h are for the DS18B20 sensor.
The SD card is an optional feature in this project. It was added to allow:
- Recording temperature logs for testing and analysis,
- Storing multiple brewing protocols,
- Saving and recalling different coffee heating algorithms.
If you do not need these features, the SD card module can be omitted and the related code sections removed.
Pin Definitions and Variables
What it does:
- Assigns pins for sensor, buttons, relay, and SD card.
- coffee_brewing_mode tracks if brewing is active.
- process_phase stores the current brewing phase code for LCD display.
Why:
Clear pin mapping makes the code easier to maintain and change later.
Setup Function
What it does:
- Starts serial communication for debugging.
- Sets button pins as inputs, relay pins as outputs.
- Initializes LCD and DS18B20 sensor.
- Calls checkSDCard() to verify if an SD card is available.
Why:
This prepares all hardware components before entering the main loop.
Main Loop
What it does:
- Reads the current temperature.
- Displays it on the LCD.
- Logs it to SD card if available.
- Checks button inputs:
- If Start pressed → begins brewing (brewCoffee).
- If Cancel pressed → stops brewing.
Why:
This is the main control loop — constantly reading temperature, updating display, logging data, and reacting to user input.
SD Card Check
What it does:
- Tests whether the SD card is inserted and functioning.
- Updates the LCD with the result.
Why:
Prevents the program from attempting to log data if the SD card is not available.
Write Temperature to SD Card
What it does:
- Opens temperature.txt on the SD card.
- Appends the current temperature in Celsius.
Why:
Creates a temperature log for testing, debugging, or analysis.
Display Temperature on LCD
What it does:
- Shows the temperature on the first line of the LCD.
- Shows the current brewing phase on the second line.
Why:
Gives real-time feedback to the user during brewing.
Coffee Brewing Logic
What it does:
- Heats in three phases:
- Fast heating until 55°C
- Slow heating for aroma protection until 70°C
- Very slow heating until 80°C
- Stops heating once 80°C is reached.
Why:
This staged heating preserves coffee aroma and prevents boiling too early.