Build a 3D Printed Arduino Weather Station: a Beginner's Guide to 3D Printing + Electronics

by Daniel DSouza in Circuits > Arduino

41 Views, 1 Favorites, 0 Comments

Build a 3D Printed Arduino Weather Station: a Beginner's Guide to 3D Printing + Electronics

cover_3d_weather_station.png

What if you could design the housing for your electronics project, press a button, and have it physically appear in front of you a few hours later — perfectly fitted, no screws, no drilling, just a custom shell you designed yourself?

That is exactly what a 3D printer lets you do. And this project is designed to teach you both things at once: how 3D printing actually works, and how to use that knowledge to build something genuinely useful — a mini weather station that reads room temperature and humidity and displays it on a small OLED screen, all sitting inside an enclosure you 3D print yourself.

By the end of this Instructable, you will have:

  1. A working understanding of how FDM 3D printer's work
  2. Printed your first functional enclosure
  3. Assembled a live weather station using Arduino
  4. Learned about filament types, slicer software, and print settings

Whether you have access to a school or makerspace 3D printer or are considering getting your own — if you're in India, you can explore a range of 3D printers and filament options online before deciding what suits your budget and project.

Supplies

All the electronic components used in this project — Arduino Nano, DHT22, OLED displays, and jumper wires — are standard maker parts available at most electronics stores.

Understanding How a 3D Printer Works

step1_how_fdm_works.png

Before you design or print anything, it pays to understand what is actually happening inside the machine.

The Technology: FDM (Fused Deposition Modelling)

The most common and affordable type of 3D printing is called FDM — Fused Deposition Modelling. Here is the process in simple terms:

  1. A plastic filament (like a long spool of wire) is fed into a heated extruder nozzle
  2. The nozzle melts the plastic to around 200°C
  3. The nozzle moves precisely in X and Y directions, laying down a thin line of melted plastic
  4. The build plate drops down slightly after each layer
  5. The next layer is deposited on top of the previous one
  6. This repeats — layer by layer — until your 3D object is complete

Key Printer Parts to Know

Part What It Does

Extruder Feeds and melts the filament

Hotend / Nozzle The tip where plastic comes out (usually 0.4mm)

Heated Bed Keeps the first layer stuck while printing

Print Head / Carriage Moves in X and Y axes

Z-axis Rod / Lead Screw Moves the bed down after each layer

Stepper Motors Precise motors controlling all movement

Control Board The "brain" running the printer firmware

What is Filament?

Filament is the raw material for FDM printing — plastic in wire form, usually 1.75mm in diameter, wound on a spool.

The two most beginner-friendly filament types:

PLA (Polylactic Acid)

  1. Made from cornstarch — biodegradable
  2. Prints at ~200°C nozzle, ~60°C bed
  3. Easy to print, low warping
  4. Perfect for enclosures, cases, decorative parts
  5. Best choice for this project

PETG (Polyethylene Terephthalate Glycol)

  1. Stronger and more heat-resistant than PLA
  2. Slightly harder to tune but excellent finish
  3. Good for parts that need durability

Tip: For your first print, always use PLA. It is forgiving, safe, and produces great results without fuss.

Choosing the Right 3D Printer for This Project

Blog images 1 - 2026-08-04T152936.245.png

Not all 3D printers are the same. For electronics enclosures and maker projects, here is what to look for:

Printer Types

Cartesian (Bed-Slinger)

The bed moves in the Y-axis, the print head moves in X and Z. Most beginner printers like the Ender 3 are this type. Affordable, widely supported, huge community.

CoreXY

Both X and Y motion is handled by the print head; the bed only moves in Z. Faster, more accurate, but typically pricier. Examples: Bambu Lab A1, Voron.

Delta

Three arms move the print head. Fast for tall cylindrical prints, but harder to calibrate. Less common for beginners.

Specs That Matter for This Project

Spec Recommended Minimum

Build Volume 120 × 120 × 120 mm (our enclosure is ~90 × 60 × 40 mm)

