Here’s the final prototype of north bracelet. During the process I’ve learned a lot about electronics (thanks for Alex). Here are some core hints:
- For this application input was tilt compensated compass (CMPS10), outputs were 3 high luminosity leds.
- First prototype was made on breadbord to check how it works and to program arduino fio.
- To make it portable the circuit had to be replaced and soldered on smaller breadbord.
- There were few tricky moments: first of all, because of different voltage, leds didn’t want to shine enough bright. Transistor, which was helpful using power supply from computer appeared useless with lithium battery. The circuit was effected by removing it.
- Reflecting tape was used to increase brightness of leds. But everytime I sticked tape on panel, leds used to stop lightning. It appeared that tape worked as well as the conductor. To solve it I put some extra isolation on metal parts of leds.
- I had to change some components’ positions and cut out part of bread bord to place everything into the box. And finally it worked.
- Arduino fio doesn’t have usb port for programming. It requires special cable with pins.
Below you can see pictures of the process and final result, video and some technical data as well.
final prototype:
process:
circuit scheme:
code:
#include <Wire.h>#define ADDRESS 0×60
void setup(){
Wire.begin(); // Conects I2C
Serial.begin(9600);
}
void loop(){
byte highByte, lowByte, fine;
char pitch, roll;
int bearing;
int bright;
Wire.beginTransmission(ADDRESS);
Wire.write(2);
Wire.endTransmission();
Wire.requestFrom(ADDRESS, 4);
while(Wire.available() < 4);
highByte = Wire.read();
lowByte = Wire.read();
pitch = Wire.read();
roll = Wire.read();
bearing = ((highByte<<8)+lowByte)/10;
fine = ((highByte<<8)+lowByte)%10;
Serial.print(“Angle ”);
Serial.println(bearing);
if ((bearing > 15) and (bearing < 344)) {
bright = 255;
}
else if ((bearing < 15) and (bearing >= 0)) {
bright = map (bearing, 15,0,255,0);
}
else if ((bearing >344) and (bearing <= 359)) {
bright = map (bearing, 344,359,255,0);
}
analogWrite (9, bright);
delay(20);
}
int soft_ver(){
int data;
Wire.beginTransmission(ADDRESS);
Wire.write((byte)0);
Wire.endTransmission();
Wire.requestFrom(ADDRESS, 1);
while(Wire.available() < 1);
data = Wire.read();
return(data);
}