https://github.com/juztins-lab/roast-meter Github link for project
https://www.treatstock.com/ 3d printer
public calibration data spreadsheet
https://docs.google.com/spreadsheets/d/19SYBuICoDAMnKG8Y6wu3l7_CpUq093Ok1aUOrpTGwx4/edit?usp=sharing
ESP32 LOLIN32 board instead of the recommended one.
https://www.sparkfun.com/products/15663 You could use this ESP32 version of the Thing Plus, and probably not need to solder any wires.
https://www.sparkfun.com/products/16474 max30101 breakout
https://www.mouser.com/ProductDetail/474-SEN-16474 alternate source I used
https://www.sparkfun.com/products/14426 50mm cable x 2
https://www.mouser.com/ProductDetail/474-PRT-14426 alternate source I used
https://www.sparkfun.com/products/14427 100mm cable
https://www.mouser.com/ProductDetail/474-PRT-14427 alternate source I used
OLED. Screen Size: 64x48 pixels (0.66" Across)
https://www.mouser.com/ProductDetail/713-104020248 alternate display $5.50 from Mouser
OLED Info Link
I used this cheaper alternate, but it has a different connector so soldering is required.
When I was trying to assemble everything, I pushed the OLED too hard into the case, and broke off a piece of the OLED. After that, only every other line lights up. To compensate I use the largest font, so it still works and is easy to read.
Normal OLED from project
https://www.sparkfun.com/products/14532 oled $18
Case
Case needs to be 3d printed
Files here
Someone from Home Barista printed a bunch out and sent one to me.
Otherwise I would have used treatstock to get it made. I saw pretty reasonable prices there.
lab slides (to make sampling window) My case already had the glass installed.
You would need to cut it to size to make a square from a rectangular thicker piece, and then superglue it in place.
https://www.amazon.com/AmScope-BS-72P-100S-22-Pre-Cleaned-Microscope-Coverslips/dp/B00L1S93PS/ref=sr_1_6?crid=363P8HPSXU7IV&keywords=lab+slides+7105&qid=1678640185&sprefix=lab+slides+7105%2Caps%2C251&sr=8-6
If you are building the battery powered version:
I used a generic lolin32 type ESP32 as pictured below. They are cheap, and it fits in the case. I was only able to put in one screw though, but it is held in place fine. I had to file the opening for the usb connection some, because the USB connector is off to one side.
I also soldered power wires to the ESP32, and use OTA programming so I no longer plug into the USB. If you plugged/unplugged a lot, then maybe the one screw could cause a problem. If you, I'd glue to board down to keep it in place.
I2C interface to MAX30101 and OLED
SDA GPIO 21
SCL GPIO 22
Ground GND
VCC 3V
Front of ESP32 LOLIN32 board used for this project.
Used the TBD cable to connect from MAX30101 board to ESP32
Cut connector off one end of the cable, strip all wires, and solder wires to ESP32
SDA GPIO 21
SCL GPIO 22
GND GND Black
3.3V 3V Red
Back of OLED board
MAX30101 board
Use the cable the comes with the OLED board.
Cut one connector off, make cable long enough to reach from OLED to MAX30101 board
Strip wires, and solder into holes on edge of MAX30101 board
SDA SDA White
SCL SCL Yellow
Ground GND Black
3.3V 3V Red
INT and 1.8V are not connected
I decided to use a USB cable with one end cut off to make a more permanent power connector.
Made it a few feet long, strip red and black wires. But strip back the outer sleeve and foil so a few inches of red and black wire are exposed.
I also added a toggle switch I had in my junk drawer, so I can easily turn on and off. Had to drill a bigger round hole where the rectangular switch cutout is. Make sure hole is far enough from edge so switch doesn't hit edge of case. When I did, the switch just makes it.
Drilled a hole in case to run this wire through, and put a tie wrap around the cable by the hole to provide strain relief and protect the solder joints if you pull the cable.
USB Red goes toggle switch. Other side of switch to 5V pin on ESP32, which is on lower left of board above the white battery connector.
USB Black goes to GND pin below the 5V pin
Pics of how I soldered the cables to the boards.
Thought about, but decided I didn't need a battery.
But info below if you want to try it.
Found an alternate, slightly cheaper battery that should work.
battery charger datasheet 500ma max charging current
PH2.0 JST connector
3.7V 522332 400mAh Lipo
1 1/4 x 1 3/16
AKZYTUE 3.7V 400mAh 802030
See Gitlab page. to get source code, and some more comments on software.
https://gitlab.com/randytsuch/roast_meter
MAX3010x library
https://github.com/sparkfun/SparkFun_MAX3010x_Sensor_Library
From arduino program, go to Tools, Manage Libraries, search for "MAX3010x"
Select and Install Sparkfun MAX3010x library in the Library Manager.
esp32 oled library https://github.com/ThingPulse/esp8266-oled-ssd1306
From arduino program, go to Tools, Manage Libraries, search for "esp oled"
Select and Install library shows below by ThingPulse in the Library Manager.
Recommended library for Seeed OLED board, but didn't work for me with ESP32
Another OLED library that didnt' work for me. Main project uses this library.
I2C scan results
I2C device found at address 0x3C
I2C device found at address 0x57
Found this is the Sparkfun docs
The ADDR jumper (highlighted below) can be used to change the I2C address of the board. The default jumper is open by default, pulling the address pin high and giving us an I2C address of 0X3D. Closing this jumper will ground the address pin, giving us an I2C address of 0X3C.
The released code is
#define PIN_RESET 9
#define DC_JUMPER 1
MicroOLED oled(PIN_RESET, DC_JUMPER);
Need to change DC_JUMPER to 0, and then Sparkfun library will use the 0x3C address.
Library
#define PIN_RESET 9
// From version v1.3, we can instantiate oled like this (but only for I2C)
MicroOLED oled(PIN_RESET);
// This is the new way of initializing the OLED.
// We can pass a different I2C address and TwoWire port
// If 0x3D does not work, try 0x3C
oled.begin(0x3D, Wire); // Initialize the OLED
if (oled.setFontType(4) == 0) // Set font to type 4 (fontlargeletter31x48)
{
Serial.println(F("Could not enable font 4 (fontlargeletter31x48)!"));
Serial.println(F("Have you changed the #define INCLUDE_FONT_LARGELETTER to 1 in SFE_MicroOLED.cpp?"));
Serial.println(F("Freezing..."));
while (1)
; // Do nothing more
}
// Demonstrate font 0. 5x8 font
oled.clear(PAGE); // Clear the screen
oled.setFontType(0); // Set font to type 0
Program uses font 1 now for please load sample, and font 3 to display readings
// Demonstrate font 1. 8x16. Let's use the print function
// to display every character defined in this font.
oled.setFontType(1); // Set font to type 1
// Demonstrate font 2. 10x16. Only numbers and '.' are defined.
// This font looks like 7-segment displays.
oled.setFontType(2); // 7-segment font
// Demonstrate font 3. 12x48. Stopwatch demo.
oled.setFontType(3); // Use the biggest font
I used code from this page https://randomnerdtutorials.com/esp32-i2c-communication-arduino-ide/
In the section "Scan I2C Address with ESP32"
It found this:
I2C device found at address 0x3C
I2C device found at address 0x57
Software includes AsyncElegantOTA library to support Over The Air Programming
In the Arduino program, select Sketch, Export compiled Binary.
After a min or two, you will see "Done Compiling" message at bottom of window. File is saved for OTA loading.
If you connect to the serial port when ESP32 boots up, IP Address of ESP will be displayed.
Enter the IP address in a browser and you will see
Hi! I am ESP32. add /update for ota
Enter ip address/update, 192.168.xxx.xxx/update
and you will see a page to upload the program.
From the OTA page in your browser, navigate to to the directory where your .ino file is stored
You will see a file with a name similar to this:
roast_meter_05.ino.d32.bin
Select it, and start upload. Wait for upload to complete.
Thats it.
Grind app to determine grind size: https://play.google.com/store/apps/details?id=com.rwurzer.burrista&hl=en_US&gl=US&pli=1