Archive for the 'DIY' Category

#Inktober 2019 Project – Post 2

Reverse Engineering the Atari 1020

The field service manual is quite helpful, but the pin numbers of the connectors are not labeled and there are no part number.

Between the manual and some measurements with my meter, I think I have it figured out.

Power Supply.

I do not have the original external (wall wart) power supply. You can tell it is AC from the schematic. I did some research and found out it is 9VAC. That goes through (2) 5V volt linear regulators (with a huge heatsink). One powers the stepper motors and all the logic. The other powers the pen up/down solenoid.

Basically, I should be able to power everything with a robust 5VDC power supply. I’ll probably use this style.

Switch Panel

This connects via a 6 pin molex SPOX 10013066 connector. The PCB side is Molex p/n 10321061. The power switch is a latching switch that connects the incoming 9VAC voltage.

The function switches are normally open, momentary switches that close to ground.

Here is the pinout of that cable.

Pin #DescriptionWire color
1GrnBlack
2Pen Change SwBlue
3Paper Feed SwPink
4pen Change SwYellow
5Power (in)Red
6Power (out)Red

Pen Solenoid

Then pen moves to and away from the paper using a solenoid. The schematic is amazingly complex here, but basically the voltage flows one way through it for pen up and the for pen down. It is a 5V coil with a resistance of 5.2 Ohm.

Stepper motors

There are (2) stepper motors. One is for the paper feed and the other moves the pen carriage. These motors are 5 wire unipolar motors. These are typically used by connecting the common to voltage+ and the other wires to transistors. If sequenced on one at a time, you get 4 independent coils.


The coil resistance of the paper feed stepper coils is 50 Ohm and the carriage is 60 Ohm.

Pen Change, Homing switch

There is a reed switch activated by a magnet in the pen carriage.

Printer Mechanism Cable

There is a 13 pin cable that connects everything in the plotter mechanism to the controller PCB. This uses a Molex connector p/n 511911300. The mate on the PCB is Molex p/n 22041131. The pinout is here.

Pin #DescriptionColor
1Reed SwBlack
2Reed SwOrange
3Carriage Stepper #1White/Red
4Carriage Stepper #2Pink
5Carriage Stepper #3Blue
6Carriage Stepper #4Red
7+5VWhite
8Feed Stepper #1Purple
9Feed Stepper #2White/Blue
10Feed Stepper #3Yellow
11Feed Stepper #4Brown
12Pen SolenoidGray
13Pen SolenoidLight Blue

Polar Coaster Version 2

I recently decided to update the Polar Coaster project. The primary reason was to update the controller to use Grbl_ESP32 firmware. I also thought I could make it smaller, lighter and remove a little cost.

Controller

The old controller was not custom made and just sort of tacked onto the back. This increased the size and didn’t look very good. It had a Bluetooth module, but you still had to stream the gcode. You could use an Android app, but that was still a little awkward.

Firmware

The controller runs Grbl_ESP32. This was recently updated to include pen machine features. This allows precise control and calibration of the pen servo. You can control the speed, timing and endpoints of the servo travel.

WebUI

 

The controller has a web server that serves a web app. This allows complete control of the machine. Web browser based control is ideal, because it is compatible with anything that can use a browser.  We hope to add additional web apps for generating gcode from images and SVGs.

SD Card

This is a great feature. If you have files on the SD card, they can easily be plotted. The WebUI lets you upload files and then click play.

Stepper motors

Both versions use NEMA 14 motors. The original version used 34mm deep motors. I used these because I had some. They are overkill, because there is very little load on the motors. I bought some 20mm deep motors for the new version. These are even a little overkill. I am only running about 0.3A of current into each one. There are not too many options for standard stepper motors that are smaller and lower cost than these.

Gear Driven Rotational Axis

I decided to change from a belt driven rational axis to a gear driven one. Loop belts are a pain, because you have to order them from expensive places like SDP-SI and if you want to tweak anything, you might need to order a different size. I decided to use helix gears this time. These are 15° gears with a modulus of 1. They print and work great with my printer, even on a coarse layer height. The motor is mounted on slots and it is easy to get virtually no backlash. The helix keeps them quiet.

Rotational Platter

