This is an analog temperature display built from a digital sensor ds18b20, a mini servo, and electronics based on an esp-12f module
It has the following features.
- Self contained unit holding electronics, servo and battery
- Good accuracy and precision using ds18b20 digital sensor
- Rechargeable LIPO with inbuilt charger
- Very low quiescent current (< 20uA) for long battery life
- Servo only turned on for short periods again giving good battery life.
- Normally the module sleeps between temperature updates but can be turned into a non sleep mode for checking and configuration
- Configuration data upload and servo test from web interface
- Minimum, maximum temperatures, Centigrade.Fahrenheit, and update interval configurable
- Battery monitoring
Software can be updated via web interface
Step 1: Components and Tools Needed
The following components are needed
- MIni servo motor (MG90S)
- Ds18b20 temp sensor
- ESP-12F (esp8266 module)
- 18650 LIPO battery
- LIPO battery holder
- micro USB LIPO charger
- LDO low quiescent current 3.3V regulator. I used XC6203
- Resistors 4K7, 10K
- 220uF 6V Decoupling capacitor
- n channel MOSFET low threshold driver. I used AO3400
- p channel MOSFET low threshold driver. I used AO3401
- Small piece of pcb prototype board
- Slide Power switch
- Small push button (6mm square)
- Hook up wire
- Double sided adhesive tape
- 3D printed enclosure design available at https://www.thingiverse.com/thing:3022069
- Optional pointer. I used a spare clock hand; a printed version may be used.
The following tools are needed
- Fine Point soldering iron
- Hot glue gun
- Hole punch
Step 2: Electronics
Most of the electronics is a ESP8266 wifi microcontroller unit. A small amount of support electronics is needed to enable the servo motor, and regulate battery to 3.3V, support the sensors, and a resistor divider to monitor battery voltage.The servo motor supply is driven by 2 MOSFET transistors. They are turned on a short period before a servo update is needed and left on for a short period to allow the servo to complete its movement. The load is so light that the servo will not move when when not powered.
All the support electronics apart from the LIPO charger are mounted on the pcb prototype board. I use SMD components to keep this as small as possible but it could be done with lead-thru components as there is a reasonable amount of space available. The LIPO charger has a micro USB port which may be used for recharging the battery. A slide power switch may be used to turn the power on and off. A buttons is to allow overriding sleep mode when powering up which then allows web access for configuration and control.
Step 3: Assembly
I did the following assembly steps
- Print up 3d enclosure
- Solder wire onto switch, button and 3 pin connector
- Fit switch, button and connector to enclosure using a small amount of resin glue to secure
- Fit servo in place. There is enough space behind for the wiring to pass through. A wedge of cardboard can then be used to secure it.
- Secure LIPO charger in place. I used wire through the four holes on the LIPO charger to adjust the height (2mm) of the base to get it to line up with usb hole. Hot glue in place.
- WIre battery holder, switch and charger leaving enough slack on battery leads so it can be on the side.
- Make up peripheral electronics on small piece of prototyping board.
- Mount prototyping board on top of esp-12 module.
- Complete hook up wiring
- Print out selected dial (and pointer if required) on stiff glossy paper and cut out.
- Use hole punch to create hole for servo
- Attach dial to box with double sided adhesive tape
- Attach pointer to servo
- Calibrate position of pointer by using the web facility to set a temperature value.
Step 4: Software
The software for this project is available at github https://github.com/roberttidey/servoThermometer
It is an Arduino based project so set up an esp8266 Arduino development environment. You may want to set the passwords for WifiManager and software update in the ino file to something more sensible.
It should be compiled in Arduino ESP8266 IDE and serial uploaded to the module. It is good to wire GPIO13 to GND in your development environment as the software will then be in continuous mode.
First time use will start an access point which should be connected to on a phone or tablet phone. See code for password. Browser on phone or tablet should then be used to access 192.168.4.1 which will allow selection of local wifi ssid and password. This only needs to be done once or if the wifi network changes. From then on the module will connect to local wifi network if required. Normal deep sleep mode does not use wifi. It wakes up at the sleep interval, reads the temperature, updates the servo and goes back to sleep. Every 10th reading it takes a battery reading and logs it. This can be checked by turning on in no sleep wifi mode and checking the log file.
Some support files should also be uploaded. These are in the data folder of the git. They can be uploaded by accessing ip/upload. Once these have been uploaded then ip/edit may be used to do further upload in an easier fashion.
Step 5: Operation
After configuration the unit will just operate after being turned on.
If it is turned on with the button pressed then a number of web commands may be used.
http:/ipAddress/upload gives access to a simple file upload. Used to bootstrap the system.
- http:/ipAddress/edit gives access to the filing system (e.g. to ulpoad a new configuration or access any log file)
- http:/ipAddress gives access to a form to set the display to a value. May be used to adjust the pointer.
- http:/ipAddress/firmware to upload a new firmware binary
Step 6: Dial and Configuration
The powerpoint contains some example dials for centigrade or fahrenheit use. These allow for 15 segments but the range can be easily adjusted by changing the step interval. If more or less segments are wanted then one needs to edit the properties of the doughnut object. Likewise the colour backgrounds of the segments can be changed.
The configuration data is contained in a file called servoTempConfig.txt This is held in the filing system on the module. To change the configuration edit the file and upload it via the web interface http:ipAddress/edit
The configuraion data is just values on lines as follows
- minimum displayed temperature (in the units chosen)
- maximum displayed temperature (in the units chosen)
- sleep interval between readings in seconds
- sleep mode (0=On continuously with wifi, 1= normal deep sleep, 2= On Continuously no wifi
- activity logging to servoTempLog.txt if logging = 1. Battery voltages are always logged.
- temperature units 0=Centigrade, 1=Fahrenheit
- ADC_CAL calibration for battery voltage readings.
Make sure the min and max temperatures are in the C/F units selected.