Nozzle Diameter 0.4 mm (standard)

Layer Resolution 0.1–0.2 mm

Heated Bed Yes (needed for PLA adhesion)

Filament Compatibility PLA / PETG

What You'll Need — Full Parts List

Blog images 1 - 2026-08-04T154255.110.png

Electronics Components

  1. Component Qty Purpose
  2. Arduino Nano 1 Main microcontroller
  3. DHT22 Sensor 1 Reads temperature + humidity
  4. 0.96" OLED Display (I2C, SSD1306) 1 Shows readings
  5. 10kΩ Resistor 1 Pull-up for DHT22 data pin
  6. Jumper Wires (M-F) 10 Connections
  7. Mini USB Cable 1 Power + programming
  8. Small Breadboard (optional) 1 Prototyping

3D Printing Materials

Item Spec

PLA Filament 1.75mm, any colour — white or grey recommended

Approx. filament used ~30g (well under 1 roll)

Tools

  1. Computer with Arduino IDE installed (free)
  2. Slicer software: Ultimaker Cura (free) or PrusaSlicer (free)
  3. 3D Printer (access via school, makerspace, or own)
  4. Soldering iron (optional — crimping or jumper wires work fine)
  5. Small Phillips screwdriver

Designing the Enclosure (or Using the Provided STL)

step4_enclosure_design.png

This is where 3D printing becomes genuinely exciting — you can design a case that fits your exact components, not whatever generic box happens to be available.

Enclosure Design Decisions

Our enclosure has:

  1. Two pieces: a bottom tray (holds the Arduino and breadboard) + a snap-fit lid
  2. Front face cutout: 26 × 14mm rectangular window for the OLED display
  3. Rear slot: 9mm wide for the USB cable (power input)
  4. Side vents: 4 × 2mm slots so the DHT22 can sense actual room air (not the heat from inside the case)
  5. Snap-fit clips: four tabs on the lid that click into the tray — no screws needed

If You Are New to CAD

You do not need to design from scratch. Use one of these free tools:

  1. Tinkercad (browser-based, perfect for beginners — just drag and combine shapes)
  2. Fusion 360 (more powerful, free for personal use)
  3. FreeCAD (fully open-source)

For this project, download the ready-made STL files here:

(STLs: weather_station_base.stl and weather_station_lid.stl)

You can modify them in Tinkercad if you want to change colours, add your name, or resize for different components.

Key design rule: Always leave 0.2–0.3mm tolerance on mating surfaces in FDM prints. Parts designed for exactly 26mm will be slightly smaller after printing due to shrinkage — design the cutout at 26.3mm and the OLED at 26mm and they'll fit perfectly.

Slicing Your Model — Turning a 3D File Into Printer Instructions

step5_slicer_settings.png

A 3D printer does not understand an STL file directly. You need slicer software to convert it into G-code — the actual movement instructions the printer follows.

Recommended Slicer: Ultimaker Cura (Free)

Download at: ultimaker.com/software/ultimaker-cura

Print Settings for This Project

Setting Value Why

Layer Height 0.2mm Good balance of speed and detail

Infill Density 20% Enough strength for an enclosure

Infill Pattern Grid or Gyroid Gyroid is slightly stronger

Print Speed 50 mm/s Safe default for most printers

Supports OFF The enclosure is designed to print without supports

Build Plate Adhesion Brim Helps with adhesion on the first layer

Nozzle Temp 200–210°C For PLA

Bed Temp 60°C For PLA

Walls / Perimeters 3 Gives the enclosure solid walls

Understanding Infill

Infill is the internal structure of your print. You don't print solid plastic — instead, the slicer creates a grid or pattern inside to save material while keeping strength. For a small enclosure:

  1. 10% infill = very light, slightly fragile
  2. 20% infill = recommended — good balance
  3. 40%+ infill = heavy, strong, uses more filament and time

Printing the Enclosure

Blog images 1 - 2026-08-04T160616.395.png

