Posts | Comments

Planet Arduino

Archive for the ‘arduino hacks’ Category

We don’t know why [stoppi71] needs to do gamma spectroscopy. We only know that he has made one, including a high-voltage power supply, a photomultiplier tube, and–what else–an Arduino. You also need a scintillation crystal to convert the gamma rays to visible light for the tube to pick up.

He started out using an open source multichannel analyzer (MCA) called Theremino. This connects through a sound card and runs on a PC. However, he wanted to roll his own and did so with some simple circuitry and an Arduino.

The tube detects very faint light in the crystal so they need to be in a light-tight enclosure. The Arduino needs a little help to read the pulses from the tube in the form of a simple circuit. The circuit acts as a peak detector and the peaks last only about twenty microseconds. The post doesn’t have the schematic for the peak detector but the video, seen below, does.

If you want a run down on spectrometer projects, check out Hacklet 122. Admittedly, most of the ones we see rely on visible light.


Filed under: Arduino Hacks, tool hacks

[kodera2t] discovered the VL53L0X Time of Flight sensor and thought it would make a great way to control the operation of a model train without touching it.

The sensor was small enough for an N-gauge train, which translates to 1:148 scale or about 9mm from rail to rail. His idea was to build a tiny control board that could fit inside the locomotive: 10mm by 40mm. His board consists of the ToF sensor, an ATMega328P-MMH, USB-serial, and a Texas Instruments DRV8830 motor driver. he powers the board via the 6V running through the track.

Right now [kodera2t]’s using the ToF as sort of a gestural controller to get the train to start rolling, but one could imagine the sensor could be incorporated into more advanced programming, like having the train speed up on straightaways and slow down on a curve, based on the height of the bridge over it.

We’ve published a bunch of [kodera2t]’s tiny circuit board projects here on Hackaday, including the smallest basic computer, his minimal frequency counter, and his VFD amplifier.


Filed under: Arduino Hacks

Infinity mirrors are some far-out table mods and make a great centerpiece. Instructables user [bongoboy23] took a couple steps beyond infinity when designing this incredible table tailor-made for our modern age.

Poplar and pine wood make up the framing, and red oak — stained and engraved — make for a chic exterior. Programmed with Arduino and run on a Teensy 3.1, the tabletop has 960 LEDs in forty sections. There are, four USB ports hidden behind sliding panels, as well as a two-port AC outlet and an inductive charging pad and circuit.  A hidden Adafruit TFT touchscreen display allows the user to control the table’s functions. Control is limited to changing lighting functions, but Pac-Man, Snake, and text features are still to come!

Weighing in at $850, it’s not a cheap build, but it looks amazing.

This is one of the most extensive Instructables you may happen across, containing dozens of pictures, CAD files, diagrams, appendices, and a change log, with tips besides; if you want one just like this at home, you are in good hands, here. Or try an easier build, we won’t judge. However, maker beware — you may be stepping through a portal that’s difficult to return from.

[Thanks for the tip, JohnL!]


Filed under: Arduino Hacks, how-to, led hacks

An ISP dongle is a very common piece of equipment on a maker’s bench. However, its potential as a hackable device is generally overlooked. The USBASP has an ATmeg8L at its heart and [Robson] decided that this humble USB device could be used as an interface between his PC and a SNES Joypad.

A SNES controller required three pins to communicate with a host: clock, data and latch. In his hack, [Robson]  connects the controller to the ISP interface using a small DIY adaptor and programs the AVR using the V-USB library. V-USB is a software USB library for small microcontrollers and comes in pretty handy in this instance.

[Robson] does a pretty good job of documenting the entire process of creating the interface which includes the USB HID code as well as the SNES joypad serial protocol. His hack works on both Windows and Linux alike and the code is available on GitHub for download.

Simple implementation like this project are a great starting point for anyone looking to dip their toes in the DIY USB device pool. Veterans may find a complete DIY joystick more up their alley and will be inspired by some plastic techniques as well.


Filed under: Arduino Hacks, hardware

