11th
MAR

LED Light with Motion Sensor

Posted by mofication under Electronic, Rooti:

LED Ceiling Lamp with Microwave Radar Sensor Module AC 220V

Product model: YX-3012
Work voltage: AC 180V-240V

The sensor works very well, but unfortunately we cannot change the delay time of the light.
Don’t worry, we can modify the sensor simply by adding an additional potentiometer to the board.

You can adjust delay time for the sensor to switch the light off once it does not detect motion.

Now let’s take a quick look at the functionality of this Module.

This device consisted of 4 parts.

  1. A proximity sensor, It is using microwaves and a Doppler effect to detect the presence of humans.
  2. EG0001/TM2291 chip detector (similar to BISS0001 signal processing integrated circuit), which doesn’t have the sensitivity trim pots.
  3. Power supply to regulate the power required for LEDs and +5 volt system DC
  4. LED Driving Circuit Based on BP2832A
    Components of a LED driver circuit are:
    • LED Driver Circuit BP2832A
    • MB6F/MB10F Bridge rectifier and an amplifier stage for taking the signal from the detector.

The output signal Vo from detector is amplified by the transistor U1 and drives the BP2832A.
The proximity sensor on board uses Doppler Radar. It’s not exactly the same as RCWL-0516 but the pin out of ICs are the same. EG0001 or TM2291 are almost identical to the BIS0001.

For decrease/increase the delay time of the sensor?

The EG0001 IC on board processes in non-retriggerable mode.

No matter how much movement is in the front of the sensor, it will stay high for the period of time given by Tx and after that it will go off for the period time given by Ti.
After that if any movement is detected again by the sensor, it will go on again, and so forth.

Microwave Radar Sensor Module AC 220V LED Ceiling Lamp

Tx = The time duration which the output pin (V0 of BP2832A) remains high after triggering. 49152*RC
Ti =
During this time period, triggering is inhibited. 48*RC (is not needed to be changed for normal home usage)

According to the datsheet
By default, the Tx delay time is about 49 seconds (49152 x 100kΩ x 10nF) and the Ti trigger blocking time is about 326 millisecond (48 x 680kΩ x 10nF).

We can handle it by placing a 1MΩ trim pot in series with the 100k fixed resistor on board. See the diagram and circuit above. I marked the RC on it.
I wanted to reduce the time form 49 to 25 seconds, so I solder a 100kΩ resistor in parallel with the existing 100kΩ smd resistor on board.

R3 is a LDR (Light Dependent Resistor). It’s used to detect environmental illumination.
It has a resistance which increases in darkens and decreases with light.
If the environment has become more bright, R3 resistor value will be reduced, so that the input of pin 9 is kept at a low level, thereby blocking Trigger signal.

For reducing the sensitivity of the sensor?

To adjust the values of Rs to reduce the gain Vref (which sets several of the voltage references inside the chip) and make the device less sensitive.

You can handle it by placing a trim pot in series with a fixed resistor Rs.
This is marked as Rs/Cs on the schematic above. The series resistance would be between 470kΩ and 1MΩ.

If the resistance value is about 680KΩ, then the sensor sensitivity for detection is a few meters.

20th
NOV

DFPlayer and Arduino

Posted by M. 4Gani under Electronici:

DFplayer  module is quite small and looks good for little project.

The module read only audios in MP3 and WAV formats and all audio files must be placed under /mp3 folder.
It’s required that files are named like 0001.mp3, 0002.mp3…..0255.mp3 (4 letters not 2 or 3 letters)
The file names can have any characters after 4 digits, such as 0001_oclock.mp3

Components

DFPlayer Mini module and Speaker
SD card – 2GB ~ 32GB formatted with FAT or FAT32
MP3 / WAV – audio files
Arduino
2 x 1kOhm resistors

How to connect the cheap DFPlayer mini module to an Arduino:

The DFPlayer mini has three modes in which mp3 files can be played.
1) The files are stored in the root directory of the SD card.
2) Files are stored in folders, numbered 01-99, with filenames 001-255.mp3
3) Up to 2999 files are stored in the directory “mp3” with four-digit filenames 0001.mp3-2999.mp3
The serial connection need 1K ohm resistor (3.3 volts vs. 5volts arduino)

Reading the DFRobotDFPlayerMini.h is very instructive and easy to read:

void playFolder(uint8_t folderNumber, uint8_t fileNumber);
void playLargeFolder(uint8_t folderNumber, uint16_t fileNumber);
void playMp3Folder(int fileNumber);

 

mp3_play (74); means play audio file 0074.mp3

8th
JUN

Set up an IR Receiver on a Arduino

Posted by M. 4Gani under Electronici:

The IR signal is a series of IR light pulses which are modulate with a high frequency known as the carrier frequency.
The carrier frequency used by most transmitters is 38 kHz.
The IR receiver has a bandpass and filtered 38 kHz than demodulates the IR light signal, pre-amplifier and converts it to a binary signal.
Each button on the remote control generate a unique hexadecimal code.
This is the information that is modulated and sent over IR to the receiver.

Hardware requirements:

– Arduino board
– IR receiver. Such as the TSOP38238
– An IR remote such as you use for controlling your TV,

Connecting the IR receiver is very simple.
The IR Remote Receiver Electronic Brick has 3 pins. GND, VCC and Signal.

There are many different IR remote controls.
All of these may have different encoding methods and number of physical buttons, and different codes received when a button is pressed.

The best way to find the key codes for your remote control you can upload this code to your Arduino and open the serial monitor.

Below an example Software Sketches for a few common IR Remotes.
You press a key on your remote and the program print the hexadecimal code.

Decoding IR Data