Now it's time to print. Here's the sequence:

Step-by-Step: First Print Checklist

Before Starting:

  1. Bed is levelled (use paper-thickness test or auto-levelling if your printer has it)
  2. Filament is loaded and extruding cleanly
  3. First layer sticks properly — watch the first 3 minutes
  4. G-code is transferred to SD card or via USB

Estimated Print Times:

  1. Bottom tray: ~2.5 hours at 0.2mm / 50mm/s
  2. Lid: ~1.5 hours
  3. Total: ~4 hours for both parts

Common Issues and Fixes

Problem Likely Cause Fix

First layer not sticking Bed too far from nozzle Lower the nozzle by 0.05mm (live adjust)

Stringing between parts Temperature too high Drop nozzle temp by 5°C

Layer shifting mid-print Print speed too high Reduce to 40mm/s

Warping at corners Bed temp too low Increase to 65°C, add brim

Under-extrusion (gaps) Clogged nozzle or cold Do a cold pull or increase temp

Pro Tip: The first layer is everything in 3D printing. If your first layer looks like a flat, slightly squished line with no gaps — you are set. If it looks like spaghetti floating above the bed — stop, re-level, and try again.

Wiring the Circuit

step7_wiring_diagram.png

With the enclosure printed, let's wire the electronics.

Wiring Table

DHT22 Sensor → Arduino Nano

DHT22 Pin Arduino Nano Pin Wire Colour

VCC (Pin 1) 3.3V Red

Data (Pin 2) D2 Yellow

NC (Pin 3) — —

GND (Pin 4) GND Black

OLED Display → Arduino Nano

OLED Pin Arduino Nano Pin Wire Colour

VCC 5V Red

GND GND Black

SDA A4 Blue

SCL A5 Green

How I2C Works (briefly)

The OLED uses a protocol called I2C (Inter-Integrated Circuit). It needs only two wires — SDA (data) and SCL (clock) — to communicate. The Arduino's A4 and A5 pins are hardware I2C pins. Multiple I2C devices can share the same two wires as long as they have different addresses. The SSD1306 OLED has a default address of 0x3C — the library handles this automatically.

Programming the Arduino

Blog images 1 - 2026-08-04T161356.680.png

Required Libraries

Install these via Arduino IDE → Tools → Manage Libraries:

  1. DHT sensor library by Adafruit
  2. Adafruit Unified Sensor by Adafruit
  3. Adafruit SSD1306 by Adafruit
  4. Adafruit GFX Library by Adafruit

The Sketch

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <DHT.h>

// --- Pin Definitions ---
#define DHTPIN 2
#define DHTTYPE DHT22

// --- OLED Setup ---
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_RESET -1
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

// --- DHT Setup ---
DHT dht(DHTPIN, DHTTYPE);

void setup() {
Serial.begin(9600);
dht.begin();

// Initialise OLED
if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
Serial.println(F("OLED not found!"));
while (true); // Halt
}

display.clearDisplay();
display.setTextColor(SSD1306_WHITE);
display.setTextSize(1);
display.setCursor(15, 20);
display.println("Weather Station");
display.setCursor(20, 40);
display.println("Initialising...");
display.display();
delay(2000);
}

void loop() {
float humidity = dht.readHumidity();
float temperature = dht.readTemperature(); // Celsius

// Check for failed readings
if (isnan(humidity) || isnan(temperature)) {
Serial.println("DHT22 read error!");
return;
}

// --- Display ---
display.clearDisplay();

// Title bar
display.setTextSize(1);
display.setCursor(25, 0);
display.println("WEATHER STATION");

// Temperature
display.setTextSize(2);
display.setCursor(0, 18);
display.print("T: ");
display.print(temperature, 1);
display.println(" C");

// Humidity
display.setCursor(0, 40);
display.print("H: ");
display.print(humidity, 1);
display.println(" %");

display.display();

// Serial monitor output
Serial.print("Temp: ");
Serial.print(temperature);
Serial.print(" C | Humidity: ");
Serial.print(humidity);
Serial.println(" %");

delay(2000); // Read every 2 seconds
}

