Tag Archives: Arduino

Nerdonic Atom X1 is the World’s Smallest 32-bit Arduino Compatible Board

Tiny 32-bit Dev Board. 14.9mm², Breadboard, 0.95g, 3-20V input, I²C, 8 PWM, Serial, 6 ADC, Prog LED.

There is a new board in the ecosystem which claims to be the world’s smallest 32-bit Arduino board. The name of it Atom X1 and measures 14.9×14.9 mm.

Atom X1 specifications:

  • MCU – Microchip Atmel  SAMD21 Cortex M0+ MCU @ 48 MHz with 256KB flash, 32KB SRAM
  • I/Os via 2x 5-pin 2.54mm pitch headers
    • Up to 8x digital I/O
    • Up to 8x PWM
    • Up to 6x analog (ADC)
    • 1x UART
    • 1x I2C
    • 1x reset
    • Limits – 3.7V, 7mA
  • USB – 1x micro USB port
  • Programming – via micro USB port or SWD header
  • Misc – Power LED, user LED, button
  • Power Supply
    • 3.3-20V (regulated to 3.3v) via power Pin 1
    • 3.3V via power pin 2
    • 5V (regulated to 3.3v) via Micro USB port
    • Current Draw Atom X1 = ~10mA
  • Dimensions – 14.9 x 14.9 x 4.4mm
  • Weight – 0.95 grams

The board is breadboard compatible, pre-flashed with Arduino Zero bootloader, and can be programmed in the Arduino IDE just like the original board.

The project has been launched on Indiegogo. Early bird rewards start at 10 GBP (~$13.2 US) for the board with shipping adding 2 GBP to the UK, and 7 GBP to the rest of the world. Delivery is scheduled for December 2017.

Three Ways to Make Arduino Works As A USB/TTL Converter

Even if you have years working with electronics, you will still find some simple hacks that you never thought about before. Personally and to save money, when I was a student with a very limited budget I knew that my Arduino UNO can work as a USB/TTL(serial) converter. I used to remove the Atmega328P from my Arduino UNO R3 board in order to use the board as a converter not as a development board.

Why we need to do some tweaking to Arduino in order to use 0 and 1 pins for direct USB <-> UART conversion? This is because of what’s called fan-out (fan-out of a logic gate output is the number of gate inputs it can drive). In Arduino UNO case, the RX & TX lines (pins 0 and 1) are connected to FT232RL/Atmega8U2 USB to TTL bridge and to the Atmega328P MCU (check the schematic). So using the same pins with an external connections without doing any changes to Arduino UNO board probably won’t work.

Patel Darshil over Hackster.io listed three ways to make Arduino works as a USB/TTL converter:

Hack #1: Set Pin 0&1 Mode to Input Mode

This is done using code:

Pin Mode Set Arduino

But why this solves the problem? Well, GPIO can operate in two modes, input and output. In the input mode the equivalent impedance of the pin is too high; therefore, the Arduino/Atmega328P’s pins will have almost no electrical effect to the converter RX/TX pins.

Hack #2: Keep Atmega in Reset Mode

Just connect the RES pin with GND (the bold red wire in the image bellow)

Arduino Reset
Image Courtesy of Patel Darshil

GPIOs are configured using special registers. For example, Atmega has GPIO port data direction register (DDR) to set the GPIO as an input or an output for each port. The value of this register is cleared during reset. Therefore, the MCU’s GPIOs mode will be input. This means high impedance, subsequently.

Hack #3: Remove The MCU

This is the common way used by most Arduino UNO users, but it’s not applicable when it comes to new versions of Arduino; where, the MCU is SMD and can’t be removed.

Arduino Two-Way Bluetooth Communication Tutorial

Welcome to another Arduino Tutorial! Today we are going to learn how to use Bluetooth to exchange data between two Arduino boards! As a demonstration project, we are going to build a simple weather station. There is a lot to cover so let’s get started!

