Posts with «featured» label

Arduino PRO Gateway for LoRa now available for pre-order

We are very happy to announce the Arduino PRO Gateway for LoRa!

Combined with Arduino MKR WAN 1300 IoT nodes it makes an ideal solution for a wide range of applications, like smart agriculture, smart cities and building automation – and many other remote monitoring applications requiring long range, low power wireless connectivity.

The gateway can be used globally and enables multiple channel management. By supporting advanced features like Listen Before Talk (LBT), it allows users to transmit at higher power on the first free channel, achieving longer ranges than conventional gateways for LoRa. 

Arduino continues its mission of making complex technology easy enough for anyone to use. Customers of the Arduino PRO Gateway will be given exclusive beta access to the Arduino IoT Cloud, which makes installation, provisioning and remote management of the gateway incredibly simple through the popular Arduino Create cloud platform.

The gateway features the advanced Embit EMB-LR1301-mPCIe module, hosted by a Raspberry Pi 3 B+ SBC, in a rugged aluminum enclosure. The gateway comes pre-installed with an optimized packet forwarder and a carrier grade Network server for LoRa WAN that is running on the Arduino Cloud provided by A2A Smart City (part of the A2A Group).

Technical Specifications

  • Chipset: Semtech SX1301
  • Modulation: LoRa Spread Spectrum, FSK, GFSK 868MHz (EU) / 915MHz (US)
  • Number of Channels: 8 LoRa Channels
  • Operating Frequency: 868MHz (EU) / 915MHz (US)
  • Frequency Range: 860MHz to 1020MHz
  • Operating Temperature: -40°C to +85°C
  • RF Output Power: Up to +27dBm
  • Sensitivity: Up to -137dBm
  • Interfaces for the LoRa Module:  mPCIe (SPI / I2C / UART / GPIOs) :
  • Dimensions: 71x40x1mm
  • Operating Voltage: +5V
  • Additional Features:
    • Listen Before Talk (LBT) Capability (for improved transmission power management),
    • On-board uFL antenna connector
    • FPGA support for LoRa Spectral Scan

 

The Arduino Pro Gateway for LoRa (868 MHz , EU version) can be pre-ordered from the Arduino Store.

Arduino Blog 14 Nov 10:39

Dual Arduino “CNC” control

Generally when you work with CNC machinery, you program it on a computer, then allow a controller to automatically run through a cutting routine. Arduino boards have long been used for this kind of control through the grbl software package, but YouTuber Electronoobs decided to do things a bit differently.

His setup takes input from a potentiometer and several buttons, enabling manual control of his stepper motor-driven router. An Arduino Nano powers the motors through a pair of stepper drivers, while a second Nano is then used to output distance information on an LCD screen, letting him view exactly where his cutter is at a glance.

Why use 2 Arduinos? Well, if I use only one, the code would be very difficult with too much interruptions. We have to create pulses for the motors and print on the LCD at the same time. I’ve done that and each time I was printing on the LCD, there was a small pause in the motor rotation, and if the refresh rate is fast, the motors will have a pause each time and we don’t want that. That’s why I use 2 Arduinos. One will create the pulses for the motors and the other one will count the steps and print the distance and speed.

We have 2 step motors. I’ve used NEMA 17. Each with a A4988 driver. This driver needs 3 signals from the Arduino. Enable, direction and steps. The enable pin is connected to a toggle switch so we could start to stop the motors manually. The toggle switch is also connected to the Arduinos so we could know when the motors are enabled or not. To control speed we use a lineal potentiometer and to move axis and reset position, some push buttons with pulldowns. To print the distance, I’ve used an I2S LCD screen of 20×4 but you will have the code for the 16×2 version of LCD as well.

Besides adding a nice readout to the machine, this concept could certainly form the basis for all manner of other stepper-driven devices.

Arduino Mega controls this amazing water organ

