How can this possibly use 25,602 bytes? OLED/DS18B20/Uno

Hello everyone, thanks for taking the time to look at this.

I've recently got into Arduino with zero programming skills, and only slightly more wiring skills. So far, I've been decently self-sufficient, and I'm currently going through Paul McWhorter's Arduino lessons on YouTube. The videos are teaching me seemingly everything in due time, but I've decided to also start a small gadget in the meantime.

Inside the bedroom, I've set up an Arduino Uno R3, three DS18B20 temp sensors (with pull-up resistor), and a run-of-the-mill 0.96" OLED. One temp sensor is placed in the central air vent, one is in a 'general' area of the room, and another is poking out pf the window for an outdoor reading.

After seeing some videos showing the capabilities of an Arduino in a smarter person's hands, I'm confused as to how my sketch is over 25,600 bytes. I didn't expect my code to have the body to rock a Speedo to the beach, but that seems a bit "fluffy" to me.

Sorry for the lack of commenting in the code, I'm generally good about it, but there isn't really any rocket surgery involved in this:

#include <OneWire.h>
#include <DallasTemperature.h>
#include "U8glib.h"

U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NO_ACK);

#define ONE_WIRE_BUS 2
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

//Sensor Index IDs: Outside is (0), Bedroom is (1), Vent is (2)


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

}

void loop(void)
{
  sensors.requestTemperatures();
  delay(1000);
  
  u8g.firstPage();
  do {
    draw();
  } while( u8g.nextPage() );
  delay(1000);
  
}

void draw(void)
{
  u8g.drawFrame(1,1,127,63);
  u8g.drawVLine(85, 1, 64);
  u8g.drawHLine(85, 32, 127);
  
  u8g.setFont(u8g_font_helvR24);
  u8g.setPrintPos(14, 53);
  u8g.print(sensors.getTempFByIndex(1),1);
  
  u8g.setFont(u8g_font_ncenR10);
  u8g.setPrintPos(16, 20);
  u8g.print("Bedroom");
  
  u8g.setPrintPos(92, 15);
  u8g.print("Vent");
  u8g.setPrintPos(93, 29);
  u8g.print(sensors.getTempFByIndex(2),1);
  
  u8g.setPrintPos(95, 46);
  u8g.print("Out");
  u8g.setPrintPos(93, 60);
  u8g.print(sensors.getTempFByIndex(0),1);
  }

Any assistance as to what I should be doing to put this on a diet?

Thanks again!

u8glib is huge (most graphics libraries are huge, especially if they contain fonts), but has many option that might reduce size. In particular, try using "u8g_font_helvR24r" instead of "u8g_font_helvR24", which will eliminate the HALF of the font table that contains international characters.

Wow, that was simple. Down to 17,632 bytes already, using that and adding the extra r to the other font code. Thanks, you've already taken it from 79% to 54% with two letters!

I figured a lot of it was the u8glib library, simply because the temp sensors shouldn't be too much. Down the line (for me), is there any way to go into the library and get rid of anything that might not apply to me? And would that even matter to my end result?

Ya, nothing burns through uC memory quite like driving displays. A lot of it goes to the font table (which is why dropping international characters made it so much smaller). 32k is not very much memory.

The digole smart displays (digole.com - also on ebay) are run-of-the-mill displays with a controller board with a microcontroller on it which does the heavy lifting allow you to use very little flash to run the display. But they're more expensive, significantly so.