Monday 1 December 2014

LED LIT RIDING JACKET



 It has been quite a while since I posted anything here and am feeling a little guilty. But this does not mean that I have not been tinkering. I recently bought a tiny 150cc bike to navigate the crazy Nairobi traffic and when I ventured on the road I felt like a small grain sand in a sea of crazy PSVs and other motorists. After Purchasing my riding gear and using it for a while I decided to make it more visible by adding some wearable tech onto it using an LED strip arduino uno and a transistor TIP122. 


Posing with the bike



Riding jacket with LED strip on it, notice it at the elbow, waistline and back

How the jacket looks in the light, maybe it is too bright

And in the dark, amazing!

Arduino Uno thrown in the mix to add different lighting effects


The code that runs this jacket is simply a combination of the fading example and the blinking example that comes with the arduino IDE.
/*
 Fade
 
 This example shows how to fade an LED on pin 9
 using the analogWrite() function.
 
 This example code is in the public domain.
 */

int led = 3;           // the pin that the LED is attached to
int brightness = 0;    // how bright the LED is
int fadeAmount = 5;    // how many points to fade the LED by

// the setup routine runs once when you press reset:
void setup()  { 
  // declare pin 9 to be an output:
  pinMode(led, OUTPUT);
} 

// the loop routine runs over and over again forever:
void loop()  { 
  int x=0;
  for(x=0;x<255;x++){
  // set the brightness of pin 9:
  analogWrite(led, brightness);    

  // change the brightness for next time through the loop:
  brightness = brightness + fadeAmount;

  // reverse the direction of the fading at the ends of the fade: 
  if (brightness == 0 || brightness == 255) {
    fadeAmount = -fadeAmount ; 
  }     
  // wait for 30 milliseconds to see the dimming effect    
  delay(30); 
  }  
  
  for(x=0;x<5;x++){
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);              // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);              // wait for a second
  }
  
  for(x=0;x<10;x++){
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(500);              // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(500);              // wait for a second
  }
} 
 
 
Enjoy! 

Thursday 24 July 2014

Fabricating a Temperature data Logger Using Arduino in two days


Recently friends  approached me requiring a data logger for a refrigeration system they were building for cooling harvested agricultural produce. I quickly put together a prototype using an Arduino Uno  and data logger shield. I demonstrated and they were overjoyed. At this point I could see the relief in their eyes with the automation in data collection so they do not have to bear the pressure of  reading and recording the temperature from  four thermometers every few seconds. The initial contraption is pictured below.


So after making a good first impression, I set out to create a device that will be cheaper than the off the shelf proof of concept device. I have been down this road before and the worry is the bugs that delay an otherwise smooth process. After about an hour of design time I converted the contraption to one file ready for Fabrication using Toner Transfer Method. Then parts were sourced and soldered and soldered after drilling and cutting PCB down to size. For code and circuits checkout the repository on bitbucket. Otherwise below are pictures of the quick and dirty prototype. 

Completed device showing the makeshift probes and the nice plastic housing


Complete device showing SLA backup battery and wall adaptor for charging

For a two day Fabrication exersise I feel good about this. To make it better a friend is smiling all the way to the Lab.



Tuesday 1 April 2014

making infrared intruder counter / alarm


Introduction

This is a gadget for counting the number of times an infrared beam of light is interrupted. It is arduino based and implemented with an atmega328 chip on a veroboard. This is an easy project and may take a day to put together.

The counter working

Parts required

  • 220 ohms resistors
  • 10k resistors 
  • 4 digit 7 segment display
  • atmega328p/ arduino uno
  • infrared photo transistor
  • infrared diode
  • 7805 voltage regulator
  • power source: 7.5Vdc to 15Vdc
  • buzzer

Connecting it together

I use the pin mapping of the atmega328p from the arduino site and is also shown below. To protect the microcontroller pins from being destroyed by large currents that may flow, add 220 ohms resistors on the common cathodes or anodes of your display. 

For connecting the 4 digit  7 segment display use the assignment shown in the picture below. Just in case you have the same display I had, otherwise find the display pin assignment in the datasheet.