Earlier this year, artist Niklas Roy was invited to participate in the Drehmoment art festival that takes place in the south-west of Germany. The “catch” to this festival is that each artist was invited to team up with a local company to take advantage of their products and resources. Of these was cleaning equipment brand Kärcher, known for their pressure washers.

With this company’s backing, Roy put together a musical water fountain powered by eight pressure washers, dubbing it the “Wasserorgel von Winnenden,” or “Water Organ of Winnenden”—the location of Kärcher’s headquarters. 

The installation is controlled by an Arduino Mega, along with supporting electronics including a Music Maker Shield and solid state relays to activate the pressure washers. During the festival, passerby were invited play some tunes using a 3D-printed keyboard made to withstand the elements and less-than-gentle interactions.

The brain of the Wasserorgel was an Arduino MEGA 2560, stacked with an Adafruit Music Maker Shield. The MIDI synthesizer of the shield generated the instrument sounds based on the input coming from a self-built, 3D-printed keyboard. The keyboard was designed solid enough to withstand weather and the misguided enthusiasm of drunk people at 3 ‘o clock at night. The program on the Arduino translated the keystrokes into water and light effects by switching 12V RGB LEDs via darlington transistors and the eight pressure sprayers via solid state relays. Five of the pressure sprayer fountains were installed on top of the main basin, one was installed on top of an existing fountain and two were installed on the roof of the Kronenplatz-building.

You can find more information in Roy’s project write-up, and see it in action below!

Vintage-style clock made from individual LEDs

If you’ve ever wanted a vintage-style timepiece, or to test your soldering abilities, this clock by YouTuber Electronoobs will let you do both at once. 

It features four display modules that resemble Nixie tubes, each made out of LED filaments soldered onto a steel wire frame. If you find soldering enjoyable and relaxing, this is likely a good project for you; though if not, there are of course other options. 

The device is controlled by an Arduino Nano, along with a MAX7219 display driver to power the LEDs as needed. An RTC module keeps things “ticking” at the correct pace, and a pair of buttons on top of the wooden enclose allow the time to be adjusted as needed.

I’ve made some “Nixie” tubes. These are actually 7-segment displays made with filament LEDs but placed in a plastic bottle so it will have a more vintage nixie look. To control the LEDs I’m using the MAX7219 driver that could control 4 x 7-segment displays. To get the real time, I’m using the DS3231 module that works with an I2C communication so it’s easy to use. The project also has 2 push buttons to set the hour and minute. All is inside a wood case painted with varnish so it will look more vintage.

Check it out in the video below, or see the build write-up for more info.

Hands on with the Arduino FPGA

All of the tools you need to work with the FPGA Arduino — the Vidor — are now in the wild!

We reported earlier that a series of French blog posts finally showed how all the pieces fit together to program the FPGA on the Arduino MKR4000 Vidor board. Of course, I wasn’t content to just read the Google translation, I had to break out the board and try myself.

I created a very simple starter template, a tool in C to do the bitstream conversion, required, and bundled it all together in one place. Here’s how you can use my starter kit to do your own FPGA designs using the Vidor. I’m going to assume you know about FPGA basics and Verilog. If you don’t, why not check out the FPGA boot camps first?

The first thing you’ll want to do is grab my GitHub repo. You’ll also need the Arduino IDE (a recent copy) and Intel’s Quartus software. Inside, you’ll find three directories, two of which contain slightly modified copies of original Arduino files. But before you start digging in, let’s get the high-level overview of the process.

Basic Concepts

The FPGA onboard the Vidor is an Intel/Altera device so to configure it, we’ll use Quartus. Usually, Quartus handles everything including programming the device, but we can’t use it for that with the Vidor. Instead, we will have to tell the CPU how we want the FPGA configured and it will do it for us as part of our Arduino program (I really hate saying sketch).

Quartus (see below) will take our Verilog files and create a ttf file that represents the configuration bitstream. This is just an ASCII text file full of decimal numbers. Unfortunately, the way the Vidor is set up, it needs the numbers bit reversed at the byte level. That is, 01 in the ttf file needs to be 80 hex sent to the FPGA.