Arduino Two-Way Bluetooth Communication Tutorial – [Link]

Decoding and Encoding JSON with Arduino or ESP8266

In this blog post you’re going to learn how to decode (parse a JSON string) and encode (generate a JSON string) with the ArduinoJson library using the Arduino with the Ethernet shield. This guide also works with the ESP8266 and ESP32 Wi-Fi modules with small changes.

Decoding and Encoding JSON with Arduino or ESP8266 – [Link]

Control a 12V Lamp via SMS with Arduino

In this tutorial we’re going to show you how you can turn a 12V lamp on and off by sending SMS to your Arduino with the text “ON” and “OFF”, respectively. You can also request the current lamp state by sending an SMS with the text “STATE”, the Arduino should reply back with the text “Lamp is on” or “Lamp is off”

Control a 12V Lamp via SMS with Arduino – [Link]

Get Sensor Data From Arduino To Smartphone Via Bluetooth

Hariharan Mathavan at allaboutcircuits.com designed a project on using Bluetooth to communicate with an Arduino. Bluetooth is one of the most popular wireless communication technologies because of its low power consumption, low cost and a light stack but provides a good range. In this project, data from a DHT-11 sensor is collected by an Arduino and then transmitted to a smartphone via Bluetooth.

Required Parts

  • An Arduino. Any model can be used, but all code and schematics in this article will be for the Uno.
  • An Android Smartphone that has Bluetooth.
  • HC-05 Bluetooth Module
  • Android Studio (To develop the required Android app)
  • USB cable for programming and powering the Arduino
  • DHT-11 temperature and humidity sensor

Connecting The Bluetooth Module

To use the HC-05 Bluetooth module, simply connect the VCC to the 5V output on the Arduino, GND to Ground, RX to TX pin of the Arduino, and TX to RX pin of the Arduino. If the module is being used for the first time, you’ll want to change the name, passcode etc. To do this the module should be set to command mode. Connect the Key pin to any pin on the Arduino and set it to high to allow the module to be programmed.

Circuit to connect HC-05 with Arduino
Circuit to connect HC-05 with Arduino

To program the module, a set of commands known as AT commands are used. Here are some of them:

AT Check connection status.
AT+NAME =”ModuleName” Set a name for the device
AT+ADDR Check MAC Address
AT+UART Check Baudrate
AT+UART=”9600″ Sets Baudrate to 9600
AT+PSWD Check Default Passcode
AT+PSWD=”1234″ Sets Passcode to 1234

The Arduino code to send data using Bluetooth module:

//If youre not using a BTBee connect set the pin connected to the KEY pin high
#include <SoftwareSerial.h>
SoftwareSerial BTSerial(4,5); 
void setup() {
 String setName = String("AT+NAME=MyBTBee\r\n"); //Setting name as 'MyBTBee'
 Serial.begin(9600);
 BTSerial.begin(38400);
 BTSerial.print("AT\r\n"); //Check Status
 delay(500);
 while (BTSerial.available()) {
 Serial.write(BTSerial.read());
 }
 BTSerial.print(setName); //Send Command to change the name
 delay(500);
 while (BTSerial.available()) {
 Serial.write(BTSerial.read());
 }}
void loop() {}

Connecting The DHT-11 Sensor

To use the DHT-11, the DHT library by Adafruit is used. Go here to download the library. When the letter “t” is received, the temperature, humidity, and heat index will be transmitted back via Bluetooth.

circuit to connect DHT-11 with Arduino
circuit to connect DHT-11 with Arduino

The code used to read data from the DHT sensor, process it and send it via Bluetooth:

#include "DHT.h"
#define DHTPIN 2 
#define DHTTYPE DHT11 
DHT dht(DHTPIN, DHTTYPE);
void setup() {
 Serial.begin(9600);
 dht.begin();}

void loop()
{ char c; 
if(Serial.available()) 
 { 
 c = Serial.read(); 
 if(c=='t')
 readSensor();
 }}
