What is The Cocomake?

The Cocomake is a low-cost board based on the ATtiny85 AVR chip. It has a special bootloader that allows it to show up as a USB device (keyboard, mouse, MIDI device). This is very handy, since the ATtiny85 does not have a real hardware serial port on it.

You can write and upload the code for the board using the Arduino IDE or use the online tool called Cocoblockly to create the code visually using a Scratch-like programming environment.

The Cocomake uses the QTouchADC library to get capacitive sensing working on the ATtiny with a minimal amount of external components needed. This means that you can attach all kinds of conductive things (coconuts and other food, metallic objects, conductive ink, conductive textiles etc.) to the board and use them as touch sensors.

Build the Cocomake Board

You should have the following parts (it is slightly different from the BOM on the Cocomake website) :

  • 1 x Cocomake PCB board (thank you Shreyasi for making these)
  • 1 x ATtiny85 microcontroller
  • 1 x 8-pin IC socket
  • 1 x USB connector
  • 1 x Potentiometer (100kΩ)
  • 2 x 3.6V Zener diodes
  • 2 x LED
  • 1 x 0.1µF capacitor
  • 2 x 68Ω resistor
  • 2 x 220Ω resistor
  • 1 x 1.5kΩ resistor

Solder the parts to the PCB, but do not place the ATtiny chip on the socket yet, we need to flash a bootloader on the chip before the board is usable. You will find instructions how to do this below.

Please note: The PCB we have has a small mistake and is missing a connection to ground for LED2. You can bend the other leg of the LED to touch the big ground copper plane on the board and solder it there. This might require you to hold the iron longer on the contact while soldering since the big ground plane dissipates more heat.

Install the Cocomake Board Definition Files and Library to the Arduino IDE

  1. Download and Install the Arduino IDE, if you have not done so already.
  2. Edit your Arduino preferences: Preferences -> Additional Board Manager URLs. Add the line below to the list:
  3. Open the Library Manager (Sketch->Include Library->Manage Libraries). Search for “coco” and update any libraries that have updates available.

Burn the Cocomake Bootloader on the ATtiny85

In order to get the ATtiny85 to show up as an USB device for on your computer, you need to burn the Cocomake bootloader on the board. You also need the bootloader in order to upload new code to the board using the Arduino IDE. We are going to use the Arduino Uno as the programmer. Check out the Arduino tutorial for more details.

  1. Upload the ArduinoISP example code to your Arduino Uno (File -> Examples -> ArduinoISP -> ArduinoISP)
  2. Connect the ATtiny85 to your Arduino Uno according to the image below. Make sure you add the capacitor between the RESET and GND of your Arduino.
  3. Select “Cocomake7” as the board from the Tools->Board menu in Arduino IDE
  4. Select “Arduino as ISP” from the Tools->Programmer menu
  5. Select Burn Bootlader from the Tools menu
  6. If all goes well, you should get a message in the console saying that the bootlader has been flashed to the device
  7. The board should now appear as a keyboard to your computer and a space character should be typed when you touch the contact point on the PCB.

How to Upload New Code to the Cocomake Board

The bootloader includes basic functionality for the board as a keyboard, but you can also write your own code for the Cocomake.

  1. Write your code
  2. Use the CocoTouch library for reading the sensor
  3. Use the CocoMidi, CocoKeyboard or CocoMouse libraries for sending the data to the computer
  4. Make sure your board is set to Cocomake in Tools->Board
  5. Upload your code (check the console for messages, you might be asked to reconnect your board)
  6. Use some other software on your computer to convert the messages from the board to something interesting