Close
0%
0%

Hack Smartphone Charger Logger

A datalogger based on ESP8266 in a "dead" smartphone charger

Public Chat
Similar projects worth following
The idea was born after the “death” of another smartphone charger, and the need of having a "just in time datalogger" to measure every thing.
I have built this simple circuit, based on a ESP8266, just adding a few other components (like a power supply in order to attach it directly to a 220V plug).
Outside the case there’s only four wires (+3.3V, ground and 2 GPIO): they are available to connect all sensors (I2C, one wire protocol etc.) like for example a DHT22 for measuring the temperature e humidity, BMP180 for barometric pressure, MPU6050 for acceleration ad so on.
The firmware was developed to be updated via OTA (in order to avoid the opening of the datalogger).

Despite the recycled case, the circuit is very simple to create. I have used a ESP8266-12E (just using the pin GPIO02 to drive the green status led,  the pins GPIO05 and GPIO04 to I2c [SDA and SCL] or wire communication to the sensor). 

I built two firmware. One sends data using MQTT to a NODE-RED to visualize the graphic of the data acquired. The second implements a webserver, so I can visualize data directly connecting to ESP. The first solution will be updated by using OTA; the second one will be reprogram with FTDI programmer.

ESP_Datalogger_OTA_v3.ino

This firmware implement a web server so you visualize by connecting to ESP8226. No router or network are needed.

x-arduino - 6.72 kB - 08/26/2018 at 22:14

Download

Step by Step .zip

Some pictures during the work

Zip Archive - 12.40 MB - 08/26/2018 at 10:32

Download

ESP8266_Datalogge_schematic.pdf

The simple ESP9266 schematic

Adobe Portable Document Format - 27.22 kB - 08/26/2018 at 10:09

Preview

ESP_Datalogger_OTA_v2x.ino

The firmware made with Arduino IDE

x-arduino - 5.81 kB - 08/25/2018 at 18:34

Download

Node-red screen shot.png

The Node-red flow

Portable Network Graphics (PNG) - 63.64 kB - 08/25/2018 at 18:12

Preview

View all 6 files

  • 1 × ESP8266 12E
  • 1 × HI-LINK 100-220Vac to 3.3V power supply
  • 1 × Electrolitic capacitor 100mF 6.3V
  • 1 × Capacitor 100nF
  • 1 × Resistor 10K

View all 7 components

  • 1
    Step by step for build a HackPowerSupply Logger

    1. Find a broken smartphone charger

    2. Cut a litte prototype PCB that fits in the case of the charger

    3. Solder a 1mm header on one side of ESP8266-12E (the side of TX, RX etc pin)

    4. Modify the 1mm header to adapt to a 2.54 mm prototype PCB

    5. Solder all component as indicated in the schematic

  • 2
    Program the ESP8266 for first time
    • To program ESP8266 you need to connect the FTDI programmer to the pin RX, TX and GND. Before apply the power, connect the pin GPIO00 to Ground. I use a Arduino IDE to program the ESP8266
    • You will need just the first upload with the FTDI programmer. No more upload with it will be needed. All the future uploads will be done through the Wi-Fi,  thanks to the OTA. 

View all instructions

Enjoy this project?

Share

Discussions

Does this project spark your interest?

Become a member to follow this project and never miss any updates