Close
0%
0%

Skeleton Attiny85 Handheld

I2C OLED connected to an Attiny85 and a Charlie-plexed button matrix

Similar projects worth following
The most minimal handheld I could think of. 6 buttons that will probably do weird stuff, when you press more than one. Coin cell powered, I saw people use the oled and an attiny on a coin cell before. Never had an OLED on an Attiny85 before, so that was a good project for it. Always loved to look at the free form soldered things.

Realtalk: I thought I'd probably send an idea in, grab some likes and then forget to actually build it :D Not this time though - I was determined to build this and make it work. I still need to show that the buttons work and replace the oled, because it's broken. 

It was important to me that you can see all the "air wires" and that they not hide behind parts - except for the battery holder I managed to do exactly that. Otherwise I could have made it a bit more compact. 

I'm also a cheap person, so I didn't solder in an Attiny85 but a DIP socket. That also helped with programming and testing it, without attaching any debug wires.

I like handhelds - but actually not like to game that often. It's just the thing itself that fascinates me. 

Adobe Portable Document Format - 16.03 kB - 12/24/2018 at 13:05

Preview
Download

  • Conclusion

    davedarko01/08/2019 at 21:15 4 comments

    At one point I had a thought that I could vary the time between asking the charlieplexed buttons and add a piezo buzzer to one pin to get some noises out of the little handheld. But then you would have to have sound all the time, because you want to scan the buttons as well.

    It would make much more sense to have the buttons connected via a bunch of resistors to the ADC, so you get free pins and a way to add a buzzer. The project I named in an earlier log is a way better basis to do so. 

    It was fun to solder up the prototype and build a charlieplexed "keyboard" for the first time, but programming a game for it wasn't really on the time table sadly. I enjoyed the positive feedback from everyone on social media though and might think of something at a later point. Thanks for having this contest, hackaday people!

    Hehe... just noticed the countdown said "since" and not "until". Anyways, nice to add some thoughts afterwards then!

  • Working with the charlieplexed buttons

    davedarko01/08/2019 at 21:08 0 comments

    I admit it was a bit trial and error development, but it worked out in the end.

    #define pin_1 1
    #define pin_2 4
    #define pin_3 3
    
    #define B_UP 0
    #define B_DN 1
    #define B_LF 2
    #define B_RT 3
    #define B_A 4
    #define B_B 5
    
    boolean pinChanged = false;
    uint8_t pinstate = 0;
    uint8_t pins[3] = { pin_1, pin_2, pin_3 };
    uint8_t switches[6][2] =
    {
      { pin_2, pin_1 },
      { pin_1, pin_3 },
      { pin_3, pin_1 },
      { pin_1, pin_2 },
      { pin_3, pin_2 },
      { pin_2, pin_3 }
    };
    
    
    
    void setup()
    {
    }
    
    void loop()
    {
      if (pinChanged)
      {
        pinChanged = false;
        if (pinstate & (1 << B_UP))
        { 
        }
    
        if (pinstate & (1 << B_DN))
        {
        }
        
        if (pinstate & (1 << B_LF))
        {
        }
        
        if (pinstate & (1 << B_RT))
        {
        }
        
        if (pinstate & (1 << B_A))
        {
        }
        
        if (pinstate & (1 << B_B))
        {
        }
      }
    
      for (uint8_t i = 0; i < 6; i++)
      {
        deactivate_all();
    
        // set pin states for button
        pinMode(switches[i][0], INPUT_PULLUP);
        pinMode(switches[i][1], OUTPUT);
        digitalWrite(switches[i][1], LOW);
    
    
        if (pinstate & (1 << i))
        {
          if (digitalRead(switches[i][0]) == HIGH)
          {
            pinstate &= ~(1 << i);
            pinChanged = true;
          }
        }
        else
        {
          if (digitalRead(switches[i][0]) == LOW)
          {
            pinstate |= (1 << i);
            pinChanged = true;
          }
        }
      }
    }
    
    void deactivate_all()
    {
      for (uint8_t i = 0; i < 3; i++)
      {
        pinMode(pins[i], OUTPUT);
        digitalWrite(pins[i], HIGH);
      }
    }

  • Making the Attiny85 work with OLED in Arduino

    davedarko12/23/2018 at 13:40 0 comments

    You need this to make the Arduino IDE be able to flash ATTINY based boards

    https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json

    And this worked for me when trying to make the OLED run

    https://www.instructables.com/id/ATTiny85-connects-to-I2C-OLED-display-Great-Things/

  • so it begins

    davedarko12/11/2018 at 12:38 0 comments

    nice start so far :) I will try to port the games from @Daniel Champagne for the #Tiny Joypad by @megazoid to this handheld, because I made the buttons work yesterday! With a trick I might be able to add some sound, but not like them. I really enjoy their take on the attiny85 handheld and the 3D printed case with a swappable / rotating display.

    The broken OLED is replaced, I've added some more of the threads that I made stronger with the help of liquid super glue! The tweet that I almost deleted because I feared spamming people got pretty crazy in comparison of my usual tweets.

    https://twitter.com/davedarko/status/1072076882957484033