It wasn’t too long ago that one could conjecture that most hackers are not avid video game players. We spend most of our free time taking things apart, tinkering with microcontrollers and reading the latest [Jenny List] article on Hackaday.com. When we do think of video games, our neurons generally fire in the direction of emulating a console on a single board computer, such as a Raspberry Pi or a Beaglebone. Or even emulating the actual console processor on an FPGA. Rarely do we venture off into 3D programs meant to make modern video games. If we can’t export an .STL with it, we’re not interested. It’s just not our bag.

Oculus Rift changed this. The VR headset was originally invented for 3D video games, but quickly became a darling to hackers the world over. Virtual Reality technology is far bigger than just video games, and brings opportunity to many fields such as real estate, construction, product visualization, education, social interaction… the list goes on and on.

The Oculus team got together with the folks over at Unity in the early days to make it easy for video game makers to make content for the Rift. Unity is a game engine designed with a shallow learning curve and is available for free for non-commercial use. The Oculus Rift can be integrated into a Unity environment with the check of a setting and importing a small package, available on the Oculus site. This makes it easy for anyone interested in VR technology to get a Rift and start pumping out content.

Hackers have taken things a step further and have written scripts that allow Unity to communicate with an Arduino. VR is fun. But VR plus physical reality is just down right exciting! In this article, we’re going to walk you through setting up your Oculus Rift and Unity game engine to communicate with the outside world via an Arduino.

Off the Shelf Options

If you head over to the Unity Asset page and run a search for Arduino, you get a few options. Sadly, searches for Raspberry Pi do not yield any fruit. There are a few generic serial communication options such as Simple Serial and SD Serial, but these options are not free and do not, at face value, appear to be well supported. Unidino looks promising, but it’s thirty bucks and there’s not much activity on the forum. The obvious choice to play around with on a rainy day is ARDunity. There’s a free version that still has plenty of capability to experiment with, and it’s well supported and documented.  It’s written in more of a WYSIWYG style that can be off-putting to coders, but it will have to suffice until someone bangs out more advanced version.

Getting Started

We’re assuming that you already have Arduino and Oculus setup on your PC. If you don’t have an Oculus Rift, we recommend to go to the Oculus site and install the software anyway. It will allow you to test the Unity/Arduino communication through the Oculus run-time even if you don’t have the hardware. This way when you do get a headset, you won’t have to do anything. Just execute the .exe and you’ll see your work in VR. Note that they used to prevent the software from installing on computers that did not meet the minimum requirements. Oculus has since toned down this nuisance, and now allows the software to be installed on most computers, including laptops!

Setting up Unity is straight forward – simply go to the site and download the installer. The latest version at the time of this article is 5.6.1. You’ll want to grab the personal version – it’s about five Gigabytes, so give it some time to download. Once installed, head over to the Oculus site and grab the Unity tools import package.

Open Unity and open a new project. Then head back to the Unity Asset store and install the ARDunity Basic Import package.  This will open Unity, and you should see a tab called Asset Store. Click on the tab and then import the package. Then go to Edit–>Project Settings–>Player and set the API compatibility level to .NET 2.0. This will clear the error you see in the bottom of the screen. Then under Other Settings, be sure to select the Virtual Reality Supported option.

Now import the Oculus package by going to Asset–>Import Package–>Custom Package and point towards the Oculus package you downloaded earlier. Restart the Unity program if needed.

Putting It All Together

At this point, everything should be set to get Unity talking to your Arduino through the Oculus Rift. Put an LED on D2 and note your comm port.  From the Project tab (lower left),  expand the folders ARDunity–>Examples–>LED–>Digital. Double click the last example – ReactingTrigger(DigitalLED).unity.

That will load the example. You should now see two cubes in the view window, and a new folder called ARDunity under the hierarchy tab on the top left. Click on ARDunity and you’ll see the inspector tab (far right) change to include a button that says “Export Sketch”. Hit the button and it will export the Arduino sketch to a place of

View of scene after opening LED example

your choosing. The .ccp and .h files will be generated automatically, along with some other dependencies. I shouldn’t have to tell you to have a look around, but don’t forget to compile and upload it after you’ve had your fill.

