Arduboy Sculpture [RIP]


(Kevin) #21

If you post something up I’ll try to use it!

This is the function I used on the original Arduboy for detecting button presses:

https://playground.arduino.cc/Code/CapacitiveSensor


#22

Hi, I’ll need some more context. I understand you are putting together an Arduboy without PCB. From the lack of details in this thread can I assume your intent is to turn each button into a (two states ON/OFF) touch sensor i.e. using the same pins as currently used by the Arduboy?


(Kevin) #23

Yeah the plan is to use the current GPIO and just not have a mechanical button, just a bare wire (soldered to a piece of copper).

The library I linked charges the internal capacitor on the gpio pin and then counts in individual processor cycles how long it takes for the charge to dissipate. I remember having to tune the library I think but if it takes more than 3 or 4 cycles then it counts as a button press.

It should be mostly as easy as swapping this function out for the current button check routine in the library. I haven’t had a chance to dig into this yet, I’m busy doing lots of last minute shipping for the holidays right now.


(Shawn) #24

If every button is a cap sensor it might be difficult to hold it without setting off random buttons unless the sensitivity is made very low to prevent false positives. It might even be necessary to put a grounding plate behind each button wire to localize the sensitivity. I’ve made cap sensors using a similar method in the past but never without a breadboard or pcb substrate, it’ll be interesting how it will work freestanding.


#25

That’s my concern too. Detecting touch as shown in the linked article is possible but doing so reliably with low rates of false positives/negatives may not be as simple as swapping out current button press code with the one from https://playground.arduino.cc/Code/CapacitiveSensor.

I’ll post a message here after updating the code.


(Kevin) #26

The library only functions on direct contact with a conductor. It’s not sensitive enough to detect anything else. I was unable to get it to even function through the silkscreen.


(Shawn) #27

Interesting, I coded something similar ages ago for pic micros that could detect your hand up to a good 6 inches away. The problem was it needed to be manually calibrated for each sensor. I intended to add an auto calibration routine but never got around to it as it wasn’t high on my priority list.


#28

First attempt is here: https://github.com/dxxb/Arduboy2/commit/c6062491cf6872cf4d4705ef6aeab3f1b54bb903

(in branch captouch_btns of my Arduboy2 library fork, note that the branch is otherwise identical to upstream’s master branch)

You can edit this #define BTN_ON_CAP_DELAY_THRESHOLD (3) line to change the threshold. No “debouncing” is implemented at this stage. Beware: this code compiles but is untested.


(Kevin) #29

Quality, let me rip apart an Arduboy and take the snapdome stickers off and see if it works. Someone with a home made unit handy might be able to check this out too.

UPDATE: It works. Thank you @dxb

Latest challenge, how to do the damn power switch. I might have to make code that auto-sleeps and wakes up every few seconds to check if the buttons are pressed. Should I put a bounty out on the auto-sleep routine?

Actually since the battery will be hard wired to the chip, even if I went with “its only on when it’s charged, and you can’t turn it off” then theoretically the battery could continue to be drained from the voltage pump in the OLED. The chip should be protected by its low voltage cutoff, but the screen does really weird things when it’s out of spec.

I had actually developed an ability to use a hardware interrupt pin and balanced it with a 1M ohm resistor to the skin and had a voltage pad so you could pinch your fingers to complete the circuit. But I really don’t want to craft that up again. I might have to.

It just hit me, it’s a little hacky but I could just make 2 external contact points that I connect from the outside with a bit of copper tape or maybe some conductive ink, when im done just take it off. That’s probably what’s happening here.


(Scott R) #30

Sleeps done I did it in tamaguino and @Mr.Blinky did it better.

I’ll dig out the links.

Edit:
You cold do a magnetic switch


(Kevin) #31

ooo embed a little reed switch mmmmmm


(Scott R) #32

You can also add battery monitor and powerdown before the screen gets funky, again I did it but @Mr.Blinky did it better :stuck_out_tongue:

Edit:
How about a tilt switch and just stand the device upside down for off?
you could make a cool one with a tube and ball bearing.
bb


(Kevin) #33

I think I already have a tilt switch I bought some from adafruit forever ago


(Kevin) #34

Lol it’s like twice as thick as I need


#35

What’s wrong with using switches? you could seal them with some masking tape (or kapton tape) when you poor in the resin / epoxy. You could experiment my making a simple PCB less gamepad/joystick


(Kevin) #36

I dont think the switch will survive the epoxy, the epoxy might flow into the internals, or actually finding a way to properly mask off the switch and have it be on the exterior of the part would be very difficult with the mold I’m using.


(serisman) #37

What about using some fast curing UV resin to pre-seal the switch?


(Kevin) #38

Not a bad idea but I almost kind of prefer to not have the mechanical switch in a way? Still not sure how I could mount it. Maybe if I make a small cavity in the mold to position the switch? Maybe the power switch is just sort of recessed like it is on the actual arduboy?

The sleep routine is the best in my mind as it makes the hardware more simple.

It’s almost the visual aspect o having the switch. It’s just another thing you see with wires going to it.

I’m pretty sure I’m also going to make a version without a battery just so it’s even more clear. I guess I hadn’t considered just adding a usb port, which would for sure need to be sealed. Be great if I had a waterproof one hanging around.


(Scott R) #39

If you don’t want a battery or USB port you could just bring six brass rods out for a diy ISCP header and power it from there with a nice polished wood programmer dock.


(Kevin) #40

That’s how I planned on doing it actually, but without it being battery powered the “magic” factor goes down considerably.

I thought about hiding the battery behind the screen too, it would be much thicker but also more clear.