Showing posts with label tips and tricks. Show all posts
Showing posts with label tips and tricks. Show all posts

Thursday, June 3, 2021

Assembling the Pro Mini OLED clock shield kit

Customers complained about the lack of documentation on the Pro Mini OLED clock kit.

I listened and I agree. Even though the silkscreen should provide the necessary directions for soldering the parts on the shield itself, adding the Pro Mini board and the OLED display are still ambiguous, especially because there are multiple options.

Here is a quick, but hopefully adequate, step-by-step guide on one way to assemble this clock kit.

1. Make sure you source the correct Pro Mini board, that looks similar to the one in the photos below. It features an ATmega328 clocked at 16MHz.


Note that SCL and SDA (A5, A4 respectively) are broken out. Also, the FTDI connects directly to the side of the Pro Mini board.


2. Program the board itself with the OLED Clock sketch. In Tools/Board, select "Arduino Duemilanove w/ ATmega328". Upload using the FTDI adapter. This step is important because you want to make sure your Pro Mini works before you mount/solder it.

3. Make sure you source the correct I2C 128x64 OLED display, like the one shown below.


The pins at the top must be in the order (left to right) VCC-GND-SCL-SDA or VCC-GND-SDA-SCL.

In case your display has a different arrangement of the pins, e.g. GND-VCC-SCL-SDA, you will need to swap the leftmost two pins, by rewiring the traces (cut, then reconnect) on the shield's PCB (not on the display, which remains untouched), as explained in Step 6.

4. Solder the DS1307, paying attention to the correct orientation (notch up), then the 2 resistors and the crystal.

5. Solder the 2 jumper bridges according to the OLED display you are going to use.


If your OLED has pin 3 and 4 configured as SCL and SDA respectively, then solder the right bridge of the left jumper and the left bridge of the right jumper (see the photo below).


6. Only if necessary
Remember, the Pro Mini OLED shield was designed for I2C OLED displays that have pin 1 as VCC and pin 2 as GND. If that is not the case (as in the photo below),

those first 2 pins must be rewired, as shown (after the traces had been cut and pins isolated).


7. Solder the Pro Mini board on top and close to the OLED shield, using machined male pins (included in the kit). Only the relevant pins, highlighted in the photo below, need to be soldered.


Pay attention, since this is a hard-to-reverse move. Fixing a mistake here involves de-soldering. Also, the parts underneath cannot be (easily) accessed anymore.

8. Solder the 4-pin female header, the 2 buttons and the battery holder, then insert the CR1225 battery, with the correct polarity (+ on top).


9. Insert the OLED display.

10. Power the clock through the FTDI breakout (observe the correct orientation) or by directly wiring VCC and GND to a 5V or battery source.
Any of the 5 clock faces can be selected by pushing simultaneously the 2 buttons.
Pressing each button individually will increment either the hours or the minutes.


 

Sunday, February 7, 2021

Enclosure ideas for WiFiChron and other clocks

It turns out that most electronics, even prototypes, can be easily enclosed with Lego. And that means no screws, no glue, no fasteners, zero tools, just the bricks and some imagination.

This is the HDSP clock variant with 1" displays driven by HT16K33 (introduced here). The board was cut and filed (0.5mm on each side) to fit snug between the walls (see this).


Next is a HDSP clock variant with two Adafruit Quad Alphanumeric displays.


Similarly, the PCB was cut and filed a bit. The assembly fits solidly between the bricks (no movement when shaken). As in the previous build, the exposed PCB is kind-of-required to allow access to the two buttons (set hours, set minutes).

Both of the above can be mounted on a Lego wall (as found in schools) or they can desk-stand on their own.

Here is an example of a Lego-encapsulated WifiChron.


The PCB was also filed about 0.5mm on each side to fit between the lateral brick walls. It did not have to be fastened in any other way. The ESP8266 module fits inside nicely. The 3 buttons and the USB mini B connector are all easily accessible from the back.

Below is the Lego version of the Axiris clock.



