Posts | Comments

Planet Arduino

Archive for the ‘attiny’ Category

Ott
22

Turn a PC on with a Knock and an ATTiny

arduino hacks, attiny, ATTiny45, computer hacks, knock, microcontrollers, piezoelectric Commenti disabilitati su Turn a PC on with a Knock and an ATTiny 

knockAttiny

Pressing the power button on your computer usually isn’t too much trouble, unless your computer is stored away somewhere hard to reach. [Joonas] has been hard at work on a solution that would also impress his friends, building a knock sensor to turn on his PC.

For around $10 in parts he put together an ATTiny45 that emulates a PS/2 device, which takes advantage of his computer’s ability to boot upon receiving PS/2 input. The build uses a Piezo buzzer and a 1M Ohm resistor as a knock sensor exactly as the official Arduino tutorial demonstrates, and one of those PS/2-to-USB adapters that are most likely lurking in the back corner of every drawer in your office.

[Joonas] used AVRweb to disable the 8X clock divider so there’d be enough clock cycles for PS/2 communication, then loaded some test code to make sure the vibrations were being detected correctly. You can check out his Github for the final code here, and stick around after the break for a quick video demo. Then check out a similar hack with [Mathieu's] home automation knock sensor.

https://www.youtube.com/watch?v=FTVppOZquE8


Filed under: Arduino Hacks, computer hacks, Microcontrollers
Set
16

The TinyLoadr Shield Programs AVRs From Your Arduino

arduino, attiny, AVR, Electronics, General, microcontrollers, shield Commenti disabilitati su The TinyLoadr Shield Programs AVRs From Your Arduino 

IMG_2974Turn your Arduino into an AVR programmer with the TinyLoadr Shield! Jeff Murchison's shield makes shrinking Arduino projects easier and more efficient.

Read more on MAKE

Ago
10

BareDuino micro

arduino, ATmega328P, attiny, ATTiny45, ATTINY85, Mcu Commenti disabilitati su BareDuino micro 

dingetje-600x400

Niek designed this BareDuino micro, that is available at github:

For some Arduino projects, you don’t actually need that many IO pins. That’s exactly the case when I tried to build a simple RGB throwie that would cycle through colours. I was looking for a cheaper alternative to the Arduino UNO’s ATmega328P when I stumbled across this post by MIT’s High-Low Tech lab. They developed a library for programming the 8-pins ATtiny45/85 from the Arduino IDE. It’s a very smart solution to use permanently in some low pin-usage projects, but you still need to hook up individual wires from your programmer to the ATtiny to be able to program it. That’s when I came up with the idea of the BareDuino Micro.

[via]

BareDuino micro - [Link]

Lug
26

ATtiny programmer using Arduino ISP

arduino, ATmega328, attiny, ATTiny45, ATTINY85, avrdude, DASA, isp, Mcu, USBtinyISP Commenti disabilitati su ATtiny programmer using Arduino ISP 

F2AY9GVGZ0MMEBD.LARGE

JeonLab @ instructables.com writes:

For relatively small (less number of pins than ATmega328) projects, ATtiny series, ATtiny45 or Attiny85 are good choice in terms of its physical size (8-DIP or 8-SOIC) and low power consumption. There are many ways to program it. One of the popular device is USBtinyISP and DASA. Both of them work very well with WinAVR (AVRdude).

ATtiny programmer using Arduino ISP - [Link]

Nov
05

Beginner project: Color Sensing with RGB LEDs and a photocell

arduino hacks, attiny, led hacks, RGB Commenti disabilitati su Beginner project: Color Sensing with RGB LEDs and a photocell 

I’ve seen the concept art for “real world eyedroppers” several times. I haven’t noticed any of the products come to market though. It isn’t the technology stoping them, color sampling can be done a million ways. I picked one of the easiest ways and tossed something together pretty quickly.

The method I chose is outlined in fantastic detail by [Fjordcarver] on instructibles. I took his project and used the Teensy2 instead of an arduino as well as seperate red, blue, and green LEDs since I had some lying around. He includes the schematic to do exactly that, so again, credit goes to him. [Fjordcarver] also made a processing sketch to display the colors. I wanted to actually use this, so I added a tiny feature where any keystroke will copy the hexidecimal color to the clipboard. This way I can just leave the “eyedropper” running and sample things whenever I want.

IMG_0590 IMG_0592 IMG_0593 IMG_0594 IMG_0595 IMG_0597 IMG_0598 fjordcarvers_schem


import processing.serial.*;
import java.awt.datatransfer.*;
import java.awt.Toolkit;

String buff = "";
int val = 0;
int wRed, wGreen, wBlue;
String col = "ffffff";
ClipHelper cp = new ClipHelper();

Serial port;

void setup(){

size(200,200);
 port = new Serial(this, "COM3", 9600); //remember to replace COM20 with the appropriate serial port on your computer
}

void draw(){
 background(wRed,wGreen,wBlue);
 // check for serial, and process
 while (port.available() > 0) {
 serialEvent(port.read());
 }
}

void keyPressed() { cp.copyString(""+col); }
void serialEvent(int serial) {

if(serial != '\n') {
 buff += char(serial);
 }
 else {
 int cRed = buff.indexOf("R");
 int cGreen = buff.indexOf("G");
 int cBlue = buff.indexOf("B");

if(cRed >=0){
 String val = buff.substring(cRed+3);
 wRed = Integer.parseInt(val.trim());
 }
 if(cGreen >=0){
 String val = buff.substring(cGreen+3);
 wGreen = Integer.parseInt(val.trim());
 }
 if(cBlue >=0){
 String val = buff.substring(cBlue+3);
 wBlue = Integer.parseInt(val.trim());
 }
 col = hex(color(wRed, wGreen, wBlue), 6);
 buff = "";
 }

}

// CLIPHELPER OBJECT CLASS:

class ClipHelper {
 Clipboard clipboard;

 ClipHelper() {
 getClipboard();
 }

 void getClipboard () {
 // this is our simple thread that grabs the clipboard
 Thread clipThread = new Thread() {
 public void run() {
 clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
 }
 };

 // start the thread as a daemon thread and wait for it to die
 if (clipboard == null) {
 try {
 clipThread.setDaemon(true);
 clipThread.start();
 clipThread.join();
 }
 catch (Exception e) {}
 }
 }

 void copyString (String data) {
 copyTransferableObject(new StringSelection(data));
 }

 void copyTransferableObject (Transferable contents) {
 getClipboard();
 clipboard.setContents(contents, null);
 }

 String pasteString () {
 String data = null;
 try {
 data = (String)pasteObject(DataFlavor.stringFlavor);
 }
 catch (Exception e) {
 System.err.println("Error getting String from clipboard: " + e);
 }
 return data;
 }

 Object pasteObject (DataFlavor flavor)
 throws UnsupportedFlavorException, IOException
 {
 Object obj = null;
 getClipboard();

 Transferable content = clipboard.getContents(null);
 if (content != null)
 obj = content.getTransferData(flavor);

 return obj;
 }
}


Filed under: arduino hacks, led hacks


  • 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