Just below the Export Sketch button will be the Comm Serial (Script) window. Search for and select the comm port for you Arduino. After you find your comm port, hit the little play button on top of the main scene window. Once you do this, you’ll see a “Connect” button appear where the Export Sketch was. Go ahead and connect. Now click on the Scene tab above the main viewing window. This will allow you to manipulate the cubes. Go ahead and grab the white cube and run it into the green one. If you did everything right, you’ll see your LED light when the two cubes collide.

The gears in your noggin should be turning right about now… if you can toggle IO from within a game engine; there is some seriously cool stuff you can do! But we’ve only scratched the surface. Let’s get this working in Virtual Reality!

Enter the Rift

In order to enter the virtual world, you need a couple of things. One is a character controller and the other is something to walk on. Hit the play button again if you haven’t already. This will disconnect everything and allow you to edit the world. Go to Game Object–>3D Object–>Plane and adjust the plane so the two cubes are hovering above it. Then un-collapse the ARDuino and expand the OVR folder to OVR–>Prefabs. Select the OVRPlayerController.prefab and drag it into the main hierarchy in the upper left. You’ll see the player controller appear in the main scene window. Drag it away from the cubes, and then under the inspector tab on the right hand side, de-select the Use Profile Data option in the OVR Player Controller (Script) section.

Now, select ARDuino under the hierarchy tab, press play and then connect. If you have an Oculus Rift connected, you should be able to put it on and run into the green cube and light the LED on the Arduino. If you don’t have one, just use the arrow keys to do the same.

Conclusion

So where can you go with this? The biggest thing that jumps out to us is haptic feedback. Imagine instead of a cube, you have a wall or table or something of that nature. Have the Arduino trigger some type of feedback when you touch or bump into the object.

Dig into the code and let us know of any bugs or improvements. Be sure to follow some other examples as well, and check out the video below for a demonstration. If you’ve done anything cool with Unity, show us in the comments.

 


Filed under: Arduino Hacks, Featured, Interest, Virtual Reality

If you were sad that Codebender had bit the dust, cheer up. A site called codeanywhere has acquired the online Arduino development environment and brought it back to life. In addition to the main Codebender site, the edu and blocks sites are also back on the air.

Not only is this great news, but it also makes sense. The codeanywhere site is a development IDE in the cloud for many different programming languages. The downside? Well, all the people who said they’d be glad to pay to keep Codebender alive will get a chance to put their money where their mouth is.

Here’s an excerpt from Codebender’s blog:

First of all, codebender will mostly remain the same. It will continue to operate as a standalone service, so you don’t have to change the way you are currently using codebender. However, it will transition to a monthly subscription service. This means that you will be able to use it for free for 1 month (as a trial, beginning on June 1st, or for the first month after registration), and it will then cost $10/month to keep using it. This is the price to pay for keeping codebender alive and sustainable, and it’s a small one, really.

Secondly, Codeanywhere intends to keep adding more and more features, the same way we have been adding features, libraries, and board support in the past few years. So you can expect codebender to keep improving with time, much as it did until now.

We have to wonder how many people will pay $120 / year to do something they can do for free. Mbed has support from ARM and offers a free IDE. Maybe a better deal with Codebender would have been with Atmel or Arduino. Not that we are opposed to charging for services, but we imagine a lot of people will just use free tools unless they have a strong use case for using a cloud-based service.

We covered Codebender’s short-lived demise back in October of last year.


Filed under: Arduino Hacks, news

[Jason Carlson]’s favorite game as kid was 1983’s Treasure of Tarmin by Intellivision, a maze game that eventually came to be called Minotaur. As an adult there was only one thing he could do: remake it on a beautiful Arduino-based handheld.

[Jason] built the handheld out of a small-footprint Arduino Mega clone, a 1.8” LCD from Adafruit, a 5 V booster, a 1” speaker and vibe motor for haptic feedback. There are some nice touches, like the joystick with a custom Sugru top and a surprisingly elegant 2 x AA battery holder — harvested from a Yamaha guitar.