Arduino supplies a Java class file to do the task, but I got frustrated because the class file needed Java 11 and I didn’t want to put it on every machine I use, so I just rewrote it in C. It is easy enough to port the algorithm, though. In the shell subdirectory, I have another example implementation using awk.

Once you have this stream of numbers, you can include it in an Arduino sketch with some boilerplate to enable the FPGA and load it. The standard program includes the file app.h which is just the output of the conversion program. There’s no C code in it, just comma-separated numbers that the main code will stick in an array at compile-time. Beyond that, it is a normal Arduino program and you can do what you like. Upload it and you’ll get the CPU and FPGA programmed all in one go.

There is one caveat. The FPGA code has a top-level block with lots of I/O pins defined and the corresponding constraints. You should be very careful not to change these or alter the pin constraints. If you drive a pin that’s already an output, for example, you could do real harm to the board. Because all the pins are shared, you have the same problem with the Arduino pins, too. If you are driving an output pin with the FPGA, you shouldn’t try to drive it with the CPU also. However, as you will see, it is perfectly fine to have the FPGA reading a pin from the CPU or vice versa. That’s good because it gives us a way to send data back and forth between them.

On to Code

I wanted something simple, and I didn’t want to accidentally modify the Arduino boilerplate Verilog. You could instantiate a Verilog module, but this would require passing all the I/O pins into the module or modifying the original code every time, both of which I wanted to avoid.

My answer was to use the Verilog `include directive inside the boilerplate. That way your code has access to everything the main module has, but you don’t have to change the main module. The only downside is that Quartus has a smart compile feature that can’t figure out when only an include file changes. So it wasn’t recompiling when I made changes. I turned that feature off in the Quartus options, so if you pick up my example project, you won’t have any problems.

Here’s my example user.v:

reg [27:0] hadcounter;
assign bMKR_D[6]=bMKR_D[5]?hadcounter[27]:hadcounter[21];

always @(posedge wOSC_CLK)
begin
   if (!rRESETCNT[5])
   begin
      hadcounter<=28'hfffffff;
   end
   else
   begin
      if (hadcounter==28'h0) hadcounter<=28'hffffffff; else hadcounter<=hadcounter-28'h1;
   end
end

In the real file, I left a lot of comments in that explains what all the main module has that you can use. But the above is the working part. I define a 28 bit counter. The bMKR_D array is the digital ports for the Arduino and I’m using pin 6 and 5 as an output and an input, respectively.

The assign statement says, in English, If D5 is high, connect the 27th bit of the counter to the LED. If it is low, connect the 21st bit. The rest of the code just makes the counter countdown. I reload the counter even though it would naturally roll over in case you want to fine tune it to a different frequency.

As the counter runs, bit 27 will toggle relatively slowly, but bit 21 will be a good bit faster — that’s just how a counter is. So by changing D5 you can make the LED blink slow or fast.

As Verilog goes, this isn’t very complicated or even useful, but it is simple and shows that we can share data with the CPU in both directions. If you open the example project in Quartus, all you really need to do is make any changes to user.v you like, add any other files you want to use and double-click the Compile Design task (see left). If you get a successful compile, you’ll find the ttf file in the output_files directory. That’s the file you need to process with either the Java program, the C program, or the awk script. Either way, collect the output as app.h and put it in the same directory as your Arduino code.

CPU Side

On the sketch side, you need to leave the template code alone since it turns on the FPGA clock, among other things. You’ll notice it also includes app.h and uses a file called jtag.c to communicate with the FPGA. I didn’t segregate the Arduino code into its own include because you probably have to change the setup function, and make changes in global space, but that could be arranged (perhaps make setup call cpu_setup and loop call cpu_loop or something).

If you want to remove the demo parts of the blink-sketch file, you can get rid of:

  • The definitions and calls related to FPGAVal, SPEED, and FPGALED
  • The Serial calls and definitions
  • Everything in the loop function

I left the unmodified code in the EmptySketch directory. Note in the demo code, though that SPEED is an output. This is set to D5, which is an input to the FPGA. By the same token, FPGALED corresponds to D6 and allows the CPU to read the state of the LED output.

You will need an LED and dropping resistor on pin 6 unless you want to watch with a scope or a meter. I always keep some LEDs with built-in 5V dropping resistors handy, and even at 3.3V it was plenty bright. With one of those, you can just stick the wires right into the header socket on the board. Don’t try that with a regular LED, though!

Once you run the sketch, you can open the serial monitor or any terminal at 9600 baud. There will be a message saying you can press any key to change the blink rate. Of course, since the serial monitor doesn’t allow you to press keys exactly, you’ll have to enter something and hit enter (set “No line ending” at the bottom of the monitor screen), but on a real terminal, any character press should do it.

The main code is pretty simple:

void loop() {
static int oldstate=-1;
static int linect=0;
int state;
if (Serial.read()!=-1)
  {
  FPGAVal=FPGAVal==HIGH?LOW:HIGH;
  digitalWrite(SPEED,FPGAVal);
  }
state=digitalRead(FPGALED);
if (state!=oldstate)
  {
  Serial.print(state);
  if (++linect==16)
    {
    Serial.println();
    linect=0;
    }
  oldstate=state;
  }
}

In the loop, if serial data appears, we just toggle the output going to the FPGA. We also sample the LED output on every pass. If it has changed from the last time, we write the new state to the terminal and then update the state so we don’t flood the screen with repeated characters. A lot of the code is just tracking when we’ve written enough to start a new line.

Vidor’s Hello World

I wanted to get everything you needed in one place and an example that would be easy to follow yet show the critical working parts. It would be easy enough to use the shared I/O pins to do SPI, for example, and then you could trade data with the FPGA quite easily. Don’t forget there’s Arduino IP (intellectual property; sort of library subroutines for FPGAs) in the IP directory, too, if you want to use it.

Now you just need a project idea that makes sense for an FPGA. Our personal favorite would be a logic analyzer. The CPU can talk to the PC, set up triggers and then let the FPGA do the dirty work of finding the trigger and storing data as fast as possible. If you want something less ambitious, it is very simple to create totally autonomous PWM outputs on an FPGA. We could see this being handy for robotics or machine control where you want a very rapid sequence of outputs without CPU intervention or overhead.

Of course, not every project has to make sense. If you are just wanting to learn about FPGAs there are plenty of projects you could do with a CPU but are easy enough to build in an FPGA (the classic traffic light comes to mind). Of course, with the Vidor you have an opportunity to use a blend of FPGA code and CPU code, which is kind of the point.

Dad-daughter MechWarrior suit ready for trick-or-treating

The idea of a mechanized walking suit to carry you around seems like a great idea, but having a practical leg assembly for it is still a futuristic concept. As seen here however, if you’re still a kid, you might be able to get your dad to carry you around in a custom suit fashioned after a MechWarrior vehicle.

The suit is beautifully designed by creator Gridlock Cosplay, and features an Arduino-powered control system. This allows the little pilot to command the mech’s human “engine” via a joystick and system of lights. The suit also features exterior and interior lights, a pilot cooling fan, spinning “radar” assembly, retractable pilot cage, and of course a cell phone holder in the padded engine compartment.

Linear movement with Arduino and 3D printing

Arduino boards are great for controlling small servo motors, but what if you need something to provide linear travel? As spotted on Reddit, while the answer here is a little less straightforward, YouTuber Potent Printables has a great solution. It uses 3D-printed components, along with a dab of epoxy and fastener hardware to convert either a micro or standard continuous rotation servo into a rack-and-pinion mechanism.

The project can be seen in the video below with an Arduino Uno and motor shield, though any Arduino capable of PWM output should have no problem with this setup. Since the servos used here are meant for continuous rotation, travel distance is based only on timing. Depending on the application, you may want add a simple microswitch or other sensing mechanism for feedback.

This is a general purpose linear servo actuator (pusher style). Two sizes have been designed, for different space constraints and force outputs.

These use continuous rotation servos which helps keep the cost very low. Off the shelf actuators of this type can cost around $70 USD.

The “mini” version will fit in smaller spacers, but has a much lower force output. The “large” version has a higher force output, but is…larger in size than the “mini.”

Dragon Ball Z head-mounted Scouter computer replica

Those familiar with the Dragon Ball Z franchise will recognize the head-mounted Scouter computer often seen adorning character faces. As part of his Goku costume, Marcin Poblocki made an impressive replica, featuring a see-through lens that shows the “strength” of the person he’s looking at, based on a distance measurement taken using a VL53L0X sensor. 

An Arduino Nano provides processing power for the headset, and light from a small OLED display is reflected on the lens for AR-style viewing.

It’s not exactly perfect copy but it’s actually working device. Inspired by Google virtual glasses I made virtual distance sensor.

I used Arduino Nano, OLED screen and laser distance sensor. Laser sensor takes readings (not calibrated yet) and displays number on OLED screen. Perspex mirror reflects the image (45 degrees) to the the lens (used from cheap Google Cardboard virtual glasses) and then it’s projected on clear Perspex screen.

So you will still see everything but in the clear Perspex you will also see distance to the object you looking at. On OLED screen I typed ‘Power’ instead distance because that’s what this device suppose to measure in DBZ.

Print files as well as code and the circuit diagram needed to hook this head-mounted device up are available on Thingiverse. For those that don’t have a DBZ costume in their immediate future, the concept could be expanded to a wide variety of other sci-fi and real world applications.

Constructing an hourglass lamp with Arduino

With the proliferation of all sorts of digital timers, the need for an hourglass to keep track of whatever activity you’re working on seems like a relic of the past. Still, the hourglass is an interesting form factor, so YouTuber Emiel Noorlander (aka The Practical Engineer) has decided to take it into the 21st century.

His device is about the size and shape of a rectangular picture frame, with the outline of an hourglass in wood attached to white polycarbonate. This diffuses programmable LEDs on the other side, controlled by Arduino Nano to simulate sand falling. The project is powered by a four AA battery pack, cleverly allowed to float in the internal structure, activating the on/off switch when positioned correctly.

In this week’s video I’m making an hourglass lamp with light effects that simulate the falling sand when you turn the lamp upside down.

Another cool feature I build into it is the on / off switch, this is hidden inside the lamp and turns on by putting the lamp on the right side. Turning it upside down then turns off the light.

The outside frame of the lamp is made of 40×6 mm metal strip that I cut to size and then welded as a frame. When this was done I went over to the bandsaw to cut the hourglass shape out of the wood. The semi-transparent panel where the light shines through is made from 3 mm opaque white polycarbonate sheet.

Salvaged Arduino powers animated House Party

What can you do with items that are destined for the dump? As seen here, if you’re Neil Mendoza, you transform furniture, an old TV, art, and even an Arduino Zero that somehow ended up in the trash into a musical installation.

His resulting “House Party” features decorations and control components that according to the project’s write-up are entirely salvaged. A MIDI interface, software written in openFrameworks, and a JSON file are used to coordinate sound and movements, which include spinning picture frames and flowers, tapping shoes, and a television that loops through a rather dreary weather report snippet. 

House Party is a musical installation that explores prized possessions in their native habitat. All the materials used to create this artwork, from the furniture to the computers, were scavenged from the discarded trash. The music is a mix of mechanical and synthesized sounds. The piece was created while an artist in residence at Recology SF.

The actuators in the installation are controlled by an Arduino Zero (also found in the trash) and each screen is connected to a computer running custom software written in openFrameworks (OF). Composition was done in Logic where a MIDI environment was set up to send MIDI data to the Arduino and an OF control program. The control program then sent the data to the other computers over ethernet as OSC. For the final installation, the control program read the data from a JSON file, triggered the screens and Arduino and played the synthesized parts of the music.

Be sure to see all the zany action in the video below!