Thursday, October 25, 2018

Arduino Cricket - How to generate soothing realistic Cricket Sounds with Arduino

The cricket is a little bug that makes noisy sounds at night.

Some people find them annoying. But some others - and I’m one of them - find them soothing and a symbol of nature and piece.

I admit that this repeatable sound of cricket can be annoying. It might get you sleep deprivation specially if it keeps making this noise in a place near where you sleep.

But the other type of people who find its sound soothing may be grateful to hear it at bedtime and feel relaxed from it.

There are even some iPhone and Android apps that do nothing but playing those sounds to keep you relaxed.

Today I thought of generating these sound using Arduino for fun.

This can be a good way of relaxation and you don’t need to go look for that cricket if you want it to stop. In this case you can simply turn it off. 

After all you are who programmed it.

I found a good post from a cleaver guy who made the most annoying cricket sound ever.

He wanted to make it a prank for his friend that he made the sound generation at random intervals.

He also made a consistent version of sound that sounded just like the normal cricket does.

In this version you can control the volume using PWM Pulse Width Modulation.

I liked the consistent sound version.

So here is how I made it.

What you’ll need:

  • Arduino board.
  • 8 ohm speaker.
  • Wires to connect the speaker to Arduino board.

Program the software


Connect the speaker

Play the sound of your cricket.

That’s all.

Thank you for reading.

#include "Volume3.h"
#define speakerPin 9