The maze maps are all the same as the original game, which [Jason] found online, but he stored the maps as bytes in an array to speed up the game—there was a flicker in the refresh already. However he added a progress map so players could see every area that was explored. In addition to Minotaur [Jason] also added remakes of Tetris, Simon and Snake, simpler games he wrote to test out the hardware.

We’ve published a bunch of handheld gaming projects over the years, including putting a Pi Zero in a GameBoy, building a throwback handheld, and playing Ocarina of Time on a N64 handheld.


Filed under: Arduino Hacks

[Jason Carlson]’s favorite game as kid was 1983’s Treasure of Tarmin by Intellivision, a maze game that eventually came to be called Minotaur. As an adult there was only one thing he could do: remake it on a beautiful Arduino-based handheld.

[Jason] built the handheld out of a small-footprint Arduino Mega clone, a 1.8” LCD from Adafruit, a 5 V booster, a 1” speaker and vibe motor for haptic feedback. There are some nice touches, like the joystick with a custom Sugru top and a surprisingly elegant 2 x AA battery holder — harvested from a Yamaha guitar.

The maze maps are all the same as the original game, which [Jason] found online, but he stored the maps as bytes in an array to speed up the game—there was a flicker in the refresh already. However he added a progress map so players could see every area that was explored. In addition to Minotaur [Jason] also added remakes of Tetris, Simon and Snake, simpler games he wrote to test out the hardware.

We’ve published a bunch of handheld gaming projects over the years, including putting a Pi Zero in a GameBoy, building a throwback handheld, and playing Ocarina of Time on a N64 handheld.


Filed under: Arduino Hacks

Working with CAD programs involves focusing on the task at hand and keyboard shortcuts can be very handy. Most software packages allow the user to customize these shortcuts but eventually, certain complex key combination can become a distraction.

[awende] over at Sparkfun has created a Cherry MX Keyboard which incorporates all of the Autodesk Eagle Shortcuts to a single 4×4 matrix. The project exploits the Arduino Pro Mini’s ability to mimic an HID device over USB thereby enabling the DIY keyboard. Pushbuttons connected to the GPIOs are read by the Arduino and corresponding shortcut key presses are sent to the host machine.

Additional functionality is implemented using two rotary encoders and the Teensy encoder library. The first knob functions as a volume control with the push-button working as a mute button. The encoder is used to control the grid spacing and the embedded button is used to switch between imperial and metric units. The entire code, as well as the schematic, is available on GitHub for your hacking pleasure. It’s a polished project just ready for you to adapt.

The project can be extended to be used with other computer software such as Gimp and the keys may be replaced by capacitive touch sensors making it more sturdy. Bluetooth can be added to make things wireless and you can check out the Double Action Keyboard to extend functionality further.


Filed under: Arduino Hacks, peripherals hacks

The Arduino Wars officially ended last October, and the new Arduino-manufacturing company was registered in January 2017.  At the time, we were promised an Arduino Foundation that would care for the open-source IDE and code infrastructure in an open and community-serving manner, but we don’t have one yet. Is it conspiracy? Or foul play? Our advice: don’t fret. These things take time.

But on the other hand, the Arduino community wants to know what’s going on, and there’s apparently some real confusion out there about the state of play in Arduino-land, so we interviewed the principals, Massimo Banzi and Federico Musto, and asked them for a progress report.

The short version is that there are still two “Arduinos”: Arduino AG, a for-profit corporation, and the soon-to-be Arduino Foundation, a non-profit in charge of guiding and funding software and IDE development. The former was incorporated in January 2017, and the latter is still in progress but looks likely to incorporate before the summer is over.

Banzi, who is a shareholder of Arduino AG, is going to be the president of the Foundation, and Musto, AG’s CEO, is going to be on the executive board and both principals told us similar visions of incredible transparency and community-driven development. Banzi is, in fact, looking to get a draft version of the Foundation’s charter early, for comment by the community, before it gets chiseled in stone.

It’s far too early to tell just how independent the Foundation is going to be, or should be, of the company that sells the boards under the same name. Setting up the Foundation correctly is extremely important for the future of Arduino, and Banzi said to us in an interview that he wouldn’t take on the job of president unless it is done right. What the Arduino community doesn’t need right now is a Foundation fork.  Instead, they need our help, encouragement, and participation once the Foundation is established. Things look like they’re on track.