The platter rotates around a central bearing. This pulls (3) smaller bearings, that act like wheels, into contact with the PCB. This causes the platter to stay very flat, without wobble. I created a copper ring, plated with solder on the PCB to make it extra smooth and wear resistant. It also looks really cool and shiny on the PCB!

Buttons

Since there was a little room left on he board, I added three buttons. I have not added anything to the firmware yet. I think one will definitely be a homing button. I am not sure what to use the others for. I thought it might be handy to have a repeat button to repeat the last plot without having to fire up the phone app.

Battery Power

I made a battery case in the base of the machine to hold an RC style LiPo battery. I am using a 3 cell (11.1V) 2200 mah battery. The idle current on the machine with the WiFi running is about 80ma. When plotting it peaks at about 800ma. I think I should get about 2 hours of continuous plotting.

Future

  • Put kinematics into the firmware. currently files need to be pre-processed with the python script.

If you want to be notified of future blog posts, please subscribe.

 

New 2.5D Pen/Laser ESP32 Controller

I have done several pen and laser machines lately, so I decided to create a custom PCB for Grbl_ESP32 for these types of machines. This is a small (70mm x 60mm) PCB with all the features a pen plotter or laser cutter/engraver would need.

These typically use stepper motors for the X and Y axes. On pen plotters, the Z axis is controlled by a servo or solenoid. On lasers you need an accurate PWM for laser power control.

Here are the features of the PCB assembly

  • (2) Stepper Motor Driver Sockets for standard stepper driver modules.
  • (1) Hobby Servo Connector.
  • (1) High Current (10A max) Output Control. This can be used for a solenoid, fans, etc.
  • (2) limit/Home Switch Connectors.
  • Laser Power PWM connector
  • Removable Micro SD card. Upload files via Wifi to reliably run off-line.
  • 5V 3A Step Down Power Supply
  • Standard DC Barrel Connector for power input. (9-28 VDC)
  • Power Output Connection for laser module.

Grbl_ESP32 Advanced Features

  • 32-Bit dual core processor
  • Fast 120kHz step rates
  • WiFi
    • Access point or station modes
    • Complete web user interface
    • Telnet
  • Bluetooth Serial
    • Compatible with phone apps
    • Compatible with most serial port gcode senders
  • 16 bit laser power control.
  • Core XY kinematics supported for T style machines.
  • RTOS (real time operating system) allows the use of custom tasks.
    • Precise servo control accurately mapped to Z motion, plus interactive calibration.
    • Precise control of solenoids via adjustable pull and hold strengths using PWM. This allows a strong pull, yet a cool hold temperature.
  • Instant On/Off – Unlike a Raspberry Pi, there is no long boot time or formal shutdown required. It is typically ready to go in a few seconds.

How to control it

There are several ways to connect to the controller, but to run jobs, you basically either stream the gcode or run it from a file on the SD card. The SD card is a great feature because it is free from connectivity interruptions and you don’t need to stay connected to your machine while it is running the job. You can quickly upload files via WiFi or remove it and plug it into your computer.

Serial port

This controller is compatible with virtually all of the serial port gcode senders for Grbl. The default baud rate is 115200.

Bluetooth Serial

This is a great way to use your phone to control a machine. When you connect via bluetooth, your phone or computer will create a virtual serial port. This means you can then use existing serial port based gcode senders.

Wifi – WebUI

The controller has a web server. The controller can create its own WiFi access point or connect to an existing WiFi network. You connect to the controller with a web browser and it serves a full featured machine controller to browser.

Controlling the Pen Up/Down Servo

The servo is controlled using a separate RTOS task on the controller. Grbl thinks it is running a normal stepper motor on the Z axis. Each time the servo task runs, it looks at the current position of the Z. It then computes and sets a position for the servo. You map the servo’s range to a Z range.  For example the range could be set for 0-5mm. Any values of Z above or below this range would would be limited by the range, so any Z value above 5mm in this example would not move the servo past where it was at 5mm.

You can calibrate the end points of the servo to fine tune it. We use the Z axis resolution and max travel settings to do this. $102=100 (100%) would be no change to the first end point. %102=90 or $120=110 would be 10% changes in either direction. $132 works the same way for the other end point. Make sure you do not adjust the servo so it hits the physical end point of its travel. You will feel the servo continuously vibrating as it pushes against the end point. This is very hard on a servo and will overheat and damage it.