void setup() {
  // put your setup code here, to run once:


void loop() {
  // put your main code here, to run repeatedly:

void chirpFade() {
  uint16_t f = 3900;

  uint8_t times = random(1,3);
  float master = 1.0;
  uint16_t v = 0;
  uint8_t vDir = 1;
  float vb = 0;

  while (times > 0) {
    while (vb < 1.0) {
      if (v < 1023 && vDir == 1) {
        v += 16;
      else {
        vDir = 0;

      if (v > 0 && vDir == 0) {
        v -= 16;
      else {
        vDir = 1;

      vol.tone(speakerPin, f, v * constrain(vb, 0.0, 1.0)*master);
      vb += 0.003;
    while (vb > 0.0) {
      if (v < 1023 && vDir == 1) {
        v += 16;
      else {
        vDir = 0;

      if (v > 0 && vDir == 0) {
        v -= 16;
      else {
        vDir = 1;

      vol.tone(speakerPin, f, v * constrain(vb, 0.0, 1.0)*master);
      vb -= 0.001;
    master -= 0.75;



Tuesday, October 23, 2018

Tools for Arduino Ladder Logic - Use Arduino like PLC using Ladder Logic

I've posted an article about Arduino based PLC and I've an unexpected response.

Many Arduino enthusiasts and students and also many other automation specialists showed interest to the subject.

This simply shows how there are so many people wanting to know more about open source and freely developed tools that can be used in automation and in industry as a whole.

I remember a friend of mine who had a dream since fourteen years ago. That dream he had was to replace old PLCs with modern Microcontrollers like PIC, Atmel and lately Arduino.

I guess now his dream came true.

I received a lot of questions on Arduino based PLC products and how they can be programmed.

So I’ve searched further and found that there are already some tools that can be used to program Arduino using ladder language.

You may like some vidoes from my YouTube Channel AeroArduino

PLCs are often programmed in ladder logic. This is because PLCs originally replaced relay control systems, and after all those years, we still haven't quite let go. A PLC, like any microprocessor, executes a list of instructions in sequence.

Today I’m putting these tools in front of you so you can start learning them and hopefully using them efficiently.


SoapBox Snap is a free and open source PC-based automation platform.

The ladder editor includes standard instructions like contacts, coils, timers, counters, rising edge and falling edge, and set/reset instructions.

SoapBox Snap also comes with an Arduino Runtime, which means you can download your ladder logic programs to an Arduino (UNO, Nano or Mega board) and even do online debugging and forcing.


It’s a compiler that starts with a ladder diagram and generates native PIC16 or AVR code.
Features include:

-       digital inputs and outputs
-       timers (TON, TOF, RTO)
-       counters (CTU, CTD, `circular counters' for use like a sequencer)
-       analog inputs, analog (PWM) outputs integer variables and arithmetic instructions
-       easy-to-use serial communications, to a PC, LCD, or other device
-       shift registers, look-up tables
-       EEPROM variables, whose values are not forgotten when you lose power
-       simulator, to test your program before you generate PIC/AVR code

I hope this article could shed some light on the subject.

Thank you for reading.

Monday, October 22, 2018

Stealing Fire: How Silicon Valley, the Navy SEALs, and Maverick Scientists Are Revolutionizing the Way We Live and Work

Today I've finished reading this book:
Stealing fire

This book considers the Zone. It's the state of Flow as the best phases of human performance.

It displays how the giants in industry, business and sport can deliberately enter this state of creativity and mindfulness.

Personally, I find the book very interesting and informative.

I agree with some areas in it and disagree with others.

What I agree with it is the idea of entering the Zone through natural ways such as mindfulness, concentration and sports.

Also by changing your state between being alert and relaxed, playfulness and seriousness.

But I also find it a little bit adopting the idea of entering this Zone using non usual chemicals and drugs. And that's what I don't agree with because it's not halal in my Islamic religion and it's also harmful to the mind and body.

I also don't agree with the idea of practicing some physical actions that seem natural in action but might have unnatural, harmful or dangerous effects on the mind and body. Those actions like hearing hallucinating sounds or watching mind altering animations.

Also there are many extreme athletes that seem like addicting to their practitioners. They may be very dangerous and they know it but they cannot stop it.

Finally, I believe that everyone of us has his own type of addiction that can get him into the Zone of peak performance and altered state of mind.

This addiction might be useful and might be harmful, valuable or a waste of time, legal or illegal, but this action is simply our way of getting out of ourselves. That's what the book calls 'Shutting down the self'.

When we find this action we keep practicing it exactly as people are addicted to drugs.

what keeps productive and creative people apart from the rest of us is that their addictive actions take them far beyond the production and creativity of normal people.

While they are driven by those compulsive addictions that in this case useful, they keep their spirits in high states and they are also productive and creative to the society.

I like the book in general and I find it influenced by books from the author who coined the term 'Flow' - Mihaly Csikszentmihalyi.

That's why I've decided to start reading the second book from the positive psychology author 'Creativity'.

By reading books from this author and from others, I've found that since my early days I've been passionate about what I lately knew as positive psychology.

It's the branch of psychology that deals with people to make them lead a happy, meaningful life and flourish.

I hope I could get you to the point.

Arduino based PLC - Open Source Electronics for Industrial Applications

Some people still think about Arduino and open source electronics as a toy for hobbyists and students.

We believe that open source hardware is in the process of revolutionizing electronics and industry in all fields of our lives.

Arduino and its shields have matured to be a modern way of researching tool, rapid prototyping and even in the field equipment for many industries.

M-DUINO PLC Arduino 57AAR I/Os Analog / Digital / Relay PLUS

Ease of use has made Arduino a good candidate for many applications. The variety of tools and millions of lines of code have facilitated the process of development.

Abundant sensors and massive processing power have found their way in Internet of Things era.

Collaborating with Big Data to collect huge amounts of bits of data to form useful information that lead to giant knowledge base for decision making on larger scales; Arduino is the heart for this big picture.

Odoo image and text block


Today you can find weather monitoring stations completely built around open source hardware using open source tools for competitive prices.

Many companies are forming around Arduino platform to evolve into industrial automation makers.

To name some: is making its own industrial Arduino PLC and shields to control water level in tanks, production lines and weather station monitoring systems. is making industrial enclosures for Arduino kits and shields for robustness.

If you are interested in Arduino, you can start by learning how to build your own industrial application.

Monday, October 15, 2018

Arduino Drawing Robot - How to do Art with Arduino and a Pin

In this post will see how this Arduino controlled robot can make beautiful patterns and drawings.

Gathering Parts

Arduino Uno
2 5v Stepper Motors
Micro Servo

You can get the code from here.

Making the frame

Circuit diagram

Installing Wheels

Mounting Servo for Pen movement

Final Assembly and Test


Sunday, October 14, 2018

Modify your old RC Car into that new modern smartphone controlled car with Arduino and Bluetooth

Who have every played with his toy RC car?
Today you can turn your old RC car into an advanced Android RC car using Arduino and Bluetooth shield in simple straight forward steps.

First you need to get the car that fits all of those simple components required for the new control circuit.

Then you need to get all of the stuff out of it. You can find room for your control board as those modern circuits are much smaller than regular ones.

What you’ll need

Arduino UNO
HC-06 Bluetooth shield
L293D IC
12v Lipo battery pack
Some resistors

And you need the program that controls the circuit

Android program:


Saturday, October 13, 2018

Beginner's Dream Quadcopter - Arduino and Bluetooth Micro Quadcopter

This is sure the Beginner's Dream Quadcopter. I've searched a lot for a Quadcopter like this. Today I've found it.

I didn't ask too much. But I couldn't find it until today. And that's why I wanted to share it with you.

Why would it make the Beginner's Dream Quadcopter?

This is one of the simplest quadcopter circuit I've seen recently.  It uses Arduino Nano as its main controller. As for quadcopter stabilization it uses 6050 MPU Module.
User control interfacing circuit is achieved via HC-06 Bluetooth module. This means that you can control this little quadcopter from your smartphone.

Motor drive circuits is built using four transistors.

Source: instructables

Monday, October 8, 2018

Mind to Matter - The Astonishing Science of How Your Brain Creates Material Reality

Just finished the book Mind to Matter. The book deals with some ideas from many disciplines of science.

It's about how the mind can form changes in real life around us.

Starting by changing the way we think and act, we can change our brains and bodies through positive thoughts.

Mind to Matter: The Astonishing Science of How Your Brain Creates Material Reality by [Church, Dawson]

Epegenetics is the branch of genetics that deals with how our genes can be formed by environment to make who we are.

It's the proof that we are not prisoners of our genes but we are also changed by our behavior and environment.

Neuroplasticity is the way our brains change by what we keep doing deliberately.

Thus we must keep focusing on our daily habits that can literally shape our brains and hence our whole life.

Wednesday, October 3, 2018

Solar Powered Quadcopter

If you are a quadcopter enthusiast then you may have thought of a solar powered quadcopter.

Actually there are many Remote Controlled Plane Models that use solar power for flight.

And there are actually real life sized planes that use solar power as well.

So the next question would be: "Is there any solar powered quadcopters?"

This question has been answered by a team from The National University of Singapore NUS.

You may have heard about the quadcopter that used ground based solar charging station for its battery pack. But this time is different.

This quadcopter uses solar power for real time flight.

This means that it can hover as long as it is exposed to direct sun shine.

It also means that it can fly for hours more than any industry standard quadcopter.

It has no onboard battery packs and it's completely powered by an array of 148 solar cells.

The quadcopter frame is built from carbon fiber and its total weight is 2.6kg.

You may ask about what such a quadcopter can do. This is obvious as it's still in development phase and it has been made mainly as a proof of concept.

But anyway this is a huge success for quadcopter industry.

This quadcopter makes Asia the first to develop a totally solar powered quadcopter that doesn't need any battery packs.