Code Walkthrough

  1. dht.readTemperature() — reads temperature in Celsius from the DHT22. Pass true for Fahrenheit.
  2. dht.readHumidity() — returns relative humidity as a float (e.g., 65.4)
  3. isnan() — DHT22 occasionally fails to respond. This check prevents garbage values from being displayed.
  4. display.clearDisplay() — clears the OLED buffer before drawing new values
  5. display.display() — pushes the buffer to the actual screen. Nothing shows until this is called.
  6. delay(2000) — DHT22 needs at least 2 seconds between readings; any faster and it returns errors.

Assembly — Fitting It All Into the Enclosure

With your enclosure printed and code uploaded, it's time to assemble.

Assembly Sequence

1. Test before closing

Before any final assembly, plug in the Arduino and verify the OLED displays temperature and humidity readings correctly. Much easier to fix wiring now than after closing the case.

2. Fit the OLED

The OLED slides into the front cutout. If you printed it correctly, it should be snug with the screen face flush to the case. You can use a small dot of hot glue or 3M foam tape on the back of the display to hold it in place.

3. Route the wires

Tuck the wires flat against the bottom of the tray. The DHT22 should sit near the side vent holes so it can sense actual room air.

4. Seat the Arduino

The Arduino Nano sits in the tray with its USB port aligned with the rear slot. The USB cable passes through this slot for power.

5. Snap the lid

Align the four snap-fit tabs with the slots on the tray and press firmly until you hear/feel each tab click. The lid should sit flush with no gaps.

6. Final test

Plug in power. OLED should show the startup screen, then begin displaying readings within 3 seconds.

Calibration, Improvements, and What to Try Next

Your weather station is running. Here's how to go further.

Calibration

The DHT22 is accurate to ±0.5°C and ±2–5% humidity — reasonably precise for a hobbyist sensor. If you have a reference thermometer, you can add an offset in the code:

float temperature = dht.readTemperature() - 1.5; // offset for your sensor

Project Upgrades to Try

Upgrade What to Add

Data logging Add an SD card module — log readings with timestamps

Wi-Fi push Swap Arduino Nano for an ESP8266/ESP32 — send data to a Thingspeak dashboard

Battery powered Add a Li-Po battery + TP4056 charging module + boost converter

Multi-room Print more stations; use ESP-NOW to send data wirelessly to a central display

3D print a desk stand Design a tilted stand in Tinkercad for a better display angle

Add a buzzer Alert when humidity goes above 80% (mould risk)

What You Learned About 3D Printing

Take a moment to note what this project actually taught you:

✅ How FDM printers build objects layer by layer

✅ The difference between PLA, PETG, and which to choose

✅ Key slicer settings: layer height, infill, walls, bed adhesion

✅ How to design for printability (tolerances, no-support geometry)

✅ First-layer diagnosis and common failure fixes

✅ How to integrate a 3D-printed part into a real functional project

That is the real value of 3D printing for makers and engineers — not just producing plastic shapes, but designing purpose-built parts that make your electronics projects self-contained and professional.

Author Notes

This project is a great first step into combining electronics and 3D printing — two skills that reinforce each other significantly. Once you've done one enclosure project, you start thinking about every future build differently: "I could just print a case for that."

Have questions, found a bug in the code, or printed a modified version? Drop a comment below.


External Resources

  1. Tinkercad — Free Browser-Based 3D Design -https://www.tinkercad.com/learn
  2. TinkerCAD Tutorial (8 Steps) - https://www.instructables.com/TinkerCAD-Tutorial-1/
  3. All3DP — What Is PLA? Materials Guide - https://all3dp.com/2/what-is-pla-3d-printing-materials-simply-explained/
  4. Adafruit Learning System — DHT22 Sensor Guide - https://learn.adafruit.com/dht?view=all