The servo updates its position 20 times per second. Therefore it will do a good job of respecting the acceleration and speed settings in the gcode.

The feature also uses the $1 (Step idle delay) setting. It the steppers motors disable, so will the servo and can be moved manually.

Additional parts you need

The controller uses plug in modules for the the ESP32 controller and the stepper motor drivers.

ESP32 Controller

The ESP32 controller needs to be a ESP32 Dev Module. It should have 2 rows of 19 pins. The rows should be spaced 0.9 inch (22.86mm) apart. Be careful: Some similar controllers have a wider pitch.

Stepper Motor Drivers

The drivers are the standard StepStick (Pololu) style footprint. The (3) microstepping selection pins (MS1, MS2, MS3) are all connected to logic high. This typically results in the highest resolution (1/16 or 1/32). The Grbl_ESP32 step rates are high enough  to make that not an issue. I typically use TI DRV 8825 or Allego A4988 modules, but others can be used as long as the pins are compatible. The PCB silkscreen has the corner pins labeled. Use them to insure you correctly install your driver modules.

Source Files (coming soon)

A completely assembled PCB is available on Tindie. The profits from Tindie help me to continue to develop the hardware and firmware for projects like this. If you want to roll your own, the source files are linked below.

 

Suggestion / Changes?

If you have any suggestions or need a custom design please contact me.

If you want to be notified of future blog posts, please subscribe.

 

DrawBot Badge – Workshop

Woot!

I and Jason Huggins (@hugs), of Tapster Robotics, will be giving a conference at the 2018 Hackaday SuperConference. The conference will be “Getting Started in Small Scale CNC and Robotics (Build a CNC Badge)”. By the end of the workshop you will have built, programmed and learned to use the DrawBot Badge.

The badge is way more than that though. The badge PCB is a very capable general purpose CNC/Robotics controller. We considered every small scale CNC machine we could think of and made sure this badge could control it. Here is what it can control.

  • (3) Stepper Motors
  • (3) Hobby Servos
  • (3) Homing/Limit switches
  • (1) Variable Speed Spindle PWM signal
  • (1) Laser Module (Power control and Safety interlock)
  • (4) Control switch inputs
  • (1) Probe switch control
  • (1) Coolant Control
  • (1) High current (3 Amp) output for relays or solenoids (includes flyback diode)
  • (1) i2C interface (for displays or Sh**ty Add-Ons)
  • (1) SD Card socket to store and run files

You can’t use every feature at once, like the Laser PWM and Spindle PWM are the same signal, but they are broken out logically to multiple, machine specific, connectors.

It is all powered by an ESP32 running Grbl_ESP32, which provides serial, Bluetooth and WebUI interfaces.

The first half of the conference will cover tips and tricks for getting started with making and controlling small machines. We will also learn and use some basic gcode to control some motors and other items. It is a just a basic intro to get you started and discover some resources. During the second half we will build the DrawBot badge.

If you are interested, sign up for the conference and be sure to get into the workshop when that is posted. The workshop will be limited to about 20 people, but I will bring extra badges for sale and will be happy to help build and hack them all weekend. I will also bring extra motors, servos, switches, etc for hacking up simple machines.

Open Source

Within the next couple weeks, all of the documentation will be released. Badge kits will also be for sale on Tindie after the conference.

 

 

Next Project – Wooden Nickel Engraver

I started working on my next backpack scale CNC project. My backpack scale projects are tiny CNC machines that I can easy carry in a backpack to tech meetups and events. This machine is going to be a wooden nickel laser engraver.

Wooden nickels are small wooden discs. You can buy blanks from various places, including Amazon. You can usually get 100 for less than $10. The goal is to create a machine that loads them from a feed tube, engraves them, then ejects them.

Mechatronics

The basic drive will be an H-Bot. It will be similar to the midTbot, but the motors are at the ends of the X axis. It will be fully enclosed, but I not started work on that part yet.

Disc Feed System

