Categories

Arduino and MAX4466 electret module example

In this article we look at an electret microphone which uses a MAX4466 op amp – you can buy these max4466 modules

Lets look at what Maxim say about the MAX4466

The MAX4465–MAX4469 are micropower op amps optimized for use as microphone preamplifiers. They provide the ideal combination of an optimized gain bandwidth product vs. supply current, and low-voltage operation in an ultra-small package. The MAX4465/MAX4467/MAX4469 are unity-gain stable and deliver a 200kHz gain bandwidth from only 24µA of supply current. The MAX4466/MAX4468 are decompensated for a minimum stable gain of +5V/V and provide a 600kHz gain bandwidth product. In addition these amplifiers feature rail-to-rail outputs, high AVOL, plus excellent power-supply rejection and common-mode rejection ratios for operation in noisy environments.

The MAX4467/MAX4468 include a complete shutdown mode. In shutdown, the amplifiers’ supply current is reduced to 5nA and the bias current to the external microphone is cut off for ultimate power savings. The single MAX4465/MAX4466 are offered in the ultra-small 5-pin SC70 package, while the single with shutdown MAX4467/MAX4468 and dual MAX4469 are available in the space-saving 8-pin SOT23 package.

Features

  • +2.4V to +5.5V Supply Voltage Operation
  • Versions with 5nA Complete Shutdown Available (MAX4467/MAX4468)
  • Excellent Power-Supply Rejection Ratio: 112dB
  • Excellent Common-Mode Rejection Ratio: 126dB
  • High AVOL: 125dB (RL = 100kΩ)
  • Rail-to-Rail Outputs
  • Low 24µA Quiescent Supply Current
  • Gain Bandwidth Product:
    • 200kHz (MAX4465/MAX4467/MAX4469)
    • 600kHz AV ≥ 5 (MAX4466/MAX4468)
  • Available in Space-Saving Packages
    • 5-Pin SC70 (MAX4465/MAX4466)
    • 8-Pin SOT23 (MAX4467/MAX4468/MAX4469)

 

Connection

 

Arduino UnoMAX4466 module
5vVcc
GndGnd
A0OUT

 

 

arduino and max4466

arduino and max4466

Parts List

Here are the parts I used

Part nameLink
Arduino UnoUNO R3 CH340G/ATmega328P, compatible for Arduino UNO
MAX4466 moduleGY-MAX4466 electret microphone amplifier MAX4466 adjustable amplifier module
Dupont cable Free shipping Dupont line 120pcs 20cm male to male + male to female and female to female jumper wire Dupont cablefor Arduino

 

Code

This is actually an adafruit example which uses sampling – you could also simply read the analog value in. This is better

const int sampleWindow = 50; // Sample window width in mS (50 mS = 20Hz)
unsigned int sample;
 
void setup()
{
   Serial.begin(9600);
}
 
 
void loop()
{
   unsigned long startMillis= millis();  // Start of sample window
   unsigned int peakToPeak = 0;   // peak-to-peak level
 
   unsigned int signalMax = 0;
   unsigned int signalMin = 1024;
 
   // collect data for 50 mS
   while (millis() - startMillis < sampleWindow)
   {
      sample = analogRead(A0);
      if (sample < 1024)  // toss out spurious readings
      {
         if (sample > signalMax)
         {
            signalMax = sample;  // save just the max levels
         }
         else if (sample < signalMin)
         {
            signalMin = sample;  // save just the min levels
         }
      }
   }
   peakToPeak = signalMax - signalMin;  // max - min = peak-peak amplitude
   double volts = (peakToPeak * 5.0) / 1024;  // convert to volts
 
   Serial.println(volts);
}

 

Links

 

 

Share

Arduino and OPEN-SMART Round Film Force Sensitive Resistor

In this article we look at an FSR from Open Smart – here is the information I have found on this module

FSRs are basically a resistor that changes its resistive value (in ohms Ω) depending on how much it is pressed.
The FSR is made of 2 layers separated by a spacer. The more one presses, the more of those Active Element dots touch the semiconductor and that makes the resistance go down.

