Back to home
Arduino project for JOTI Many people in Scouting will know JOTI. It is an annual weekend where scouts of all ages can communicate with eachother using IRC servers and clients.
More information about this can be found on: the scouting jota/joti website.

During this weekend a number of activities are done, including games and small projects.

Here is one of these projects: a digital temperature/humidity gauge using arduino!
The project is entirely put together and programmed by a member of Scouting Geulle in the Netherlands, and is free to use for anybody.
It can do multiple things with the same project, showing the power of using an arduino. The code can be set up to do the following things:

Updated version! Please check out the update at the end of the page!
Parts For this project a minimal amount of parts is needed:
All of these parts can be obtained very cheap on aliexpress and other websites. When buying in bulk (for about 100 packages) the price per complete project comes down to about $7.
The reason for the breadboard is twofold: it's hard to get enough solderingstations on a weekend when dealing with 50 scouts. With a breadboard none are needed. Also, this way burning fingers isn't an issue, especially with the younger kids.
Documents/code/software First, you will need the arduino IDE software for programming the project.
The latest version for this is downloadable from: https://www.arduino.cc/en/main/software
To make sure you have a working version, there is a direct download for the arduino IDE version 1.8.5 right here: arduino ide
Download it, open the zipfile and copy the folder 'arduino 1.8.5' to your desktop.

Drivers
Once you have downloaded Once set up, you will also need a driver for the arduino nano. There are drivers included in the arduino install, but it might happen that no driver is available.
If you (like me) ordered the arduino's in china, it probably has a different serial chip.

The drivers for this chip:
Windows 7: Arduino driver
Download and install it, then plug in the arduino, it should recognize it as a COM port.

Windows 10:
It is a bit of a hit and miss in windows 10. Just plug in the arduino and wait. Sometimes windows 10 will find a driver online for it!
It might take up to 15 minutes to find it though..
If for some reason it just won't install the driver, things get a little more difficult.
First, download the driver here CH341SER.EXE
and run the install
Then, know solutions are:
The code
Last, you need the code to make it work!
All documents and code needed for this project can be downloaded here as one zipfile: arduinojoti.zip
Once unpacked, you have a folder with 2 main items in it:
Copy these files in an easy to find folder.

Documents
The document that can be included in the kit can be downloaded werkbladen.doc
Unfortunately, this is in dutch. If you would like an english version, let me know (use the email on the main page).
Building the project First start by building the project: That's all for building the project!
Programming To make the project do anything at all, the arduino needs to be programmed.
To do this, start the arduino IDE and open the file arduinojoti.ino
This code can actually do several things with the project. For this there are several so-called DEFINE lines to tell the code what to do.
The code is written in dutch, so the most imporant comments are translated here.

display brightness
The line #define BRIGHTNESS 20 tells the arduino how bright the display should be. Allowed are values from 0 (= off) to 100 (= full on).

Program mode.
#DEFINE PROGRAMMA 1
this line defines what the code actually does with the project:

Switch function
#define SCHAKELAARFUNCTIE 0
The switch in the project can have different functions, depending on the program mode that is selected.
For program mode 1, there are 4 different functions for the switch:

For program mode 2
the switch is used to start, stop and reset the clock, in that order.

For program mode 3
the switch is used to stop the counter.

Delay time
#define DISPLAYDELAY 2
defines how long the temperature and humidity is shown in seconds. The default is 2 seconds for each.

Screen off time
#define DISPLAYOFF 4
defines how long the sreen will stay on after one press of the button (in switch mode 2 and 3). The default is 4 seconds, exactly enough time to show the temperature and humidity 2 seconds each

Sensor correction
Since these cheap sensors (DHT-12) are not calibrated officially, they might deviate from the actual temperature by a couple degrees. Also the humidity might differ a little.
This deviation is not the same for all the sensors.
To be able to correct this deviation, 2 lines are added:
#define TCORRECTIE 0
#define HCORRECTIE 0

The way to go about setting the correct value for these is first to have a calibrated temperature and humidity gauge to compare to
Then, leaving both at 0, check the measured temperature and humidity on the arduino.
Now write down the difference for both, and subtract the measured value from the calibrated value, and put that on TCORRECTIE for the temperature, and HCORRECTIE for the humidity.
After uploading the project to the arduino again, it should now have the correct temperature and humidity
Programming the arduino After all the changes are made (or none, the code defaults to program 1, switch function 0), it's time to program the arduino!
For this, you only have to click on the 'upload' button of the arduino IDE on the top left.
You should see the led flicker, after which the arduino will start executing the program and the display should light up showing the temperature and humidity.

After the arduino has been programmed with the wanted options, it will run off of any USB connection providing it with 5 volts. So any charger, usb port and powerbank will make it run!
Update: version 2! Yes, kids are wonderfull. While doing the project, a couple of kids were wondering: Why can't i switch the program without reprograming?
Good question!
So version 2 was born. Another nice idea is to power the project using 2 CR2032 batteries. The changes compared to version 1:

The extra cost: about $1 for everything if you buy it in bulk
You could leave out the batteries and power the project another way. In which case the parts can stay where they are and only the switch position and connections change.

Build up the project as before but take note of these points when building:

Now, you can start programming the arduino exactly the same as version 1 but using the version 2 code.
In the code settings, the setting called PROGRAMMA is now the starting program for the arduino when it powers up.
The left switch has the same function as the single swith in version 1. The right switch will switch the running program!

In the screen testing mode (program 4), just keep the switch pressed while it it running, eventually it will switch to program 1 again.
Troubleshooting There are not many things that can go wrong with this project, but like anything, something can (and probably will on occasion).
The most common problems are listed here:

The arduino is not doing anything (no led is lighting up)
Most likely problem: the USB cable is defective or not plugged in correctly. Most unlikely cause: defective arduino
Easy to test by plugging the usb cable into a phone. If it charges, the arduino is defective.

The display is not showing anything
Most likely the connections to the display aren't right. The display can handle the signals being on the wrong pin, so solving it is simple: check the connections if they are in the right spot.
If they are, test with another display unit. If that lights up, it's a defective display. If it doesn't, check the display with another arduino, it might be a broken port on the arduino.

The display is showing weird values for temperature and humidity
Most likely this is either a wrongly connected sensor or broken sensor. Check the connections. If these seem ok, replace the sensor with a known to be good one.
Also, program mode 9 can be loaded to check the values coming out of the sensor.