I hope to be able to use a single hobby servo to handle the loading and unloading of the blanks. The servo will control a sliding device that has three positions.

  • In the first position it acts like a support shelf for the disc. The bed slides under the feed tube and a disk drops into the pocket.
  • The next position is the clamping position. This holds the disc still while engraving.
  • The final position retracts the shelf so the disc drops through.

Electronics

The goal is to use a low cost controller like an Arduino Nano.

  • (2) Stepper motors for the X,Y motion
  • (1) Hobby servo for the disc feed system (PWM)
  • (1) Laser power control (PWM)
  • (2) homing switches
  • (1) interlock switch loop if there is a door and/or cover

Status

The major new feature of this design is the disc feed system, so I am primarily working on that right now.


If you want to be notified of future blog posts, please subscribe.

TWANG32 – An ESP32 Port of TWANG

 

I ported the TWANG game over to ESP32. I wanted to do this for several reasons.

  • Cost: The ESP32 is generally lower cost than the Arduino Mega
  • Speed: The ESP32 has a dual core 80MHz processor vs. the 16MHz Arduino Mega
  • Memory: The ESP32 has much more RAM and program space to allow more features, levels and audio files.
  • Physical Size: A Mega is very big. This creates a large enclosure that takes a while to print. The smaller enclosure is also more portable.
  • DAC Pins: The audio capabilities on the Mega are very crude and basically limited to square wave tones. A DAC can output digital audio. Currently I am just using a similar square wave tone to the Mega, but it works much better for adjusting the volume.
  • Wireless: The ESP32 has Wifi and Bluetooth. This will allow easier (smartphone) interfacing for options (brightness, volume) and level pack uploads. I also want to consider dual player battle type games with linked controllers.

The Audio

The original TWANG bit banged audio directly from I/O to a speaker. This was super simple, but the volume at max was not loud enough for noisy environments. The ESP32 I/O is a lower voltage (3.3v) and less current, so something needed to be done. I prototyped with a PAM8403 based amplifier (~$4 on Amazon). This worked great, so I added that I.C. to my shield. The volume is controlled by the amplitude of the DAC.

The Shield

I made a shield to simply the wiring and provide a stable way to mount the ESP32. I used a NodeMCU 32S development board for the ESP32. Under the ESP32 is a the audio circuitry. I should have some extra boards to sell on Tindie soon. I will publish the source files soon.

The Firmware

The code is on Github. The port was relatively easy, but I had to rewrite a few libraries. They were designed so the main “setup” and “loop” parts did not change much. Currently the serial port based setup from the Mega version was not ported. This probably won’t be used. A wireless version is in the works.

Enclosure

The new enclosure is smaller. It prints quicker and is easier to fit in my backpack. The size is still big enough to hold comfortably while playing. The files will be uploaded to Thingiverse within the week.

Next Steps

  • Wireless control: I want a simple way to read the game statistics (average score, levels played, boos kills, etc) and tweak simple settings like audio volume and brightness. I think the easiest way is to make it a wifi access point with a simple web server. This eliminates having to write any client side apps and any smartphone or computer can hope on easily.
  • Levels: Make some way to edit or upload levels via wifi.
  • Multiplayer: I should be able to link multiple controllers. If I can think of a good dual player game idea, I might try to add that.
  • Python: It might be a fun challenge to write the game in Micro Python. This might open up the development to more people.

If you want to be notified of future blog posts, please subscribe.

 

Laser Galvo Control Experiments

 

 

I recently bought some laser galvos from Aliexpress. What I got was the basic guts of a laser light show system. It came with everything I needed except the lasers. My goal is to control a laser to make a large interactive artistic display or game controlled by a micro controller with a DAC. I have a PSoC 5 and an ESP32 that have DACs, so I may use those.

Galvos work like speakers, old school analog meters or hard drive arms. They move proportional to a current. They can move extremely fast and precisely with the ability to move to 30,000 positions per second. The galvos came with drivers. This simplifies the control to a simple differential voltage. A differential voltage is used to increase noise immunity. The ILDA spec says the differencial voltage is 0 to 10V. This means at one end of travel you supply -5V and 5V and at the other end of travel you swap the voltages supply +5V and -5V.

My DACs are 0V to 5V (0r 3.3V). I need to convert this range to a 10V differential voltage. The easiest way for me to do this is to use some op amps. With what I have on hand it is easiest to get the 10V differencial using 0 to 10V and -10V to 0. I tested on the galvos by outputting a -10V to 10V sin wave from a function generator. It worked great.

