Pages with tag Arduino

Arduino UNO first step, connect to your laptop, run a simple application

The Arduino is an extremely popular microcontroller for open source DIY hardware hacking projects. There are many flavors of Arduino, and for this project we'll use an Arduino UNO. All Arduino's have a well-defined GPIO interface supporting "Shield" boards providing customized capabilities. The GPIO pins can be connected to your DIY hardware, or to 3rd party Shields, for which there are many suppliers. That's what makes the Arduino so interesting to regular folk like you and me. There's a whole slew of microcontroller chips and boards targeted to commercial and industrial systems. That's not who we are, we're hacking away in a spare bedroom.

With this article we'll take a first step or two to get an Arduino connected to our computer, get accustomed to the IDE, and upload a couple simple programs. Down at the bottom are a few videos.

Arduino board and accessories buying guide.

The Arduino marketplace includes a long list of controller boards and add-on accessories. This guide shows some of the best Arduino-compatible products available.

Build an FM radio using Arduino Nano and a TEA5767 Radio Module

With a few add-on parts, you can create your own customized FM radio receiver. The attached project uses an Arduino NANO and a TES5767 radio module that can be used either with Raspberry Pi or Arduino. The display is a Nokia 5110 LCD display, but you could use any display of your choosing. The TES5767 uses an I2C interface, making it easy to integrate, and making an I2C display unit a good addition.

Displaying text on LCD screen from the Arduino UNO

The Arduino doesn't have an intrinsically native display. Programmers frequently debug their software by printing stuff to a screen, or they need a human-machine-interface to show what's happening, and even a simple text display can be quite handy.

With this article we'll install a particular kind of LCD display, and learn how to drive the LCD display using the LiquidCrystal library. This particular LCD requires wiring up a little circuit that uses a potentiometer to control brightness. While we might yearn for a simple-to-connect-display, we do learn a little electronics along the way. At the end of the day the Arduino is about encouraging us to fire up our soldering iron and making things.

Once you've wired the display, the LiquidCrystal library makes it easy to display text on the screen.

Easy I2C: Introduction to I2C I2C is an acronym for Inter-Integrated-Circuit-Communications. It was invented by Phillips Semiconductor, now NXP. It's meant to provide simple, robust, inexpensive and easy-to-use communications between a "chain" of devices. Many devices such as accelerometers, temperature sensors, pressure sensors, etc. communicate on the I2C bus.
How I2C Communication Works and How To Use It with Arduino The I2C protocol allows communications across a "bus" between a master device, multiple masters, and one-or-more slave devices. Two wires are required, supporting communication with up to 112 devices, with one line carrying a clock signal and the other line carrying data. The video shows using I2C on Arduino using the GY-80 board and GY-521 board, both of which has several sensors. The video shows how to communicate with those devices using Arduino Sketch programs.
Initial notes on using MAX485 based TTL-to-RS485 adapter boards with Arduino or Raspberry Pi

I've been looking for an inexpensive but robust way to connect an inexpensive embedded computer to an RS485 network. The MAX485 based interface boards look enticingly inexpensive, and claim to be easy to connect. They should be more reliable than a USB RS485 adapter, because the MAX485 boards are hardwired to GPIO pins. It took much searching to find any advice about connecting these adapters to a computer. The board I received was marked DI/DE/RE/RO on one end, and Vcc/A/B/GND on the other. The latter is clear, that's power and the RS485 pins, but what could the other end mean.

Reliable data transmission with an Arduino

Communicating data is important - your Arduino might be used as a sensor, or to control some hardware, and therefore needs to either send data to another computer, or to receive commands from another computer. The core necessity is sending and receiving data. This video is an in-depth look at how to implement NRZ (Non-Return-To-Zero) data communications using a single pin on the Arduino. Also in the video is a look at connecting a certain LCD panel to an Arduino.

Use the I2C Bus to control a Character LCD with Arduino - Tutorial Let's use the I2C Bus to connect and use a Character LCD the easy way with only 2 wires. The tutorial shows reading data from an ultrasonic range sensor, and displaying on the LCD.
Using an Arduino to read a simple MODBUS/RTU RS-485 temperature sensor

Arduino's are very popular for DIY or IoT projects involving a small computerized controller board, some GPIO pins to read inputs from the environment or to control devices, with optional communication with remote services. Theoretically an Arduino, or for that matter larger computers like the Raspberry Pi, can replace the PLC devices commonly used in industrial control applications. Why spend several hundred dollars on an expensive PLC device when the same goal can be achieved more flexibly and inexpensively with newfangled embedded computers like the Arduino?

A key to this is for an Arduino (or other embedded control computer) to interface with MODBUS and other protocols used in industrial settings. In this article we'll go over using an RS-485 Shield for Arduino, using it to communicate with the simple MODBUS temperature sensor we're using.

The libraries we'll discuss in this article enable using the Arduino as either MODBUS Master or Slave. The last is interesting considering the huge variety of sensors available for Arduino. Consider a simple energy monitoring project - One can interface a CT (current transformer) to measure the current in a circuit, and directly measure the voltage using an analog input, a Sketch could read that data from the sensor, and make it available via MODBUS. An Arduino could be a very simple and inexpensive device in a MODBUS network.

Using the Arduino serial console to monitor your Sketch

The most useful debugging tool many programmers have is the Print statement. They insert Print statements throughout their code, to see if the program got to certain points and if so what was the values. While there are fancy schmancy debugger packages available, the Print statement is extremely useful and simple. An Arduino presents a challenge because the software executes over on that teensy board, there's no computer display, no direct connection, where would the print statement send its output? Turns out the Arduino software stack includes a Serial console that you can view from inside the Arduino IDE. What we'll do in this article is go over a trivial example of reading an analog value to print on the serial console.