The Aurora Boxealis – A Color Sensing and Mirroring Project

Introduction

Besides looking damned good on an otherwise bland and ordinary desk, this project is about more than just being attention grabbing eye candy.  It’s about demonstrating a small portion of our single board computer capabilities by hooking up a color sensor, RGB light strip, and enclosing it in a nice looking wooden enclosure.  We’re dubbing it the “aurora boxealis”, and it’s made to stand out from the crowd at trade shows and provide a fun, interactive way to professionally demonstrate an interesting sensor, in this case a color sensor.  Grabbing a color swatch from the table and placing it on the top of the box will trigger the lights to mirror that color.

Furthermore, with inspiration from the Celebrationator from “Cloudy with a Chance of Meatballs”, it has a party mode of dancing disco lights which is triggered by pressing the party button on top.

When it’s not partying or matching colors, it displays a calming, color changing effect somewhat reminiscent of the aurora borealis.  Take a gander at a full demonstration over on our YouTube channel and then come back for the following details on the build below.

Hardware

The stars of the show are the TS-7970 single board computer, TCS34725 color sensor, FadeCandy RGB LED driver, and RGB LED light strip (WS2811 based).  The TS-7970 provides the I/O, power, and processing for the color sensor, FadeCandy, and light strip.  The color sensor has everything built-in, including a bright white LED and IR filter.  It has an interrupt pin and settings for interrupt thresholds based on the clear light value it reads.  The FadeCandy driver is a clever little piece of hardware that utilizes software and firmware to maximize the performance of the RGB LEDs, like for example, color correction and dithering for fantastic color depth. Take a look at their respective product pages for more information.  Finally, a button was hooked up to an interrupt pin on the TS-7970 for starting a party.

Everything has been enclosed inside a custom-made wooden enclosure with the light strip and diffuser wrapped all around.  The color sensor and button are mounted on the lid for easy access.  A power barrel connector is cleanly installed on the back of the unit.  Here’s the wiring diagram for how it’s all hooked up.

HD1 – 24 PIN

  • Attaches to LED strip
  • Pin 3 – Ground – Black
  • Pin 15 – 5V Power – Red

HD2 – 24 PIN

  • Attaches to RGB sensor and button
  • Pin 2 – GPIO#64 (LED Enable) – Blue
  • Pin 4 – GPIO#65 (Sensor Interrupt) – White
  • Pin 6 – GPIO#66 (Button Interrupt) – Green

HD3 – 16 PIN

  • Attaches to RGB sensor and button
  • Pin 3 – 3.3V Power – Red
  • Pin 15 – SCL (I2C Clock) – Green
  • Pin 16 – SDA (I2C Data) – Yellow

The box itself is made from oak hobby board purchased at a local hardware store.  The mitered corners are glued together using some high-strength wood glue.  The cap was spliced together using biscuits and edged with thin pieces of oak.  Holes were drilled for the button, power adapter, and color sensor.  For the rectangular color sensor PCB, a chisel was used to chip out a rectangular spot for the sensor to fit in.  A ¼” thick and ¼” deep gap was routed into the middle of the box for the LEDs.  A ½” thick, very shallow gap was routed into the middle as well for the diffuser material to sit on.  A panel board was used for the bottom and the TS-7970 was mounted to it using custom wooden standoffs.  Everything was rounded off and finished up on the bench router before sanding and staining the final product.  The result was a very nice, travel-ready, oak box with detachable lid.

Software

First off, let’s acknowledge how awesome the open source community is.  Most of the legwork was already completed and packaged up for use with Python, including GPIO sysfs interface with interrupt support, TCS34725 support, and plenty of FadeCandy examples which work with Open Pixel Control (OPC).  The only thing that was left to do was figure out how to use the Twisted reactor used with the GPIO sysfs interface code for handling interrupts.  Admittedly, this did add a layer of complexity to the code which took a little while to comprehend, but once the learning curve is overcome, it’s not a bad way to go.