void readSensor() {
 float h = dht.readHumidity();
 float t = dht.readTemperature();
 if (isnan(h) || isnan(t)) {
 Serial.println("Failed to read from DHT sensor!");
 return;
 }
 float hic = dht.computeHeatIndex(t, h, false);
 Serial.print("Humidity: ");
 Serial.print(h);
 Serial.print(" %\t");
 Serial.print("Temperature: ");
 Serial.print(t);
 Serial.print(" *C ");
 Serial.print("Heat index: ");
 Serial.print(hic);
 Serial.print(" *C ");
}

Developing The Android App

The flow diagram of the Android app is illustrated below,

Flow diagram of the Android app
Flow diagram of the Android app

As this app will be using the onboard Bluetooth adapter, it will have to be mentioned in the Manifest.

uses-permission android:name="android.permission.BLUETOOTH"

Use the following code to test if Bluetooth adapter is present or not,

BluetoothAdapter bluetoothAdapter=BluetoothAdapter.getDefaultAdapter();
if (bluetoothAdapter == null) {
Toast.makeText(getApplicationContext(),"Device doesnt Support Bluetooth",Toast.LENGTH_SHORT).show();
}

The following part of the code deals with reading the data,

int byteCount = inputStream.available();
 if(byteCount > 0)
 {
 byte[] rawBytes = new byte[byteCount];
 inputStream.read(rawBytes);
 final String string=new String(rawBytes,"UTF-8");
 handler.post(new Runnable() {
 public void run()
 {
 textView.append(string);
 }
 });
 }

To send data, pass the String to the OutputStream.

outputStream.write(string.getBytes());

The complete source code of the Android application can be downloaded from here.

Testing

Power up the Arduino and turn on the Bluetooth from your mobile. Pair with the HC-05 module by providing the correct passcode – 0000 is the default one. Now, when “t” is sent to the Arduino, it replies with the Temperature, Humidity, and Heat Index.

the application screen
the application screen

Attiny Programmer (using Arduino UNO)

by @ instructables.com:

The Arduino UNO is small, but if you require your project to be in a small enclosure, the UNO might be way too big. You could try using a NANO or MINI, but if you really want to go small, you go tiny, Attiny to be precise.

They are quite small, cheap chips (basically small Arduinos) and can be programmed in the Arduino IDE, however you might notice that there is no USB connection. So how do we program it???

Attiny Programmer (using Arduino UNO) – [Link]

STM32 Arduino Tutorial – How to use the STM32F103C8T6 board with the Arduino IDE

In this Arduino Tutorial, we are going to take a first look at the STM32 Arduino Compatible Board. This board is powerful and inexpensive. Let’s see what it has to offer!

STM32 Arduino Tutorial – How to use the STM32F103C8T6 board with the Arduino IDE – [Link]

FemtoUSB Board (Atmel ARM Cortex M0+)

Arduino compatible, Atmel SAM D21 chip, open source!

This is one of the smallest ARM powered boards in the world. If you are ready to transition away from AVR 8-bit hardware to the very powerful ARM 32-bit stuff, this is the way to learn! The board design, schematic, and parts lists are completely open-source.

FemtoUSB Board (Atmel ARM Cortex M0+) – [Link]

Arduino compatible high precision frequency counter

The concept of this board is to build an open, very versatile frequency counter, so it can be used to measure a wide variety of signals. It is designed to be customizable in every possible way.

Freq_LF_HF v1.0 board uses the famous AVR microcontroler Atmega328p-AU. This is not the newest ATMEL model but this chip is standard on Arduino UNO v3.0 board. It is a powerfull microcontroller and very small (TQFP- 32). This gives the opportunity for users to benefit from the Arduino community support and the many software libraries. The firmware uses a couple of the wonderfull functionnalities of this chip, namely the 16 bits timer, interrupts and comparator to an external precision voltage reference.