Since it does not have any buttons, the time is set through Bluetooth (command "SET TIME=hh:mm", sent from Terminal app while BT paired).

And finally, a couple of OLED clocks, both running the same software on similar hardware: pro-mini + OLED shield and wsduino + 2.42" OLED shield, respectively.



Note that this is the prototype version, using a LiPo battery with charger (similar to the one shown here).


Again, all the above enclosures feel solid: nothing moves or rattles when upside down or even shaken. I did not try dropping them though :)

And lastly, the WiFiChron with Adafruit quad 0.56" displays from the previous post, sandwiched between scrap plexiglass plates:




Sunday, April 5, 2020

HDSP clock revision 2

The latest revision of the HDSP clock uses the same schematic, but offers an improved PCB layout, with:
  • 4 holes in the corners, for encasing;
  • addition of I2C signals to the FTDI connector, for expansion;
  • the regular push buttons can be replaced with 2-pin right angle buttons;

This revision was successfully used as the assembly kit in the "Introduction to Practical Electronics" course for Grade 6 students.

This would also be a good place for step-by-step assembly instructions, for those who require directions.


melt a bit of solder on the battery pad, to raise it (not pictured)


slide in the CR1220 battery, flat side (+ pole) up (not pictured)


Use a mini B USB cable to power the clock. It should work right away, since the processor is already programmed with the clock software. Use the "Hours" (left) and "Minutes" (right) buttons to set up the time.
Also, insert the CR1220 battery into the holder. It powers the DS1307 RTC (real time clock) when the clock board is disconnected from USB. Note that the small coin battery ONLY powers the RTC integrated circuit, and not the whole clock. The display is lit only when connected to the USB power.

Troubleshooting
  • check for missing soldering joints; you may have forgotten to solder some terminals;
  • check for solder bridges; solder blobs may accidentally connect adjacent holes/terminals that should not be connected;
  • make sure the orientation of the integrated circuits and the display matches the silkscreen, by checking the notches/indentations;
  • ensure that the ICs are fully and completely pushed in the socket, until their bottoms touch the socket's plastic;

What's next

1. Catch up on the theory:
  • recognize components symbols in schematics;
  • recap units of measure for some of the components (ohms for resistors, farads for capacitors); read their intended values (3 digits, color code), measure their real values using a multimeter;
  • understand electrical concepts: voltage, current, resistance (and their dependency), frequency; recap their units of measure;
2. Design and make an enclosure (hint: the easiest is to sandwich the board between plates of transparent acrylic, with standoffs in the 4 corners).

3. Look for a new kit to assemble.

Sunday, February 2, 2020

Introduction to practical electronics for children

I designed this 7-hour (one hour/day) course for 6 graders, as part of their STEM curriculum.
The goal is to introduce the children to practical electronics and teach them about:

1. electronic parts/components: how to identify/recognize them, how to measure (using a multi-meter), what they are used for (role in an electronic circuit):
  • resistors (current reduction), variable resistor/potentiometer, trimmer
  • capacitors (energy accumulator), variable capacitor
  • transistors (amplification)
  • coils (inductors)
  • diodes, LEDs
  • speakers. microphones
  • buttons, switches
  • integrated circuits, processors
  • displays
  • sensors (light, magnetic, proximity/infrared/ultrasound)
  • servo motors
  • relays
2. how to solder (using a soldering station), how to place and position parts on a board, how to check connection, how to follow steps of an instruction manual;

3. electricity and electronics concept:
  • voltage, current, resistance;
  • AC vs DC
  • digital vs analog
  • oscillation
  • rectification
  • amplification
  • series, parallel
  • voltage transformation (AC)
  • voltage regulation (AC, DC)
4. basic understanding/reading of schematics (wiring, electrical connections).


Required materials

Course schedule

Day 1
theory: introduction to components; presentation and identification (1/2 hour)
practice: beginning soldering (1/2 hour) LED + resistor, using flux, soldering wire, wick, on prototype PCBs;