#include "IRremote.h"
int receiver = 11;                   // pin 1 of IR receiver to Arduino digital pin 11

IRrecv irrecv(receiver);
decode_results results;

void setup() {
  Serial.begin(9600);
  Serial.println("IR Receiver Raw Data + Button Decode Test");
  irrecv.enableIRIn();               // Start the receiver
}

void loop() {
  if (irrecv.decode(&results)) {    // have we received an IR signal?
    Serial.println(results.value, HEX);
    translateIR();
    irrecv.resume();                // receive the next value
  }
}

void translateIR() {                // takes action based on IR code received
  switch(results.value) {
    case 0xFF20DF: case 0x202C23D: Serial.println(" 0ff"); break;
    case 0xFFB04F: case 0x20238C7: Serial.println(" v+"); break;
    case 0xFF906F: case 0x202A857: Serial.println(" v-"); break;
    case 0xFF48B7: case 0x202B04F: Serial.println(" ok"); break;
    case 0xFFA857: case 0x202F807: Serial.println(" FORWARD"); break;
    case 0xFF08F7: case 0x20208F7: Serial.println(" LEFT"); break;
    case 0xFFC837: case 0x2028877: Serial.println(" RIGHT"); break;
    case 0xFF10EF: case 0x20220DF: Serial.println(" 4"); break;
    case 0xFF38C7: case 0x202A05F: Serial.println(" 5"); break;
    case 0xFF5AA5: case 0x202609F: Serial.println(" 6"); break;
    case 0xFF30CF: case 0x202807F: Serial.println(" 1"); break;
    case 0xFF18E7: case 0x20240BF: Serial.println(" 2"); break;
    case 0xFF7A85: case 0x202C03F: Serial.println(" 3"); break;
    case 0xFF42BD: case 0x202E01F: Serial.println(" 7"); break;
    case 0xFF4AB5: case 0x20210EF: Serial.println(" 8"); break;
    case 0xFF52AD: case 0x202906F: Serial.println(" 9"); break;
    case 0xFFC23D: case 0x20200FF: Serial.println(" 0"); break;
    default:  Serial.println("-> other button  <-");
  }
  delay(500);
} 

28th
JAN

DS18B20 & LCD 128×64

Posted by M. 4Gani under Electronici:

Before I start, let’s of a quick review about the differences between DHT22 Temperature and Humidity sensor and DS18B20 Temperature sensor 1-Wire. (DHT22 vs. DS18B20)

سنسور دما دیجیتال DS18B20,  سنسور رطوبت و دما DHT22, دماسنج NTC

 

DHT22 vs. DS18B20 & NTC

DHT22 vs. DS18B20 & NTC

DHT22 is a digital temperature and humidity sensor.
DHT22 has a capacitive humidity  and a thermistor sensor and measures the surrounding air in one device.
The device only has a digital signal output (NOT any analog output).
The data can be read from the output every 2 seconds .
It comes in different technologies and forms.

DS18B20 Temperature Sensor

DS18B20 is 1-Wire interface Temperature sensor. This sensor has 3 pins and looks like a transistor.
The sensors only requires one port pin for communication and needs NO other external components to work.

Each individual device has its unique ID.
This ID consists of a 64-bit number (8 bytes). The microcontroller calls a unique ID and receive the carry data information in two bytes from the device.

All the other devices connected to the bus remain silent during their ID is not called.
The sending the data bytes for a DS18B20 takes about 750 msec.

The thermometer resolution of DS18B20 is programmable from 9 to 12 bits and it converts 12-bit temperature to digital in less than 750 ms.

For my project I decided to use a DS18B20 Sensor.

Components

– Arduino board
– DS18B20 Temperature Sensor module
– LCD 128×64 (ST7920) with serial mode – SPI

 

22nd
JAN

Clock with LCD 1602 & DS1307

Posted by M. 4Gani under Electronici:

Make a clock with DS1307 real clock module and 1602 16×2 LCD panel with back-panel to convert it to I2C protocol. (I2C راه اندازی با)
The time and date will be displayed in alphanumeric on LCD.

Clock with LCD 1602 16x2 & DS1307 real clock

Clock with LCD 1602 16×2 & DS1307

Device: LCD 1602 with back-panel  (نمایشگر LCD 16×2 کاراکتری دو سیمی)

The communication requires only two pins on the microcontroller bord: A4 and A5.
SDA: Analog 4
SCL: Analog5
VCC: 5V
GND: GND terminals
Contrast Adjust : has a built in potentiometer for contrast adjustment.
I2C Address: in my case is 0x27

You should see the LCD light up by starting, if it dose not happened, you may want to turn down the contrast of the LCD.

LCD has 2 lines, 16 character in each line and each character have 5-pixel in width and 8-pixel in height.
The LCD supports up to 8 custom characters numbered from 0 to 7.

The DS1307 Real time use also I2C Protocol to communicate with arduino.

Driver IC: I2C DS1307 Real Time Clock
SCL:
Analog 5  (clock line)
SDA: Analog 4   (data line)
Voltage: 3.3V to 5V
GND:  GND of Arduino
I2C Address: in my case was 0x68

Each device on the I2C bus has its own unique address. The LCD display used here has address 0x27.
You can use the scanner script to find  I2C addresses on arduino by using

The I2C address used by a device can be found with the sketch i2c_scanner

Scanning…
I2C device found at address 0x27 !
I2C device found at address 0x68 !
done

To drive LCD I’m using the LiquidCrystal_I2C library, which seems to be commonly used.

 

 

 

See more website here...

  • Advertise Here
  • Advertise Here
  • Advertise Here
  • Advertise Here