Saturday, June 6, 2020

Restoring a Telegraph Key / Sounder

20 years ago, I found this in my grandfather's basement.

I learned years later, that it belonged to my grand-grandfather.



I was immediately attracted to its complexity and beautiful engineering



As for cosmetics, it was not only oxidized everywhere, but the isolation on the cables was also history...

After some research, I found that this is a Field Sounder Mark II, c1900, and even late 1800s.
*Source: The Australian Telegraph Office - by Ron McMullen (link).

You can find the description at #586 here.

I took it apart and began working in bringing back some life to the wooden base. I then stopped the project and left it sitting in my basement for the best part of the last 20 years

The year 2020 came along and I felt it was time to finish what I had started and aim for a full restoration and shiny bronze, so here goes my step-by step process:

Step 1: Remove the enamel coat. I used gel paint stripper:







Step 2: Submerge the parts in Liquid Rust remover (which is a strong acid) and leave dor a few hours.


At least the rust was gone, but I was super scared after seeing the chemical reaction with the acid: It turned everything to a brown copper color. But not all was lost: it was time for Step 3.

Step 3: Recover the golden color: Rotary metal brush.



Now we're talking. The metal brush on your dremel is a quick and great way to both restore color and shine.

Step 4: Polish to remove scratches and provide a finished aspect.






Step 5: This is the final step: reassembly.






I also found the schematics for the operation with another key for both continuous and intermittent mode.




The metal plate reads: "Caution: C is not to be connected to Z without first disconnecting the battery."
Which makes perfect sense since doing so would short-circuit the battery.

Now to the elecronics.

I have no one to telegraph to however, I'm thinking of sneaking-in a battery and do some microcontroller magic so I can talk to it by tapping the key and obtain a solenoid response.

The solenoid is 12V, so the first thing I want to test is to have it potentially working with 5V, and it does not.

I may come with an external circuit powered with 12V.

To be continued...








Wednesday, May 9, 2018

Incandescent light bulb effect simulated with a microcontroller and LEDs

Last year, I received this marquee sign as a gift:


What do we have?

A beautiful marquee sign: simply constructed on a real metal frame, printed cardboard with printed rust, printed screw holes and such for aged-tin effect. It looks fairly realistic and pleasant to the eye.



A very nice detail I found are these mock-up light bulbs ,made of a small glass bulb screwed on top of a standard warm white LED:


A small switch on the side closes the circuit delivering 3v from two AA batteries located on the back, allowing all of these leds to turn on simultaneously. It's nice to see it lit, but there is room for a small project.

Room for improvement:

This sign is crying for enhanced simulation, so this project will consist of:

1) Adding a sequence for the bulbs just like the real deal.

and

2) LEDs bright up instantly, and there's no nostalgia in that. Instead, let's emulate the slow paced filament / tungsten / incandescent effect of vintage light bulbs.

This whole project was influenced by real marquee signs such as the one below


some of you may recognize this sign.

Solution:

This is a relatively simple microcontroller project, so let's get it done:

Requires cutting the original connections and rewire them to the PWM pins on the arduino.
The pins you choose NEED to be PWM if you want to simulate the filament effect.

I wired each letter individually and treated the bowling pin as an individual, (the LEDs on the bowling pin are in parallel).


The original battery holder was also replaced by a holder for two 18650 type batteries. These will deliver 8v but the voltage regulator on the Arduino nano takes care of the excess voltage.

The light bulb effect:

There is a way of achieving this with an analog circuit (more on that here), but I went for a software solution since the Arduino board was already in.

So here's my gift to you people: How to accurately simulate a lightbulb by means of applied science.

It's not a matter of slowly turning a led on or off in a linear fashion, no: that doesn't look natural nor responds to the way the I-V curve of a light bulb behaves in real life.

If you want a more realistic approach, you should go for an exponential equation that looks like this:



The blue line represents the turning on phase, and the red one when the led shuts down.

To accomplish this, you may use an equation of the form:

Source: 1st order differential equations (https://www.math24.net/learning-curve/)


In this case Lmax is equal to 255 since PWM on the atmega 328 fluctuates between 0 and 255.
I chose k = 0.02 to shape the curve to my liking, and M=0 (M being the resulting value of L(t) when t=0)

The equation looks like this when coded in C or Process and the aforementioned values are applied:

led_intensity = 255-((255-0)*exp(-0.02*t));

...where the function exp(x) means e to the power of x.

And voilá, the project is finished and the sign is much more fun to watch now.


This animation above does not reflect the incandescence effect, but you get the idea. Try the code and play with it!


Sound effect bonus:
You may have noticed that the Arduino nano sits on top of a green PCB. This is because I may decide to add a 5v mini relay and have it click every time a bulb turns on or off. Then the effect will be complete, by emulating the clicking sound of vintage marquee signs.


Code:




/// June 2017Marquee Bowling sign with Tungsten filament lightbulb simulation using LEDS

// Pin number definition follows
// These all need to be PWM pins, so that explains the choice for 3,5,6,9 and 11.

#define B_lamp 3  
#define O_lamp 5
#define W_lamp 6
#define L_lamp 9
#define BOWLINGPIN_lamps 11

#define max_illumination 110  // Up to 255, this defines the maximum illumination you want
// multiple lamps in parallel require an extra for extra current so we need to compensate for that
// otherwise the letters on the sign will glow brighter than the bowling pin
#define max_illumination_for_bowling_pin 255  
#define pausa 1000
#define filament_simulation 1500  // This parameter allows your lamps to turn on an off quicker or slower depending on the type of light bulb and voltage you are simulating.

// the setup function runs once when you press reset or power the board
void setup() 
{
  // Serial.begin(9600);  // This is for debugging purposes, disabled by default. 
  // initialize digital pins
  pinMode(B_lamp, OUTPUT);
  pinMode(O_lamp, OUTPUT);
  pinMode(W_lamp, OUTPUT);
  pinMode(L_lamp, OUTPUT);
  pinMode(BOWLINGPIN_lamps, OUTPUT);
}

// the loop function runs over and over again forever
void loop() 
{
  // Program the sequence you like. This is the one I chose.
  turn_on(B_lamp);
  delay(pausa);
  turn_on(O_lamp);
  delay(pausa);
  turn_on(W_lamp);
  delay(pausa);
  turn_on(L_lamp);
  delay(pausa);
  blink_bowlingpin();
  delay(pausa*3);
  turn_off(B_lamp);
  delay(pausa);
  turn_off(O_lamp);
  delay(pausa);
  turn_off(W_lamp);
  delay(pausa);
  turn_off(L_lamp);
  delay(pausa);
  turn_off(BOWLINGPIN_lamps);
  delay(pausa*2);
}


void turn_on(int lamp)
{
  int maximum = max_illumination; if (lamp==BOWLINGPIN_lamps) maximum = max_illumination_for_bowling_pin;  
  // Now we initiate the slow glow effect
  for(int tungsten=0 ; tungsten <= 200 ; tungsten++)
    {
      float level = 255-((255-0)*exp(-0.02*tungsten));  // This is what really matters: an exponential equation for realistic light bulb simulation, not that linear rubbish.
      level = map(level,0,251,0,maximum);  // Remap the maximum to the desired level.
      analogWrite(lamp, level); // PWM comes to save the day, that's why we analogWrite
      delayMicroseconds(filament_simulation);  // How fast or slow you want your bulbs to be
      //Serial.print(tungsten);Serial.print(";");Serial.println(level);  //This is for debugging only.
    }
}

void turn_off(int lamp)
{
  int maximum = max_illumination; 
  if (lamp==BOWLINGPIN_lamps) maximum = max_illumination_for_bowling_pin; 
  for(int tungsten=0; tungsten <= 200 ; tungsten++)
    {
      float level = 251-(255-((255-0)*exp(-0.02*tungsten)));  // The same curve, in the opposite direction
      level = map(level,0,251,0,maximum);
      analogWrite(lamp, level); 
      delayMicroseconds(filament_simulation/2);
      //Serial.print(tungsten);Serial.print(";");Serial.println(level);
    }
}

// Now some blinking to catch the eye of the distracted driver on the road and get them into our bowling business

void blink_bowlingpin() 
{
  for (int blink=0; blink <3 ;blink++)
  {
    turn_on(BOWLINGPIN_lamps);
    delay(pausa/2);
    turn_off(BOWLINGPIN_lamps);
    delay(pausa/2);
  }
  turn_on(BOWLINGPIN_lamps);
}

Wednesday, September 23, 2015

Illuminate your Space Shuttle the way it deserves




This particular project somehow embodies three of the things that amaze me the most: Electronics, Space Exploration (particularly the STS since I watched the first Columbia launch live on TV back in 1981) and yes: Lego.

I acquired this set (# 10231) very recently without really understanding why didn't I get it when it first came out but anyway, this gorgeous Shuttle finally decorates my home office and it's staying.

One of the first things I thought after playing with it was "wouldn't it be cool if..."


Okay you get the idea, now to the project.

The implementation is simple and I executed it in two hours: Add LEDs to the spotlights of the set while adding a nice feature: have them power up automatically whenever there's no enough ambient light for an incredibly cool effect.

First thing was to figure out a simple circuit and for that Internet can be your friend:


Thanks to the people at Build Circuit Australia

This circuit senses ambient light with the phototransistor and if it gets dark, it fires up the LEDs.
Power consumption when idle is 0.9mA and when fully lit is 1.4mA.

The reason why this circuit draws current when idle is because that in the presence of light (or IR light) Q3 turns on and current will flow through it, and through the Base-Emitter junction of Q1.

When Dark both Q3 and Q1 are turned off. R1 then takes control, exciting the base of Q2, turning the LED on as a consequence.

I changed several resistor values here in order to make it work the way I wanted. I also used PN2222A NPN transistors just because I had those laying around. So feel free to play around with these values until it works the way you want.

Some soldering, I added a switch for MECO (that's NASA terminology I feel like using for this post).


Batteries on the flip side:


Prepare the MLP (more NASA terminology for you to find out in case you are not already familiarized) and modify accordingly for it to receive the new circuit and power supply:



Here you can see it fits right between the SRB underneath the stack. The added circuit remains invisible to the spectator.



Now the trickiest part, yet still fairly easy to accomplish: Fit the LEDs. I used isolated fine copper wire from an inductive charger. You can find this type of wire in an old transformer as well.




Done.

And done. The wire is barely visible, and I use some Lego parts to hide it further. The cables go straight to and behind the TSMs and then routed to the circuit board.


Finished Project. You can see I'm using my hand to shadow the phototransistor for this particular test:



View from behind:


End result. Whenever it gets dark, the Shuttle remains visible.

Enjoy!!!!!











Tuesday, October 7, 2014

Retrobright your R2-D2

Yellowed R2-D2?


This R2 unit was acquired from some jawas who came by my house a long time ago...

So long ago, that its shell yellowed from the effects of the UV and its 12+ years of ownership.

This is the Hasbro voice command R2 unit, made of plastic..

Since the yellowing is caused primarily by the bromine present in the flame retardant the manufacturer adds to the ABS plastic, I thought of actually reversing the yellowing process instead of painting R2.

This can be accomplished with a mix called Retr0bright.

These are the preliminary results after day 1:





Left: 10:30am.   Right: 6:00pm after brushing it with Retrobright and direct UV from sunlight.



The results are impressive to say the least. The yellowing does not go away completely but I am very satisfied with the improvement. Texture of the plastic was not affected in any way, although the blue paint got some stains that I think I can fix with polishing with some cloth.

Skills required:


- Disassembly skills and (screwdrivers+patience). There's an instructive video on how to disassemble R2.






- Soldering skills. Quite a bit, yes. In order to truly separate all the plastic from electronics, you need to de-solder some of the wiring. And you want to truly separate plastic because you will need washing, brushing, painting, rinsing your droid. Attempting this on an assembled model will be MUCH harder.

Inside R2.




Detail of motor circuit being de-soldered.



Ultra-Violet (UV) exposure for 7 hours


Get it done:


1.- Check the weather forecast and ensure a full sunny day if that is possible at your location.
2.- Lay your plastic parts as separate to each other as you can, so they don't shadow themselves.
3.- Put on your gloves and goggles and prepare a Retr0brite mix. 1/3 of a cereal bowl should do. It will seem too much at first but you will be re-applying many times throughout the day until you deplete your dose.
4.- Paint a layer over the yellow. Try to avoid paint and stickers but if you paint over them there won't be substantial damage to the paint so no need to be perfect.
5.- Leave it there for two hours and re-apply as soon as you see it's drying out. Rinse your latex gloves with water every time, then remove them from your hands.
6.- Let the sun do its magic.
7.- Go to step 5 until sunset.
8.- Rinse your plastic parts one by one and use a brush to ensure mechanical removal. Don't ever remove your gloves nor your goggles.
9.- Repeat another day if needed. 
10.- Sell it to the same Jawas for double the price.  

WARNING:


This project is not for kids. Maybe not even for adults (if you happen to have another droid to do this for you, have HIM do it.)

The reason being that Hydrogen Peroxide at this concentration can SEVERELY BURN YOUR SKIN or BLIND YOU FOR GOOD.

I used latex gloves at all times, and while rinsing the plastic with a brush I accidentally sprayed some of the substance straight to my eyes. I was wearing eye protection, however I experienced some burning on my face out of oxidative stress on skin, to a point it hurts and whitened the surface of the skin.

USE IT AT YOUR OWN RISK AND WEAR EYE AND HAND PROTECTION AT ALL TIMES