Day 2
theory: introduction of a simple clock kit or another, more familiar to me, simple HDSP clock kit; assembly analysis, component placement and positioning;
practice: solder passive components on PCB; assemble the HDSP clock;

Day 3
theory: more on components; introduction to schematics;
practice: solder the active components of the clock kit;

Day 4
theory: electricity concepts (digital vs analog);
practice: finishing up the kit assembly; power, test, use;

Day 5
theory: electricity concepts (voltage, current, resistance); example of other kits;
practice: learn to use an ohm/volt/meter;

Day 6
theory: electronics concepts (oscillation, rectification, amplification, sound generation etc.);
practice: bring an electronic toy, working or not; disassembly, analysis, repair (if needed);

Day 7
practice: continuation from Day 6; identification of components used in the toy; understanding of how it works; modding/expanding functionality/adding LEDs, speaker, buttons etc.;


We are already on "Day 3", but behind schedule. Soldering is harder for the kids than I originally thought. One thing that I overlooked was that each student needs individual attention/supervision on the practical side (soldering, component placement etc.). Half hour per day of hands-on practice is definitely too short at this level. The schedule may be a little aggressive for the average Grade 6, probably better suited for older and more disciplined students. In any case, I am working on adjusting the content of the course and the feedback I receive is amazing. Kids really enjoy the fact that it is practical and some of them are amazed when they see the LEDs they soldered actually lighting up.


Monday, July 24, 2017

IV-3 VFD confusion

So you want to build Axiris's IV-3 shield for Arduino, sourcing the IV-3 VFD tubes yourself, from any of the numerous ebay sellers, as I did.

Firstly, it is important to note that, although the assembly manual for IV-3 shield refers to it as "IV-3/IV-3a/IV-6 VFD shield for Arduino", which would make you think one could install either IV-3, IV-3A or IV-6 tubes, this is not quite the case. The reason is the difference in pin configuration:
  • IV-3: 9-segment + dot, 14 pins (1 not connected)

(pin configuration is bottom view)
  • IV-3A and IV-6: 7 segment + dot, 12 pins (1 not connected)
(pin configuration is bottom view)
  • and then, there is IV-3 v-82, which I bought on ebay: 7 segment + dot, 14 pins (3 not connected)
(pin configuration is top view)

IV-3 v-82 (as I named it, based on the printing on the back of the tube), is an amalgamation between IV-3 and IV-3A:
- can be found in either 7 segment or 9 segment (+ dot), although only 7 segments are connected;
- has 14 pins (as to support a 9 segment digit + dot), with 3 not connected;
- pin sequence differs from both IV-3 and IV-3A;
- the "key" (the trimmed unconnected pin) is on the opposite side compared to IV-3/IV-3A.
Below are some photos, with the "axiris" IV-3A on the left.



(Also notice the color of the ceramic insulator, white for the "axiris" IV-3A, pink for the IV-3 v-82.)

To adapt the IV-3 v-82 tube to the Axiris board, the pins need to be scrambled like this:


which leads to this ugly assemblage:



It would probably work with proper heat-shrink tubing around the tube terminals, but I preferred to order the correct IV-3A for which the board was designed.

Conclusion: Pay attention when (and if) you order the tubes for "Axiris IV-3 VFD shield" separately. The sure bet is to order IV-3A, with the white ceramic insulator, and the trimmed pin on the right side (when looking at the digit).

