INFOSTATION CORP
  • Home
  • Gallery
  • Contact
  • About
  • Digital Goods
  • Home
  • Gallery
  • Contact
  • About
  • Digital Goods
Search

Getting the temperature using the Digital Temperature Sensor Module

31/5/2019

Comments

 
Today I will discuss about use the digital temperature module with the use of 18B20 (Programmable 1-Wire digital Thermometer) so we can measure the temperature in our environment. The following are the things that we need. Arduino board, the digital temperature 18B20 module, jumper wires and breadboard.
Information about digital temperture 18B20 module
This module reports degrees in Celsius from -55 to 125 celsius degrees, with +- 0.5 accuracy/precision. It has 3 pins, namely: VCC, D0 and GND. it can be used as thermometer.
Picture
This sensor has 1-wire interface, in which only one pin will be required to communicate with the Arduino to read the temperature of one or more sensors. Each 18B20 has a unique 64 bit serial code, which allows multiple sensors to function on the same 1-Wire bus (data line). The 18B20 temperature sensor can derive power directly from the data line ("parasite power"), in which you may not need an external power source. In our module, you just connect the VCC pin to the 5V of Arduino. This temperature sensor can be used to temperature monitoring systems in your home, buildings, machine, equipment and other process control systems.
Picture
Materials:
Arduino board (Uno or any compatible)
Breadboard
DS18B20 temp sensor module (if you have no module, and you have just a sensor, you need to get  4.7k ohms to be connected between signal pin and 5V pin)  
​

    
The OneWire library is typically used for a one-wire components like digital temperature sensor.  The Dallas library is used to simplify and to shorter the code for processing the output of the temperature sensor. Make sure all these libraries are included in your Arduino IDE to compile it successfully.
Comments

Using Active buzzer module

30/5/2019

Comments

 
We discussed the passive buzzer module from the previous article. You may wonder what's the difference between these two buzzers. The passive buzzer requires an AC signal (oscillating signal) to make a sound, while the passive signal don't need the oscillating signal to produce a sound. The active buzzer can produce a tone automatically by simply applying a DC voltage. An active buzzer generates tone using the internal oscillator. To check if you have a passive or active buzzer, apply a voltage source to the buzzer. If it buzzes, it means you have an active buzzer. For more control in the programming to produce tone or sound, better to use active buzzer. The active buzzer does not need to use hardware timer or additional code to make sound. In fact, you don't need the Arduino to produce sound with the use of active buzzer. Just apply the voltage and it will produce a buzz sound.
Picture
Check the code below for active buzzer code example
//Simple code for active buzzer module
const int buzzerPin = 5;
void setup() {
    pinMode(buzzerPin, OUTPUT);
}

void loop() {
   // pulse the buzzer on for 150ms 
   digitalWrite(BuzzerPin, HIGH);
   delay(100);
   digitalWrite(buzzerPin, LOW);
   delay(1500);
}

In the sample code, the buzzer produces a buzz sound for 150 milliseconds and then turned off for 1.5 seconds. We can use an analogWrite() to produce different tones.  Pin 9, 10 and 11 in Arduino can be used to write a PWM values using the analogWrite() function. We are going to use pin 9 to our code. See code below for an example using the analogWrite().

Code Editor

    
In the code above, it produces a simple sound with tune. 
Comments

Joystick game controller module

29/5/2019

Comments

 
The joystick game controller module is a PS2 style joystick that gives flexible way of getting input operation. It is a thumb operated controller where it has two potentiometers and one push button switch. The two potentiometers use to give direction depending on where the joystick was pushed. The push button switch will be in low state (0 or ground) when the joystick knob is pressed. 
The joystick module consists of 5 pins, namely: Key, Y, X, VCC and GND. The Key pin represents the push button switch, where typically should be connected to the digital pin of Arduino. The Y pin represents the vertical direction of the joystick (up - down direction) and usually connected to the input analog of the Arduino. The X pin represents the horizontal direction of the joystick (left - right direction) and usually connected to the input analog of the Arduino. The VCC pin is used to connect to the 5V of Arduino. The GND pin is used to connect to the GND pin of Arduino.

Picture
Picture
Picture
 The analog inputs is used to measure the joystick position. The analog input values can be range between 0 and 1023. Keep in mind that the input values may vary.  I suggest you test the joystick position so you could get an accurate result. See the figure for the common output orientation of the joystick.
