Thursday, December 25, 2014

Getting Started with Adafruit Trinket: 15 Projects with the Low-Cost AVR ATtiny85 Board

Getting Started with Adafruit Trinket: 15 Projects with the Low-Cost AVR ATtiny85 Board

Arduino's ubiquity and simplicity has led to a gigantic surge in the use of microcontrollers to build programmable electronics project. Despite the low cost of Arduino, you're still committing about $30 worth of hardware every time you build a project that has an Arduino inside. This is where Adafruit's Trinket comes in. Arduino-compatible, one-third the price, and low-power, the Trinket lets you make inexpensive and powerful programmable electronic projects. Written by one of the authors of Adafruit's Trinket documentation, Getting Started with Trinket gets you up and running quickly with this board, and gives you some great projects to inspire your own creations.

Building Open Source Hardware: DIY Manufacturing for Hackers and Makers

Building Open Source Hardware: DIY Manufacturing for Hackers and Makers

This is the first hands-on guide to the entire process of designing and manufacturing open source hardware. Drawing on extensive personal experience with DIY, maker, and hardware hacking projects, industry-leading contributors share proven approaches to design, remixing, fabrication, manufacturing, troubleshooting, licensing, documentation, and running an open source hardware business.

Part I covers the emergence and evolution of open source hardware, what open source hardware licenses mean, and the growing role of standards in making hardware more open. Part II offers contributors’ expert advice on key tasks, ranging from creating derivatives to using source files. Part III turns to production, showing how to manufacture at multiple scales–from personal to commercial.

Appendixes provide valuable checklists for design, manufacture, security, and documentation. And to foster even more hands-on learning and experimentation, the low-cost Blinky Buildings open source hardware kit is used as an example throughout.

Learn how to
  • Get involved in the open source hardware community–its history and values
  • Develop designs you can successfully prototype and manufacture
  • Walk step by step through making derivatives from existing projects
  • Build open source 3D printers, and remix 3D printable objects
  • Create open source wearables
  • Work with diverse source files, from electronics to other physical materials
  • Fabricate your own designs
  • Move from prototype to commercial manufacturing, and troubleshoot problems
  • Choose a business model and build a profitable open source hardware company
  • Avoid pitfalls associated with trademarks, copyrights, patents, and licensing
  • Write documentation other hardware hackers can use
  • Use open source hardware in education, helping students learn without boundaries

Raspberry Pi + Arduino i2c communication, write block and read byte

In this example Raspbery Pi (programmed with Python) is connected with Arduino Uno via I2C. The Raspberry Pi act as i2c master, and Arduino act as i2c slave. Raspberry Pi send block of data to Arduino, and read byte echo from Arduino.

Read my another blog for the source code:

Monday, December 22, 2014

Generate sin wave on Arduino Due

Example to generate sin wave on DAC pin of Arduino Due.

#define maxSamplesNum 120

