The Teensy 3.2 is an amazing small Arduino, and it uses a powerful ARM processor running at 96 MHz. One of the benefits of this part is that it has a multitude of sensor inputs (on the order of 12) that can be used as switches or similar sensors.
This is a plot from a sketch with approximately 1 ms sample rate (I think it is more like 10 ms sample rate because I was simulating a button press). I plan to use this as a synthesizer input for generation of electronic music. Note the baseline is 1000 units, which is much higher than a normal open pin value of 17 or so. This is due to the length of wires, the layout and the brass pad of approximately .5 x .8 inches.
The C++ (Arduino) code used to create this is, and the plot was performed in the LibreOffice application Calc.
Amazon has a pair of very inexpensive on the ear headphones that I thought would be perfect for a variety of low fidelity uses where I did not want to bother with in the ear/earbud type transducers. Also, it provides a good balance of noise blocking, comfort and bass response. These headphones, sold under their ‘Basics’ label are very inexpensive and highly regarded (what ever that means) by the Amazon customers that evaluated them. They can be found at: https://www.amazon.com/AmazonBasics-Lightweight-On-Ear-Headphones-Black/dp/B00NBEWB4U And they have an average rating of 4.3 of 5.0.
Also, I wanted to build a simple, optimized amplifier to drive these headphones for a variety of uses from Arduino projects (Mozzi based music synthesizer to amateur radio applications), but their specifications were not readily available. In this post we will describe the headphones and then the amplifier used to drive them.
The over the ear headphones have a diaphragm size of 36 mm and an impedance of approximately 32 Ohms. By using a simple flat plate coupler and an inexpensive sound pressure meter (not well calibrated, but probably close) the sensitivity was measured as 72mv at 1 KHz to generate 94 dB SPL. This should be checked, but is directionally correct.
The schematic shows the use of two unity gain, low voltage followers as drivers. One is a virtual ground, the other is a unity gain follower.
Here is what the circuit looks like functioning as a follower after the Teensy 3.2 that I am using to run some Mozzi sound synthesis routines. The circuit, using TLV2462 Op Amps (really great low voltage op amps), can generate almost 1.2 VRMS which generates almost 116 dB SPL with these headphones, which is plenty loud off of a 5 volt supply! Note that I put the headphones in parallel, so it is 16 ohms and the output is current limited.
I’ve switched to using Adobe’s CC photo sharing facility for sharing photographs with others. Although you can not add text, you can show a nice ‘light table’ image of all photos at once, and you can then click on photos that you like.
Here are the instructions on how to do this from Lightroom’s help:
Step 1 of 6
Sign in to Lightroom
From the Lightroom desktop app, click “Get started with Lightroom on mobile” in the top left corner of the workspace.
Click “Sign In” and enter your Adobe credentials or create an Adobe user ID and password, if you don’t already have one.
Step 2 of 6
When you sync a collection in Lightroom desktop, you share your photo collection on Lightroom on the web and in Lightroom on mobile.
In the Lightroom desktop app, click the arrow next to Collections to see a list of your photo collections. As you hover your mouse to the left of a collection, the Sync icon appears (as shown). Click the Sync icon for the collections you wish to share. Step 3 of 6
View your collection on Lightroom on the web
Go to Lightroom on the web. On this page, select “Try Lightroom on the web” and sign in with your Adobe user ID and password.
Tip: To do this from Lightroom desktop, right-click (Windows) or control-click (Mac) the collection you wish to share, and in the context menu, select Lightroom mobile Links > View on web.
Project for portable Arduino work that also allows integration and experimentation with BMP180 Barometric Sensor breakout board. It also has a pushbutton input and a photo transistor, and a voltage divider to measure current. I plan to use this in the future to measure current draw for Arduinos and also the KX3.
Original documentation is from Oct 6, 2016 and is recorded in the Green notebook. This project incorporates some unusual libraries and should be a benchmark/standard for future projects. The libraries include:
The hardware uses a small 5cm x 7cm substrate board, on which the feather and s7s is mounted. The various components are also attached to the substrate
The BMP180 is attached to the feather breadboard area
The substrate board is attached to a Mintz tin by high strength loop and hook adhesive pads – on on Mintz tin, and the other on the substrate
The software looks like:
Adafruit Unified Sensor Library
SERCOM Library to allow use of multiplexed hardware IO as the Feather does not do software serial (also includes pin Peripheral function)
Standard Seven Segment library, but uses SERCOM, not software serial
Arduino Code: hwSer_180_s7s_f_nov12a, stored in the Ubuntu and Mac Book Air computers
The Feather sometimes requires the use of the reset button to load new software
The code looks like the following:
Setup the serial ports, the pressure sensor, and the seven segment display
Displays the code date of 1112
Loop: gets sensor data (if valid), and then prints it to the console monitor and then formats it for display on the seven segment, and displays the pressure and temperature alternating every second.
The temperature is in degrees f, and the pressure is in millibars
Recently, I have added a sensor shield (Sense Hat) to an Raspberry Pi3 that has an 8×8 array of neoPixel LEDs. As a simple challenge, I wanted a python script to display the real time quotes of a stock, using the scrolling API that came with the shield.
This time I used a distributed development environment, and I think I will never go back to doing development on the Pi unless forced to do so. I used Microsoft Visual Code to develop the python script, and then Filezilla to transfer the source to the pi. After loading python updates, I then use ssh to run the script and the display is output on the shield.
The mechanical configuration consists of the Sense Hat simply plugging into the RPi, and the sandwich attached to a space frame made from aluminum robotics extrusions. The RPi is attached to the space frame using the ultra strong hooks and loops bonding system by 3M. Note that the system looks ‘upside down’. This was intentional since it minimizes cables coming out of odd places, and improves the looks.
SSH 10.0.0.xx -l pi /yes / password. Fill in xx with the actual network address of the pi on your local LAN.
python py927.py. This command executes the most current version on the pi. This file also prints out the same data as being displayed on the serial console, if you choose to further debug the program.
Another learning project based on this Nordic Semiconductor product, NRF24L01 chip. Nordic, RF, 2.4 GHz part with really flexible and high bandwidth radio performance for digital sensor data.
Purchased a 6 pack from Amazon for very little Dollars – maybe only $4 per circuit board and trying to set up. From the problem solving post from 5 years ago, here are some steps:
Review prior projects – have we done this before?
Look at Safari and Amazon for answers – are there books on this topic?
Research physical books – look at the physical library
Search internet – Arduino, Wikis, Specialist sites, then general search
Search YouTube – find gurus and experts who have series, then individuals
Well, I hit gold with the 4th bullet, internet search where I landed on an Arduino wikispaces site that has a number of posts on the nRF24L01 chip, including a page on how to solve problems with the device.
Although I was keen to dual bypass the Nordic breakout board and connect it the the 3.3 VDC pin of the Arduino Pro Mini (3.3 V, 8 MHz), it turns out that this probably was the problem. I connected both devices to my lab supply of 3.3 VDC, and the test routines that I loaded worked immediately! First time!
Routine: YourDuinoStarter Example: Simple nRF24L01 radio
In working on some Arduino projects, the primary language of sketches is C++, though hidden under the Arduino IDE. In order to be more efficient, I’d like to understand more about how errors creep into designs, so that they can be avoided in the future.
Early days in programming, syntax errors at compile time are more frequent, and many times they are a barrier – usually taking much less to debug than runtime errors, but time consuming nevertheless.
Compile Errors – Header
include the wrong header file
delay() not in scope (need to add <Arduino.h>
include header file after reference to type
not include header file for each function
no need to include file if in same folder as .ino file
SoftwareSerial object not declared in this scope (resolved by passing class objects as parameters)
Compile Errors – Scope
variable scope defined inside case statement (should be outside)
typo – printLN, should be println
typo – used wrong variable name (buttonTime versus button1Time)
Should install ubuntu applications in Home, not in Downloads
Logical error – ‘getAge’ object should not be called until button pressed and flag set (keep logic simple)
Syntax error – did not update variable holding member data after updating it (avoid new variables)
Syntax error – referred to wrong member attribute (timePB versus _pinTime)
What a day installing and removing and installing the Arduino IDE on the new Z170/i5 computer that was built over the last three days. I learned quite a bit on the journey and the purpose of this blog is to briefly highlight the steps and pitfalls.
Downloaded Arduino IDE 1.7.10 for Linux64 (this was a mistake, because the Teensyduino application, which interfaces the IDE to Teensy 3.2 Arduinos is not compatible with 1.7, so I had to download 1.6.8). READ ERROR MESSAGES from Teensyduino!
Java was missing so I needed to install this – jre default
Modified permissions of ‘dial out’ and ‘TTYACMO’ (note this varies from install to install) READ ERROR MESSAGES!
Got AVRDude error messages because I did not select the right processor (selected Pro Mini 168 and should have been 368) READ ERROR MESSAGES!
Installed 1.6.8, installed Teensyduino 1.28, and then 49 rules – I put the Arduino app in the Home folder to prevent R/W error messages when they were in usr/local (though I now discovered the issue was probably not protection, but that I did not have 1.6.8 downloaded)
Thanks to Sliverhoof on Reddit & Snackeye’s blog post on installing Arduino and Teensyduino.
Background: I have lived with the Ubuntu 14.04 system that I had installed on the Gigabyte GA990F – and lived to really enjoy programming the Arduino on that system more than working with a Mac or Windows machine. While I have not tuned up the IDE toolchain like I have with a Mac system, using Textmate, I have gotten pretty proficient at using Linux. However, I noticed that the way the SSDs were partitioned over time, that the Ubuntu partition only has 3 GB left, and that is too close for comfort… so in the spirit of learning and continuous improvement, I built a new system. Also, adding fuel to the fire was that the Gigabyte Mobo was over 4 years old.
Components: This is a mid range to mid range plus system (not quite gaming, but fairly fast) that relies on new components and CPU. Here are the components (and cost, circa May 15, 2016):
Asus Z170 A, Using intel Z170 Controller, onboard HDMI, DDR4 ($160)
Samsung 850 EVO 250 GB SSD ($90)
Corsair DDR4 3000 MHz 2×8 GB Memory sticks ($80)
The total cost was $530 since I already had a power supply and built the system on a thin piece of wood. Below is a snapshot of the component cables:
Results: After installing Ubuntu 16.06 LTS (I evaluated Ubuntu Mate, but did not really like the UI) I’m exceedingly happy with the performance. I plan to do some benchmarks versus the GA990F system running Ubuntu 14.04.
April 02, 2016, cap_feather_apr02; modified for 12 Bit ADC, including threshold increasing
Zero Voltage threshold to prevent hanging waiting for full discharge.
Adafruit Feather M0 Basic Arduino Board
Uses MICROSecond timer, not MILLISecond timer for greater precision and to measure caps below
1 nF in value.
1) There is a noticable error (DC offset from ADC of around 14 of 4096 full scale
2) Settling to full discharge so a non-zero threshold is set, ~50 count
3) ADC conversion time is about .5 milliseconds, so this is subtracted from measurement
4) Added loop counter Mar 27, so see if ADC compensation is correct
5) Added input selection via digital inputs
Derived from program from Arduino site, from Paul Badger 2008 Uses of RC time constants to
measure the value of a capacitor.
TC = R * C – The capacitor’s voltage at one time constant is defined as 63.2% of the charging voltage.
6) Changed to nF printout, and also added A9 as input for 10M Charging R
Hardware setup (verbal schematic):
Test Capacitor between common point and ground
Test Resistor between chargePin and common point
220 ohm resistor between dischargePin and common point
Wire between common point and analogPin (A/D input)
Software: Cap_feather_apr02, Win 10 GA9 machine, in Arduino folder and in DB>project folder
Platform: Feather M0 Core from Adafruit.
Schematic: See above
Layout: See photo
MetaData: In lab notebook (3/15-4/02) and in DB>Projects, and in Project 3 Ring Binder.