Assuming I use the 0-5V DAC, I need to map that to a -10V to 10V range. That is a 20V span and requires a 4x gain. I then need to offset that by -10V. The op amp circuit I show below is what I made.

I used an LM324N because I had some. That has (4) op amps in a single package. The rails of the device need to be hooked up to a + and – supply that is greater than the range I will be using. Fortunately the galvos came with a power supply that outputs +15V and -15V. I used some potentiometers in the circuit to allow me to adjust the circuit.

The lower op amp provides the gain. The gain on the positive side is 1 + 30k/10k which is 4. The negative side is used for the offset and its gain is 30k/10k which is 3. I need an offset of 10V, so 10V divided by the gain of 3 is 3.33V.  I need that value to come from the upper op amp. That op amp has a gain of 1 so I simply need to adjust the pot in front of that to output 3.33V.

 

The DAC is connected to the lower left voltage source in the schematic shown as 2.49V. The galvos would be connected to Gnd and the output of the lower op amp (green line).  The schematic is interactive. Click the link below and try adjusting the input voltage between 0V and 5V.

Click here to interact with the circuit.

I needed to create 1 circuit for each axis. Here is my breadboard.

Here are the signals on an oscilloscope. The yellow trace is the 0-5V input as a 5kHz sin wave. The blue trace is the output. Both traces use the center line as the 0V. The scale is 5V per division. The input has a low of 0V and a high of 5V. The output goes from -10v to 10v.

 

I am using the tiniest laser I could find so that I don’t have to worry about safety yet. I 3D printed a base to keep things in line.

Here is a short Instagram video of some testing.

 

Playing with my laser galvos at NERP tonight.

A post shared by @ buildlog on


If you want to be notified of future blog posts, please subscribe.

Building a TWANG

Introduction

First…. Most of the credit must go to Robin Baumgarten and Critters for the inspiration and firmware. While I have hacked and tweaked the firmware a lot, the basic design is still all Critter’s. He did a great job.

A lot of people have asked me to help them build one, so this blog post is here to help them out. It is easy and fun to design and build your own parts and electronics. You can also either use my or Critters 3D printed parts.

The Electronics

The electronics are quite simple and only consist of a few basic pieces.

Arduino Mega – The firmware will not fit on an Arduino UNO, so you must use an Arduino Mega or anything using the the atmega2560 micro-controller. You can tpyically find a clone for less than $10.

MPU-6050 – This is a 3 axis MEMS accelerometer and gyroscope. The easiest way is to buy a GY-521 breakout board. You only need to use the VCC, GND, SCL and SDA pins. Note: My shield also has the INT pin, but that was for experimentation. You can find these breakout boards on Amazon for less than $5.

Speaker – You need a small standard speaker. The sound quality is not great, so don’t invest in anything expensive. I used an 8 Ohm speaker, but anything should probably work. The speaker is hooked directly to the Mega I/O, so you also need a 100 Ohm resistor in the speaker circuit. Typically a 1/10w to 1/4w resistor would be used. Note: This resistor is included on my shield. If you use my 3D printed design you will want a 40mm diameter with very little depth to it. Note: Do not connect directly to an amplifier. It is not designed for that.

LED Strip – The FastLED library that is used, supports a lot of types. I like the APA102C (Dotstar) type. I have also tested WS2812 (Neopixel) types. Most of the testing I did was on a 1 meter 144 LED APA102C strand and it looked great. The game gets difficult when there are less LEDs, so I would recommend at least 90. I have also tested with (2) 1 meter 144/m strips soldered together and a giant 5 meter 90 LED/M strip. They all look and work great.  The firmware supports up to 1000. Most longer strips are soldered smaller sections. It is easy to solder strips together like the image below. Be sure the 5V, Gnd, etc. are aligned the right way. I have some strips that are waterproof. That is not required, but does not hurt.

Note: Do not power the LED strip directly from the Arduino. Power it separately from a power supply. Note: My shield has an input for this. It will also power the Arduino.

Power Supply – Technically, you could need upwards of 40mA per LED. I bought a 10A supply and it has worked fine without getting hot up to 450 LEDs.

Life LEDs – The firmware supports remaining “life” LEDs. I prefer to use the main LED strip for this. It is fun to live within the limitations of the LED strip as the sole display. Using the strip also allows you to adjust the life count in firmware. The default is 3 lives per level, but I have boosted it to 5 for testing.  Note: My shield uses different I/O pins for the LED than the original TWANG firmware, so you need to check this if using them.

Wiring

The image below shows all the required connections to the Arduino Mega. My prototype used male header pins poked into the Arduino headers. It worked fine, but wires did often pop out when removing the cover.

The TWANG Shield

While hand wiring is very simple, I found it to be messy and I worried about failures. I made a basic shield to clean everything up. Here are the features of the shield.

  • LED Strip Terminal Block – It is very easy to hook up the strip. It works with both 3 and 4 wire strips. The power comes from the shield and no additional connections are required on the strip. Connections are clearly labeled. 3 wires LED strips do not use the CLK connection.
  • Accelerometer Terminal Block: This has clearly labeled connections using the same names that are on the MPU-6050 accelerometer module. Just hook them up 1 to 1.
  • Speaker Terminal Block: This also has 5V and Gnd if your hacking requires these connections. The 10 Ohm speaker resistor is mounted on the board.
  • Main 5V power entry connector: This powers the LED strip. It also powers the Arduino. It uses a diode so you can also power the Arduino via USB for programming.
  • Arduino UNO compatible: While the default firmware will not fit on an UNO, future compact version might be possible.
  • Life LEDs – My enclosure does not use them, but you could wire some in. The resistors are included, but not the LEDs. You could solder LEDS on the board or remotely locate them and solder wires to the PCB.

Shield Source Files

The 3D Printed Parts and other hardware

You need to 3D print a bunch of parts, a door spring, some hardware and a little hot glue.

Tindie Store

Typically I buy a small batch of PCBs for all my projects. If everything goes well I sell the rest on Tindie and often order more if they sell out.

  • Just the assembled shield. (coming soon)
  • A kit with all the custom parts
    • Assembled Shield
    • MPU-6050 wired and terminated with wire ferrules.
    • Speaker wired and terminated with wire ferrules
    • Door Spring

The Firmware

All of this is fully compatible with the original TWANG firmware. I forked the original and added a few changes. I would be happy to merge back to the original some time in future. The firmware relies on several libraries. Follow the instructions on GitHub pages to get those libraries.

Hacking the Firmware.

Hacking the firmware is quite easy. You should at least try editing some levels. More advanced hacking could improve the graphics and sounds.  Please give feedback if anyone has made any improvements.

At a minimum you have to set the number of LEDs and the LED strip type in the firmware before compiling.

Video

(coming soon) This thing looks so awesome in person, but is nearly impossible to video due to the crazy brightness of the LEDs. A friend is going to help me try to get a decent video.

In the mean time, take a look at Critter’s videos.


If you want to be notified of future blog posts, please subscribe.

TWANG Play Testing

 

I took my TWANG Clone to ORD Camp, NERP and the Hardware Happy Hour Meetup over the past week. It got a ton of play time.  I received a lot of feedback to work on.

Observations and Feedback.

It’s difficult to beat.  Only one person got all the way to the boss level and defeated it. Amazingly, it was Elan Lee. He loved the game and gave me some good ideas to work on.

Most people got killed in the second to last level. It has a lot of enemies and a conveyor that keeps pushing you back to the bottom. There is also a sneaky enemy spawner at the bottom that gets a lot of people.  It is a great level, so I don’t want to remove it. I have added a few more levels before it to practice before that.

The Lava Pools. The lava pools confused some people. I changed the pools to look more red, flickering and scary when they are on and less scary when off.  To me it looks more obvious now what to do.

The Sound. I love the chip tune style sound out of the Arduino, but it needs to be way louder. In a large crowd, you cannot hear it at all. I think it needs an amplifier or an option for an external speaker.

Boss Level: By design, the exit at the top of the boss level does not appear until all bosses are dead. People did not understand this and tried to exit out the top early, because the boss respawns below you after the first “kill”. That caused the players to try to leave the game without ending the level. If you exited the top in this mode, the player disappeared without a way back.  This is very annoying if you get all the way to this last level.  I fixed the code so you can’t goes past the second to last LED when the boss is still alive.