P.S. Also, make sure the tubes are "mirrory" black at the top. If the top is white, then the tube is damaged for sure, air got in the tube (basically the tube's glass is cracked), like in the photo below (right tube is damaged).



Tuesday, March 17, 2015

How to assemble the 2-servo mini pan-tilt kit

Mystery solved!

This is somehow embarrassing, but I post it anyway, hoping that it may help others.

Although it looks easy, I had trouble assembling the mini pan-tilt kit from adafruit, specifically the bottom servo. I just couldn't figure out how to fix the servo with screws to the main arm, since there are no holes for screws (unless I drill them myself). Also, there is no guide anywhere to be found (uncharacteristic for adafruit), nor explicit photos of the assembled parts. I thought that there must be a trick, so I bought the assembled version as well. Guess what? The "trick" is obvious, and I missed it because I was focused on using the screws! The bottom servo must be inserted in the 2 tracks on each side of the two symmetrical parts that make the arm, no screws needed!

When assembling the kit, the easiest way is to start by attaching together the 2 symmetrical parts of the arm, with the servo between them. (In the photo below, i was too lazy to completely dis-assemble the 2 halves of the arm, I only pulled them apart enough to fit the servo in between, with servo's bracket in one of the tracks.) Notice the servo's bracket snug in the groove.


See? No screws on either side of the servo! Because they are not needed!



I hope these photos will bring some light and spare the frustration to (probably very few) people like me.

Saturday, January 31, 2015

My experience with Axiris IV-3 shield for Arduino

I recently bought on ebay the PCB for this open source VFD shield, designed and made by Axiris, a company in Belgium. I was attracted by the solid documentation provided on their site, which includes the schematics (even Eagle files), assembly instructions, demo software, files for laser-cutting the enclosure. I should also mention the professional photos, rivaling those of the top sites (e.g. adafruit, sparkfun).

Assembly went smoothly, as expected. I also expected it to work on the first try, like the other two VFD devices I built previously, the Ice Tube Clock and the akafugu VFD clock. I guess I ran out of luck :)
But, as my kid would say, "losing is learning". This became an opportunity for me to actually go one step further than just soldering the components mindlessly (because the instructions are too easy :)

This is how I learned what fascinating little devices VFDs are. They function similar to cathode ray tubes (CRT), used in the previous generation of TVs: the filament gets heated (by about 1V, believe it or not(*)) and frees electrons; a thin grid, supplied with higher voltage, attracts these electrons and speeds them towards the anodes, which are conductors that become fluorescent when hit by these electrons.
VFDs are also similar in functionality to triodes, and probably can even be used as amplifiers (in a MacGyver-kind situation :).

Compared to Numitron tubes or even Nixies, VFDs are more complicated to drive, since they require two voltages: a very low one (around 1V) for the filament (cathode) and a higher one (between 5V and 60V, depending on the model) for the fluorescent anodes and the grid.

IV-3 tubes used in the Axiris shield require about 30V for the anodes and 0.85V for the filament. The power source to generate these two voltages is original (when compared to those in other successful VFD devices). The documentation gives a great explanation on how it works.

In any case, it only "half-worked" for me: I got the high voltage around 32V, but the tubes were still dark.
There were 2 possible causes for this:
  • either defective tubes (with burned filament) or
  • missing low voltage
Not being able to find a "troubleshooting guide", I contacted Axiris. After a few emails, their advice was to check C2 and C3 and eventually play a bit with their values (between 5 and 15 nF). Which I did, with no success.

Needless to say that the design of this power source is out of my league. The filament voltage is high-frequency AC, impossible to measure with a regular multimeter (**). But a VFD's filament, like a light bulb's filament, works with DC as well. So I tried lighting them up with 3 AAA batteries in series (since the 4 filaments are connected in series). I was able to see them glowing (until that moment I didn't even know where the tube's filament was). That did the trick and proved that the VFDs were not defective.


As an alternate (working) solution, I chose to replace the low voltage AC from the oscillator's power supply (which did not work for me) with the PWM voltage from the available D11. I cut the trace to VFIL1 (see schematics below) and re-wired to the anode of diode D1. I took out C2 and C3 (right hand side in the photo above) and connected a wire between VFIL2 and Arduino's D11.


With analogWrite(D11, 200), the 4 in-series filaments are now powered with a measurable 3.2V (3.9V from D11 minus 0.7V voltage drop on diode D1). This is not an outrageous solution when you think of switching power sources driven by pulses from uC used in some Nixie clocks.

With the hack in place, I was then able to successfully run Axiris' demo sketch (shown in action in the photo).
As they say, "all is good when it ends well".

What I would change or improve in this kit:
  • add the ability to adjust the high voltage with a trim-pot; for two reasons:
    • eliminates the restriction to use only a 12V power adapter to generate the required 30V;
    • the tubes' luminescence diminishes over time (I read); a higher anode voltage can bring the brightness back;
  • power the filaments independently (in parallel);
    • if the filament of one tube burns out for some reason, all tubes will go dark; finding which one is defective is not obvious, and will require a multimeter;
  • replace the 8-pin "power" header with a 6-pin header, to be able to plug the shield in the original Arduino 2009 as well; the left-most 2 pins are not used, yet Arduino's capacitors are touching one of them;
  • add a troubleshooting section;
    • include measuring the resistance between VFIL1 and VFIL2 being about 32 ohms; that proves that the filaments are intact;
    • include testing of the filaments with a battery for the common folks that lack an oscilloscope (for those who have one, include some info on the AC voltage);

In conclusion, I find this kit as a great introduction to VFDs. I think it is easier to understand how it works than the Ice Tube clock, since it's all discrete components (no IC driver). It is also a lot more software-hackable, being controlled by an Arduino sketch. It is more hardware-hackable through the use of Arduino shields, which may include an RTC, Bluetooth, buzzer etc.


(*) One can also start a fire with a AA (1.5V) battery.
(**) Nick, I am just one step away from using the oscilloscope you sent me. I promise to write a review on it soon.


Saturday, January 24, 2015

Experimenting with Numitron filament tubes

A while ago I built a battery-powered single digit Numitron clock. There was nothing challenging about it. Each segment of a Numitron takes less than 20mA, like a LED, and requires between 3.5V and 4.5V to light up. So the segments can be driven directly from the processor or other TTLs (shift registers etc).

Since Numitrons behave so similar to (7-segments) LEDs, why not use one of my old LED matrix shields to multiplex 4 of them, I thought. And instead of the current limiting resistors, I would use Schottky diodes, to bring them even closer functionally to LEDs. I would even be able to use the same interrupt-based code for multiplexing.

I started the practical experiment with just one Numitron. The 7 segments are driven by a 595 shift register and the common electrode gets grounded through a ULN2803 gate. The diodes insure the current flows in one direction only and they also guarantee a maximum voltage of 4.5V on each segment.

In practice, multiplexing does not work very well with filaments. The reason is, I think, the "switch" time, the interval between the moment the voltage is applied to the filament and the moment the filament becomes incandescent and glowing. Unlike LEDs, which are diodes and "switch" quite fast (microseconds), filaments (which are essentially resistors), are orders of magnitude slower to emit light.

The sequence of 3 photos below shows one Numitron multiplexed at a 4:1 ratio, 2:1 and 1:1 respectively.
The 4:1 ratio is too dark; 2:1 is acceptable and 1:1 is optimal.


Here is the sketch I used for the experiment. I changed the number of multiplexed tubes (in the ISR), between 1, 2 and 4.


byte digitDefinition[10] = {B11110110, B11000000, B10101110, B11101010, B11011000, B01111010, B01111110, B11100000, B11111110, B11111001};

// pins used for LED matrix rows (multiplexed);
#define SHIFT_CLOCK_PIN   4
#define STORE_CLOCK_PIN   5
#define SER_DATA_PIN      6

// pins assigned to tubes' common electrodes (in theory board can drive max 8 Numitrons);
byte pinTube[8] = {8, 9, 10, 11, 12, 13, 7, 3};

byte activeTube = 0;

void setup()
{
  // Calculation for timer 2
  // 16 MHz / 8 = 2 MHz (prescaler 8)
  // 2 MHz / 256 = 7812 Hz
  // soft_prescaler = 15 ==> 520.8 updates per second
  // 520.8 / 8 rows ==> 65.1 Hz for the complete display
  TCCR2A = 0;           // normal operation
  TCCR2B = (1<<CS21);
  TIMSK2 = (1<<TOIE2);  // enable overflow interrupt

   // outputs for ULN2803;
  for (int i=0; i<8; i++)
    pinMode(pinTube[i], OUTPUT);

  // outputs for serial shift registers;
  pinMode(SHIFT_CLOCK_PIN, OUTPUT);
  pinMode(STORE_CLOCK_PIN, OUTPUT);
  pinMode(SER_DATA_PIN,    OUTPUT);
}

/**
 * ISR TIMER2_OVF_vect; gets called 7812 times/second.
 */
ISR(TIMER2_OVF_vect)
{
    // turn off current tube;
    digitalWrite(pinTube[activeTube], LOW);

    // change the number of multiplexed tubes here;
    activeTube = (activeTube + 1) % 4;

    // activate the next tube;
    digitalWrite(pinTube[activeTube], HIGH);
}

void shiftOutRow(byte digitDefinition)
{
  digitalWrite(STORE_CLOCK_PIN, LOW);
  shiftOut(SER_DATA_PIN, SHIFT_CLOCK_PIN, LSBFIRST, digitDefinition);
  digitalWrite(STORE_CLOCK_PIN, HIGH);
}

byte getDigit(byte activeTube)
{
  return activeTube;
}

void loop()
{
  shiftOutRow(digitDefinition[getDigit(activeTube)]);
  activateNextTube();
}


In conclusion, I could build a 4-digit clock using the LED matrix shield (which has two 595 shift registers) with 2:1 multiplexing, or better, I could use the dual LED matrix shield (featuring four 595s) without multiplexing.

I'll report back when I'm done soldering.


PS Most of the Numitron schematics out there do not use multiplexing (thus confirming my finding). The few that do (like this one), use a higher voltage (>4.5V) to make them brighter. This solution may have an impact on the life of the tubes though. In addition, if for some reason (program bug, processor failure etc) the multiplexing stops working, the Numitrons will be toast, quite literally.

Sunday, January 11, 2015

Horizontal mod for the HDSP clock

Making a proper enclosure for the HDSP clock is challenging, since it was designed specifically to stand on a phone charging dock. Inspired by DaveC's lay-flat version (he didn't send photos of the inside though), I put some thinking into how to easily convert the "stand up", vertical clock, to an "encasable" horizontal one. The main requirement is to place the display perpendicular to the board. This could be done using a right-angle header of some sort, as shown in the photo below.