Now, let’s talk about the source code, located at https://github.com/embeddedarm/aurora.  The main file is aurora.py, which utilizes a bunch of different libraries including:

  • Adafruit TCS34725 – Uses smbus for I2C communication and provides a bunch of handy functions for interfacing with the color sensor.
  • Python Sysfs GPIO – Provides a bunch of handy functions for interfacing with the GPIO pins that are brought out using the Linux GPIO sysfs interface.  Includes interrupt support by using Twisted.
  • Open Pixel Control (OPC) – Sends pixel values to an Open Pixel Control server, in our case FadeCandy, to be displayed.
  • FadeCandy Server – A separate process running in the background which receives instructions from OPC and lights up the RGB LED strip.
  • Pillow – Used to process images used for party (party.jpg) and chill (chill.jpg) modes.

Don’t worry, this won’t be a deep dive.  Instead, we’ll discuss a few highlights of the code.  As mentioned, we’re using the Twisted reactor to handle GPIO interrupt events, threading, and provide our main while loop via LoopingCall(main).  The program starts with the call to reactor.run().  We use a bunch of global variables to keep track of the different states we’re in, including party, chill, or matching.  We do this as a simple way to break out of the thread, mainly because there’s no other easy way to stop a threaded processes in Python.

For example, let’s say we’re chilling in our display_image(‘chill.jpg’) thread, which will last until the for loop has finished processing the image top to bottom only to be called again in a forever loop by our main looping call.  Then, somebody comes along and presses the party button.  This fires a system event for the GPIO interrupt and sets the global variables to break out of the chill loop so we can start the party loop.  Same sort of thing for the matching mode when somebody places a color swatch above the color sensor.

Before calling the main loop, we initialize the GPIO pins, color sensor, OPC client, and event triggers.

First, we setup our GPIO pins:

Controller.available_pins = [LED_EN, RGB_INT, PTY_BTN]
led_en = Controller.alloc_pin(LED_EN, OUTPUT)
sensor_int = Controller.alloc_pin(RGB_INT, INPUT, sensor_interrupt_fired, BOTH)
button_int = Controller.alloc_pin(PTY_BTN, INPUT, button_pressed, FALLING)

The LED_EN (LED Enable) output pin controls the LED mounted on the color sensor, which is normally on.  We only want it to turn on when we’re ready to color match.  The two interrupt pins, sensor interrupt and button interrupt, are set up as interrupts with callback functions.

Next, the color sensor gets initialized and the interrupt pin and tolerances are set:

tcs = Adafruit_TCS34725.TCS34725()
tcs.set_persistence(TCS34725_PERS_10_CYCLE)
tcs.set_interrupt_limits(0x0002, 0xFFFF)
tcs.set_interrupt(True)

What we’re saying here is, set the interrupt pin if the clear color is outside the limits of 0x0002 (very dark) to 0xFFFF (max light) in a period of 10 readings.

Then, we setup our OPC client.

client = opc.Client('localhost:7890')
client.put_pixels(black)
client.put_pixels(black)

We set the client to connect to localhost, port 7890, served by the Fadecandy server, fcserver.  This is what drives the addressable RGB LEDs of the NeoPixel strip.  To start, we want to make sure all pixels are black.

For debugging, it’s handy to have a signal handler to help cleanly kill off the program when Ctrl+C is hit on the keyboard.

signal.signal(signal.SIGINT, signal_handler)

Next, we setup our system event triggers for the Twisted reactor.

reactor.addSystemEventTrigger('before', 'sensor-interrupt', sensor_interrupt_event_handler)
reactor.addSystemEventTrigger('before', 'button-interrupt', button_interrupt_event_handler)

We can then call, for example, reactor.fireSystemEvent(‘button-interrupt’), and the callback function button_interrupt_event_handler() will be called.

Finally, we set up and start our main looping call and fire up the reactor to kick everything off.

lc = LoopingCall(main)
lc.start(.1)
reactor.run()

Closing Remarks

Overall, this was an incredibly fun and rewarding project, combining two passions of woodworking and computer engineering into one end result.  That end result being an attractive, out of the ordinary product that will grab attention while showing off a really neat sensor and some of the capabilities of our TS-7970.