Suggest you to connect it series with a 1k ohm resistor, so that you can detect the voltage so that you can calculate its resistance.

Features:
– No load resistance: >1000kOhm
– Load resistance: <1kOhm @50N
– Working Voltage VCC: 5.5 VDC(MAX)
– Working Current: 5 mA(MAX)
– Pressure Scale: 0-50N
– Response time:  < 10ms
– Recovery Time:  < 40ms
– Sensing area diameter: 9mm
– Total length: 40mm

 

Connection

 

Arduino UnoOpen Smart FSR
5vVcc
GndGnd
A0SIG

 

Parts List

Here are the parts I used

Part nameLink
Arduino UnoUNO R3 CH340G/ATmega328P, compatible for Arduino UNO
Open Smart FSRFilm Force Sensitive Resistor 50N / 5kg FSR Sensor Module for Arduino
Dupont cable Free shipping Dupont line 120pcs 20cm male to male + male to female and female to female jumper wire Dupont cablefor Arduino

 

Code

There are 2 code examples – I have republished them here

Example 1

#define FSR_PIN A0//SIG of FSR sensor module connect to A0 of Arduino
#define DIVIDER_RES 10 //the resistance of the resistor connect with the FSR resistor in series.
// the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
 
}
 
// the loop routine runs over and over again forever:
void loop() {
 
  int sensorValue = analogRead(FSR_PIN);
  float val = sensorValue;
  float res = DIVIDER_RES*1023.00/val-DIVIDER_RES;
  //print out the value you read:
  Serial.println(sensorValue);
  Serial.print(res);
  Serial.println("KOhm");
  judgeForce(res);
  delay(600);        // delay in between reads for stability
}
 
void judgeForce(float res)
{
  if(res > 1200) Serial.println("Nothing on the FSR");
  else if(res > 300) Serial.println("Did you have breakfast? Your strength is too small.");
  else if(res > 50) Serial.println("Your strength can be bigger...");
  else if(res > 15) Serial.println("Man, your strength is big!");
  else Serial.println("You are most strong in the world!");
}

Example 2

#define S0 3 //S0 of the LED Bar module connect to D3 of Arduino
#define S1 4 
#define S2 5
#define S3 6
#define S4 7
#define S5 8
#define S6 9
#define S7 10
const int leds[] = {S0, S1, S2, S3, S4, S5, S6, S7};
 
#define FSR_PIN A0 //SIG of FSR sensor module connect to A0 of Arduino
 
#define MAX_SENSORVALUE 150
#define MAX_LIGHT_LEVEL 8
// the setup routine runs once when you press reset:
void setup() {
 
  for(uint8_t i=0;i < 8; i++){
   pinMode(leds[i], OUTPUT);
 }
 for(uint8_t i=0;i < 8; i++)
  {
    ledOff(i);
  }
}
 
// the loop routine runs over and over again forever:
void loop() {
  int sensorValue = analogRead(FSR_PIN); //the greater the pressure in the sensing area, the higher the output voltage,
                                          //and larger the sensorValue.
  int level = map(sensorValue, 0, MAX_SENSORVALUE, 0, MAX_LIGHT_LEVEL); //convert the sensor value to the light level
  levelOn(level);
}
 
//------------------------------------
void ledOn(uint8_t Sx)
{
  digitalWrite(leds[Sx], LOW);
}
void ledOff(uint8_t Sx)
{
  digitalWrite(leds[Sx], HIGH);
}
 
void levelOn(uint8_t level)
{
  if(level > 8) level = 8;
  for(uint8_t i = 0; i < level;i ++)
  {
    ledOn(i);
  }
  for(uint8_t i = level; i < 8;i ++)
  {
    ledOff(i);
  }
}
//-------------------------------------------

 

Links

FP9-40

 

Share

Arduino and mics-5524 gas sensor example

In this example we look at a MICS 5524 gas module

