FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    Homemade ATTINY85 contact digital thermometer

     

    "With the advanced development of current technology technology, you may think that this design is not large, you may even say"! " thermometer? " However, there are many experiments based on temperature (water temperature, room temperature, etc.), thus considering other alternatives and cost / performance ratios, digital thermometer becomes a key instrument for temperature measurement. It measures the temperature of the human body to measuring the temperature of the chemical. Therefore, in this instructable, we will build a digital thermometer, which can run nearly 140 days on a single CR2032 battery! (In the words of Captain, this is great!) And also operates low power by optimizing the code and circuitry. In addition, in order to add some nostalgic elements, I use a piezoelectric sensor to reset the thermometer that people usually do with mercury glass thermometers. So let's start making it. Supplement (buy in Amazon) Attiny 85: https: //amzn.to/3bb8t8p ATTINY development board: https: //amzn.to/3bc1cp3 Pieces: https: //amzn.to/2s6yo0v Arduino nano: https://amzn.to/3ty8i3e PETG filament: https: //amzn.to/3w6bb46 DS18B20: https://amzn.to/3ylgry0 OLED display: https://amzn.to/2vceatc CR2032: https://amzn.to/3ysfiox CR2032 battery seat: https: //amzn.to/3fsfhl8 Resistance kit: https: //amzn.to/3frj4nx 3D printer: https://amzn.to/3TRVWKW Printer upgrade: https://amzn.to/3hbk3ga Step 1: Temperature Sensors DS18B20 Let us start from the core part of the project, temperature sensor. Why is DS18B20? Different sensors are available for selection based on accuracy, types, and they transmit data to microcontrollers. But I chose DS18B20 because it is designed very well, and can read the temperature from the external object, and only one wire can be read from this sensor. In addition, due to metal probes, this is better, or difficult to make custom metal probes to make contact points, the other main reasons is supported by various library with Arduino and consumes sleep mode Time is 5ua. Step 2: Connect the DS18B20 with the microcontroller To interface this. You can use any microcontroller because the sensor uses a protocol called single line, which is completely dependent on the software instead of hardware, you only need a single GPIO pin of the microcontroller. Just for this example, I will use Nodemcu. Circuit connection is easy. Connect the power supply to the red line to + 3.3V, black wire ground, yellow data cable to the NodeMCU's D2, is like this. Don't forget this important step, add a 4.7K pull-up resistor between 3.3V and Data Pin. If not, the microcontroller will not read data from the sensor. Step 3: Test DS18B20 Now we can program the NodeMCU, just go to your Arduino IDE and download the Dallas temperature sensor library and single libraries. Once the installation is complete. Go to the example and open a simple temperature sensor example and change the pin connected to the sensor, in my case it is pin D2, which is GPIO 4. Compile and upload code. Once uploaded, you can open a serial monitor. You will see that the sensor data is displayed here, but this DS18B20 sensor does not immediately display the same accurate temperature reading as the commercial temperature meter, and it takes a period of time to stabilize the correct value, you can also see this on the final build. . So, for this experiment, I decrease the measurement time to 15 seconds. However, if you need higher precision, you can increase the measurement time in your code at any time. Step 4: Connect 128x32 OLED Display Since we can read the temperature now, let's try to display it on the OLED display. I used a 0.91-inch 4-pin OLED display that connects the SCL of the display to D1, connect the SDA of the display to D2, because D1 and D2 are the default I2C pin of the NodeMCU, and power the display, connect VCC and module. Ground from 3.3V and Nodemcu. Step 5: Test OLED To test if the OLED monitor is working properly, go to your Arduino IDE and download the Adafrouit SSD1306 library from the library manager. [Go to Sketch -> contain the library -> management library -> adafrouit ssd1306] Now open the sketch hardware_test.ino, compile and upload the code to your Nodemcu. Now we can read the temperature and display it on the OLED display. Datual! Hardware_test.ino Step 6: PEIZO sensor However, the current settings will continue to read the sensor value. I hope it stops reading the temperature after a while and then restarting when we provide some input. To do this, you can use the button, but in the introduction, you will see the thermometer is triggered by the slam. This is more easier than you expect. I have neither use complex sensors and have no complex coding. On the contrary, I used a very simple piezoelectric sensor. This is a quite interesting sensor. It includes a small crystal between the two metal plates, and when the pressure is applied to this crystal, the sensor outputs a small current. Therefore, we can build a very simple circuit to measure the current and perform some tasks based on the reading. Step 7: Connect and Test the PEIZO sensor Similarly, the circuit is very simple, just build a voltage divider using a 5.6kResistor and a piezoelectric sensor. Then connect the node to the pin A0 of the NodeMCU. For code, simply read and display it on a serial monitor. When we apply different stress to the sensor, you can see the value of the value. Now we add it to our existing circuit and add a threshold for the sensor value in the code, so the code will be reset regardless of when the piezoelectric reaches the value, the temperature reading will start again. (Upload a hardware_test.ino file in the previous step) You can see this is fully in line with our expectations! But this is different from us to the logic of the sensor in the final building, but slightly different, we will discuss more later. Step 8: Find microcontroller alternatives Suppose we hope that the entire circuit works with this CR2032 battery. This is almost impossible, because this single battery (3.3V / 210mAh) is not enough to run Arduino UNO / NANO or Nodemcu (ESP8266), so it cannot run the entire circuit, piezoelectric and display with a temperature sensor. We need an alternative microcontroller that does not require too much power, and can run the display, temperature sensor, and piezoelectric electricity with this single battery. This may ask too much, but fortunately, there is a microcontroller to do this! Know ATTINY 85. Step 9: Attiny 85 This is an 8-bit microcontroller with eight pins, all of which we fully need, one for driving an I2C for driving the OLED display, an input pin for reading a temperature reading, and an input voltage Analog input for electrical reading. Most importantly, this can do all of these work only by powering only by a 3.3V battery. But it also has its own shortcomings. Programming is a bit complicated, the store is limited to 8KB, RAM is only 512 bytes, and only 5 available pins are available. We can use the reset pin as GPIO, but it will only make things more complicated than the initial. Therefore, determining that the microcontroller is purely based on several simple issues: Is this enough? Can we put all things in? I have? Can I program? Yes, that's right! Step 10: Connect Attiny 85 So, let me show you how to program this Attiny 85, and we need a support of an Arduino, Arduino NANO or UNO, which supports ISP. I will use nano as an example to show how to program the microcontroller. The first step is to prepare Arduino. Simply connect the board to your computer and open Arduino IDE. Now, go to the example and open the Arduino ISP example. Simply compile and upload this code to your Arduino nano. This is all the settings we need, followed by the connection between Arduino Nano and Attiny 85, connect the power VCC to 3.3V and ground. The pin D13 is then connected to the pin 7, and the pin D12 is connected to the pin 6, and the pin D11 is connected to the pin 5, and the final pin D10 is connected to the pin 1. And add a electrolytic capacitor between Arduino Nano Reset and the land. If you want to continue learning, you can view the links in the connection circuit diagram description. Step 11: Test Attiny 85 After the connection is complete, open Arduino IDE, go to the preference and paste this link. Be Be Https://Raw.githubuserContent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json Be Be This will let Arduino IDE download Attiny core. Go to Board Manager and search Attiny, then install the board. Now change the circuit board, processor to Attiny 85, and the clock is changed to 8MHz, and finally changes the port connected to Arduino Nano. After this setting is completed, go to the tool and click the Burning Boot Loader. This completes the programming settings of Attiny 85. We can test it by running a simple glitter sketch. Connect a LED on the 85 pin 3, then write and modify the flash sketch to drive the pin. In our case, I have connected the LED to the GPIO D4 of the pin 3. Then make sure that AttintY 85 is selected and uploaded under tools. In this way, the ATTINY85 was successfully programmed! Step 12: Verify the power consumption of the circuit Before you use other components, let's first verify that the current supplied from this 3V battery is enough to drive all components. So the battery I use is CR2032. The battery has a capacity of 210 mAh and a peak current of 30 mA. So we have to keep all things in at least 20 mA to work perfect. Attiny 85 requires almost 4mA [Data Table] at 3.3V and 8MHz, the temperature sensor DS18B20 requires a 1.5mA [Data Table] when reading the temperature, and all pixels are displayed on the screen, the OLED display requires 20mA [Data Table ]. Combine all of these, we are still less than 30mA peak current. Notice: Don't pin the lithium battery like a tweezers like this! (For schematic only). I have a 1.5OHMS resistance when the battery is short-circuited to the tweezers, and the battery must be discharged from 3.3V / 1.5OHM = 2.2a (ohm law). However, the peak current consumption of the battery is only 30mA, so this will seriously damage the battery or significantly shorten the battery life. Step 13: Place all things together I built the entire circuit on the breadboard. Complete circuit diagrams and code will be available on my Github. When writing code, I make sure some delays have been added in the code, just to add some boot screens, if you don't like it, you can completely ignore it by commenting in the code. Be Be Ozoled.cleardisplay (); Ozoled.printstring ("" "" Attiny 85 ", 0, 0); Ozoled.printstring ("" "thermometer!", 0, 2); Delay (5000); Ozoled.cleardisplay (); Ozoled.PrintString ("Measuring" ", 0, 0); Ozoled.PrintString ("3 seconds", 0, 2); Delay (3000); Ozoled.cleardisplay (); Ozoled.PrintString ("Measurement ...", 0, 2); Lastmeausretime = milliseconds (); Be Be Step 14: Test circuit Figure 23 After the power is turned on, you can see that the device starts running. I also attached a multimeter to see how much current consumes. It consumes 6.5mA before and after the measurement temperature, which will reach the peak 11mA in a few seconds when displaying temperature data. I also implemented deep sleep to achieve significant dropLow battery consumption. You can see the screen close, the circuit enters deep sleep. The circuit here is less than 60ua. This sounds great! Use the current settings, we can run nearly 134 days, 100 times a day! The device takes 25 seconds from the startup screen to the temperature measurement. If I eliminate unnecessary delays and reduce the clock to 1 MHz, we can compress 4-5 days with a unit. We will try to build a circuit on the PCB. Step 15: Build a perforated plate circuit Therefore, the theory and mathematics are already enough, let us build circuits on the perforated plate! Starting from the perforated plate, the shape may look a bit strange, but this is a completely needed design, because when we start designing the case, we need to reduce the size as much as possible. I will use SMD version instead of using DIP IC, this should not have a big impact on performance, and it should give us a very small foothold! In addition, the rest of the circuit is the same as we do on the breadboard. Step 16: Programming attiny 85 on Perfboard To upload the code, temporarily weld the jumper to Attiny 85 (SMD) pin [1, 4, 5, 6, 7, 8] and connect these pins to Arduino NANO, which is the same as step 10. The clock speed is then changed to the use of 1MHz and upload code in Arduino IDE, just as we do in step 11. Step 17: Test the perforated plate circuit This kind of look is very strange, but once we designed the shell, it should look very good! But before this, let's see how much current consumes this circuit, because when testing with the bread board, I have decreased the clock speed to 1 MHz. This looks very good! We reduce the circuit power consumption! It is only less than 3mA during operation, and 58ua is required during sleep. Therefore, through this setting, we can use it about 140 days! But in practice, it will be much less. Considering that all components are ready, there is no major modification of the circuit, which is still great. Reducing the speed of 1MHz may cause the screen update to slow down, you can see this in the video, but I am really happy that this is the case, I don't think the speed of the screen is slower is a big problem. Step 18: Print PCB using PCBWAY Be You can use the final build circuit diagram to create the polishing version of the device, but because it is simple, I don't plan to print the PCB for the project, but if you really want me to design a video, I am happy to do this! Step 19: 3D Model - 3D Print I have designed a model in Fusion 360, which looks not complicated. If you like this design, you can view the Github REPO or download the STL file in this step. I have STL files and circuit diagrams and code. Ok, the model is ready, let us print it! The PETG layer I use is 0.2 mm, with a nozzle temperature of 245 degrees Celsius, and the hot bed temperature is 70 degrees Celsius and the speed is 40 mm / sec. Even if the speed is slow, I am also difficult to use PETG and cause a large number of pull lines in the model. If you have any tips / skills, put them below! THERMOMETER_BOTTOM_CASE.STL THERMOMETER_TOP_CASE.STL Ring .stl Step 20: Assembly It is simple to assemble. Simply use a little glue or insulating material on the solder joint, so piezoelectric does not short the circuit. The circuit is then placed on the bottom casing and close the top shell. Now use the ring to close the other side. This way we will do it! Step 21: Final idea You need to know this is quyching for a suitable alternative for commercial thermometer. This is just an interesting small project where you can understand the electronic products and other DIY. You can make a lot of upgrade to improve the project. First, I like the shell design, but it is not very strong, so a better design method will be great! Second is a longer measurement time, as I said, I just shorten the time for video to get more accurate results. Try to change 45seconds + in the code. Finally, a suitable PCB with all components is effectively completed! "

     

     

     

     

    List all Question

    Nickname

    Email

    Questions

    Our other product:

    Professional FM Radio Station Equipment Package

     



     

    Hotel IPTV Solution

     


      Enter email  to get a surprise

      fmuser.org

      es.fmuser.org
      it.fmuser.org
      fr.fmuser.org
      de.fmuser.org
      af.fmuser.org ->Afrikaans
      sq.fmuser.org ->Albanian
      ar.fmuser.org ->Arabic
      hy.fmuser.org ->Armenian
      az.fmuser.org ->Azerbaijani
      eu.fmuser.org ->Basque
      be.fmuser.org ->Belarusian
      bg.fmuser.org ->Bulgarian
      ca.fmuser.org ->Catalan
      zh-CN.fmuser.org ->Chinese (Simplified)
      zh-TW.fmuser.org ->Chinese (Traditional)
      hr.fmuser.org ->Croatian
      cs.fmuser.org ->Czech
      da.fmuser.org ->Danish
      nl.fmuser.org ->Dutch
      et.fmuser.org ->Estonian
      tl.fmuser.org ->Filipino
      fi.fmuser.org ->Finnish
      fr.fmuser.org ->French
      gl.fmuser.org ->Galician
      ka.fmuser.org ->Georgian
      de.fmuser.org ->German
      el.fmuser.org ->Greek
      ht.fmuser.org ->Haitian Creole
      iw.fmuser.org ->Hebrew
      hi.fmuser.org ->Hindi
      hu.fmuser.org ->Hungarian
      is.fmuser.org ->Icelandic
      id.fmuser.org ->Indonesian
      ga.fmuser.org ->Irish
      it.fmuser.org ->Italian
      ja.fmuser.org ->Japanese
      ko.fmuser.org ->Korean
      lv.fmuser.org ->Latvian
      lt.fmuser.org ->Lithuanian
      mk.fmuser.org ->Macedonian
      ms.fmuser.org ->Malay
      mt.fmuser.org ->Maltese
      no.fmuser.org ->Norwegian
      fa.fmuser.org ->Persian
      pl.fmuser.org ->Polish
      pt.fmuser.org ->Portuguese
      ro.fmuser.org ->Romanian
      ru.fmuser.org ->Russian
      sr.fmuser.org ->Serbian
      sk.fmuser.org ->Slovak
      sl.fmuser.org ->Slovenian
      es.fmuser.org ->Spanish
      sw.fmuser.org ->Swahili
      sv.fmuser.org ->Swedish
      th.fmuser.org ->Thai
      tr.fmuser.org ->Turkish
      uk.fmuser.org ->Ukrainian
      ur.fmuser.org ->Urdu
      vi.fmuser.org ->Vietnamese
      cy.fmuser.org ->Welsh
      yi.fmuser.org ->Yiddish

       
  •  

    FMUSER Wirless Transmit Video And Audio More Easier !

  • Contact

    Address:
    No.305 Room HuiLan Building No.273 Huanpu Road Guangzhou China 510620

    E-mail:
    [email protected]

    Tel / WhatApps:
    +8618078869184

  • Categories

  • Newsletter

    FIRST OR FULL NAME

    E-mail

  • paypal solution  Western UnionBank OF China
    E-mail:[email protected]   WhatsApp:+8618078869184   Skype:sky198710021 Chat with me
    Copyright 2006-2020 Powered By www.fmuser.org

    Contact Us