With this easiest solution, as you see in the next photo, the board must be upside down for the display to show properly.


With a bit of more work, basically re-wiring the connections to the display on the adapter PCB (that holds the display), the whole device looks more appropriate, as shown in the next photo.


Which brings me to the subject of "display adapters". Although the HDSP clock was designed specifically for HDSP-2534, it can be easily converted to use similar "smart displays" but with a different pin configuration, as is HDSP-2133. (I got this particular one as a gift from MarkB. Thanks once again!)

So, to recap, if you have one of these 8-character parallel-interface HDSP smart displays, you can use it with the HDSP clock through pluggable display-adapters (shown in the photo below). Note that the code works without modifications.


Now back to enclosure. The HDSP clock board seems to fit perfectly (according the the datasheet) inside a Serpac A20 box. Even the screw holes in the box match empty spaces on the PCB, so holes for the mounting screws can be drilled properly.
How about the buttons?
  • long-stem buttons could be accessed through holes in the upper side of the box (ugly though);
  • the buttons can be mounted on the back panel of the box, connected with wires to the board;
  • a Bluetooth module can be added, thus eliminating the need for buttons altogether (requires code changes);
  • add remote control.
I plan to update this post, with photos, after I try what I "preached" above.


Update Feb 10, 2015
I created a "double bubble adapter", using two QDSP-6064 ("bubble") 7-segment LED displays, shown in the photo below.


The LED segments are driven by the shift register's parallel outputs and the 8 digits are multiplexed directly with the processor. All these 16 pins are available on the original connector for HDSP-2534 display.