The MiCS-5524 is a robust MEMS sensor for indoor carbon monoxide and natural gas leakage detection; suitable also for indoor air quality monitoring; breath checker and early fire detection.

Detectable gases

• Carbon monoxide CO 1 – 1000ppm
• Ethanol C2H5OH 10 – 500ppm
• Hydrogen H2 1 – 1000ppm
• Ammonia NH3 1 – 500ppm
• Methane CH4 >1000ppm

One thing to note is that this sensor is sensitive to multiple gasses, as you can see above – but does not know which gas it is

Connection

 

Arduino UnoMICS 5524 module
5v5v
GndGnd
A0A0

 

arduino and mics5524

arduino and mics5524

 

Parts List

Here are the parts I used

Part nameLink
Arduino UnoUNO R3 CH340G/ATmega328P, compatible for Arduino UNO
MICS 5524 module1PCS MiCS5524 CO Alcohol and VOC Gas Sensor Breakout Detector
Dupont cable Free shipping Dupont line 120pcs 20cm male to male + male to female and female to female jumper wire Dupont cablefor Arduino

 

Code

void setup()
{
  Serial.begin(9600);
  Serial.println("MiCS-5524 demo!");
}
 
void loop()
{
  int reading = analogRead(A0);
  Serial.println(reading);
  delay(100);
}

Output

OPen the serial monitor, if you have a gas source such as alcohol then you could test this further

MiCS-5524 demo!
61
57
57
56
56
56
57
56
56
56
56
55
54

 

Serial plotter example

 

Links

 

Share

Arduino and CJMCU-1010 module example

In this example we look at the CJMCU-1010 module – this is based on the AT42QT101x

The AT42QT101x Single Key capacitive touch controller family provides an easy way to add a touch key to any application. It implements advanced filtering algorithm to offer robust operation in noisy environment. Sensitivity and low power modes can be configured as well.

The AT42QT1011 output will remain high as long as a touch is detected. No “Max On” time out.

Additional Features
    • Number of Keys: One – configurable as either a single key or a proximity sensor
    • Key outline sizes: 6 mm × 6 mm or larger (panel thickness dependent); widely different sizes and shapes possible
    • Electrode design: Solid or ring electrode shapes
    • PCB Layers required: One
    • Electrode materials: Etched copper, silver, carbon, Indium Tin Oxide (ITO)
    • Panel thickness:  Up to 12 mm glass, 6 mm plastic (electrode size and Cs dependent)
    • Key sensitivity: Settable via capacitor (Cs)
    • Power consumption: 17 µA at 1.8 V typical
    • Applications: Control panels, consumer appliances, IoT, proximity sensor applications, toys, lighting controls, mechanical switch or button replacement

 

 

Connection

 

Arduino UnoCJMCU-1010 module
5vVcc
GndGnd
D2OUT

Parts List

Here are the parts I used

Part nameLink
Arduino UnoUNO R3 CH340G/ATmega328P, compatible for Arduino UNO
 CJMCU-1010 module
Dupont cable Free shipping Dupont line 120pcs 20cm male to male + male to female and female to female jumper wire Dupont cablefor Arduino

 

Code

const int TOUCH_BUTTON_PIN = 2;  // Input pin for touch state
const int LED_PIN = 13;          // Pin number for LED
 
// Global Variables
int buttonState = 0;             // Variable for reading button
 
void setup() {
 
  // Configure button pin as input 
  pinMode(TOUCH_BUTTON_PIN, INPUT);
 
  // Configure LED pin as output
  pinMode(LED_PIN, OUTPUT);
 
}
 
void loop() {
 
  // Read the state of the capacitive touch board
  buttonState = digitalRead(TOUCH_BUTTON_PIN);
 
  // If a touch is detected, turn on the LED
  if (buttonState == HIGH) {
    digitalWrite(LED_PIN, HIGH);
  } else {
    digitalWrite(LED_PIN, LOW);
  }
}

 

 

Links

http://ww1.microchip.com/downloads/en/devicedoc/40001948a.pdf

Share