New Features: I asked several people for new ideas. I got some to work on, but already added one. The attack width is now adjustable. It will default to the old width, but you can change it per level.

More levels. A typical game lasts about about 1-2 minutes. I think a few more medium difficulty levels would help.

Scoring System: It would be cool to know how you did compared to others. It could display the score as a bar on the strip, with the max possible being the full length. You could then mark your level somehow by the strip. (Postit note flag, dry erase pen, etc)

Next Steps

  • Release all the source files.
    • Firmware: I have been hacking the code quite a bit.  I’ll release my changes after some clean up and testing.
    • STL files: I have been using odd sized speakers harvested from some cheap external speakers. When looking looking to buy some, it seems like 40mm diameter is a good standard size that is cheap and available. As soon as I get some and test them, I will release the files for this size.
    • Sell on Tindie. My shield makes wiring super easy, but is definitely not required.  I think I’ll sell everything, except for the Mega and LED strip. I’ll also just sell the assembled PCB by itself.
  • New Hardware:
    • Raspberry Pi Zero W: I have looked into several hardware options and this seems to be a good candidate. I think it will be a simple way to get good audio and connectivity. I have the accelerometer and LED strip working so far.  The audio will be an I2S amp chip that will be put on a shield. The (2) drawbacks are boot time (20-30 second) and you are probably limited to APA102C (dotstar) type LED strips. Edit: I got a good portion of the code on the Pi running. It runs fine, but I don’t like the requirement for a slow and controlled shutdown of the Pi. It would require a button and some sort of visual feedback.

 

 

TWANG Pi Zero Prototype


If you want to be notified of future blog posts, please subscribe.

TWANG Shield

While the my TWANG clone has been running great, I wanted to clean up the wiring, so I made a shield to plug into the Arduino. I previously used header connectors plugging into the Arduino. The connectors go to three different places and come from all over the Arduino , so there were a lot of connectors including some single pin ones. I was worried they might pop out or fail. I also had to externally power the LED strip and supply power via USB to the Arduino.

The shield takes care of all of this and groups all of the external connections by function on easy to connect and clearly labeled terminal blocks. Here are the features I have…

  • Single 5V Power Connector: This connector powers the LED strip via a very heavy trace on the PCB. It also powers the Arduino. The Arduino is powered through a Schottke diode. If you plug in the USB, the Arduino switches to be powered by the USB. This allows you to program and hack the firmware while the LED strip is powered.
  • Terminal Block Connections: The wires are grouped by peripheral (Accel, Speaker, LED Strip) and clearly labeled.
  • LED Strip Connections: This powers and controls the LED strip. I have tested it with 4 wire (APA102, Dotstar) and 3 wire (Neopixel) strips.
  • Speaker Connection: There is an integral 100 Ohm resistor that is required when you directly power the a speaker from an Arduino. The terminal block also has 5V and Gnd in case you want to add a simple amplifier. BTW: Driving the speaker directly from the Arduino is plenty loud in my opinion.
  • Shield Size: The shield will work on both an Arduino Mega sized board or an Arduino UNO sized board. The TWANG firmware requires the extra memory of the Mega, but a tiny, reduced feature, UNO version could probably be made.
  • Life LEDs: There are provisions for 3 LEDs that are typically used to show remaining lives. I have not been using those. I prefer to use the LED strip to show remaining lives. I like working with the restriction of a 1D LED strip display.

Prototype Assembly Notes: I did not have all of the correct parts for the build. I did not have a 100 Ohm SMD part, so I tacked on a through hole part. I did not have the right terminal blocks, so I cut one and only used 3 positions for the speaker. The correct parts will arrive soon.

Here are some more images.

 

Future Changes

  • I will probably get rid of the life LEDs.
  • I will add a large capacitor for sensitive LEDs, like Neopixels. Right now I just connect the cap to the terminal block.
  • I will probably sell the rest of this batch on my Tindie store in a week or two. I will probably sell assembled boards and full assemblies (less LED strip and Mega)
  • I will release of the documentation under an CC4.0-A-SA license.

If you want to be notified of future blog posts, please subscribe.