ThermosTap
This project creates a connected temperature sensor that is used as a thermostat from a TapNLink module. The project uses TapNLink's embedded Java Virtual Machine (JVM) as the application processor. The JVM runs a simple Java program to drive the temperature sensor.
*** WARNING ***
THE THERMOSTAP IN THIS DESIGN CONNECTS DIRECTLY TO 220 VOLT MAINS POWER.
Physical contact with any component of the design can cause electrocution resulting in serious INJURY, or DEATH.
DO NOT reproduce this design without appropriate knowledge of, and protective measures for working with mains power.
Disconnect power before handling the material or manipulating the connections. Ensure that material is properly grounded and isolated. Always work with another adult present in case of an emergency.
Note: Before starting, learn how TapNLink and the associated tools work in this Getting Started.
This project is on Github !
The project has 4 folders:
-
app_generated/ThermosTap.apk
: Source for the mobile application. It was auto generated by IoTize mobile app build server. -
java/ThermosTap.java
: Contains a Java code which will be executed by theJVM
. -
iotize_studio/ThermosTap.iotz
: IoTize Studio configuration file to configure the TapNLink for the demo. -
doc
: Contains a pictures and java code readme file.
The Main Components
The main components used in this project are:
- TapNLink (the communication module), it's here.
How it Works
The hardware setup
Overview
General view of the project
Schematic
The schematic below contains 3 blocks that can be used to control the temperature:
- a simple relay that is supposed to start/stop heating.
- an OT+ (opentherm) interface,
- a 'pilot wire' that is an interface very popular on the French market (and almost unknown everywhere else).
In the application below, only the 'simple relay' block will be used.
Electrical diagram
Java code
In the Java
code executed by the JVM
, the onCheck()
is called periodically (the period is specified in the TapNLinkVar
construct). Using this method, we determine the power by evaluating the differences in the pulses counts during the elapsed time.
- for more
Java
code information, click here !
IoTize Studio
- Open the TapNLink configuration project
iotize_studio/ThermosTap.iotz
with IoTize Studio. For more information about Studio click here. - In the
IoTize_Studio/Tap
section, setUser internal JVM
toYes
, and set the.java
file pathjava/ThermosTap.java
. - In IoTize Studio, execute the
java
build to generate the.bcb
file. - Configure your
TapNLink
usingIoTize Studio
:- Setup the connection to your TapNLink
- Set the IoT Platform (MQTT) settings.
- Click on the
Configure
button, and wait until the end of the configuration process.
- Reboot the TapNLink to apply the new configuration.
Running the 'ThermosTap' App
- Because this app has not been published on app stores, you have to install it manually. See how this is done here.
- After your circuit is properly connected, and your TapNLink configured, launch the mobile app. The fastest way is to approach your mobile phone (with NFC enabled) to the TapNLink. NFC will launch the app and connect the mobile to the TapNLink automatically.
- With
TapNLink
you can now monitor the target and current temperatures.
View of the app
Active Mode
You can activate any mode. However, if Auto recovery
mode is enabled, then the mode will automatically be reset to AUTO
at the start of each time period.
Selecting the mode
Set the Temperature for Each Mode
The temperatures for each mode is changed from the app using a slider.
The temperature sliders
Adjust the Hysteresis
You can modify the hysteresis to avoid frequent On/Off switching.
Hysteresis slider
Define Days by Type
For each day, set the type as Work Day or Weekend. This will determine the program that is applied for each day.
Setting the type of day
Create a Program for Each Type
For each type of day, set the schedule with heating modes (Comfort, Eco, etc.) for each time period.
Programming the Weekend