05/30/2017 at 17:36 •
The capacitive touch isn't working reliably. I thought maybe it was my implementation. I was using a strip of copper tape with a wire soldered to it and connected to the PCB. In testing, this worked just fine. I tried a breakout board from Adafruit that uses the AT42QT1010, and while it worked fine in testing, it also had the exact same problems at the museum.
While explaining to the person who runs the museum what was going on, she asked about the light conditions affecting it, and I explained that light had nothing to do with capacitive touch (though maybe possibly the fluorescent ballast is doing it?), but the light conditions idea stuck with me.
I'm now working on a photoresistor implementation. Fortunately, the circuit is easily modified to support the photoresistor instead of the capacitive touch sensor, and all the code for detecting touch was in a custom library, so fixing all the cells requires just a single change to the library (and uploading to each cell of course).
I tested out the photoresistor behind paper like it will be in the installation, and it was still easy to detect the changes. I also put in some code to have a moving average and moving threshold, so it looks for quick change. This will help with people holding their hands over for a long time, or with changing light conditions as lights are turned off or on, or the sun rises and sets. I still need to test this in the museum to make sure it works, but it's promising.
11/05/2015 at 02:42 •
I thought I had learned my lesson with the first museum exhibit I developed; don't use buttons because people, especially children, are brutal. So I moved to capacitive touch buttons. And I thought that would solve the problem. A single sheet of acrylic in front of each column of elements would be easy to clean, would provide a nice interface, and wouldn't have any mechanical problems. Well, it does all those things, but presented me with a billion other problems.
I need help figuring out how to get the cap touch to work for the elements. Here's how it's configured now:
- 1/8" acrylic sheet on the full column of elements.
- Photo glossy sheet of paper with the element description and a 'button' that says "Press to Start"
- 1/8" acrylic piece behind the sheet of paper to hold it.
- 3"x1.5" piece of copper tape attached to the back of the acrylic. If you're keeping track, that's 1/4" of acrylic and a glossy sheet of paper between the finger and the foil.
- 4" wire from the foil to the pin.
- 10M Ohm resistor between the two pins on the ATTiny (using the capsense library).
- 22pF capacitor between the sense pin and ground.
- A custom library abstracts away the capsense library so every element gets the same configuration for touch sensitivity.
- There is a ground plane on the PCB, and every element has a cable carrying +5V, +12V, and ground back to an ATX power supply which is connected via a 3 prong power cable into a power strip.
- Acrylic wiped down with anti-static, anti-fog wipe.
- All elements run for a certain amount of time and then stop. During that time they ignore the button. When they stop running, they start looking at the button again for input.
- The cap sense library allows recalibration every N seconds. I have this set to 20.
This works. Usually. It worked in testing just fine. However, when I installed everything at the museum, things went crazy. Here are some of the problems:
- One of the columns is sensitive in such a way that touching anywhere on the acrylic sheet will activate the whole column.
- Some of the elements will activate way too easily.
- Others require a full palm.
- Sometimes they just start on their own.
- Sometimes you can activate them and they'll start, but even if you're standing a few feet away they'll keep going a few more times before they finally stop.
I spent a lot of time playing around with different sensitivity values for this, but I'm worried that it doesn't matter because each element seems to behave differently. I'd really like a consistent configuration because putting them in and taking them out of the installation is difficult, so tweaking each element would be horrible.
11/01/2015 at 21:38 •
The science museum is now open! We didn't get even close to 60 elements. We never had the budget to do the full thing anyway. But we did manage to finish 16 of them, and I threw together another column of elements with photos and descriptions of the process, and another element that asks for donations and help. So with those 6 cells, 16 finished ones, and a whole bunch of empty elements, the project is at least museum-presentable, and the visitors understand what else is coming.
The cap sense is still a big issue. I decided to go with too easy to start rather than too hard, so there are times when the elements will just start moving on their own.
Here's video of it working!
11/01/2015 at 21:30 •
This is a time-consuming project. There are way too many parts that need to be built.
Here's what's going on:
Building each of the elements takes forever. There are a few hours of design, followed by 3D printing the parts, then refining the parts to get them to fit together and work smoothly without friction, then doing the electronics and attaching everything to the element box, refining again to make sure it runs consistently, and then cleaning everything up and printing the text. It's a lot of work. Fortunately we have a growing library of consistent parts, like pieces that hold the stepper motors, and parts that hold shafts with bearings inside.
Cables are a pain. I've gone with ATX supplies, and I'm using 4 pin molex connectors. This is great because I have +5, +12, and ground, and that's what the ATX supplies pump out, with high current levels, and it's an easily sourced part. Yay for the ATX power supplies. However, I need to get that power up to each element in each column. Doing that requires lots of cables. Rather than use a terminal block or a huge stack of Y connectors (which are hard to source anyway), I decided to make a bunch of cables. They have one male connector to go into the ATX supply, and 5 female connectors. Each of the five has a different length, so that they can go from the bottom element up to the top element. The original design had each element supplying power through it via a connector on top and bottom, and merely stacking them would align them and pass power through. That didn't work so well, and I couldn't find a flush connector that would work. So I made a lot of connectors and I just pass them up behind the elements (there is some space in the wall).
The wall is made. A carpenter built a frame that is 12 cells wide and 5 tall. It has about 2 feet on bottom to lift up the display, which also leaves room for cables and power supplies and a power strip. The wall has columns with a 9.25" width, and roughly 5 inch depth. Since our elements are 9" x 3", that's some extra wiggle room. The 1/4" on the sides means everything slides in fine and we can just shim it up, and the depth in back allows us to have the cables come up the back, plus screw heads on the back of the elements, and whatever else may be necessary in the future. They are also shimmed in the back with a couple loose pieces of wood so that they are held to the front. The whole thing is nicely finished, and large pieces cover up the top and bottom so that it is safe from human prying. It's also bolted firmly to the wall in case of little kids climbing (this is a museum exhibit after all). Large pieces of acrylic slide into each column and are held in place by the frame, preventing people from poking the elements, and allowing interaction through the capacitive touch, but with just a smooth surface that can easily be cleaned.
The element enclosures are all made. This took a full day of laser cutting to accomplish, but it's done. There are now roughly 75 enclosures. The exhibit only holds 60, but the extra allow us to have some in development that can get swapped in without leaving any spots blank at the museum. The enclosures are all taped together and look very clean and nice.
The electronics are mostly done being assembled. That's 60 PCBs with a few components on each, plus a connector for power. Many will have another PCB wired to it for the stepper motor driver, but not all, so I can't assemble all of those.
Firmware is working. I created a library that contains the stepper driver, the cap touch button sensing, and most of the timing. That makes the individual firmware for each element a lot shorter.
Cap touch is... touchy. I don't know how to get it consistent across all the elements, and it's a pain because even though they were fine during testing, once installed they are all over the place in sensitivity. I attached a capacitor to the sensor to smooth it out, and that helped, but not enough. I'm disappointed, but I'll keep plugging away at a solution.
08/17/2015 at 04:12 •
With a template for the cells in place, and a first prototype built, it was time to build a complete first cell to demonstrate how everything worked and make sure that it will all come together.
This is a prototype cell. When I make the cells for the exhibit, there will be somewhere between 20 and 60 cells, each one different, and each one demonstrating a different mechanical motion (like http://507movements.com/)
The first cell I started with a simple pair of gears. I downloaded some off GrabCAD, then modified them slightly to have a smaller inner diameter and an arrow on top to have a visual indicator of it as it turns.
After 3D printing them, I needed to figure out a mechanism to attach them to the cell. This is where things are going to get tricky for all the cells; not only the motion needs to be designed, but the fixture to hold the moving parts to the cell need to be designed as well. This will make all of the cells a little more time consuming than I'd like.
Since this is a rough draft of a cell, I didn't want to work too hard on making it perfect, so I took some HDPE blocks and carved them on the band saw and drill press to make them fit with some metal hardware. Hot glue was the final ingredient to get everything to stick. This is what the prototype cell looks like assembled:
Attaching the PCB was fairly straightforward, and I was fortunate to have measured the mounting holes correctly. Soldering everything on the PCB was a cinch, with only a few components required.
There was some firmware development as well, but I already had sample code for each of the different parts (LED, cap touch, and servo), so it was mostly a matter of copy/pasting things together. It was pretty nice that during the hardware validation step I had created a sample sketch to test each part individually.
Here is a video of the sample cell working. Touch the capacitive touch button and it turns on the lights and starts the action. It'll run for a few seconds, then turn itself off.
I'm conflicted about the light. It's too harsh, but it might be better in bright day in the museum. And it's too noisy. I'd like to reduce that. I also need to figure out a good way to get cap touch sensitive and reliable. Also, the connector hanging out the bottom will have to go away. The intent is to have a set of spring connectors sticking out the bottom, and when they make contact in the wall mount frame then power is supplied. These power rails would go up to the top of the cell, too, so that a stacked cell would get power.
08/16/2015 at 23:35 •
Designing the cell enclosure was little more than a box, but it needed some specific features. First, it's constrained to 9" square and 3" depth. Second, we needed space for the cell description. This we arbitrarily set to 3.5". With those specs, I whipped up a design, made it into DXF, and cut it on the laser out of acrylic.
Then I used acrylic adhesive to assemble, and spray painted it black so it would look cool and cover up fingerprints. I used some spacers screwed into the acrylic to attach the PCB.
And BTW, this PCB is awesome. It's so flexible; for the first cell I wanted to build I only needed to populate 4 components! Yay ATTINY!
Then there's the top with a description. This is dummy text and a dummy design, but once some graphic design-fu is applied, there will be a good template ready for any cell.
And that's what a cell looks like! I think in the future I'll use black colored acrylic instead of spray painting clear, which will make assembly so much quicker. I also need to change a few dimensions on some holes, but that's no big deal. Next up I fill the cell with actual mechanics.
08/16/2015 at 23:25 •
Museum exhibits are expensive. Their cost is measured by the square foot, and can easily range from $100-$1000 per square foot. That means a single exhibit can easily cost in the tens of thousands of dollars.
One of the goals of this project is to make an extensible exhibit that is flexible enough to fit within any budget and capable of growing as funds are acquired. Because it's open source, it should require less engineering, and should be easier to build and maintain.
That said, material costs for this project are not insignificant. The wall mount will be a couple hundred dollars, and each cell is roughly $50. For the museum that this exhibit will go in, we have room for 60 cells. That's $3k just for the cells, and a few hundred more gets us a decent chunk of change. Unfortunately, the museum told us we had a budget of $1200. Yes, this is ridiculously low. There's no way a museum exhibit can cost that little and still look good.
Fortunately, we don't have to populate the whole thing! We can build only a few cells and drop those in, and as we get money we can add more cells and it won't hurt the look of the table at all. What's more, we could do sponsorships! We're planning to do a bit of a fundraiser, and call on the local construction and engineering firms to chip in $100 per cell to sponsor one. It's a tiny amount for them, it covers costs, and they get to sponsor something in a museum. Win win.
07/26/2015 at 16:09 •
PCBs arrived this week from china (I use http://smart-prototyping.com for my cheap PCBs). I was able to get all the PCBs I need for the full project (I needed 60) for $25 + $20 shipping, so under $1 per PCB. Not bad for prototyping! At that price, it made sense for me to just order the full number and hope they worked on the first try instead of ordering a couple and then ordering a second batch. Anyway, they arrived, so I spent the day doing some hardware validation.
To me, validation means slowly hooking up each part of the circuit and testing it. In this case, I also wrote an arduino sketch that focused on each specific section. Unfortunately, after my day of testing I had 2 errors. Fortunately, one of the errors was solved by putting a SMT resistor in between two adjacent .1" pins (pro tip 0603 resistors fit perfectly between .1" pads), and the other error was my servos had a different pinout than I expected, but I was able to swap the servo pins in the connector and the problem was solved. So no rework necessary, and no need to do a new board revision. Woo!
Here's what the new PCB looks like:
A quick walkthrough of the schematic:
First there's the microcontroller. An ATTINY44A-PU. Next is the cap touch sensor, which is just a pin. This was the mistake I made. There should also be a large (>1M) resistor between pins 6 and 7, which isn't captured on the schematic. Oops. Next is the programming header. There are two servos as well. For some reason the servos I ended up with had the control and +5 swapped. Not a big deal. Next we have "other control" which switches a +5V load. It can be used for whatever. There's also an LED Strip control, which is used to indicate when the cell is on. The Power Rail connectors are for attaching the power bus, and there are two for convenience. Only one is necessary. Then there's the limit switches, which are 5 connectors to allow for 5 buttons. The concept is a simple voltage divider, and the values I chose (which aren't labeled), are 2.2k for R1, then 0, 330, 620, 1k, and 2.2k. This gives me easily distinguishable ADC readings. Finally there's the motor controller, a L293D. This takes four control signals, which is a bunch for such a tiny microcontroller. Notice that signals Control1 and Control2 are duplicated with the servos. This means that you can't simultaneously have M1 and the servos. That was a limitation I was willing to accept in order to have the PCB be flexible enough to use servos and/or motors. But really, any mechanical system that needs more than a motor and two servos is probably too complex for the table. So options are: 2 motors and no servos, 2 servos and 1 motor, or 2 servos and leave L293D unpopulated.
Here's a pic of the back of the board. This is where I had to add the extra resistor for the cap sense. See how snugly it fits? Pretty sweet.
I populated two PCBs during the hardware validation testing. This is so that I know if something doesn't work I can see if it's a soldering problem or a real hardware problem. In this case it also allowed me to test motor vs servo functionality.
Now that testing is complete, I'm happy to report that everything works, there are no showstoppers, I have enough PCBs to make all the cells I need, and I have working sketches for each part of the hardware, which will be helpful when developing the individual cells, as I'll have discrete working bits that I can drop in.
07/08/2015 at 22:40 •
I quickly threw together a sample enclosure for a cell to see if the size was about right for the installation and for usability. I settled on 9"x9"x3", which allows ample room for a large button, lengthy description, and a sizable area for the actual mechanics. It was a big hit with the museum curator, who loved the size and used it to block off the area in the museum where it will go to get a sense of how big it will be and what it will look like.
I also etched the first revision of the PCB to test the motor controller, ATTiny, mosfets, power supply, and capacitive touch. I learned quite a bit and have some good changes in mind for the next revision.
- Capacitive touch works great, through acrylic with no problems.
- ATTiny works great. Easy to program.
- Limit switches work great. I'm using a single pin and checking the ADC value with different resistors for each switch, so I can tell which one was pressed with only a single pin. The next revision will allow up to 4 switches.
- MOSFETs work great.
- Motor controller works, BUT the motors require a huge current to start, and it's browning out my electronics. I've decided that rather than a single supply and a regulator, I'll have a +5 and +12 bus and no regulator on board. The supply will be done with an ATX supply, and the higher current will be necessary because I imagine a common use will be little kids pressing every button at once.
- The power plug doesn't make sense any more.
- I am adding the ability to do servos as well as motors. Not simultaneous, but in case a cell needs a servo instead of a DC motor, this should work.
- I'm switching a MOSFET from 5V to 12V. This one will be dedicated to an LED strip which indicates a cell is on. I couldn't find 5V LED strips.