Showing posts with label electronics design. Show all posts
Showing posts with label electronics design. Show all posts

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! 

Monday, 15 July 2013

Unlock your potential with open source hardware


For long many have been scared of starting off in embedded systems and programming because of the fallacy that they it is hard. Times have changed and today there exists open source tools and platforms like that make the entry level requirements have gone qiute low. It is amazing the kind of projects that have been powerded by these platforms from blinking an led to going to space with ardusat.
 Just to mention a few platforms;

1. arduino is based on 8 bit avr microcontrollers with the new arduino Due for 32 bit microcontrollers.
"Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It's intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments." by Arduino Team
Arduino Due

Mbed : Based powerful 32 bit ARM microcontrollers.
"The mbed rapid prototyping platform is the fastest way to design products based on ARM microcontrollers.
The project is being developed by ARM, its Partners and the contributions of the global mbed Developer Community" by the mbed team.

mbed FRDM KL25Z

pinguino :Based on ©Microchip microcontrollers
"Pinguino is an Arduino-like board based on a PIC Microcontroller. The goal of this project is to build an integrated IDE easy to use on LINUX, WINDOWS and MAC OS X. Arduino is a powerful tool with some defaults. One of its inconveniences are a no native USB interface on the chip and its code length." by the Pinguino team.



Many other projects are featured on wikipedia and are interesting to look at.

With all these project one the greatest emphasis is on getting people to do the projects without worrying too much about about the complexity of  writing the underlying complex routines. They make you design your application easily without spending hours learning pragma, configuration bit or command line compilers. Most provides USB Bootloaders. This means that there is small program running inside the microcontroller is responsible for transferring your user program to the program memory and handing over the control to this program afterwards. No programmer is needed, the microcontrollers can be reprogrammed over USB with a PC.
These platforms come with plenty of examples and libraries which come in handy for both the advanced users as well as the beginners. Not to forget the numerous support from users all over the world. With only a few hours of study you could well have finished some nice projects.

Sites like instructables have numerous projects with step by step directions on how to work with these nice little toys. From my childhood days, I learnt that playing with toys is most enjoyable if the toy is mine. for this reason head to  nerokas electronics shop, get your toy and let the fun begin.