» Topics » Advice »Thermostat on the Arduino Mega 2560

Thermostat on the Arduino Mega 2560


Good day to all. This project was implemented in one of the schools near Moscow for a class of robotics and natural sciences. The device's task includes images of date, time, temperature, as well as recording information on sd media with an interval of half an hour in a txt format file.

The composition of the product includes:
1. Arduino mega 2560
Thermostat on the Arduino Mega 2560

2. Glcd12864 v 2.0 (or a standard Chinese screen on the ks0107 / ks0108 chips)

3. Real time clock Hz 85 63

4. Temperature sensor TMP36

5. Module for micro sd card


Scheme and connections


Glcd12864 v2.0 display is connected via a parallel interface. The real-time clock uses the I2c protocol (sda sdc pins on the board), and the micro sd module uses spi, pins 50 through 53 (specifically on this board). Everything is powered except the display backlight from 5V, the backlight uses 3.3V. In general, the scheme is not complicated. Board power came from a simple, standard 5V adapter. Device current consumption in the region of 100 mA.

View on breadboard


Sketch
Sketch
U8glib library

The sketch itself uses the standard arduino libraries, with the exception of the display, which requires the U8glib library. Fonts for the sketch are given in the archive and for correct operation should be in the folder with the sketch. Comments on the main issues are given in the sketch itself.

The timer is set by writing the value of the decimal-binary code in lines 45 and 46. In this case, the response period is half an hour. To change the period for an hour, we write in line 46 the value B00111111. Accordingly, we write the same value to the timer reset function line 54. More detailed information on manipulating the timer in rtc pcf 8563 manual

All temperature information is written to the sd card in txt format and has the following form

Subsequently, the data were used to compile temperature graphs of the weather.
This device is a prototype, there are no working copies on hand (everything is currently working). As soon as I can get it I will describe the process of complete assembly with the manufacture of software, etc.

Suitable for topic

Related topics

Add a comment

    • smilesmilesxaxaokdontknowyahoonea
      bossscratchfoolyesyes-yesaggressivesecret
      sorrydancedance2dance3pardonhelpdrinks
      stopfriendsgoodgoodgoodwhistleswoontongue
      smokeclappingcraydeclarederisivedon-t_mentiondownload
      heatirefullaugh1mdameetingmoskingnegative
      not_ipopcornpunishreadscarescaressearch
      tauntthank_youthisto_clueumnikacuteagree
      badbeeeblack_eyeblum3blushboastboredom
      censoredpleasantrysecret2threatenvictoryyusun_bespectacled
      shokrespektlolprevedwelcomekrutoyya_za
      ya_dobryihelperne_huliganne_othodifludbanclose

We advise you to read:

Hand it for the smartphone ...