There’s certainly room for expansion in the future as well, like adding a microphone and speaker and interfacing with Google Voice Actions or Amazon Alexa Voice Service to make a voice-controller home appliance and music box.  Control the color of the lights by speaking to it or set up the lights to dance to the music it plays.  Add other sensors to the box, like a gesture sensor, to come up with other clever things, like controlling lights or thermostats in your IoT connected smart home.

I do hope you enjoyed this project and will share it.  I’m anxious to hear your thoughts, so be sure to leave a comment below.  Until next time, party on!

Sources

Materials

Here’s a detailed list of everything needed to build this project.  Not including the cost of the SBC or shipping, this project costed approximately $157.42, and that’s if you’re starting from scratch.  Most will have the necessities like bread boards, wiring, and solder.  Some will have spare stain, poly, glues, and wood for the box build.

Arduino PICO, The Tiny Arduino-Compatible Board

MellBell, the Canadian-based hardware and electronics company, has launched their first product: Arduino PICO!

At first, the company says that Arduino PICO is the smallest Arduino compatible board ever, since it is 0.6″ x 0.6″ inch sized (~15mm squared). This tiny fully-fledged arduino-compatible board has a Leonardo-compatible 16MHz ATMEGA32U4 chip and a micro-USB port. The main cause of building PICO was to have a really small brain to use in many application with worrying about size or allocated space.

PICO’s Technical Specifications

The 16MHz ATMEGA32U4 integrates 2.5KB SRAM and 32KB flash, 4KB of which the bootloader uses. The 1.1-gram PICO has 8x digital I/O pins, 3x analog inputs, a PWM channel, and a reset button. In addition, the board has a 7-12V power with 5V operating voltage, where each I/O pin uses 40mA. It is worth to mention that PICO is competing with 12 x 12mm, $18 µduino, which similarly offers an Arduino Leonardo compatible ATMEGA32U4 MCU and which is smaller in size.

Moreover, MellBell provides an aluminum version that comes with the same ATMEGA32u4 core processor. With an Aluminum not regular fiber-glass, this makes PICO more reliable for overheated applications and environments.

Arduino PICO is now live on a Kickstarter campaign that two days ago had achieved its goal! Fortunately, there is still a chance until 17 Aug 2017 to pre-order one of PICO’s packages. You can get your early bird PICO for CA$18 ($14) and Aluminum edition for CA$32($25). Also, there is a special edition that includes  Aluminium PICO, four colored PICOs,  PICO joystick shield, micro drone kit, PICO solar station,  dual PICO board,  micro li-ion battery, PICO starter kit,  MiniMega board and finally a special “THANK YOU” video for CA$ 960 ($765).

Romeo BLE – An Arduino Based Powerful Robot Control Board With Bluetooth 4.0

Romeo BLE is an all-in-one Arduino based control board specially designed for robotics applications from DFRobot. This platform is open source and it’s powered by thousands of publicly available open-sourced codes. Romeo BLE can easily be expanded using Arduino shields. The most important feature—Bluetooth 4.0 wireless communication, allows the board to receive commands via Bluetooth. So, users can now use their smartphone, tablet, or computer to interact with the control board.

Control Robot From Smartphones by Bluetooth 4.0
Control Robot From Smartphones by Bluetooth 4.0

Even the codes can be uploaded over Bluetooth a USB Bluno Link adapter, without requiring any wired USB connection between the board and a PC. This is a great advantage for mobile applications where codes are debugged and uploaded frequently.

The Romeo BLE also includes two integrated two-channel DC motor drivers and wireless sockets, which makes project development more hassle-free. One can start the project immediately without needing an additional motor driver circuitry. The motor driving section also supports extra servos which need more current.

