ESP8266
A WiFi webserver for a calculator that has none
← Casio calculator data logger – project overview
An improvement and additional capabilities in this family of Casio FX-9750 data loggers. With an ESP8266 you can have GPS location and timestamped logging, long range ESP-NOW for wireless sensors and remote control.
Borrowing from my B9 robot research, the ESP8266 costs little more than a PICAXE and adds the thing a calculator cannot do on its own: WiFi. The board can log to the calculator and serve the same readings as a web page at the same time, so a phone on the bench shows what the calculator is plotting.
A WEMOS D1 mini has just 1 ADC input but using I2C permits many other sensors, and a GPS module, to be added.
The forgotten feature in the 2.5 mm port of a Casio FX-9750 and FX-9860 is now available on my GitHub, open-source and free. It takes the burden off the teacher, because the learners become the experts - constructing, coding and repairing their own smart data logger that also acts as a remote control, a PIN pad, and automation control interface.
This is an extension of my 2008 research, which carried classroom validation and student feedback, now with a modern facelift using all modern microcontrollers, including the ESP8266. Learners can record heart rate, temperature, sound level, and other readings using sensors they build themselves, for cents or a few dollars.
The calculator needs no modification or firmware change. It does not need to know what is on the other end of the cross-over cable.
Before you wire anything
Check the wiring of every conductor with a multimeter first. The wire colours inside a bought SB-62 cable may not match the colours in any diagram, including this one. Check the tip, ring and sleeve against your own cable before connecting a calculator. The ESP8266 is a 3.3 V part and is not 5 V tolerant.
What you need
- A Wemos D1 mini or equivalent ESP8266 board.
- A calculator: FX-9750G Plus or FX-9750GIII.
- The four interface components below.
- The Arduino IDE with ESP8266 board support.
The interface circuit
Four components, and the same circuit on every platform. It serves both calculator generations and both board supply voltages.
- 1N4148 in the blue wire, band toward the board. This makes the board's output open-drain: it can only pull the line low, and the calculator raises it with its own internal pull-up. That is what lets one cable serve a 5 V board and a 3.3 V one.
- 4.7 kΩ pull-up from the yellow wire to the board's own supply. Both calculators power their port down between transfers, so a board that is listening reads a permanent break without it.
- 10 kΩ in series with the receive pin, and a 1N5711 Schottky from that pin to the board's supply. These matter only when a 3.3 V board meets an FX-9750G Plus, whose transmit line sits at 4.75 V. On every other combination the Schottky is idle and costs nothing.
The 10 kΩ is in series only. Nothing connects the receive pin to ground. Add a resistor there and it becomes a divider, which drops an FX-9750GIII's 2.75 V mark to about 1.8 V and stops working.
Pins – the shipping build
The released configuration is CASIO_TRANSPORT_UART 1: the hardware UART0, swapped onto D8 and D7. Hardware serial is what gives you a real second stop bit, and that is what an FX-9750G Plus needs.
| Signal | Pin | Note |
|---|---|---|
| To Casio RX – blue, ring, via the 1N4148 | D8 (GPIO15) | band toward the board |
| From Casio TX – yellow, tip | D7 (GPIO13) | with the pull-up to 3.3 V |
| Ground – black, sleeve | GND | connect this one first |
| DS18B20 thermometer | D5 (GPIO14) | 4.7 kΩ pull-up to 3.3 V |
| BME280, I2C | D1 / D2 | SCL / SDA |
The code
Casio-ESP8266-NSN-webserver.ino. Three lines carry the weight:
Serial.begin(9600, SERIAL_8N2); // the second stop bit - load-bearing
Serial.swap(); // move UART0 to D8/D7, after boot
#define TURNAROUND_MS 5 // required on every platform
With hardware 8N2 there is no need to pace the bytes at all: the UART supplies the idle for free, and the send path is a plain write() of the whole packet.
Three requirements apply to every platform. They are why this works at all, and each of them was found by a link that would not run without it.
- Idle between bytes. An FX-9750G Plus needs roughly one bit period – about 104 µs at 9600 baud – of idle line between one byte and the next. A second stop bit supplies it; so does a deliberate delay. An FX-9750GIII does not care.
- A turnaround delay. About 5 ms before every transmission, so the calculator can switch its port from sending to listening. Without it the calculator answers
0x22and never sends its request packet. - Build the packet, then send it. Nothing computed part-way through a transmission – a checksum between the last two bytes will insert a pause a G Plus refuses.
What goes wrong
D8 is a boot-mode strapping pin – this is the one to read twice
GPIO15 must be low when the ESP8266 boots, or the chip will not start. The D1 mini fits a pull-down for exactly that reason. The trap is that the interface's own pull-up, or a calculator holding the line, can feed enough current into D8 at power-up to defeat it. This is why the code does not swap the UART onto D8/D7 until setup() runs, which is after boot. If your board refuses to start with the calculator plugged in, add a 4.7 kΩ pull-down from D8 to ground.
SERIAL_8N1 fails on an FX-9750G Plus
A hardware UART handed a buffer clocks the bytes out back to back with no gap. On a GIII that is fine and 8N1 logs perfectly; on a G Plus it produces 0x22 and a Com ERROR on a packet that is correct in every other respect. Leave it at SERIAL_8N2.
Other things worth knowing
- The board can log alone. Unlike a PICAXE, an ESP8266 holds the record and can hand it over afterwards, so the calculator does not have to stay connected for the whole run.
- Serving a web page during a run: a GIII will refresh a page on a phone without disturbing the interval. An FX-9750G Plus is slower and needs a longer sampling interval before the board has time to answer – see the ESP32 page for the same behaviour.
- Supply noise from a cheap USB source produces immediate Com ERRORs that look like a protocol fault.
Code, manual and the other platforms
- Repository, all platforms: github.com/MikeFentonNZ/Casio-calculator-datalogger-picaxe-esp-microbit-arduino
- Technical manual – wiring, the full
Receive(sequence, every packet and checksum: https://doi.org/10.5281/zenodo.22095227 - Project overview: Casio calculator data logger – the $10 upgrade
WARNING - TAKE CARE!
NEVER connect mains electricity (240 V / 110 V) to the calculator, to the microcontroller, or to any sensor wiring.
NEVER use mains-connected equipment near water.
Keep every sensor signal within 0 V to 3.3 V. The ESP32 and ESP8266 are not 5 V tolerant. A bare ESP8266 A0 pin reads 0 to 1.0 V only; 3.3 V will destroy it. However, popular development boards like NodeMCU and Wemos D1 Mini include an onboard resistor voltage divider, which safely extends their external board tolerance to 0 to 3.2V–3.3V
Special Warning: DO NOT let students test boiling water.
There is no need to calibrate temperature sensors using boiling water. Where in the real world would a student expect to record that temperature? If you are investigating cooling curves, YOU should safely get sensor readings at 100 °C and PROVIDE THIS to learners.
READ THE DISCLAIMER in the Technical manual - No responsibility is taken for how you use this information! This is a research project provided open-source to educators.
Use it
Always remind learners that scientists and engineers work carefully and safely, no matter what they see in movies or TV.
Sensor Lab: With a breakout adapter, try inventing your own ultra-low-cost sensors. Anything that changes its electrical resistance due to one environmental factor is a good start. You may need a 10k pull-up resistor - learn about these and what they do. Alternatively, try low cost NTC temperature thermistors, light dependent resistors (LDR). Advanced learners can try DS18B20 temperature sensors, HC-SR04 range-finders, and DHT-11 modules. Build a colorimeter to detect light changes with a LDR and an LED as a light source for chemistry investigations. You do not need a LED to log the change in glow stick brightness over time - does temperature affect this?
NOTE: Use a current limiting resistor on the LED!
Medical Lab: Connect a low-cost heart beat sensor, and code the ESP8266 to calculate heart rate. Send this to the Casio FX-9750 to see trends before and after exercise, or see if you can make a lie detector!
Connect to smart devices to show live graphs and GPS location, date and time stamps: Attach a low-cost GPS unit and you have a survey field logger! The robot B9 (Lost in Space) is a very large container for the circuit, but you can use a regular jiffy or project box!
The ultimate “Build it, Test it, Use it” project. The B9 robot from Lost in Space has storage built into his legs for digital multimeters, sensors, and Casio calculator data loggers. Go explore this planet - no need for a space suit!
A renewed justification in a post AI-era.
When technology cost and availability is no longer a consideration, the use of simulated data for STEM learning is a decision that now requires justification, rather than being the default.
The original case for this work was equity: timed data logging for a few dollars instead of hundreds. There is now a second reason it matters. As generative AI is trained on a scientific literature increasingly polluted by fabricated paper mill studies (Richardson and Amaral, 2025, PNAS), simulated datasets can no longer be assumed to reflect physical reality. Subverting the Casio serial protocol so learners can gather their own first-hand measurements gives them data whose provenance is transparent and which can still surprise. The exploit is no longer only about cost; it is about preserving access to real, trustworthy observation.
Other platform build guides: PICAXE · BBC micro:bit · ESP32 · Arduino Uno
Casio calculator Hasbro Smart R2D2 DoidX app
B9 robot mobile science lab – Lost in Space