Connect the 4digit 7-segment display using pin assignement in the code and load the code to the MCU using a programmer. For me I use UsbTinyISP.

Code


/*Written by Dean Reading, 2012.  deanreading@hotmail.com
/Edited by Peter Mbari to Count number of Intruders using Infrared
 

 */

#include "SevSeg.h"

//Create an instance of the object.
SevSeg sevseg;

int sPin=12;
int buzzer=13;
int people=0;
//Create global variables
unsigned long timer;
int CentSec=0;

void setup() {
  //I am using a common anode display, with the digit pins connected
  //from 0-3 and the segment pins connected from 4-11
  sevseg.Begin(1,0,1,2,3,4,5,6,7,8,9,10,11);
  //Set the desired brightness (0 to 100);
  sevseg.Brightness(50);
  
  pinMode(sPin, INPUT);// Setup the Infared sensor pin as input
  
  pinMode(buzzer, OUTPUT);// Set Buzzer pin as output
  timer=millis();
}

void loop() {
  //Produce an output on the display
  sevseg.PrintOutput();
  
 if(digitalRead(sPin)==LOW)
 {
   people++;
  while(digitalRead(sPin)==LOW)sevseg.PrintOutput();
  digitalWrite(13,HIGH);  
  delay(500);
  digitalWrite(13, LOW);
 }
 
  
    //Update the number to be displayed, with a decimal
    //place in the correct position.
    sevseg.NewNum(people,(byte) 0);
  
}


Finaly after the board is assembled and working you get a nice display like the one shown in the video below.




Happy making








Thursday 9 January 2014

Home-made UV exposure box for PCB prototyping

Earliest last year I wrote this  post on how to make printed circuit boards using the method of toner transfer. Since before then I have known that the method is not consistent in the results obtained. Sometime the toner does not stick evenly on the copper clad especially for bigger designs.

During the same period I made several PCB at the University of  Nairobi Electrical Engineering department and the boards were much more superior to the ones I had made before using the toner transfer method.


good pcb made using pre-sensitized copper clad  


double sided pcb exposure box 

controls for the pcb exposure box
The department has a double sided PCB exposure box that is proven to give very good results over the many years it has been in service. Problem is I can't access this machine at my  leisure and therefore I decided to make my own machine.

First I sourced for the UV bulbs that were available in Nairobi and then enlisted the help of a colleague to get the box designed. A press fit design was quickly put together and cut from left over mdf using a cnc router we have at the fablab and some pictures are shown below!

Cutting the parts on the Shopbot
Some of the cut parts ready for assembly




Filing the edges for a nice fit

The we put together the box by press fitting as shown in the pictures below.

Press fit Box for the top cover
The bottom was also cut and assembled in the same way. The UV bulbs were then fitted and the fun began. . . TESTING!


Putting the bulb holders in place



fitting the bulbs after fitting the reflective foil(kitchen foil works fine)

the complete assembly

fitting a paper cover for a quick and dirty testing session(Just couldn't wait to fix the plexi glass cover)
 After all this hard work, it was now time to test this baby! Having recently bought a can of UV curable solder mask paint I decided to see if it will cure in this UV light.
After several failed attempts mostly due to underexposure, the results were messy.

the messy results


At the point whre I almost gave up and almost  threw the box in the dustbin, I had some of the  solder mask cured on one of the samples and my hope was rekindled! With this burst of energy and enthusiasm I experimented with different timings for the exposure and got some impressive results
pcb with solder mask after curing and cleaning with acetone

first encouraging results using an actual pcb
At this point I could predict the results and my money did not go to waste after all.

 One more experiment though PCB exposure for etching!
This is the primary reason for this box and it had to be tried as well with the following great results!

pcb  after exposure and development

pcb after etching!

pcb with Solder mask applied to it!

 Now that the machine is useful, a Plexiglas cover will be perfect for the top. Using a laser cutter this was cut and fitted and now the box is complete at least for single sided boards.



For double sided exposures I will have to finish the top, but I am impressed with the results I have got already!



THE QUEST CONTINUES!