View all 4 project logs

Enjoy this project?

Share

Discussions

CooperRC wrote 6 hours ago point

Saya ingin sekali menjadi seorang HACKER

  Are you sure? yes | no

Xasin wrote 12 hours ago point

I'm really sorry to hear that this project didn't even get mentioned. It's really creative to use such a small microcontroller to do so much, and it's even cooler to see it all without a PCB and just well placed wires!
Even if you didn't get the contest, you got me interested in making these types of devices. I hope that counts as some sort of success for you.

In any case, keep up the good work, and don't be discouraged by this :c

  Are you sure? yes | no

davedarko wrote 10 hours ago point

Thank you! I think winter got to me a bit. I still received a lot of of positive feedback for this projects and learned something / did something I haven't done before (wire frames and charlieplexed buttons). That's something that should be more important than winning. Also thank you for writing that it sparked your interest, that's valuable to me, too!

  Are you sure? yes | no

Xasin wrote 9 hours ago point

Your Charlyplexed buttons certainly are something I haven't seen before! And I have a feeling they could be very helpful with ESP32 projects, their chips sadly don't have many IO pins. I was thinking about building a smart little DSKY replica based on the chip and am still not sure how to handle the keyboard.

  Are you sure? yes | no

davedarko wrote 7 hours ago point

@Xasin I would suggest using IO expander for that, makes it easier to switch MCUs as well, just connect the panel over I2C or SPI then.

  Are you sure? yes | no

Xasin wrote 7 hours ago point

That was the idea, yeah.
I wanted to build a "portable", miniature version of the DSKY with protected connections for UART, I2C, SPI, maybe CAN, and use it as a sort of retro-style debugger. The ESP32 as MCU would be soldered on, so I won't be changing the MCU.

I wanted to use WS2811 for the 14-segment displays, and then maybe an I2C I/O expander for buttons :>

  Are you sure? yes | no

Sophi Kravitz wrote a day ago point

This is really well done, congrats for finishing (I guess that's what a log called conclusion means). I love the gallery! More pics and a video?? <3

  Are you sure? yes | no

davedarko wrote a day ago point

There was no log rule posted. But I was an hour late to finish writing something about a project I considered PoC days before deadline

  Are you sure? yes | no

davedarko wrote a day ago point

I'm just grumpy with myself that I didn't took the time to write another log earlier. When I finally did I checked the countdown and thought I had another hour - but then noticed it was already an hour over. Then I looked for the famous 3-log rule and it really isn't there, but also see that everyone else winning deserved that. So I'm pretty disappointed by myself and this thing that reminds me of that - probably gonna leave it in it's box and never take another look at it. 

Also it's winter here. Meh.

  Are you sure? yes | no

morgan wrote a day ago point

Yeah, I'm in the same boat, I took so long building that I ran out of time on a write up and better pictures.

  Are you sure? yes | no

davedarko wrote a day ago point

I guess likes aren't everything :/

  Are you sure? yes | no

ꝺeshipu wrote 21 hours ago point

Let's face it, you had very fierce competition there!

  Are you sure? yes | no

davedarko wrote 21 hours ago point

no argument there - really. I'm just surprised since the feedback overall was very positive. Got me +1k likes on twitter and all. Seems like I was knocked out because of the log rule that I can't find - which would annoy me, since I could have written everything earlier and more. Just didn't took the time and was busy with other things.

  Are you sure? yes | no

davedarko wrote 20 hours ago point

I know I sound like all the whiny nonwinners from the price. But I came from 1k tweet + like leader down to not even a mention on the blogpost. I'm just disappointed and surprised by that hard crash. And its winter here. Meh.

  Are you sure? yes | no

Jeffrey Jacques wrote 19 hours ago point

You're not the only one disappointed. Several projects got featured multiple times and the article just seems lazy/short when #badgelife gets a 4 part tome... Some of the entries are really good and deserved a win but a lot I'd chalk up to subjective taste. My entry got featured on hackster's insta and got lots of likes but not even a mention here, so not gonna sweat it. If there's some unwritten log entry rule the editors should really be upfront about it.

  Are you sure? yes | no

davedarko wrote 12 hours ago point

You had one of my favorite projects for this contest :/ I think you might got kicked because of that 3 log rule that wasn't defined for the contest, but kind of is an unwritten rule at this point, since it was given in every other contest. 

Let's stay positive though, otherwise this will become an even suckier winter :D

  Are you sure? yes | no

Jan wrote 12 hours ago point

Man, I really hoped your project will make it. Everything seemed like it would. Can totally undertand your dissapointment!

  Are you sure? yes | no

davedarko wrote 12 hours ago point

thank you

  Are you sure? yes | no

Elliot Williams wrote 12/14/2018 at 13:58 point

1) Awesome!

