Showing posts with label attiny45. Show all posts
Showing posts with label attiny45. Show all posts
Wednesday, December 2, 2015
123DCircuits and Digispark for Easy Cheap Projects
I have been working with ATTINY chips for some time. When I saw the low cost Digispark that has one on board, I had have 1.
I have developed this project that utilizes the ease of programming with 123D Circuits and the cost of digispark. It is very similar to the standalone ATTINY circuits posted several years ago but has been simplified, to make it easier to program and easier to manufacture. Check out the instructions bellow.
PCB manufacturing tutorial
123D Tutorial 1
123D Tutorial 2
123D Tutorial 3
123D Tutorial 4
123D Arduino project
123D ATTINY without Digispark
Software install - new version
software install - old version
Chinese Digisparks
Real Digispark
Labels:
Arduino,
attiny,
attiny45,
Design Technology,
electronics,
Maker space,
MakerED
Friday, September 26, 2014
Trinket Back-up Sensor
Recently I purchased some Trinket 5V boards from ADAFRUIT. They are a great little board for Learning about electronics and they use the Arduino IDE for programming. With a price tag of $9 in Canada they make a great substitution for the Arduino board and its $30 price tag.
I have put together a great little project using the Trinket and a HC-SR04 distance sensor. All this is a simple back-up sensor. If there is a safe amount of space it displays a green light, as you approach a yellow and then red light are displayed.
Code:
int ECHOPIN = 3; // Pin to receive echo pulse
int TRIGPIN = 4; // Pin to send trigger pulse
int LED1 = 0;
int LED2 = 1;
int LED3 = 2;
void setup(){
pinMode(ECHOPIN, INPUT); // sets echo pin to recive pulse from range finder
pinMode(TRIGPIN, OUTPUT); //sets trigger pin so range finder can start pulse
pinMode(LED1,OUTPUT);
pinMode(LED2,OUTPUT);
pinMode(LED3,OUTPUT);
}
void loop (){
digitalWrite(TRIGPIN, LOW);
delayMicroseconds(2);
digitalWrite(TRIGPIN, HIGH);
delayMicroseconds(10);
digitalWrite(TRIGPIN, LOW);
float distance = pulseIn(ECHOPIN, HIGH);
distance= distance/58;
if(distance >= 100){
digitalWrite(LED1, HIGH);
digitalWrite(LED2, LOW);
digitalWrite(LED3, LOW);
delay(100);
}
if(distance <= 75 && distance >=50 ){
digitalWrite(LED2, HIGH);
digitalWrite(LED1, LOW);
digitalWrite(LED3, LOW);
delay(100);
}
if(distance <= 49.9 && distance >=25 ){
digitalWrite(LED3, HIGH);
digitalWrite(LED1, LOW);
digitalWrite(LED2, LOW);
delay(100);
}
if(distance <= 24.5 && distance >=15){
digitalWrite(LED3, HIGH);
digitalWrite(LED1, HIGH);
digitalWrite(LED2, HIGH);
delay(500);
digitalWrite(LED3, LOW);
digitalWrite(LED1, LOW);
digitalWrite(LED2, LOW);
delay(500);
}
if(distance <= 14.5){
digitalWrite(LED3, HIGH);
digitalWrite(LED1, HIGH);
digitalWrite(LED2, HIGH);
delay(100);
digitalWrite(LED3, LOW);
digitalWrite(LED1, LOW);
digitalWrite(LED2, LOW);
delay(100);
}
}
I have put together a great little project using the Trinket and a HC-SR04 distance sensor. All this is a simple back-up sensor. If there is a safe amount of space it displays a green light, as you approach a yellow and then red light are displayed.
Code:
int ECHOPIN = 3; // Pin to receive echo pulse
int TRIGPIN = 4; // Pin to send trigger pulse
int LED1 = 0;
int LED2 = 1;
int LED3 = 2;
void setup(){
pinMode(ECHOPIN, INPUT); // sets echo pin to recive pulse from range finder
pinMode(TRIGPIN, OUTPUT); //sets trigger pin so range finder can start pulse
pinMode(LED1,OUTPUT);
pinMode(LED2,OUTPUT);
pinMode(LED3,OUTPUT);
}
void loop (){
digitalWrite(TRIGPIN, LOW);
delayMicroseconds(2);
digitalWrite(TRIGPIN, HIGH);
delayMicroseconds(10);
digitalWrite(TRIGPIN, LOW);
float distance = pulseIn(ECHOPIN, HIGH);
distance= distance/58;
if(distance >= 100){
digitalWrite(LED1, HIGH);
digitalWrite(LED2, LOW);
digitalWrite(LED3, LOW);
delay(100);
}
if(distance <= 75 && distance >=50 ){
digitalWrite(LED2, HIGH);
digitalWrite(LED1, LOW);
digitalWrite(LED3, LOW);
delay(100);
}
if(distance <= 49.9 && distance >=25 ){
digitalWrite(LED3, HIGH);
digitalWrite(LED1, LOW);
digitalWrite(LED2, LOW);
delay(100);
}
if(distance <= 24.5 && distance >=15){
digitalWrite(LED3, HIGH);
digitalWrite(LED1, HIGH);
digitalWrite(LED2, HIGH);
delay(500);
digitalWrite(LED3, LOW);
digitalWrite(LED1, LOW);
digitalWrite(LED2, LOW);
delay(500);
}
if(distance <= 14.5){
digitalWrite(LED3, HIGH);
digitalWrite(LED1, HIGH);
digitalWrite(LED2, HIGH);
delay(100);
digitalWrite(LED3, LOW);
digitalWrite(LED1, LOW);
digitalWrite(LED2, LOW);
delay(100);
}
}
Labels:
Arduino,
attiny45,
electronics,
Maker space,
MakerED,
Trinket
Sunday, January 15, 2012
Programing the ATTINY 45/85 & 44/84 and building a Attiny 4LED display
I have been working with Arduino for several years now. The biggest problem I have had is the cost of take home projects for students. The Arduino boards themselves are inexpensive but building simple circuits with the AtMega 328 is not. I stumbled across the High-Low Tech page and was very interested in their Attiny programming. I went through the several post on the subject and compiled them in to a written tutorial that students can follow to program an ATTINY 45/85 or 44/84. Not all the technical data is there, but the steps for programming are.
In the last post I went over bread boarding a 4 LED display using an Arduino. This activity now correlates to a simple 4 led display. You will find attached the Fritzing file for the ATINY 45 display as well as Fritzing diagrams for programming both the ATTINY 45/85 and 44/84
Note: I this procedure only works with the Arduino Duemilanove board. If there are any corrections that will make it work with an uno board please not them in the comments.
Note if using the UNO board and Arduino 0022 or 0023 use This for step 1 in the tutorial
Programming Instructions
Fritzing 45-85
Fritzing 44-84 Updated!
Fritzing 4 LED display
Inkscape 4 LED Silk screen
Working display code
Trouble shooting:
If you can not get your codes to upload with Arduino 0022 or 0023 with an uno board try the fix at http://www.sirmc.net/view/2002/
If you are using nano arduino you can check out the soultion at http://jedahan.com/2012/01/15/arduino-code.html , Thanks Jonathan!
Labels:
Arduino,
attiny,
attiny44,
attiny45,
electronics,
Maker space,
MakerED
Subscribe to:
Posts (Atom)