A Tale of Two Arduinos

Until late 2014, there were two “Arduinos”: Arduino LLC, which took on the task developing the IDE and guiding the community, and Smart Projects, which was the manufacturing arm of the project that incidentally owned the trademark on the name “Arduino”, at least in Europe. All legal heck broke loose in November 2014, when Smart Projects changed its name to Arduino SRL (an Italian form of limited-liability corporation) and stopped funneling profits back into Arduino LLC. Arduino LLC filed for a trademark in the US, and Arduino SRL countered the filing based on their EU trademark. Arduino LLC filed a lawsuit in the USA, which resulted in two years of uncertainty about which company was the “real” Arduino, confusion in retail channels, two websites, and two versions of the IDE. It wasn’t pretty.

In October 2016, the lawsuit was settled out of court. The settlement documents themselves are under a sort of non-disclosure agreement, and we were told that there are around 500 pages worth. But a very short version is that a new Arduino corporation (Arduino AG) would hold the trademark and rights to produce the boards, while the Arduino Foundation, a 501(c)(6) non-profit corporation would be established to develop the firmware and the IDE.

In a nearly Solomonic decision, Arduino AG is 51% owned by the previous owners of Arduino SRL, and 49% owned by the previous Arduino LLC principals. Federico Musto, the largest shareholder of SRL, is now Arduino AG’s CEO, and Massimo Banzi, the largest shareholder in LLC, is picked to be the Arduino Foundation’s president.

So there are still two “Arduinos”, but their incentives are now aligned instead of adversarial. Arduino AG owns the trademark, manufactures the boards, and makes the money. The Arduino Foundation will be funded by at least Arduino AG, but also by any other stake-holders in the Arduino ecosystem that wish to contribute. Arduino AG is now in a sense just a company that makes development boards, while the Arduino Foundation is in control of the rest of what makes Arduino “Arduino”: the non-tangible environment.

As a result, the community should care a lot about the Foundation. The choices made there will change your programming experience most directly, and if you’re interested in contributing code to the mainline distribution, the Foundation will be the gatekeeper — as much as there can be a gatekeeper in entirely open source software.

Progress, but Slow Progress

So why is setting up the Arduino Foundation taking so long? We’d claim it’s not, and that the signs from both parties indicate that it’s on the right track.

First of all, Musto and Banzi were in an existential fight over control of the ownership of “Arduino” for two of the last two-and-a-half years. As of January 2017, they became part owners of the Arduino AG holding company, but that doesn’t mean they instantly started getting along. It’s no surprise that there’s at least half a year’s worth of trust-building to do between the two.

Add to these personal issues that the Foundation was not the top (legal) priority. Banzi mentioned that, of the 500-page settlement, the Arduino Foundation was one of the last items on the list, and that the settlement wasn’t extremely detailed in that regard to begin with. So there was a lot of work to do, and it was put off until the prioritized stuff was out of the way. We were told that there’s no deadline in the settlement, and in reality, they haven’t been working on the Foundation for more than four months so far. Add in some time for lawyering, and IRS accreditation, and we would forgive them for taking until the end of 2017. Let’s hope it’s sooner.

Finally, both Banzi and Musto are very candid that this is the first Foundation that either of them have ever set up, and that it’s an important one. Nobody wants to get this wrong, and both are looking to other successful open-source Foundations for inspiration and guidance. Both mentioned the Linux and Mozilla foundations as models. This suggests that there’s going to be a mix of developer, user, and manufacturer interests all coming together. And it suggests that the founders are doing their due dilligence instead of just slapping something together.

The Signal, and the Noise

So what can we expect from the Arduino Foundation? Neither Banzi and Musto were able to guarantee anything specific, because they’re still under discussion. Still, there was a reassuring degree of overlap between what Banzi and Musto said. It sounds like they’re getting there.