Joystick Orientation
Joystick x & y Orientation
Notice on the joystick orientation that there's no negative values. the value x=512 and y=512 means that the position of the joystick handle is in the middle or the user did no touch it. If value of x= 512 and y= 1023, the joystick handle is pushed-up. If the joystick values that you received do not match on the diagram, you may calibrate it or you may experiment and map all the positions with the right values. 
Picture
Setting up the joystick controller module to arduino board
See the code below for joystick controller module

    
Setup the joystick controller module.
Connect the X pin of joystick to A1 of Arduino, Y pin of joystick module to A2 of Arduino and switch pin of joystick to digital pin 3 of Arduino. Connect the GND pin of joystick to GND of Arduino and the VCC pin of joystick to 5V of Arduino. Once completed, upload the code to Arduino. If the code has been uploaded successfully, open the Serial Monitor of Arduino Editor and watch out the display as you move the joystick handle and pushing the joystick switch. You will see the values of x, y and the switch.


Comments

Sensor - Photoresistor Module

28/5/2019

Comments

 
I will discuss the photoresistor module today. Photoresistor is a sensor that can sense the amount of light intensity in your environment. This is typically used if you want to control any devices when the environment is dark or when it is light. Our photoresistor module has 3 pins. The left pin is the signal pin, where you connect it to the analog pin in Arduino for as input.  The middle pin is the VCC pin (+5V) and the right pin is GND pin, where it should connect to the ground pin of arduino.
Picture
The input value coming from the photoresistor produces voltage value, a maximum of +5V and a minimum of 0V. Once the arduino receives this voltage value, this will be converted into a number value, from 0 to 1023 value. if the input value is 1023, it means the voltage value produced by photoresistor is +5V. This will only happens when the photoresistor detects a very bright light in the environment, in which it causes the photoresistor reduces its resistance value. ​
Let's try the photoresistor module functionality by uploading our code below.
int sensorPin = A1;    // set the input pin for the photoresistor
int led = 13;      // set the pin for the LED
int sensorValue = 0;  // set the variable to store the value coming from the photoresistor sensor

void setup() {
  pinMode(ledPin, OUTPUT);
}

void loop() {
  // read the value from the photoresistor sensor:
  sensorValue = analogRead(sensorPin);
  // turn on the LED
  digitalWrite(led, HIGH);
  // pause for milliseconds based on value from photoresistor:
  delay(sensorValue);
  // turn off the LED
  digitalWrite(led, LOW);
  // pause for milliseconds based on value from photoresistor
  delay(sensorValue);
}


    
Let's discuss the code inside the loop() function. The analogRead() returns a number between 0 and 1023 based on the voltage produced on Analog pin 1 of Arduino. The value returns will be used as the parameter value for the delay() function. The higher the number, the longer the pause of the system.
Comments

Sensor - Passive Buzzer Module

27/5/2019

Comments

 
A passive Buzzer module can produce a range of tone or sound, like a speaker. It can generate tones between 1.5 kHz up to 2.5 kHz. This buzzer can be found in telephones, alarms, computers, printers,  electronic toys and other electronic products that need to produce tones or sounds. This module has 3 pins, The one with the 'S' label is the signal in which it should be connected to digital output in the Arduino. The one with '-' label is a GND in which it should be connected to the GND pin of the Arduino. The middle pin is not used, therefore no connection to any pins of the Arduino.
Picture
Code example- Simple sound for passive buzzer module

    
Upload this code to the arduino and you will hear sound from the passive buzzer.  See below for screenshots of my passive buzzer demo. I'm using my Arduino Mega ADK for this demo.
Picture
If you want to hear some familiar songs, there are many available samples in the internet.  Try to get the code from the link and you will hear the fur elise song by Beethoven from the passive buzzer. Enjoy!
Comments
<<Previous

    Noel Anonas

    Author, coder, Innovator
    email:
    ​noelqanonas@gmail.com
    My Resume
    ​Couse Outline for Java

    Picture

    Archives

    July 2019
    June 2019
    May 2019
    June 2017

    Categories

    All

    RSS Feed

    View my profile on LinkedIn
  • Home
  • Gallery
  • Contact
  • About
  • Digital Goods