2) Moar dimensions!

  Are you sure? yes | no

Tillo wrote 12/13/2018 at 20:32 point

A beautiful project, as always.

  Are you sure? yes | no

Peter wrote 12/13/2018 at 01:39 point

Very cool project and wonderfully executed.

  Are you sure? yes | no

davedarko wrote 12/13/2018 at 12:23 point

thank you very much!

  Are you sure? yes | no

Florian wrote 12/12/2018 at 09:02 point

Hey Dave, it looks so pretty ;) Can you upload some details (like source, circuit diagram) on github? I want to build it, too.  Very nice work. Thank you for sharing.

  Are you sure? yes | no

Daniel Rojas wrote 12/12/2018 at 17:58 point

if the schematic does not mirror the layout of the wires I will be severely disappointed :)

  Are you sure? yes | no

davedarko wrote 12/12/2018 at 19:46 point

hehe, thanks! It might be better to try that with the #Tiny Joypad  project instead, because they have sound and games going already. It looks like the part count is almost the same. 
I will definitely share schematics (technically @Daniel Rojas is right :D)  of this build and the code to make it work in the coming days! 

  Are you sure? yes | no

Jan wrote 12/12/2018 at 20:08 point

Ha, why bother? The schematic is right in the picture!

  Are you sure? yes | no

Florian wrote 12/12/2018 at 21:37 point

Thank you. I know that the schematic is already right in the picture but i was confused about the transistor on the left side. A second thing, i dont know the size of the resistor at the attiny.

  Are you sure? yes | no

davedarko wrote 12/13/2018 at 00:16 point

there's not really a transistor. Top left is the on off switch, there's an OLED display, a 10k pullup resistor for the reset pin of the attiny85. Then 6 diodes and six buttons and one battery holder :) there are two "jumpers", where I've bend the wire above another. I wanted all the wires to be visible from the top, nothing is hidden behind a part.

  Are you sure? yes | no

davedarko wrote 12/24/2018 at 13:11 point

Hey @Florian - I've added some schematics in image and pdf form

  Are you sure? yes | no

Florian wrote 12/24/2018 at 13:48 point

Thank you very much and merry christmas.

  Are you sure? yes | no

Mike Szczys wrote 12/10/2018 at 19:11 point

So beautiful. I'd bend this think like crazy with my button mashing!

It would be a really fun project to encapsulate in clear resin.

  Are you sure? yes | no

davedarko wrote 12/10/2018 at 19:28 point

Thanks :) I might do the resin treatment at one point, but I it's tricky to not end up with buttons and switches full of resin, right? thought about partially having it in resin... don't know. I'm happy that I found a way to stabilise the frame with thread dipped in liquid super glue :)

  Are you sure? yes | no

Jarrett wrote 12/10/2018 at 20:08 point

That just sounds like another problem to be worked out :)

Maybe do it in two stages - Tape up the side of the switches and then use viscous resin around it. Then let it cure, and resin up the rest.

  Are you sure? yes | no

ꝺeshipu wrote 12/10/2018 at 20:28 point

I think you could cover the buttons in butter, or something similar, and wash it out after encapsulating.

  Are you sure? yes | no

Morning.Star wrote 12/11/2018 at 07:58 point

Peelable solder mask, Dave. Just paint the tops of the buttons and sockets etc, wipe the sides and fill to it. Pick the rubber back out with tweezers and trim. ;-)
IMO definitely worth taking the time to make it sturdy, its beautiful. :-)

  Are you sure? yes | no

Dr. Cockroach wrote 12/09/2018 at 19:21 point

Ahhh, my kind of wiring. Looking good :-)

  Are you sure? yes | no

davedarko wrote 12/09/2018 at 21:51 point

thanks :) 

  Are you sure? yes | no

Morning.Star wrote 12/08/2018 at 15:15 point

Are you deadbugging that Dave?

It sure looks that way... :-D

  Are you sure? yes | no

davedarko wrote 12/08/2018 at 16:35 point

well that's what the circuit sculpture contest is about ;)

  Are you sure? yes | no

Morning.Star wrote 12/10/2018 at 07:11 point

Nice build dude, very tidy :-)

Loving that copper wire :-D

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates