I like to have multiple projects going at the same time so I'm thinking of starting yet another. This project was triggered from a discussion elsewhere about the accuracy of the power line frequency. How exact is the 50/60 hz and how does it vary over the day?
I'm thinking of doing this project on two separate boards. One small board that measures the power line and sends the data to the display and storage board.
[attachment=1]
The main board would have a 7-segment display that would look something like the image below, showing the current time ( according to the time kept by the controller and OCXO), the number of seconds the time derived from the powerline frequency vould be off from the real time, and the current frequency + voltage of the power line.
The data would be logged in a SD memory card for later download via USB to a computer for graphing and analysis.
[attachment=2]
I'm planning to do the measuring board with a transformer-less power supply. A small microcontroller and an optocoupler doesn't require too much power and getting 30-40 mA from the supply is not a problem.
Here I'm using a 1 uF capacitor in series with the power input to reduce the current to a level that the zener can handle. A high ohm resistor is connected directly from the hot wire to a pin on the AVR for zero-cross detection. The AVR have internal clamping diodes that will limit the voltage to approximately VCC/GND, and as long as the current is low enough no damage will occur. The measuring of the voltage is done with a diode to remove the negative parts of the ac voltage and then a voltage divider that reduces the 235 peak voltage down to a range measurable by the internal 10-bit ACD in the AVR.
At every zero crossing the ADC value will serially be sent as two bytes via the optocoupler to the main board. Since the zerocrossings occur every 8.3 mS at 60Hz. A byte takes little bit over 1 mS to send at 9600 bps so any rate faster than 2400 bps would be sufficient.
[attachment=0]
Any comments, suggestions or questions are welcome....
A real P&P machine is horrendously expensive and most hombrews seems to be based on a CNC mill which usually makes their speed somewhere between slow and really slow. If I can hand place my parts faster than the machine can, it really doesn't seem like such a good idea to use it.
As so many other tinkerers I also have been thinking of how to make a usable machine that is reasonably cheap. I probably will never have the mechanical resources to actually build/test/debug a contraption like this, but it's fun to just plan and think about it.
My goals with this idea is not to to a fullblown P&P that can handle all imaginable parts, just the ones that there usually are a lot of on the boards. If it can do 0805 and 0603 caps and resistors, SOT23x -parts, standard SOIC and possibly SSOP 0.65mm my needs would be mostly fullfilled. The rest of the components can be hand mounted on the boards.
With my very "leet SketchUp skillz" I did a simple drawing of my basic idea of the major parts.
[attachment=0]
Most homebrew machines is having the PCB stationary and are using steppers for moving the pickup head in X & Y coordinates. This is causing a lot of (slow) movement - especially since many of them are using lead screws.
Here I'm using a stepper with a lead screw (red in the drawing) to move the PCB in the X-axis, and the parts would be populated in order of the X-axis as well. So the PCB would only make one slow pass from top to bottom making the speed of the X-axis irrelevant as it can move while the head is heading over to pick up a new part and having the parts orientation analyzed by the cameras (blue in the drawing).
The Y-axis movement of the pickup/rotational head (green) is done by a linear motor (orange) for high speed and acceleration (8 meters per second and 10 G accel for the more fancy variants). [Wikipedia - A linear motor is an electric motor that has had its stator and rotor "unrolled" so that instead of producing a torque (rotation) it produces a linear force along its length.]
Having the machine only doing small parts on a previously unpopulated pcb makes the required movement in the Z-axis (up/down) rather small, a 1 cm (1/2") movement should be more than enough so this can be made fast as well.
The maximum number of reels that can be fitted of course depends on the width of the linear motor/rail, so it's a matter of cost since a longer motor will cost more. Maybe the linear motor could be replaced with a belt driven carriage using a stepper, but that would be slower.
I'm not sure of how many reels that would be a minimum requirement for a usable P&P, I suppose that 10 would be enough for basic operation, if more is needed maybe the placement could be done in two passes.
I just started soldering up the Curious-C Beeper. So far I just put in the "battery holders" :-)
It's actually more like a battery clip since I've made it out of the outer loop of a regular steel paper clip. Putting a small blob of solder on the bottom pad will make the connection between the pcb and the battery more reliable - I always do this, even when using real button cell holders.
I needed two power (just ~1 watt) 12 ohm resistors for a project and I only had a bunch of 1 ohm 5w resistors and some random other values that I couldn't use so I wound two resistors by hand for the first time in my 40 years of electronics tinkering.
I had a roll of about AWG38 (0.1 mm) magnetic wire and used my dmm to find out that I needed about 6 meters (20 foot) of it to get to the right resistance.
I soldered the ends of the wire to a high-ohm resistor and used kapton tape to tape it down to a short length of a wooden pencil to use as a carrier and then just wound up the wire onto the pencil and put some more kapton on top of it. Works just fine - but I think I'll replace these with proper resistors at my next order to Element14.
I had some extra space left on a 5x5 cm board so I put some test-patterns there to see what they actually can produce. They claim to be able to do down to 6/6mil so I put some concentric circles with 6/6, 5/5, 4/4, 3/3 and finally 2/2 mil width/spacing on them. Top half of the circle is bare copper and the bottom half is covered with soldermask.
Seeed complained a bit over this PCB, but after I had assured them it was only for test and I took full responsibility of the possibility of a bad etching they sent it to their fab house.
[attachment=0]
As can be seen on the picture above even 3/3 mil seems almost perfect as long as it's covered by soldermask. The HASL doesn't work too well even at 6/6 when there's no soldermask between the tracks. I suppose that ENIG (gold) would be ok at 3/3, but that test will have to wait for a later time.
The 12 mil vias (0.3mm) is placed very precisely in the copper pads on this batch, but I've had other batches that looked worse.
Here's a hi-res image with four of these boards if anyone is interested and want to have a closer look. It's too big (2.3MB) for having as an attachment here so I put it on Google Drive. https://docs.google.com/open?id=0B-BEFU ... 2gyZnFWeGs
This is a Constant Load generator that is controlled by a keypad. When I started this project I was not sure what it would end up being so I built in in modules that are interconnected. THis gives me greater flexibility and it is easier for a beginner to understand the schematics and operation of the parts
I use only CMOS 4xxx -logic running on 12 volts with the exception of the Russian K155N1 Nixie drivers - they are TTL and uses 5 volts.
In total there are 10 pcs CMOS chips, 4 pcs Nixie Driver, 2 pcs NE555 and 3 pcs of TL084 Quad Op-amp. I also have 60 pcs of 0.1% precision resistors and a dozen of caps and ordinary pullup/down resistors.
There are six separate PCB's mounted onto a wooden frame and and interconnected by in headers.
Board 1 - Keypad & Decoder
The keypad that is using a CD40147 "10-line to 4-line BCD Priorty Encoder" that together with 4 inverting gates (CD40106) output a binary/BDC representation of the key that is pressed. If no key is pressed binary 1111 (decimal 15) is output. With a discrete OR-circuit made out of diodes and a pullup resistor and a capacitor a key-strobe is generated and is active when any key is pressed.
Board 2 - Storage of keypresses
Has a counter (CD40147 "Decade Counter") that increments one step for each keypress. The first four outputs of the counter is connected to the clock/latch input of four latches (CD4042 "Quad Clocked D-Latch") that each stores the data coming from the keyboard encoder. So for each press of a key that value is stored in one of the latches.
When the counter has counted four pressed it stops further counting by pulling it's own enable input high from the 5'th output. To then enter a new value on the keypad the Clear-key must first be pressed. The C-key is connected to the Reset-input of the counter so it goes back to selecting the first output pin. The C-key is also connected to all the clock/latch input if all the CD4042's (via isolation diodes) so when pressed all latches latch the value currently on the keyboard-bus - this is binary 1111 since no numeric key is pressed.
Board 3 - Nixie tubes and high voltage drivers
This board has four IN-16 nixie tubes that each are connected to a K155N1 Nixie driver (4 bit BCD to Decimal High voltage driver/decoder) that is in its turn connected to a CD4050 (hex non-invering buffer). The buffers are then connected to the outputs of the latches on board 2. Since the K155N1 are TTL technology it requires 5 volts and also present quite a high load on their inputs I need to have buffers between them and the latches or else the voltage on the latches would drop down a lot - and the output of the laches is also used for the discrete DAC's on board 6.
Board 4 - High voltage boost converter
The nixes require a voltage between 170 and 200 volts to light up so this board is a simple switched mode boost converter based on a NE555 timer and a N-FET transistor and a 100 uH inductor. This is a clone of the design from http://www.ledsales.com.au/kits/nixie_supply.pdf
Board 5 - Negative voltage converter
The TL084 opamps on board 6 requires both a positive and a negative supply. The current is very low so I simply use a NE555 oscillator and connected the output to two capacitors and diodes to generata about -10.5 volts out of the regular +12 volts power. http://en.wikipedia.org/wiki/Charge_pump
Board 6 - Digital-to-Analog converters and Constant current load
The outputs from each latch are connected to a 4-bit R2R-ladder that together with a TL084 opamp convers the digital BDC value on each latch into a voltage ranging from 0 to -675 mV. The R2R-ladders are made out of 10K 0.1% resistors.
The output of each DAC are buffered by another TL048 connected as a non-invering unity gain voltage follower. Then the buffered voltages are summed in yet another (1/4 of) TL084 using 100 ohm, 1K, 10K and 100K as the summing resistors to have each DAC affect the sum by a 10th of the previous DAC. So the first DAC affects the output in steps of 100mV, the second in steps of 10mV, the third in steps of 1mV and the last least significant DAC is only affecting the output voltage in steps of 0.1mV.
This summing stage also amplifies and inverts the signal so the total output is between 0mV and 999.9mV (almost 1 full volt).
This voltage is now used to control a standard constant current load circuit. EEVblog - construction of a Dummy Load http://www.youtube.com/watch?v=8xX2SVcItOA A power N-FET and a 1 ohm resistor is connected in series to the load and the voltage drop over the 1 ohm resistor is read by one input of an opamp. The other opamp is connected to the DAC voltage and the opamps job adjusting the N-FET so that the voltages on its input pins are the same. So if the DAC outputs 0.5 volts to one pin the opamp will adjust the current trough the FET so that the 1 ohm resistor also drops 0.5 volts. And 0.5 volt over 1 ohm is 0.5 ampere.
The load current will always follow the voltage of the DAC. So in theory the is I enter 000.1 on the keypad the DAC will output 0.1mV and the current should be adjusted to 0.1mA - but in practice the DAC is not prefect and the opams have quite a bit of bias on their inputs so my voltage don't exactly follow the value entered. With some trimmers and better opamps this might become more exact, but for this exercise it's good enough.
The current load circuit also have two small N-FET transistors that are short circuiting the input of the power N-FET to ground while not all four digits are entered. Without that the output would be at full load when the Clear-button is pressed since the latches are set to all one's then. Not a good thing. So the short circuit FET are connected to the Enable-input of the counter at board 2 and is activated as long as the counter is still accepting more digits.
I've just backed the Bora board on Kickstarter http://www.kickstarter.com/projects/545 ... orer-board. For $35 you will (eventually) get a pcb with usb-connectivity, 7-segment displays, a bunch of leds and switches as well as a XC9572XL CPLD (72 macrocells with 1,600 usable gates).
Today I soldered up and wrote a quick dummy test on my KimCard. The KimCard is to be a credit card sized emulator of the KIM-1 single board computer back from the mid-seventies. http://en.wikipedia.org/wiki/KIM-1
[attachment=2] It has a whopping 1 KB of RAM and is running at 1 MHz on a 6502. Software entry is done either on the hexadecimal keypad with six 7-digit displays as the output or via a teletype terminal.
My emulator will emulate the 6502 and some of the functionality of the ROM/RAM/IO/TIMER support chips on the board using a ATXMEGA32D4. Possibly also the Teletype interface will be emulated over the USB connector as a standard CDC interface.
To Save/Load the code a cassette tape interface or punched paper tape on the Teletype was used. I'll probably use a serial EEPROM as storage for a few images of the 1K RAM memory space.
[attachment=1] When I first connected the micro USB cable to power it my 3.6 volt vreg started smoking. That is usually not a good sign.... It turned out that the micro usb connector I had home had the connectors reversed compared to the footprint (Sparkfun) I used in the design. So I basically fed the reg with -5 volt instead of +5 volt - no wonder that it didn't like it.
So I scraped off some soldermask and soldered a mini usb and just greenwired (or in this case yellowwired ^_^) the power lead into the board (The USB data wires will be dealt with later) , replaced the vreg and crossed my fingers. And whoo! The power led came on and I could connect to the CPU with the PDI programming/debugging interface.
A few lines of code later and I could test that the rest of the hardware was in reasonable shape. The green power led is far too bright and the seven segments are too dim. But that is to be expected.
I haven't attached the lipo battery or the charger for it yet. And since I'm not using the USB comms yet I haven't bothered to get the crystal in place either - for the time being the 32 MHz internal oscillator is fine.
So far I'm rather happy and will now start to get the 6502 emulator part of the code in shape - but that won't happen until after my entry of the 7400 competition is in.
If you combine Ian's adventure into the world of Nixie tubes with my freeformed Litte Wire clone you get something like this:
[attachment=0]
It's a clock made of a single IN-1 Nixie tube controlled by a ATMega8. The Mega8 directly controls 10 pcs of MPSA42 high voltage transistors for lighting up the filaments in in Nixie. It also generates the high voltage required for the tubes by a pwm output connected to a IRF520 N-FET and the usual inductor and fast recovery diode.
Unfortunately I've lost the schematics and firmware many years ago...
Just to keep myself motivated I'll document my progress of my 7400 entry here. I won't tell you what the end result will be yet, but I'm not afraid of anyone "stealing" my idea either. It's nothing groundbreaking and fascinating, just something resembling how things were made when I started with electronics as a hobby back in the mid-70'ies.
I'll make my design modular so I can reuse (fat chance I'll ever do that) the modules for other projects and/or replace the backend with something else - or even have multiple backends. As of today I'm not 100% sure of what backend I'll use, but as times goes by and the deadline gets nearer I probably need to make a decision.
The first module is a keyboard encoder using a CD40147BE. It's a 10 input priority encoder with a 4 bit binary output. It output the binary code for the input (0-9) of the highest input. So if input 3 is active the outputs will be active, active, inactive, inactive. [attachment=0]
My usage of the word active instead of high is intentional. Looking at the Truth Table of the 40147 it seems at a first glance that the output would be high (1) when all inputs are 0/inactive/low. So that is how I made my design. But when I had build it and was testing it nothing happened when I pressed the buttons. I checked the wiring and I replaced the IC but no joy. The output was stuck at low/high/high/low just as if the button 6 was pressed all the time.
After a nights sleep I looked at the datasheet again and realized that I've missed the very important words "Negative Logic". So all inputs and outputs are inverted in the truth table.
[attachment=1]
So the the encoder actually had all buttons "pressed/activated" so it was giving the result for "9" which is the inverse bit pattern of "6".
My original design had pulldown resistors on all inputs and the buttons connected to vcc so the all the unpressed buttons would present 0 on the inputs of the IC and the pressed button would be 1. But nope - that is not how the 40147 wants it.... Luckily it could be easily fixed by changing the pulldowns to pullups and connecting the switches to ground. I only needed to change two wires on the pcb for that - that's the power of daisychaining.
I already had a hex inverting schmitt trigger (SN74HC14N) on the pcb for doing any-key-pressed detection and debouncing so I had a few spare inverters to also invert the four output signals of the encoder. The SN74HC14 needs to be replaced with the pin compatible CN40106 since I will be running this project on 12 volts and the HC-series only eats 3-6 volts, but the HC14 was the only I already got in stock at home.
Happiness & joy. It all works as is should now, but I should have learned to read the datasheets more carefully after almost 40 years of electronics hacking. But bloody hell - who in their right mind would represent a high voltage as "0" and a low voltage as "1" in a datasheet?
Module two will be up in a few days - stay tuned - don't touch that dial.....
While waiting for a handful of dirt cheap ($4.50) Ethernet modules http://r.ebay.com/z20h6H and some Serial Bluetooth modules to arrive from ebay for the second revision of my 16-channel light dimmer project I've started on the next project from my last batch from Seeed.
This time it's a Logic Pen controlled by a tiny 6-pin PIC10F202. The PCB is 5 cm by 5mm so it fits just fine inside a regular ballpoint pen and have 5 leds (1 power led and 4 controllable from the PIC), over voltage protection on the probe input, reverse polarity protection using a p-fet.
There are no buttons on it so I plan to have it configurable by applying power while the tip is grounded and then the tip can ba tapped to ground/power as is was a regular button. Crude but usable enough I think.
I've soldered it up and hardwired it to my Pickit3. I've just uploaded some old led flashing software on it from another project and the leds are blinking away so the basic hardware seems to be ok.
[attachment=1]
The schematics of the LOpen is rather straightforward. A FET for reverse polarity protection. A double diode that clamps the input from the probe to 0.7 volts over/below vcc/gnd. Four charlieplexed leds. The resistor R2 is used as as "wiggler" that is used for trying to very weakly override the value on the probe. If it can be overridden the probe is considered to be floating.
Well... Since the Visulizer project is "done" I fearlessly threw myself into the next project - a 16 channel 110/230 volt light dimmer that can be controlled via USB or Bluetooth.
I messed up the layout a bit so there is only 0.2mm distance between the high voltage live and neutral. My plan was to have 0.8-1.0 mm in distance there but apparently I changed the settings of the fills in Eagle. Connecting 230 volt to the PCB without any parts soldered expect for the fuse resulted in *nothing*, no fires, no sparks, no explosions. So it seems that the 0.2 mm can cope with 230 volts for a while at least.
To see if the schematics and the design on rest of the board is ok I soldered up one board - but only installed 1 set of the power parts (triac, screw terminal, optocoupler) of the 16 that should be on the board. No need to waste parts if there are some other bugs.
The board looks a bit strange with all big and clunky thru-hole parts and one TQFP44. But since all the power parts are thru-hole I was thinking that "why not just continue using thru-hole stuff board". Why mix?
While soldering I realized that I've forgot the "HWB" button that activates the Atmel USB Bootloader during boot in the schematics, so I patched a button and a resistor ontop of the USB connector - far away from the mains power :-)
Time for some dinner and a few hours of writing the first revision of the firmware for it....
I finally soldered up the Visulizer shield (the pcb with the dithered image of an eye on the backside) from my last batch of pcbs from Seeed.
So far I'm happy with the layout and the silk, let's see if I'm equally happy with it once I try to write the firmware for it :-) It's a very simple design so I don't foresee any problems with the hardware, but Murphy happens every now and then as evidenced by my Single Wire Lcd Backpacks....
[attachment=0] (Pic taken with a cellphone on my "signature" datasheet background)
In my last batch of PCBs from Seeed I had two versions of LCD backpacks. One for connecting to a LCD with a single 16-pin header and one for smaller displays that are using a header with two rows of eight pins.
The backpack only have a few discretes and a '595 shift register on them and and controlled by a single pin from your host microcontroller with a timed scheme for sending 0 / 1 bits latching the data in the shift register. The backpack also have a button input that share the same pin to the host and doesn't affect the display updates.
After soldering up one of each I couldn't get them to work at all. After using an oscilloscope looking at the timing send from the host and the results of the RC-networks on the backpack I realized that I had swapped the SCK and SCL at the shift register in my schematic. I had interpreted SCL as SerialCLock and not SerialClear as it really is. After some track cutting and soldering of patch wires it still didn't work.... Then I saw to my horror that two other pins (SerialData and SerialClock) must be swapped as well - clearly a brain fart from my side when doing the schematics.... Arrgh!
But after fixing that it actually worked - at least the 1x16 connector-variant did. On the 2x8-connector I had forgot(!!!) to connect the Anode to the backlight. I've must have been drinking too much the night before I did these PCBs or something....
Well, after all the patching they work just fine. I can read the state of the button, output data to the LCD and turn the backligt on/off thru a single pin on my microcontroller.
The update speed of the display is not the best, but it's quite sufficient for displaying a menu or update some values at the LCD, but I wouldn't try to write an action game on a 8 lines by 40 characters display.... :-)
The Big Blob of Glue. A few years back I urgently needed a DIP version of ATMega168 and I only had a TQFP at hand and no adapter boards so 20 minutes of soldering wires directly to the pins on the chip and some hot glue later this abomination was born. :-)
[attachment=1]
I needed a 10 amp diode to rectify 12 volts for my 555-competition entry, but I had no power diodes available so I just paralleled a few 1n4001's to get it to carry the load without exploding. They are still vastly overloaded and will burn your fingers in a few seconds, but it was enough to test the my design.