Friday, May 8, 2015

Adafruit Neopixel Tiara on a breadboard

I decided to make the Adafruit Neopixel Tiara.  I have ordered some tiara's (plural to allow for error), and will fix the gemma and neopixels to it.  When I was thinking about it my town was getting ready for the annual "Brewster in Bloom" festival, which features daffodils, so I decided to see if I could do a similar project using fake daffodils.  The same day Becky Stern has a neopixel boquet project with fake flower on Wearable Wednesday. So, I figured I was on the right track.



After I got the products, I decided to test everything on a breadboard.  I soldered headers on one of my 3V Trinkets (I'll use a Trinket for the daffodils).

Here's the video

More after I start building.

Monday, April 20, 2015

@Make #Electronics Experiments 26-28--Fun with Coils

These three experiments, like #25, are pretty short. Since they're related, I decided to do them all together.  I thought of doing this starting with 25, but I did not have all the parts I needed (lacking the spool of magnet wire).  Now that I have what I need, I'm ready.


Here's a video of the three experiments.  Following is a discussion of each part and links to individual (shorter) videos.

Experiment 26: Tabletop Power Generation

This one is neat. It's in two parts:

  1. Use a 3/4-inch neodymium magnet to generate alternating current
    By stripping the ends of a 100ft coil of 26-gauge magnet wire on a spool, connecting the ends to an LED, and then moving the magnet up and down through the spool, we generate electricity to light the LED. The LED flashes only on one direction--reverse the connections and it only flashes in the other (alternating current).
    Video.
  2. Use a diode to rectify AC current and store in a capacitor
    Using the same coil as in part 1, we use a 1N4001 signal diode and 100uf electrolytic capacitor in series to replace the LED.  We connect a multimeter across the leads of the capacitor to measure volts.  When we move the magnet up and down through the coil, it generates electricity, but the diode blocks one direction, so it's DC.  The capacitor charges up until we stop moving the magnet (I got it to about 2.5V), then it slowly discharges.
    Video.

Experiment 27: Loudspeaker destruction
I fudged this a little because I did not have a 2" speaker. The 1 1/4" Radio Shack cheapie was good enough for demonstration.  The whole point is that there's a coil and a magnet and the inputs to the speaker causes vibrations which are received as sound.
Video.

Experiment 28: Making a Coil React
In this experiment , we power a circuit from 12V DC, passing through a momentary tactile switch, a 220 Ohm resistor, two low-current LEDs oriented in opposite directions, and on through a coil.  When the button is pushed, the coil initially blocks flow so the circuit finds a path through one of the LEDs.  Once the coil;s self-inductance is overcome, it accepts current and the LED goes out.  When we release the button, the current that was stored in the coil releases and lights the other LED.
Video.

Sunday, April 19, 2015

Regulated 5V Power Supply


Taking a break from the book experiments, I decided to make my own 5V regulated power supply, since we've been including it in many experiments.

This took WAY longer than it should have. I though it would take an hour--instead it took most of two afternoons, including 2 trips to Radio Shack.  The first day was setting it up on a breadboard so I could replicated it on a PCB.  I made a bunch of stupid mistakes...finally took it all apart and re-did it and it worked.

The second day was taking the model and putting it on a PCB.  I wanted it on perfboard, and I wanted header pins to plug into a standard breadboard.  Plain perfboard does not facilitate soldering. I had a one sided PCB, and I got the header pins on, but that made soldering connections on the bottom side difficult.  First trip to Radio Shack: unsuccessful, no double-sided PCBs. I have several Adafruit perma-proto boards in 1/2, 1/4, and 1/8 sizes.  They don't fit the breadboard, but I made due with the 1/4 size.  After a bunch of wiring errors, I got it working.

Parts:
Adafruit barrel jack
Adafruit 1/4 size perma-proto board
LM7805 Voltage Regulator
PCB mount toggle switch
22 Gauge Hook-up wire
Tinned Copper Bus Wire
10uf electrolytic capacitor
.1uf electrolytic capacitor (I ran out of the mylar versions)
LED
330 Ohm resistor
standoffs and screws

The barrel jack takes 6-12V in.  The power from the jack connects to pin 1 (power in) of the LM7805 and ground to pin 2 (ground).  the 10uf cap goes between LM7805 pins 1 and 2, and the .1uf between pins 2 and 3 (power out) Since both capacitors are electrolytic, the negative side for both goes to pin 2.  Pin 3 goes to the PCB power rail, and Pin 2 to the ground rail.  Hookup wire connects the rails from side to side of the PVB.  Pin 3 also goes to one side of the toggle switch, and the other side of the switch goes to ground (WRONG!--see "Update" below). The LED goes from power to the 330 Ohm resistor to ground.

Since I could not plug this into a breadboard, I added hook-up wire (22-gauge, solid core) soldered to the power and ground rails.

Here's the video.

Update: see my comments, below.  The voltage regulator overheated when the device was turned off with the toggle switch.  Dumb mistake: I should have put the switch between 9V in from the barrel jack and the 9V side of the LN7805.  I fixed that. Here's  an annotated photo of the bottom of the PCB. I know it's messy--I haven't trimmed the wires yet.
DIY 5V Power Supply Wired Correctly (bottom view)

Saturday, April 11, 2015

@Make #Electronics Experiment 25: Magnetism

Experiment 25 is a very simple grade school experiment on electricity and magnetism.

Charles includes it because it's neat and because he's introducing self-inductance, the third property of passive components (with resistance and capacitance),



I cut 6 feet of 22-gauge hook -up wire and wrapped it ~60 times around a screwdriver. I then attached alligator clips to the ends of the wire. When I connected the other ends of the clips to the poles of a AA battery, the paper clip moves towards the screwdriver. More fun!

Here's the video

Next we go on to generate electricity with a magnet (assuming that I can find 100 feet of magnet wire),



@MAKE Electronics Experiment 24: Gonna Skip It

I've been away, and recovering from being away, for a couple of weeks, so I'm just getting back to my journey of discovery with Charles Platt as my guide.

Experiment 24 involves enhancing the intrusion alarm from experiment 15.  All the enhancements are worthwhile, but I never implemented the system (my wife was not enthusiastic about adding the reed switches to windows and string wires around the house). So, the enhancements would be a learning exercise only. That's not bad--these are all learning exercises--but I think I've got the concepts and I'm ready to move on.

Here's what Charles proposes:

  1. Delayed activation
    Use a 555 timer mounted in a separate box with a button to activate the circuit and the 12V power to the alarm passing through it. Before leaving the house (e.g.) you push the button, activating the circuit which cuts the power to the alarm for 30 seconds. That gives you 30 seconds to open and close the door (which in this case has the reed switches) without triggering the alarm,  After 30 seconds, the power to the alarm is restored and the next time the door is open the alarm will be triggered.
  2. Keypad Deactivation
    In experiment 15, once the alarm is triggered it makes noise until the power is cut.  By adding a latching relay and keypad system a la experiment 20, we can turn it off without cutting power
  3. Delay before deactivating
    It would be nice to have some time when entering the house before the alarm sounds.  The solution here is to add another 555 circuit, in bistable mode.  This is interesting, becuase in addition to using the threshold/trigger mechanism, it is necessary to be sure the the circuit starts and stays going without being reset, so there is a smaller capacitor on the reset pin to make sure it starts LOW (output inhibited) and becomes HIGH (output allowed) faster than the output is triggered.  If we did not do this, we're leaving it to a 50/50 chance that the output is H or L. This feature allows us to control that.
A worthwhile exercise, but I'm ready to move into Chapter 5.

Monday, March 30, 2015

@MAKE Electronics Experiment 23: Nice Dice

This is an interesting and challenging experiment. Challenging because I sometimes have problems getting from schematics to breadboards, and I always have in the back of my mind that I may have cooked a chip.  No cooking this time, just stupid wiring tricks.  But, I got it to work.

We started with a 555 timer to send pulses to the a 74LS92 counter chip and 3 LEDs to count from 0-5 in binary, Note that the LSs are TTL chips as opposed to the HC CMOS chips we've been using.

Since the idea is to emulate dice, we need 7 LEDs, one for each dot on a die. We did that by adding a 74LS27 quad-gate triple input NOR chip, along with 4 diodes too protect inputs from flowing back into outputs.  In this version we had low-current LEDs tied to GND through 4.7KOhm resistors. This LEDs were not too bright (like me). By connecting the middle dot, to one output. each of the to diagonal pairs to 2 more outputs, and the two middle side LEDs to another, we were able to produce 7 combinations from the 4 outputs by connecting thim. The middle lights on 1, 3, and 5.  The middle sides light on 6 only.  One diagonal lights on 2, 3. 4, 5, and 6, and the other lights on 4, 5, and 6.

Next step was to add an inverter.  In the previous set up, the NOR chip needed to power the LEDs, What we want is for it to sink power, but to do that we needed to reverse the logic.  We used normal LEDs connected to power through 100Ohm resistors, and connected the inverter outputs to the negative side if the LEDs.  This was much better, because the LEDs are much brighter. 

Making the right connections from the NOR to the inverter to the LEDs turned out to be a challenge, but I stuck with it.

Finally, I replaced the 10uf capacitor between pins 7 and 8 of the timer with a .01uf, making the lights flash 1000 times faster and the change not visible (to me, at least).

So, you hold down the pushbutton and all LEDs appear to be lit. Release the button, and you have a roll of the die. Nice dice


Saturday, March 21, 2015

@MAKE Electronics Experiment 22: DeBouncing and Flip-Flop

This experiment is deceptively straightforward. The only issue I had was a bad chip.

First, I mentioned in the last experiment that the slide switch was not breadboard friendly.  The pins are not long enough and with only one row of pins it's not stable. I tried taking it apart with the intention of making a breakout board, but that proved to be harder than it should be (I should have left it together).  So, I went to Radio Shack and found this. The advantage is that it's a DPDT and  has 2 rows of pins, making it more stable.

So with a better switch, I tackled the experiment. Both circuits do the same thing. Debouncing means ignoring errant button pushes. Since latching logic gates set in the first impulse, anything further is ignored.  We latch by feeding the outputs of each gate to one of the inputs to the other.  The second input is connected to a pull-down (NOR) or pull-up (NAND) resistor and to one side of the switch. The pole of the switch (we only use one) is connected to Vcc (NOR) or GND (NAND).
Each output also powers a low current LED when it's HIGH.

NOR output is LOW unless both inputs are LOW.  When the switch is towards a gate's input, that input goes H, making the output  L. That gate's LED is off, and one input to the second gate is L. Since the switch is away from the second gate, that input is also L, making the output H, turning on the LED and making one input back to the other gate H, keeping it's output L and it's LED off. Switch to the other gate and one input goes H, making output L  and both inputs to the other gate L and it's output H and LED on.  It can only be in one state or the other. Debounced.

NAND works similarly.  NAND output is H unless both inputs are H.  The switch is connected to GND and each gate has 1 input connected to a side of the switch and a pull-up resistor. So, one input is H unless the switch is closed to that side, in which case it's output goes H,turning on the LED and feeding H to one input of the other gate.  Since the switch is open to that side, it's pull-up resistor makes the other input H, making the output L, turning off it's LED and feeding L back to the non-switch input of the other gate, keeping it's output H until the switch is moved (or power to the circuit is cut).

Fun and interesting. Here's the video.