static int sinwave[maxSamplesNum] = {
  0x7ff, 0x86a, 0x8d5, 0x93f, 0x9a9, 0xa11, 0xa78, 0xadd, 0xb40, 0xba1,
  0xbff, 0xc5a, 0xcb2, 0xd08, 0xd59, 0xda7, 0xdf1, 0xe36, 0xe77, 0xeb4,
  0xeec, 0xf1f, 0xf4d, 0xf77, 0xf9a, 0xfb9, 0xfd2, 0xfe5, 0xff3, 0xffc,
  0xfff, 0xffc, 0xff3, 0xfe5, 0xfd2, 0xfb9, 0xf9a, 0xf77, 0xf4d, 0xf1f,
  0xeec, 0xeb4, 0xe77, 0xe36, 0xdf1, 0xda7, 0xd59, 0xd08, 0xcb2, 0xc5a,
  0xbff, 0xba1, 0xb40, 0xadd, 0xa78, 0xa11, 0x9a9, 0x93f, 0x8d5, 0x86a,
  0x7ff, 0x794, 0x729, 0x6bf, 0x655, 0x5ed, 0x586, 0x521, 0x4be, 0x45d,
  0x3ff, 0x3a4, 0x34c, 0x2f6, 0x2a5, 0x257, 0x20d, 0x1c8, 0x187, 0x14a,
  0x112, 0xdf, 0xb1, 0x87, 0x64, 0x45, 0x2c, 0x19, 0xb, 0x2,
  0x0, 0x2, 0xb, 0x19, 0x2c, 0x45, 0x64, 0x87, 0xb1, 0xdf,
  0x112, 0x14a, 0x187, 0x1c8, 0x20d, 0x257, 0x2a5, 0x2f6, 0x34c, 0x3a4,
  0x3ff, 0x45d, 0x4be, 0x521, 0x586, 0x5ed, 0x655, 0x6bf, 0x729, 0x794

int i = 0;

void setup() {

void loop() {
  if(i == maxSamplesNum)
    i = 0;
  analogWrite(DAC1, sinwave[i]);

Sunday, December 21, 2014

Assemble, test, align and power-up DSO138, Open-sourced Oscilloscope DIY kit

Just purchased a Open-source Oscilloscope DIY kit DSO138, with surface mount components soldered. Here how I assembled it in 2 hours.

After assembled, check voltage on TP22. Make sure it is arround 3.3V. Then short JP4 and install LCD module.

Notice: This video recorded after my final tested, so JP4 have been shorted at beginning. Actually, you have to keep it open after 3.3V on TP22 confirmed.

After the kit worked, align the 0V line and calibrate the probe.

For details and update of the DSO 138 DIY Kit, read Users Manual on the website.

Tested with Arduino Due generated sin wave.

Tuesday, December 16, 2014

Sunday, December 14, 2014

Saturday, December 13, 2014

Experimenting with AVR Microcontrollers

Experimenting with AVR Microcontrollers

AVR is the brain that runs Arduino, but you don't need the whole Arduino board to do fun projects. Experimenting with AVR Microcontrollers, from Practical AVR Microcontrollers, shows you how to create a spiffy set of projects that you can build to learn more about electronics, about AVR, and just to generate new ideas for your own projects.

Alan Trevennor will show you how to create a secret panel project, a gadget to drive your pets crazy, a hallway lighting system, and even a small home automation network.

What you’ll learn
  • How to create an illuminated secret panel
  • How to create visual effects with AVR
  • How to create a waterfall-like lighting system
  • How to set up a small home automation network
Who this book is for
Electronics hobbyists, Arduino fans, and any maker who wants to try some fun ideas with AVR.

Table of Contents
1. Good Evening, Mr. Bond! Your Secret Panel
2. Here Kitty, Kitty: Rainbow Beams to Drive Your Pets Crazy
3. WordDune: How Much Do You Really See?
4. A Waterfall of Lights: The Passageway Lighting System
5. Moving to Mesmerize: Small Projects with Nifty Effects
6. Home Automation: Small Projects using CAN Bus Controller Area Networks

Wednesday, December 10, 2014

Open-sourced DSO (Digital Storage Oscilloscope) DIY kit - DSO138

Interesting open-sourced digital oscilloscope DIY kit, DSO138, think about buying one. But I can't find the source in the web-site, and instruction to flash the firmware!

DSO138 was designed as a training oscilloscope kit. It contains only the basical oscilloscope functions with no fancy features. Simplicity in structure and easiness in assembly/operation are among the main targets of the design. For these purpose DSO138 uses mostly through-hole parts. The heart of DSO138 is a Cortex-M3 ARM processor (STM32F103C8) from ST. It uses 2.4-inch TFT LCD (320 X 240 dotmatrix, 262K colors) as its display element and displays nice and clear waveforms. Detailed assembly instructions are provided in combination with troubleshooting guide and schematc. Source codes are also available to allow user to add their own features.

DSO138 kits are solded in two configurations. One is with all SMD parts pre-soldered (PN: 13801K). The other is with only the main IC (the MCU) pre-soldered (PN: 13802K). The latter serves also as a SMD soldering training kit. For both configurations the MCU has been pre-programmed and no re-programming required.

DSO138 is partially open-sourced. This opens the possibility for users to add different features or develop new applications on the hardware.

Major features of DSO138: 
  • Analog bandwidth: 0 - 200KHz
  • Sampling rate: 1Msps max
  • Sensitivity: 10mV/Div - 5V/Div
  • Sensitivity error: < 5%
  • Vertical resolution: 12-bit
  • Timebase: 10us/Div - 500s/Div
  • Record length: 1024 points
  • Built-in 1KHz/3.3V test signal
  • Waveform frozen (HOLD) function available

Finally I bought my own DSO138 kit, read Assemble, test, align and power-up DSO138, Open-sourced Oscilloscope DIY kit.

Monday, December 8, 2014

Program Arduino Pro Mini with USB-to-Serial adapter

This is a good video tutorial for programming (or flash) Arduino Pro Mini with USB-to-Serial adapter. Using 3 different USB to Serial modules to program a clone Arduino Pro Mini. The chips are the FTDI FT232RL, the Silicon Labs CP2102 and the Prolific Technologies PL2032HX.

HC-05 Serial Port Bluetooth Module (Master/Slave)

HC-05 module is an easy to use Bluetooth SPP (Serial Port Protocol) module, designed for transparent wireless serial connection setup.

Serial port Bluetooth module is fully qualified Bluetooth V2.0+EDR (Enhanced Data Rate) 3Mbps Modulation with complete 2.4GHz radio transceiver and baseband. It uses CSR Bluecore 04-External single chip Bluetooth system with CMOS technology and with AFH(Adaptive Frequency Hopping Feature). It has the footprint as small as 12.7mmx27mm. Hope it will simplify your overall design/development cycle.

Sunday, December 7, 2014

Arduino ISP

The Arduino ISP ( is a tiny AVR-ISP (in-system programmer) based on David Mellis' project FabISP ( With this programmer you can upload sketches and burn the bootloader on any AVR based boards, including Arduinos. By uploading a sketch with an external programmer you can remove the bootloader and use the extra space for your sketch. The Arduino ISP can also be used to burn the Arduino bootloader, so you can recover your chip if you accidentally corrupt the bootloader. Burning the bootloader is also necessary when you use a new ATmega microcontroller in your Arduino, and you wish to use the bootloader to upload a sketch via the USB-Serial connection.

For more details about using the Arduino ISP please visit the Getting Started page.