Posts with «featured» label

Automating a chop saw with Arduino

YouTuber “Absorber Of Light” needed to cut thousands of tiny aluminum pieces with a chop saw, and after paying someone to do this for him, decided to instead automate the process. 

His system is controlled by an Arduino Uno, and moves strips of aluminum under the saw using stepper motor and threaded rod assembly—a sort of very simple CNC. Once in position, a second stepper activates a linear actuator via a physical H-bridge relay setup with cams and microswitches. This actuator pushes the saw into the aluminum strip, cutting it to an impressive ±.002 in, or ~.05 mm tolerance.

You can see it in action in the video below and find the project’s code in the description.

Cutting thousands of these small pieces of aluminum with the help of an Arduino and a couple of stepper motors. They will eventually become brackets to fasten computer monitors to metal enclosures.

The brackets measure .750″ x .547″ x .125″, tolerance is quite decent at + or – .002″ I tried to keep the code as simple as possible because I’m not much of a programmer and didn’t want to spend too much time on it. The loop is triggered by the Arduino reset button. The linear actuator is controlled by an H-bridge with 4 simple switches activated by one of the steppers.

Toy piano converted into a self-playing instrument

Upon obtaining a small toy piano, Måns Jonasson went to work “Arduinoizing” it with 30 solenoids to hammer out tunes. 

A MIDI shield is used to pipe commands from a computer to the Arduino Mega that’s used for control, and after experimenting with discreet wiring and electronics for each of the solenoids, he switched to motor shields as outlined here to simplify the setup. This, along with a new version of the solenoid holders he designed, cleaned up the build nicely, allowing it to play a plinky version of the Super Mario Bros. theme song.

Be sure to check out the Mario themed auto-concert in the video below, plus a video outline of its construction, below. 

Create Agent – Windows installer tampering while preserving Authenticode signature

Arduino Create Agent is a plug-in that was designed to help Arduino users connect their devices to the Arduino Create platform. The plug-in lets your browser communicate with your device’s serial port from a web application.  

We chose Bitrock’s InstallBuilder, a powerful and easy to use cross-platform installer creation tool, for generating the Arduino Create Agent installers (Windows, macOS, Linux). Those binaries are then served through our global CDN.

Yesterday, Bitrock has published an important security advisory in which they stated that Windows binaries generated with InstallBuilder versions earlier than 19.7.0 are vulnerable to tampering even if they contain a valid Authenticode signature. A specially crafted payload can be appended to an existing installer and trick the installer initialization code to execute code included in it, while the existing signature remains valid.

The issue, originally reported to them by Youfu Zhang of Chaitin Security Research Lab (@ChaitinTech), got addressed by releasing an updated version of InstallBuilder so all their customers could re-build and re-release their installers. CVE-2019-5530 has been assigned to this issue (CVSSv3 score of 6.7).

Once we’ve been notified, and given the potential impact of this security issue, we worked around the clock to re-build and re-release our Agent’s Windows installer. Version 1.1.89 has now been released through our official channels.

Please note that all versions of the Windows installer before version 1.1.89 are vulnerable to CVE-2019-5530.

Because this issue can be exploited with existing binaries already released, we also want to remind all of you to only download installers from official sources.

If you have any questions regarding this security issue, or if you need any help with upgrading your installer, please do not hesitate to contact Arduino Support through e-mail at support@arduino.cc.

Arduino Blog 13 Aug 11:53

Reviving an old CNC router with Arduino

Makerspace i3Detroit was the recent recipient of a free yet non-functioning CNC router. While out of commission when received, the device’s mechanical components and motors appeared to be in operational condition, plus it had a large work surface. The decision was made to get the CNC up and running for now, with the eventual goal of turning it into a plasma cutter.

First, they booted up its (Windows 95) computer and replaced a power supply on the controller. An adapter board for the controller was then built using info from this Arduino Forum post, allowing the router to be controlled with an Arduino Mega running grbl firmware

Although there is still some work to do, it can be seen happily jogging along in the video below, and appears well on its way to becoming a usable machine!

Chirp brings data-over-sound capabilities your Arduino projects

We are excited to announce a new partnership with Chirp, a London-based company on a mission to simplify connectivity using sound. Chirp’s machine-to-machine communications software enables any device with a loudspeaker or microphone to exchange data via inaudible sound waves. 

Starting today, our Chirp integration will allow Arduino-powered projects to send and receive data wirelessly over sound waves, using just microphones and loudspeakers. Thanks to some compatible libraries included in the official Arduino Library Manager and in the Arduino Create — as well as further comprehensive documentation, tutorials and technical support — it will be easy for anyone to add data-over-sound capabilities to their Arduino projects.

Our new Nano 33 BLE Sense board, with a DSP-optimised Arm Cortex-M4 processor, will be the first board in the Arduino range with the power to transmit and receive Chirp audio signals leveraging the board’s microphone as a receiver. From now on, the Chirp SDK for Arduino will support the following boards in send-only mode: Arduino MKR Zero, Arduino MKR Vidor 4000, Arduino MKR Fox 1200, Arduino MKR WAN 1300, Arduino MKR WiFi 1010, Arduino MKR GSM 1400, Arduino MKR NB 1500 and the Arduino Nano 33 IoT.

Creative applications of Arduino and Chirp include, but certainly are not limited to:

  • Triggering events from YouTube audio
  • Securely unlocking a smart lock with sound 
  • Sending Wi-Fi credentials to bring offline devices onto a Wi-Fi network
  • Having a remote control that only interacts with the gadgets in the same room as you

Connectivity is a fundamental asset for our users, as the demands of IoT uptake require devices to communicate information seamlessly and with minimal impact for the end user. Chirp’s data-over-sound solution equips our boards with robust data transmission, helping us to deliver enhanced user experiences whilst increasing the capabilities of our hardware at scale,” said Massimo Banzi, Arduino co-founder.  

“Sound is prevailing as a highly effective and versatile means of seamless data transmission, presenting developers with a simple to use, software-defined solution which can connect devices. Working with Arduino to extend the integration of data-over-sound across its impressive range of boards will not only increase the reach of Chirp’s technology, but provide many more developers with an accessible and easily integrated connectivity solution to help them drive their projects forward in all purposes and environments. We can’t wait to see what the Arduino community builds,” commented James Nesfield, Chirp CEO. 

To learn how to send data with sound with an Arduino Nano 33 BLE Sense and Chirp, check out this tutorial and visit Chirp website here


An Australian-style pedestrian traffic signal

If you have ever thought what is missing in your life is a pedestrian traffic light, be sure to check out Ronald Diaz’s recent build.

The project uses a pair of lights that Diaz had in storage for the past decade, to which he’s finally added an Arduino controller that takes care of the walk/stop sequence.

The device is initiated by a pushbutton, which then cycles between a red light that implores pedestrians to wait, to a green signal that tells people to go, to a flashing red light and back to solid red. A piezo speaker was also included, which plays sounds based around actual Australian tones depending on the light state. 

Code can be found over on GitHub, and you can see it demonstrated in the video below.

New Teensy 4.0 Blows Away Benchmarks, Implements Self-Recovery, Returns to Smaller Form

Paul Stoffregen did it again: the Teensy 4.0 has been released. The latest in the Teensy microcontroller development board line, the 4.0 returns to the smaller form-factor last seen with the 3.2, as opposed to the larger 3.5 and 3.6 boards.

Don’t let the smaller size fool you; the 4.0 is based on an ARM Cortex M7 running at 600 MHz (!), the fastest microcontroller you can get in 2019, and testing on real-world examples shows it executing code more than five times faster than the Teensy 3.6, and fifteen times faster than the Teensy 3.2. Of course, the new board is also packed with periperals, including two 480 Mbps USB ports, 3 digital audio interfaces, 3 CAN busses, and multiple SPI/I2C/serial interfaces backed with integrated FIFOs. Programming? Easy: there’s an add-on to the Arduino IDE called Teensyduino that “just works”. And it rings up at an MSRP of just $19.95; a welcomed price point, but not unexpected for a microcontroller breakout board.

The board launches today, but I had a chance to test drive a couple of them in one of the East Coast Hackaday labs over the past few days. So, let’s have a closer look.

First Impressions

The board looks superficially similar to the older 3.2, at least from the top. There’s the usual dual row of pin headers you can plug into a breadboard, a micro-USB connector, and reset button. A new red LED near the USB connector gives you some status information, while the traditional “Arduino LED” is orange. Flip the board over, and you start to see some of the extra power this board wields. Besides ten more GPIO pins, there are pads for an SD card interface using 4-bit SDIO, and D+ and D- lines for the second 480 Mbps USB interface. The unmarked round pads are test points used in manufacturing and are no-connects from the end-user’s perspective.

Teensy 3.2 Everything Killer?

When doing hardware reviews it’s crucial to choose the right comparison hardware. I think the best comparison in this case is between the two boards that share the same form factor; the Teensy 4.0 and the 3.2. I’ve chosen not to make the comparison with the Teensy 3.5 and 3.6, which are priced a little higher, in a larger form factor, and have SD card slots soldered on.

Incredibly, the Teensy 4.0 is priced at $19.95, as opposed to the $19.80 Teensy 3.2. What does that extra fifteen cents buy? First, there’s performance. The 4.0’s 600 MHz clock vs the 72 MHz on the 3.2 doesn’t tell the whole story. The Cortex M7 on the 4.0 is a dual-issue superscalar processor capable of executing up to two 32-bit instructions per clock cycle; initial tests showed this happening between 40-50% of the time on Arduino-compiled code. Additionally, the Cortex-M7 is the first ARM microcontroller with branch prediction. While on the Cortex M4, a branch always takes 3 clock cycles, after a few passes through a loop, for instance, the Cortex M7 can begin executing correctly-predicted branches in a single clock. This is technology originally pioneered in supercomputers that you can use in your next Halloween costume.

Then, there’s floating-point. Veteran embedded programmers may have a bias against floating-point code, and with good reason. Without native floating-point instructions, these operations must be emulated, and run very slowly. The same thing happens with double-precision operations on a processor which only supports single-precision instructions. While Cortex-M4 processors support single-precision floating-point, the Cortex-M7’s include native double-precision instructions, so if you need the extra precision afforded by doubles, you’re not going to take a huge performance hit: basically, doubles seem to execute in only twice as many cycles as floats.

The Cortex-M7 on this board also supports tightly-coupled memory (TCM), which provides fast access like a cache, but without the non-determinism that can complicate hard real-time applications — one of the problems with other high-power microcontrollers. The 64-bit ITCM bus can fetch 64-bits, while two dedicated 32-bit buses (DTCM) can fetch up to two instructions from the TCM each cycle – these buses are separate from the main AXI bus used to communicate with other memory and peripherals. The Teensyduino environment automatically allocates code and statically allocated memory into the DTCM area, which can be up to 512K in size, although you can override the default behavior with some command-line switches. Memory that isn’t accessed by the tightly-coupled buses is optimized for access by the peripherals using DMA.

Spec Sheet

Despite its size, there’s a lot to this board and the chip it carries, so here’s condensed spec list:

  • ARM Cortex-M7 at 600 MHz
  • 1024K RAM (512K is tightly coupled)
  • 2048K Flash (64K reserved for recovery & EEPROM emulation)
  • 2 USB ports, both 480 MBit/sec
  • 3 CAN Bus (1 with CAN FD)
  • 2 I2S Digital Audio
  • 1 S/PDIF Digital Audio
  • 1 SDIO (4 bit) native SD
  • 3 SPI, all with 16 word FIFO
  • 3 I2C, all with 4 byte FIFO
  • 7 Serial, all with 4 byte FIFO
  • 32 general purpose DMA channels
  • 31 PWM pins
  • 40 digital pins, all interrupt capable
  • 14 analog pins, 2 ADCs on chip
  • Cryptographic Acceleration
  • Random Number Generator
  • RTC for date/time
  • Programmable FlexIO
  • Pixel Processing Pipeline
  • Peripheral cross triggering
  • Power On/Off management

The board consumes around 100 mA with a 600 MHz clock. Although I didn’t try it myself with the evaluation boards I have here, Paul notes that it can be overclocked for a performance boost. It also supports dynamic clock scaling: the instruction clock speed is decoupled from the peripherals, so that baud rates, audio sample rates, and timing functions continue to function properly if you change the CPU speed.

For the ultimate in power savings, you can shut the board off by adding a pushbutton to the On/Off pin. Pressing the button for more than five seconds disables the 3.3 V supply; a subsequent brief press will turn it back on. This doesn’t affect the real-time-clock (RTC) functionality, however: connecting a coin cell to the VBAT terminal will keep the time and date counter going.

Hands-On Benchmarks

Higher is better
Board CoreMark
Teensy 4.0 2313.57
Teensy 3.6 440.72
Sparkfun ESP32 Thing 351.33
Teensy 3.5 265.50
Teensy 3.2 218.26
Metro M4 Grand Central 214.85
Arduino Due 94.95
Arduino Zero 56.86
Arduino Mega 7.03

To see how fast this thing really is, Paul ported the CoreMark embedded-processor benchmark to the Arduino environment. (Note that CoreMark seems to be a registered trademark of the Embedded Microprocessor Benchmark Consortium (EEMBC)). This synthetic benchmark tests performance managing linked lists, doing matrix multiplies, and executing state machine code. He reports the following scores for a number of boards (larger numbers are better).

I was able to verify the Teensy 4.0 and 3.2 numbers; my 3.6 must have sprouted legs and walked off somewhere, and I didn’t have any of the other boards handy for testing. Using my numbers (nearly identical to those above), the 4.0 is around ten times as fast as the 3.2.

Since the CoreMark code is a “synthetic” benchmark, Paul wanted to test the new board in a more realistic scenario. In another GitHub repo, he has some code to do an RSA signature with a 2048-bit key. This is a processor-intensive operation, believe me — I had to implement it once in Lua (don’t ask!). Here are the scores for the same boards (lower numbers are better).

Lower is better
Board Seconds
Teensy 4.0 0.085
Teensy 3.6 0.474
Sparkfun ESP32 Thing 0.518
Metro M4 Grand Central 0.840
Teensy 3.5 0.909
Teensy 3.2 1.325
Arduino Due 1.901
Arduino Zero 9.638

Again, I was able to verify the numbers for the Teensy 3.2 and 4.0 boards. In this case, the 4.0 is around fifteen times as fast as the 3.2.

If you have any of these, or other Arduino-compatible boards lying around, clone one or both of these repos, open the respective *.ino file from either one, and test them out. Feel free to report results in the comments below.

15 Seconds to Sanity

One of the new features of the Teensy 4.0 is the automatic recovery process, which restores the board to a known good state without the need for a PC connection. If you press and hold the reset button for 15 seconds, the red LED will flash to indicate you’ve entered restore mode. Once you release the button, the red LED will illuminate while the flash memory is erased and re-written with the traditional Arduino “blink” program. Once the re-write is complete, the blink program is run and the orange LED begins blinking, just like on every Arduino-compatible for the past decade and a half. It’s DFU mode without the need for host computer or known-working binary. These used to be key components for hardware-based restore and now they’re part of the board itself.

Why would you want to do this? In a nutshell, because USB itself is a train-wreck. On top of an insanely sprawling and complex protocol, there are charge-only cables sans data pins lurking in your junk box, operating system bugs waiting to trip you up (looking at you, Windows 7), and a whole host of other issues that cause serious head-scratching when things stop working. This can be especially confusing with native-USB boards like the Teensy 4.0; while the built-in USB functionality is amazingly powerful, and can be used in a wide variety of ways, when something stops working, you’re not always sure how to get back on track. Now, you are – just press the button.

What Can You Do with a 600 MHz Microcontroller?

Paul envisions this Teensy 4.0 being used for polyphonic audio synthesis, running moderately complex machine learning algorithms, and real-time audio analysis. In many cases, the first level of processing on data-intensive input devices can now be moved from a host computer to the external microcontroller, narrowing the bandwidth required to the host system. And for projects driving a display, the built-in pixel processing pipeline can also accelerate graphics operations, offloading this work from the CPU.

There will be some fraction of hackers that will still wonder why we need a 600 MHz microcontroller; another fraction will have already needed it yesterday. In between, most users will take some time to figure out what doors this opens up. The reality is that our tools constrain not only our current designs, but also, to some extent, our imagination. A 15x performance improvement over the current tiny development board you may be using could enable some new and exciting applications, and you, dear reader, are the one who makes them happen. So, drive home a different way from work tonight, sleep on the sofa instead of the bed, or use whatever other tricks you have to shock your brain into creativity and figure out what you could really do with this thing. It’s a lot more than you can do with a 555. For that matter, it’s a lot more than most computers could do in the 90s.

Developing a photovoltaic solar tracker controller with a MKR Zero

While energy consumption is an important concern in our modern world, you might have noticed that energy in the form of light shines down on us every day from the sun. Solar panels can be utilized to harvest this and turn it into useful electricity, and if your panels can track the sun throughout the day, you can see an efficiency bump of 15-40%.

In order to experiment with this concept, Frank Migge has, after several iterations, come up with a beautiful display called “SunTracker2 Revision 2.

The device uses stored sun data fed to an Arduino MKR Zero via its SD card reader, and controls 32 LEDs that show the sun’s position, sunset/sunrise, and magnetic north. Automatic alignment is handled by an onboard magnetometer, and a stepper is even implemented to simulate future panel movement.

You can check out the demo below, and find more info over on GitHub.

Track made baskets with this Arduino/smartphone setup

Marcelo Ávila de Oliveira likes to practice basketball, and while most of us would be content to shoot and hopefully improve, he actually tracks his workouts. While figuring out the number of made baskets, misses, times, etc. is useful, it’s also quite boring and difficult, so he came up with a real-time scoreboard system to take care of this for him. 

The device is mounted to an enclosure under the hoop, and uses an IR proximity sensor poking through Jerry West’s head to know when a ball has gone through. It also employs a vibration sensor to detect if the ball has hit the rim, and if the IR sensor isn’t triggered within three seconds, a miss is counted. 

The setup’s Arduino Mega communicates with a custom smartphone app over Bluetooth, and displays statistics on the practice session. It even plays notification sounds for scores and misses, as shown in the video below.

Arduino and industrial distance sensor communicate via RS-485

After obtaining an industrial distance sensor, TUENHIDIY decided to use it as the basis for an interesting visual indicator.

The device communicates with an Arduino Uno via an RS-485 module, and outputs distance values in the form of a 9 x 14 pixel display made out of discreet LEDs soldered onto an LoL Shield.

As shown in the video be low, it does a good job of sensing how far an object is from it on a table, and the 126 LEDs provide a nice brilliant display. 

Code for the build can be found on GitHub if you’d like to make something similar. Seeing as though the sensor used here will set you back close to $1,000, you may want to also consider alternatives like an HC-SR04 ultrasonic module instead!