Friday, December 18, 2020

Classic bluetooth connection on Arduino

//  use the following sample to connect to the mobile Serial bluetooth terminal app by Kai Morich to test // modules are working or not

#include <SoftwareSerial.h>

SoftwareSerial mySerial(2, 4); // RX, TX configured on Arduino to TX, RX of bluetooth module

void setup() {

  // Open serial communications and wait for port to open:

  Serial.begin(9600);  // so far, it seems 9600 is the working baudrate

  while (!Serial) {

    ; // wait for serial port to connect. Needed for native USB port only

  }

  Serial.println("Goodnight moon!");

  // set the data rate for the SoftwareSerial port

  mySerial.begin(9600);

  mySerial.println("Hello, world?");

}

void loop() { // run over and over

  if (mySerial.available()) {

    Serial.write(mySerial.read());

  }

  if (Serial.available()) {

    mySerial.write(Serial.read());

  }

}


Tuesday, November 12, 2019

Wednesday, October 9, 2019

Sharp GP2Y1010 dust particle sensor

Pinout of a dust particle sensor
Source: http://www.theorycircuit.com/wp-content/uploads/2018/03/dust-sensor-arduino-interface.png

Reference:
https://github.com/PaulZC/GP2Y1010AU0F_Dust_Sensor
http://hazardweatherstation.blogspot.com/2012/06/optical-dust-sensor.html

AHA... need to multiply the Dustdensity by 1000