There are two ways to power the Romeo BLE board. But, the polarity must be correct. Otherwise, the board may get permanently damaged as there exists no reverse polarity protection. The two powering methods are:

  • Power from USB: Plug in the USB cable to the Romeo controller from a power source (i.e. wall jack or computer). If the input voltage and current are sufficient, the Romeo BLE board should turn on and a LED should light up. While powered from USB, do NOT connect anything else like motor, servo etc. except LED. Because the USB can only provide 500mA current which is certainly not enough for driving loads like motors.
  • Power from External Power Supply: Connect the ground wire from your supply to the screw terminal labeled “GND” on Romeo board, and then connect the positive wire from your supply to the screw terminal labeled “VIN”. The maximum acceptable input voltage is 23 volts. Do not exceed this value anyway.
Romeo BLE Board Pin Diagram
Romeo BLE Board Pin Diagram

Specifications:

  • Microcontroller: ATmega328P
  • Bootloader: Arduino UNO
  • Onboard BLE chip: TI CC2540
  • 14 Digital I/O ports
  • 6 PWM Outputs (Pin11, Pin10, Pin9, Pin6, Pin5, Pin3)
  • 8 10-bit analog input ports
  • 3 I2Cs
  • 5 Buttons
  • Power Supply Port: USB or DC2.1
  • External Power Supply Range: 5-23V
  • DC output: 5V/3.3V
  • Size: 94mm x 80mm

Features:

  • Auto sensing/switching external power input
  • Transmission range: 70m in free space
  • Support Bluetooth remote update the Arduino program
  • Support Bluetooth HID
  • Support iBeacons
  • Support AT command to config the BLE
  • Support Transparent communication through Serial
  • Support the master-slave machine switch
  • Support USB update BLE chip program
  • Support Male and Female Pin Header
  • Two-way H-bridge motor Driver with 2A maximum current
  • Integrated sockets for APC220 RF Module

You can program Romeo BLE using Arduino IDE version 1.8.1 or above. Select Arduino UNO from Tools –> Boards in the IDE. Go to arduino.en.cc to download the latest version of Arduino IDE. Read the Romeo BLE wiki to learn more.

Harvesting Sound Energy From Passing Cars

by Mechanical Attraction @ instructables.com:

There is energy everywhere around us and in many different forms. Many devices have been developed to harvest light, wind, waves, and more. One unusual place of energy harvesting is from passing cars. As cars pass by some of their energy is released in form of sound. Even though the overall energy maybe small it can be harvested. In this Instructable I will show how to apply the solution of Euler–Bernoulli beam theory to design a cantilever beam to oscillate at such a frequency to adsorb sound waves as well as converting its mechanical motion into electricity.

Harvesting Sound Energy From Passing Cars – [Link]

Should you build or buy your next single-board computer?

by Markku Riihonen @ EDN Europe:

Does it make sense to design and build your own single-board computers? It used to be the sensible option for anyone concerned about matching features to production cost.
Traditionally, with your own board design, you have the freedom to add only the components that are absolutely vital to achieving the right level of functionality for the target application. But the relentless rise of the system-on-chip (SoC) device has changed that equation in a number of ways.

Should you build or buy your next single-board computer?- [Link]

Edgefx Kits, Get Your DIY Project Kit Now!

Aiming to bridge the gap between the academics and industry in electronics, communication and electrical sectors, Edgefx Technologies was born at 2012 as an online store for project solutions.

Edgefx provides practical skill building solutions to the engineering students in the form of Do It Yourself (DIY) project kits. These kits support wide areas of electronics and communication, and also the latest trends like IoT, Android, Arduino, Raspberry Pi and many more.

Edgefx kits are easy to use and self-explanatory. They come with hardware and training material in the form of extensive audio-visuals and can be purchased online.

The company has grown to have a very strong focus on customer service, quality and morale of the staff and most of all, a passion for what we do. And although we’re a team of almost 30 right now, nothing about us is corporate. We don’t have multiple tiers of hierarchy. The vast majority of our employees work on the front lines, taking care of our customers or shipping items out of the Edgefx Fulfillment Centers.

The website contains more than 200 projects in about 15 different categories. Kits prices range from Rs. 1500 to Rs. 50000 (~ $23 to $750). In addition to the project kits, Edgefx also conducts practical workshops in colleges and schools.

