At the end of the chapter, Charles shows how to latch an AND gate to HIGH by putting a diode between the output and input 2, which goes to a 10K resistor and GND, as well as to a switch. Input 1 goes to power. So, at power up, on input 1 is H and input 2 is L, AND ing to L, so the LED does not light. When the switch in pushed, input 2 goes H, ANDing to H, and the LED lights. By feeding the output to input 2, when it goes H, the circuit stays H.
As I mentioned, I do not have my 74HC08 AND chips yet. I got a shipment from China today, but it was my 555s, not my 74HC08s. I wracked my brains trying to figure out how to replicate this latching with the chips I have. I found a useful example here That got me thinking. However, I think I really need a gate that is H when both inputs are H. The only other one that might work is XNOR, but I don't have that either. I may be wrong--but I can't figure that out.
Then I figured that what I really need is a latch, and should focus on that. A google for "latch a logic ic to low" yielded this. I followed the directions for an "Active-high circuit: Both inputs are normally tied to ground (LOW), and the latch is triggered by a momentary HIGH signal on either of the inputs" (same web site). That's what I have on the NOR Gate. Both inputs are L, and are taken H the corresponding button is pushed.
So, I used the gate on the opposite side of the chip. I added 10K resistors to GND on the inputs. Input 1 was tied to the output of the other gate. Input 2 was tied to switch 2, so it goes H when the switch is pushed. The output goes to Input 2 of the other gate. Input 1 of that gate is still connected to the switch, and output to the NAND gate as before, in addition to input 1 of the other gate.
As before, on power up the both inputs to NOR gate 1 are L, so it's output is H, causing the NAND gate to output L in response to it's 2 H inputs, and the LED is dark. Also as before, when we press switch 1 the output of NOR gate 1 NORs to L and the NAND gate goes H and the LED lights. HOWEVER, when we let go of the button, the LED stays lit because the output also goes to the other NOR gate which now goes H and feeds that back to input 1 of the other gate. The light stays on until it's reset, which happens when the other button is pressed, causing input 2 of gate 2 to go H and the output to go L, causing input 2 of gate 1 to go low, causing the output of gate 1 to go H as at power on.
Not as complicated as it sounds. See the reference for diagrams and further explanation.
Here's the video.
Saturday, January 31, 2015
Friday, January 30, 2015
@MAKE Electronics Experiment 19 - logic chips (Part II)
I still do not have the 74HC08 AND chips, so I moved ahead and used what I have. I took out the 00 and replaced it with a 74HC02 NOR chip. NOR is not or. OR logic yields a HIGH result (or TRUE, or ON, or 1) when either input is HIGH, and LOW if both are LOW (or FALSE, or LOW, or 0). NOR is the opposite--only HIGH if both inputs are LOW.
I was reminded that NOR chips are the only ones with different pinouts, so I had to do some minor rewiring, but that's OK. Once I got the chip in, I pushed the buttons like yesterday. On power up the LED is on, just like yesterday. However, if either or both buttons are pushed, it turns off.
Next I wired up the NAND chip again, moving the LED and 1K resistor down to its output, connecting one input to power (so it's always HIGH), and the other input to the output of the NOR chip. Now the light will turn off if the output of the NOR is HIGH. We know how to do that: as in the previous paragraph, if neither button is pushed, it sends a HIGH signal to the NAND chip, making both inputs HIGH and turning off the LED. If I push either button, the signal is LOW, and NAND turns on the LED. Very cool.
Here's the video.
I was reminded that NOR chips are the only ones with different pinouts, so I had to do some minor rewiring, but that's OK. Once I got the chip in, I pushed the buttons like yesterday. On power up the LED is on, just like yesterday. However, if either or both buttons are pushed, it turns off.
Next I wired up the NAND chip again, moving the LED and 1K resistor down to its output, connecting one input to power (so it's always HIGH), and the other input to the output of the NOR chip. Now the light will turn off if the output of the NOR is HIGH. We know how to do that: as in the previous paragraph, if neither button is pushed, it sends a HIGH signal to the NAND chip, making both inputs HIGH and turning off the LED. If I push either button, the signal is LOW, and NAND turns on the LED. Very cool.
Here's the video.
Labels:
74HC00,
74HC02,
electronics,
logic chip,
MAKE,
NAND,
NOR
Thursday, January 29, 2015
@MAKE Electronics Experiment 19 - logic chips (Part I)
There is not much to Experiment 19, but it's still really neat.
This is the first use of logic chips, and Charles is just introducing the concept. In this experiment, we use a 74HC00 quad 2-input NAND chip and a 74HC08 quad 2-input AND chip. My 08s have not arrived from China yet, so Part I deals with the 00.
Logic chips use Boolean logic, taking False as 0 and True as 1. Since there are two inputs, the Boolean operation yield an off or on (logic LOW or logic HIGH) condition.
The 00 applies a NAND, or negative and, operation on the two inputs. This means that it's the opposite of an AND operation, in which both inputs must be true (or on or HIGH) to yield a true (or on or HIGH) output. The negative of that means that NAND yields a true (or on or HIGH) result unless bioth inputs are true (or on or HIGH).
Here's a truth table (T=true or on or HIGH, F=false or off or LOW):
input1 input2 AND NAND
F F F T
F T F T
T F F T
T T T F
In the experiment, we first have to supply 5V, regulated, to the chip. We take the 9V input (in my case from a Compact Switching Power Supply - Selectable Output 3-12VDC from Adafruit), through a 7805 voltage regulator and 2 capacitors to smooth it out. The output of the 7805 (4.95V by my meter) supplied the chip. Charles calls for a 33uF capacitor, but I only have 22s and 47s, so I used a 47.
The circuit only used one of the 4 gates. 74HC00 is a 14-pin chip. Pins 1, 4, 9, and 12 are input1. Pints 2, 5, 10, and 13 are input2. 3, 6, 8, and 11 are the outputs from the corresponding inputs. 14 is power and 7 is GND. Gate 1 is pins 1 and 2 with output on pin 3. All other input pins are tied to GND (LOW), and the other 3 outputs are floating.
The inputs 1 and 2 (pins 1 and 2) are connected to power through a normally open momentary switch., with 10K pull-down resistors connected to GND. Output (pin 3) is connected to a low-current LED, which is connected to a 1K resistor to GND. Each input is LOW unless the button it is connected to is pushed, closing the connection to power and taking it HIGH.
Here's the schematic and breadboard layout:
This is the first use of logic chips, and Charles is just introducing the concept. In this experiment, we use a 74HC00 quad 2-input NAND chip and a 74HC08 quad 2-input AND chip. My 08s have not arrived from China yet, so Part I deals with the 00.
Logic chips use Boolean logic, taking False as 0 and True as 1. Since there are two inputs, the Boolean operation yield an off or on (logic LOW or logic HIGH) condition.
The 00 applies a NAND, or negative and, operation on the two inputs. This means that it's the opposite of an AND operation, in which both inputs must be true (or on or HIGH) to yield a true (or on or HIGH) output. The negative of that means that NAND yields a true (or on or HIGH) result unless bioth inputs are true (or on or HIGH).
Here's a truth table (T=true or on or HIGH, F=false or off or LOW):
input1 input2 AND NAND
F F F T
F T F T
T F F T
T T T F
In the experiment, we first have to supply 5V, regulated, to the chip. We take the 9V input (in my case from a Compact Switching Power Supply - Selectable Output 3-12VDC from Adafruit), through a 7805 voltage regulator and 2 capacitors to smooth it out. The output of the 7805 (4.95V by my meter) supplied the chip. Charles calls for a 33uF capacitor, but I only have 22s and 47s, so I used a 47.
The circuit only used one of the 4 gates. 74HC00 is a 14-pin chip. Pins 1, 4, 9, and 12 are input1. Pints 2, 5, 10, and 13 are input2. 3, 6, 8, and 11 are the outputs from the corresponding inputs. 14 is power and 7 is GND. Gate 1 is pins 1 and 2 with output on pin 3. All other input pins are tied to GND (LOW), and the other 3 outputs are floating.
The inputs 1 and 2 (pins 1 and 2) are connected to power through a normally open momentary switch., with 10K pull-down resistors connected to GND. Output (pin 3) is connected to a low-current LED, which is connected to a 1K resistor to GND. Each input is LOW unless the button it is connected to is pushed, closing the connection to power and taking it HIGH.
Here's the schematic and breadboard layout:
![]() |
| Figure 4-46 |
![]() |
| Figure 4-47 |
Both figures are from Charles Platt, Make: Electronics, First Edition, Maker Media, Inc., 2009, p. 182.
Both inputs are LOW on power up. Pressing a button takes its input HIGH. Referring to the truth table above, we expect the LED will light unless both inputs are HIGH. This is in fact what happens: when the power is connected, the LED is on and stays on unless both buttons are pushed. See the video here.
Labels:
74HC00,
electronics,
logic chip,
Make.,
NAND
Sunday, January 25, 2015
@MAKE Electronics Experiment 18 - 7-segment displays, 4026 counters, 555 timers
Here's the latest, from +Make: Electronics. Experiment 18 uses 3 single digit 7-segment displays, 3 4026 decade counter chips (1 for each digit, chained together so they roll over), 3 555 timers to get the circuit to run by itself.
I did a video but it was too big for Blogger to handle. See it in this post on Google Plus.
After I did the video, I added another 555 (actually the other side of the 556), an LED, and some additional resistors and capacitors. The book gives really clear directions, My only variations were using the 556 (because I thought that would be interesting), using 3 1-digit displays instead of a 3 (my 3s are not individually addressable--only 12 pins as opposed to the 28-pin version Charles used). Also, I turned on the decimal point between digits 2 and 3 just for grins.
This was fun. I just got a bunch of 7-segment displays from ebay, and it's interesting to see how to control them through chips only--no programming,
On power up, the counter runs. You stop it and clear it, then hit the start switch, After a delay, the LED lights and the counter starts. You the hit the stop switch to time your reflexes. I almost got there, but I had some sparks and some component is likely fried. Since I got it almost working, I'll move on.
The next exercise is using logic chips, and I really want to do that. I ordered a whole bunch of them from ebay, but not all have arrived yet, including one of the 2 chips I need for this experiment.
While I'm waiting, I think I'll get the 7-segment displays working with arduino. In addition to the 1-digit displays I have some 3- and 4-digit ones., That could be interesting. Less clutter on the breadboard...kind of cheating, which is why I wanted to do it Charles' way first.
Update 01/26/2014: it turns out that the only thing I fried was the LED. I got it working again (there were a couple of loose connections, too). I think I will go on and fuss with the capacitor values to see if I can get it to count close to real time by 1/100s of seconds. could be fun. That, and the Arduino thing.
Update 1/27/2014: the closest I could get was replacing R8 (2K2Ohms) with a 10K potentiometer (actually a knob I took from a fried clock radio) and 22 microfarad capacitor for C2. Spec for C2 was 68uF but all I had was a 47. Charles said to use a .1uF (then on the next page he said 1, which I think is what he meant because he said a 10 was 10 times the value). I tried several values from 1 to 100, and settled on 22 because that gave me the most responsiveness from the pot.
This whole thing was really interesting--using different chips in multiple configurations, playing wiht the speed of the timer displayed on the 7-segment devices, etc.
After I did the video, I added another 555 (actually the other side of the 556), an LED, and some additional resistors and capacitors. The book gives really clear directions, My only variations were using the 556 (because I thought that would be interesting), using 3 1-digit displays instead of a 3 (my 3s are not individually addressable--only 12 pins as opposed to the 28-pin version Charles used). Also, I turned on the decimal point between digits 2 and 3 just for grins.
This was fun. I just got a bunch of 7-segment displays from ebay, and it's interesting to see how to control them through chips only--no programming,
On power up, the counter runs. You stop it and clear it, then hit the start switch, After a delay, the LED lights and the counter starts. You the hit the stop switch to time your reflexes. I almost got there, but I had some sparks and some component is likely fried. Since I got it almost working, I'll move on.
The next exercise is using logic chips, and I really want to do that. I ordered a whole bunch of them from ebay, but not all have arrived yet, including one of the 2 chips I need for this experiment.
While I'm waiting, I think I'll get the 7-segment displays working with arduino. In addition to the 1-digit displays I have some 3- and 4-digit ones., That could be interesting. Less clutter on the breadboard...kind of cheating, which is why I wanted to do it Charles' way first.
Update 01/26/2014: it turns out that the only thing I fried was the LED. I got it working again (there were a couple of loose connections, too). I think I will go on and fuss with the capacitor values to see if I can get it to count close to real time by 1/100s of seconds. could be fun. That, and the Arduino thing.
Update 1/27/2014: the closest I could get was replacing R8 (2K2Ohms) with a 10K potentiometer (actually a knob I took from a fried clock radio) and 22 microfarad capacitor for C2. Spec for C2 was 68uF but all I had was a 47. Charles said to use a .1uF (then on the next page he said 1, which I think is what he meant because he said a 10 was 10 times the value). I tried several values from 1 to 100, and settled on 22 because that gave me the most responsiveness from the pot.
This whole thing was really interesting--using different chips in multiple configurations, playing wiht the speed of the timer displayed on the 7-segment devices, etc.
Monday, January 19, 2015
Mario Question Block from @adafruit - Final(?)
It's finished. See video
The final steps were:
The final steps were:
- desolder the floating wire on the LED+
- desolder the GND wire, cut it to the same length as the + wire, resolder
- cut wires to go from LED1 to LED2
- solder LED1+ to LED2+ and LED1- to LED1-
- uncscrew the Piezo, drill the holes to expand, and refasten
- use tack to fix the backpack on the Trinket
- place the switch in it's holder
- mount the Trinket (this was not great--the screw head strips, but I got enough in to hold it)
- close it up (this was hard, because there's a lot of stuff in there and the cover still does not fit perfectly, but I got it)
- It says that the LEDs should be connected in series when only a parallel connection works
- There is no mention of the battery--where to position it, etc--the answer apparently is "stuff it in any way you can."
- The wiring diagram shows all wires coming out of the top of the Trinket. Some must come out of the bottom. There is no mention of that in the text.
- The stuff about tolerances for 3D printing was not obvious (to me which is OK because I don't know anything, but it was also not clear to the 3D printing service I used)
Labels:
adafruit,
arduino,
electronics,
mario,
trinket
Sunday, January 18, 2015
Mario Question Block from @adafruit - Part V
I got the LEDs to work.
However, I wired the LEDs in parallel as opposed to series, and they both light. I have given feedback on the tutorial.
Next: put it all back together and wear!
- I verified all the other connections
- I tried a 5mm LED in the circuit instead of the LED sequin I desoldered--no change
- I put the LED sequins in series on a breadboard, powered by a 5V 1500mA wall wart--they both lit
- I checked the datasheet for the LED sequins, Max forward current is 25mA. Average forward voltage is 3.4V at 20mA.
However, I wired the LEDs in parallel as opposed to series, and they both light. I have given feedback on the tutorial.
Next: put it all back together and wear!
Labels:
adafruit,
arduino,
electronics,
mario,
trinket
Friday, January 16, 2015
Mario Question Block from @adafruit - Part IV
I drilled the hole in the case for connecting the Trinket. From the webs, I ascertained that I needed about a 1/16" bit (.0625 for a .067 screw). That worked. I was able to attach the Trinket, but I'm holding off on the final solution until I get through some of the following issues. I got some 2-56 3/8" screws, Philips head, and they work much better (I replaced the screws for the Piezo, also).
I put my meter on the circuit (DUH--learning the obvious lesson: do this DURING assembly to assure the connections will work).
First, I verified what the switch was telling me--I did not completely remove the trace between the pads on the backpack, so the circuit is always open and the switch had no effect. It looked OK to me, but I did some more scraping and now it works.
Second, I checked the LED connections. My meter showed continuity throughout. Using alligator clips to jump various connections, I could get one or the other LEDs to light, but not both. I desoldered one, and tried various combinations of connections with no luck. It occurred to me that maybe the battery did not have enough juice, but according to my meter it's putting out 3.96V, and it's rated at 3,7V. I also tried it connected via USB--no change.
Meanwhile, the Piezo wires came loose from the Trinket and I had to resolder.
I have posted a query on the Adafruit Support Forum about the LEDs. If I get an answer, I'll move on. If not, I may try it with 1 LED (which was the original design).
I put my meter on the circuit (DUH--learning the obvious lesson: do this DURING assembly to assure the connections will work).
First, I verified what the switch was telling me--I did not completely remove the trace between the pads on the backpack, so the circuit is always open and the switch had no effect. It looked OK to me, but I did some more scraping and now it works.
Second, I checked the LED connections. My meter showed continuity throughout. Using alligator clips to jump various connections, I could get one or the other LEDs to light, but not both. I desoldered one, and tried various combinations of connections with no luck. It occurred to me that maybe the battery did not have enough juice, but according to my meter it's putting out 3.96V, and it's rated at 3,7V. I also tried it connected via USB--no change.
Meanwhile, the Piezo wires came loose from the Trinket and I had to resolder.
I have posted a query on the Adafruit Support Forum about the LEDs. If I get an answer, I'll move on. If not, I may try it with 1 LED (which was the original design).
Labels:
adafruit,
arduino,
electronics,
mario,
trinket
Subscribe to:
Posts (Atom)