If you’re interested in the future of the IDE, Banzi’s recent article on the near future is probably a good roadmap, and there’s a lot to like: separating the cross-platform code from the device-specific code (“Project Chainsaw”), and re-thinking the split between the high-level and low-level APIs sounds great to us. Adapting the Arduino pre-processor and toolchain to work with more modern workflows (clang on LLVM) is a huge win. Musto mentioned making the IDE more modular, so that any given part of it could be easily called by external code.

As for the organization itself, it’s likely that there will be an executive board, with half appointed by Musto and half by Banzi, that will run the show. In addition, Musto floated the idea of a few advisory boards, potentially split along lines of hardware manufacturers and firmware developers. He repeatedly said, as he was airing these possibilities, that it was up to Banzi as president to decide in the end. For his part, Banzi declined to speak on any specifics until they’d hammered the details out. In whatever form, we wouldn’t be surprised if representatives from Intel, ST, Nordic Semiconductor, and other chip manufacturers who make Arduino boards have a seat at the table. We’d also like to see the developer community pulled in and given a formal voice somehow.

Both Musto and Banzi seem committed to extreme transparency in the Foundation. Musto mentioned that the Foundation’s financials should be viewable online every month. Banzi is proposing to pre-release the Foundation’s charter. Musto is considering having Arduino AG donate to the Foundation in proportion to Arduino sales, and allowing the purchasers to earmark their portion of the donation toward a specific project as a form of radical democracy. Both Musto and Banzi said the word “open” more times than we could count in the interviews. Given Banzi’s history as an open source hardware pioneer, and Musto’s financial incentives to keep the Arduino train on the tracks, we have little reason to doubt their intentions.

Foundation Fork?

Meanwhile, Dale Dougherty, the founder of Make Magazine, wrote a piece in which he calls for a “Free Arduino” Foundation, where the Arduino community can jointly determine the future of the little blue boards and their programming environment. Half of the article consists of personal attacks on Federico Musto. Ironically, it was Musto himself who first proposed creating an Arduino Foundation as a neutral party in charge of the IDE, and as a means to funnel money back to the people contributing most to the ecosystem — the developers. Nowhere in the post does Dougherty mention Banzi’s role in the Foundation.

In addition to Dale Dougherty’s post on Make, Phil Torrone of Adafruit made a few posts last week that suggested, vaguely or otherwise, that the future of the IDE was being “steered off a cliff” or otherwise hijacked by the Foundation because of Musto’s participation. He interpreted Dougherty’s post as calling for a grassroots, developer-based Arduino Foundation.

We asked both Massimo Banzi and Federico Musto what they thought about the call for a Foundation fork. Neither of them had talked to Dougherty or Adafruit about the Foundation, and both felt blindsided by their accusations. Banzi was quite dismissive of the “Arduino is no longer open source” argument, stating that once code is out there with an open license, it can’t be taken back. If Arduino steers off a cliff, just roll back a few versions and fork. Banzi felt like the argument was insulting the last decade of his, along with the other early founders’, work. He would not comment on Dougherty’s article, saying instead that he’ll talk with him later.

The elephant in the room is Musto’s alleged fabrication of his previous academic credentials, which he has since retracted. It certainly does raise the question of whether he is trustworthy. But with Banzi still involved and slated to take the helm of the Foundation we see more reasons for hope in the future than not, or at least a reason to wait and see.

Is the Arduino Foundation run by insiders? Of course it is. Who other than Massimo Banzi would you appoint to run it? And you have to give the Arduino AG CEO a seat on the board, not the least because they own the trademark and the software needs to run on their hardware. Banzi and Musto display every sign of wanting to get it right: keeping it open, transparent, and responsive to both the community and industry.

Arduino’s code acceptance over the last twelve years hasn’t always been exactly transparent either, and many parts of the IDE could use a fresh coat of paint. It’s easy to idealize the past, but looking to the future, a Foundation which brings numerous and diverse stakeholders to the table can help refresh stale perspectives. Banzi’s roadmap for the IDE is solid. With some more good ideas, and money to back them up, the Foundation could be the best thing that’s ever happened to Arduino.


Filed under: Arduino Hacks, Current Events, Featured, news


  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook