I’ve uploaded gearbug #1 to http://www.thingiverse.com/thing:31426. It was the first gearbug design I cut on the laser. It morphed into some simpler designs that I considered “finished” before I got the original working exactly how I wanted.
The artwork is Pacific Northwest themed. Don’t worry, the plant is a rhododendron. The text is only visible if you turn the gears and reveal it a little at a time. I’m really happy with how this design came out.
I also uploaded a toy car design to thingiverse yesterday. My nephew loves cars and I am working on a birthday gift for him.
I’m still looking for someone with a more powerful laser to outsource some cutting to. Ponoko is way too expensive. So far no one I have contacted has gotten back to me or is very interested in cutting 50-100 of my designs.
I’m always running out of the good pins in my Arduino projects. PWM pins are in particularly scarce supply and I sometimes even find myself short on analog inputs. Tricks like using shift registers or software PWM help, but they have limitations that aren’t always easy to work around.
The open source ExtraCore library on GitHub helps you use a second Arduino compatible to nearly double your pin count. You can stop scratching your head over how to get all the functionality you need once you go beyond “blinky LED” type projects. You can just pop in a second Amtega328 based board.
Lets you read or write to every pin on the extra board as easily as the onboard pins.
Adds 6 PWM outputs instantly.
Communication only takes 2 wires (A4->A4, A5->A5)
When Tim Malcom wanted to make a giant interactive bagpipe sculpture for Maker Faire he ended up using 3 Arduinos and two of them were talking over a two wire interface. This was one of the intended missions of the ExtraCore, but Tim had to do all his own code. Now if he wanted to farm out I/O to a second Arduino he could have it working in just a few minutes with this library, or use it as a jumping off point for something more complex.
You will need the Wire and EasyTransferI2C libraries in your Arduino libraries folder. The included examples will connect two Arduinos and blink pin 13 in time as well as run one PWM output and show you how to read remote inputs. The client example is meant to run as is for most projects. The manager is where your own code would run.
Here some of the code from the manager side.
#include <Wire.h> // You don't need to call Wire or EasyTransferI2C directly, just include them.
pinMode(13, OUTPUT); //set local pin13 to output.
extraCore.beginManager();//begin Manager role.
extraCore.setPinIOstate(6, OUTPUT);//set remote pin to output.
extraCore.setPinIOstate(13, OUTPUT);//set remote pin to output.
extraCore.setTriStateValue(3, TRUE);//sets remote pin to INPUT with pullup resistor active.
extraCore.setAnalogOutput(6, 127);//Turns on remote PWM
extraCore.setDigitalOutput(13, HIGH);//Turns one remotes Digital 13 pin
extraCore.sendConfig();//send the current I/O setting to the remote to execute.
int r2 = extraCore.getDigitalReading(2);
As you can see using the remote pins is pretty similar to using the local pins. One exception is using high-impedence mode on an input pin. You need to specifically call setTriStateValue(pin, state). Setting this to true will both set the remote pin to input and digitalWrite(pin, HIGH). Setting it to false will only clear the pullup by setting digitalWrite(pin, LOW), but won’t change the input state of the pin.
Fritzing Diagram of setup the works with example code. This will allow you to see pin 13′s flashing in time, a PWM LED light and dim and see the reading on D2 go on and off.
Diagram of example code setup.
The library is meant to get you up and running quickly by adding more ports easily. If you need timing resolution greater than about 20 milliseconds you should roll your own. Keep all your timing critical stuff local to the manager board and you should be fine.
The libraries use the built in i2c in hardware. If you call Serial.print in your sketch too often it will cause the i2c communications to fail. You can get a few debug messages out, but if you run into problems try disabling Serial.print* commands.
If your outputs aren’t working, but sure you set the pin state to output. Just like local pins they default to input.
Start sending and receiving data as the manager.
void setPinIOstate(pin, boolean);
Set the desired INPUT/OUTPUT state of a pin.
void setDigitalOutput(pin, boolean);
Set the desired HIGH, LOW output state of a pin.
void setAnalogOutput(pin, pwm);
Set the desired PWM (0-255) state of a pin. Ignored if not PWM cabable.
void setTriStateValue(int, boolean);
Set the pullup resistor to TRUE/FALSE. True will automatically set the pin to INPUT.
Get the last known digital reading from the remote.
Get the last known analog reading from the remote.
Send the current desired state of all the pins to the remote.
This is required to for changes to take effect.
begin sending and recieving as client.
Get the desired IO state for a pin.
Get the desired digital output value for a pin.
get the desired pullup resistor value for a pin.
Get the desired PWM output for a PWM pin.
void setDigitalReading(pin, value);
Set the digital reading from the remote for a pin.
void setAnalogReading(pin, value);
Set the Analog reading for pin.
Send the currently known pin readings to the manager.
This is required for updates to take effect.
Returns true if new data has arrived since the last time it was checked.
Easily get your Arduino to talk to your TV with just three components and this library. IR protocols are a little tricky even with a really good write up in Make Magazine recently. Ken’s library is going to make it a lot easier to experiment with.
Send and receive IR remote codes in multiple protocols.
Digispark is a Kickstarter project that ends Sept. 10th. On August 24th they had reached $168,332 (of $5000 goal). It’s a great platform. People have been asking how it stacks up against ExtraCore. Digispark is a very complementary product to ExtraCore. Both are entries in “small, inexpensive Arduino Compatible.” But they live in different niches. You can’t get everything you want for $10 yet.
Digital I/O capable pins
yes (pin 0)
yes (pin 13)
Uno compatible in IDE
Programmable Serial USART
Master/Slave SPI Serial Interface
Byte-oriented 2-wire Serial Interface (Philips I2C compatible)
Programmable Watchdog Timer with Separate On-chip Oscillator
*2 leds total.
You have to Modify your Arduino IDE files to program to Digispark with included files. Should be super easy.
The less powerful processor of the Digispark missing a few features on board. As you can see from the last 4 entries in the table. Most people probably won’t miss them or you can make a software solution.
Bottom line: Digispark is an outstanding platform when you want something cheap and simple. ExtraCore is suited to projects that are more complex in hardware or software.
I am working on a library for Ardunio that will easily allow someone to connect two Arduinos together with 2 wires and have one serve as extra I/O. For $15 and two I/O pins you can add an ExtraCore to a project to extend your I/O capacity for example. For digital only, of course a shift register is a better deal. A shift register won’t also get you 5 Analog inputs and 6 PWM outputs.
Controlling all the I/O pins on a remote Arduino
I have the “hello world” of the Arduino world working. I can blink pin13 remotely. The code is generic and any of the digital pin states can be set to 0 or 1 right now.
There are still a few functions to finish up, but the hard part is done.
I used the Easy Transfer library which in turn uses the built in Wire library. I ran into some problems when trying to use arrays with Easy Transfer. It’s supposed to work but I had mixed results.
The code for controlling the remote is pretty simple. You set your pin mode, then you set the output value and send the config to the remote.
I still need to finish the code for reading digital and analog input as well as setting remote PWM outputs. Adding support for things like tone() would be easy as well. I expect the code to be done soon. The hardest part was getting 2 way i2c working the way I wanted.
(Since “Master” and “Slave” are not considered polite terms, I use the terms Manager and Client/Remote.)
I’m trying to transition from full time work “for the man” to full time Kickstarting and looking for my next Kickstarter project. I currently have several ideas. With twosuccessful open source Kickstarter projects under my belt I am ready to tackle another challenge. Here are some of the ideas I have. What do you want in an Arduino Compatible or Arduino accessory?
The original ExtraCore is about the size of a quarter
ExtraCore with a V2 Extracore super-imposed for scale
ExtraCore V2 compared to a quarter
I was showing the ExtraCore around Maker Faire in California this year. The owner of Modern Device bought some on the spot to sell online. While we were talking he asked how much smaller it would be with a VQFN Atmega chip. He also wondered about adding a power regulator to the back.
Now that the Robotic Minion Kickstarter engineering and lasering work is wrapped up I have had a little bit of time to play with the ideas I got for the ExtraCore.
The first thing I did was switch to 2mm headers. Then I replaced the main chip with a VQFN version. There is a 28 and 32 pin version. I choose the 28 pin version because it’s quite a bit smaller but gives up the two analog inputs A6 and A7.
I went from a 1206 LED to an 0603. I left the other components at 0805. With a 400ma power regular strapped to it’s back it all fits on a board that’s 16mm x 18mm. I haven’t got past the Eagle PBC design stage yet.
I’d love to hear what you think about this design. It could be my next Kickstarter. Another contender is an ExtraCore with a voltage booster on board so it can be run off a single AA battery, like the eChanter.
In order to get a rough idea how long something will take on a CNC or laser cutter I wanted to be able to measure all the vector lines and arcs in a file. I knew it was going to be possible to do in Inkscape. I looked around for an extension that that would do what I wanted, but none did.
Built into Inkscape is an extension to measure the paths of selected item. I didn’t like it for a couple of reasons. 1. You have to select the object. 2. It prints the length on the objects themselves.
I really wanted to be able to separate the lengths by the stroke color of the items. This allows me to color the cuts in one color and the etching in another color. Cuts are slower on most materials.
I’ve never use Python before, but I was able to figure out enough of it to be able to adapt the existing plug in to do exactly what I wanted.
I’m sure there are some pathological Inkscape files that will break or defeat the plug-in. However, it’s pretty handy as it stands to be able to measure the lengths in a file quickly. I imagine it would be easily possible to adapt into a web-script to allow a person to get a quick estimate of lengths for a laser cutting business application.