School students, starting from 8 years old, can opt for school electronic projects that empowering them to innovate. It includes three basic level STEM kits and one intermediate level kit. All of these kits are edutainment and fun, with real time applications using latest technologies, and also can create multiple experiments.

Each basic kit has a three project inside, these projects are:

  • Security protection for museum items
  • Touch controlled fan
  • Touch me not LED warning
  • Bike theft alarm
  • Upside down  indicator for fragile item
  • Toll gate auto light LED
  • Security area protecting alarm
  • Auto door opening motor
  • Human detection under debries

The intermediate kit is an Arduino project kit. This project is designed for digital sensors solder-less Arduino projects on breadboard. It will light flasher of different color light on single LED each time on sensing finger swipe with the help of IR obstacle sensor. Also, the project makes different unique sounds on sensing each time.

Beginners Arduino Project Kit

So, if you are searching for some project kits you have to visit the Edgefx store, explore the kits to find the project you want to make and then order it. In the end, don’t forget to share with us your experience once you buy and use the kit!

New parts library for Mentor PADS & DX Designer accelerates PCB design

Designers can build circuit boards faster with millions of symbols & footprints on SnapEDA.

July 18, 2017 –  SAN FRANCISCO –  Mentor, a Siemens business, and SnapEDA, the Internet’s first parts library for circuit board design, are announcing new support for Mentor PADS® and DX Designer on SnapEDA.

Whether building satellites or medical devices, hardware designers spend days creating digital models for each component on their circuit boards, a painful and time-consuming process that hinders product development.

With today’s launch, Mentor PADS & DX Designer customers will gain access to SnapEDA’s extensive component library containing millions of symbols, footprints, and 3D models, further enhancing the vast resources available for Mentor PCB design software.

All parts are auto-verified with SnapEDA’s proprietary verification technology, helping to reduce risk and unneeded, costly prototype iterations. This technology answers common questions designers have about libraries, such as “what standards does this footprint conform to?”

As the world becomes more connected, electronic devices are proliferating and diversifying, and time-to-market is more crucial than ever for companies to stay competitive.

Slimline SMD Bamboo IN-14 Nixie Clock

@ instructables.com writes:

There are a lot of nixie clocks out there and a lot of them are based on the IN-14 tubes. I wanted to design my own for the sake of designing my own, but also had some specific requirements: Make it as small and thin as possible. A lot of the clocks out there have very bulky bases. CNC a nice case out of bamboo. Because I like bamboo and wanted to get some use out of my little desktop CNC machine. No RGB leds under the tubes. I hate those. Single spin of the PCB, no prototypes. I wanted this to be a relatively quick project. This meant using a microcontroller and RTC I have used before, heavily borrowing from proven designs and using a pre-made power supply to limit the risk of having to iterate the board.

Slimline SMD Bamboo IN-14 Nixie Clock – [Link]

LTC7003 – Fast 60V Protected High Side NMOS Static Switch Driver

The LTC7003 is a fast high side N-channel MOSFET gate driver that operates from input voltages up to 60V. It contains an internal charge pump that fully enhances an external N-channel MOSFET switch, allowing it to remain on indefinitely. Its powerful driver can easily drive large gate capacitances with very short transition times, making it well suited for both high frequency switching applications or static switch applications that require a fast turn-on and/or turn-off time. When an internal comparator senses that the switch current has exceeded a preset level, a fault flag is asserted and the switch is turned off after a period of time set by an external timing capacitor. After a cooldown period, the LTC7003 automatically retries.

LTC7003 – Fast 60V Protected High Side NMOS Static Switch Driver – [Link]

Integrated 36V buck battery charger provides seamless backup power

By Graham Prophet @ eedesignnewseurope.com:

LTC4091 is a complete lithium-ion battery backup management system for 3.45V to 4.45V supply rails that must be kept active during a long duration main power failure. The LTC4091 employs a 36V monolithic buck converter with adaptive output control to provide power to a system load and enable high efficiency battery charging from the buck output.

Integrated 36V buck battery charger provides seamless backup power – [Link]

TOP PCB Companies