Using the ATTiny85 instead of the UNO


Programming the ATTiny85, Arduino Style
by Thatcher
This is a sort of a continuation of the last post. In the last post,
I showed how to load the ATTiny85 cores into the Arduino IDE.
If that worked for you, cool! This how to actually program the chip. 
If it didn't work... put a comment somewhere. I'll try to help.
Anyway, programming the ATTiny is very easy. 
The only thing you really need to do is set up a target board. 
This is either a breadboard, perfboard, or PCB circuit that interfaces 
the ATTiny to an Arduino board. The circuit should have
these connections:

This is called ISP circuit. The chips communicate over
SPI via this configuration.

  























What this circuit does is connect the ATTiny to power and ground,
but it also has four wires for communication. It does this using a 
protocol called SPI. The four connections are SCK (clock), 
MISO and MOSI (communication), and Reset (resets the chips 
when it is done). That circuit connects the SCK, MISO, and MOSI pins
of both chips to the corresponding one on the other chip. 

The reset pins of the two chips are not connected, however. 
The Master (Arduino in this case) has a digital pin connected to the 
actual reset pin of the slave (ATTiny85). On the Arduino Uno and 
Duemilanove (and some other ones of the same shape), SCK is pin 13,
MISO pin 12, MOSI pin 11, and reset pin 10. The ATTiny85 pinout is below.

ATTiny85 pinout, showing the uses of all the pins.
   







The breadboard programmer above isn't the only way making
a target board.I made one out of a small piece of perf board, 
a DIP 8 socket, a five-pin header, and a bunch of wires.


That one wire that shoots off in both pictures is going to power.















It is is the same circuit as the breadboard, only more permanent. 
Same connections, though.

Actually Programming the Chip
 
Once you have one of these target boards, either on a breadboard or
perfboard (or something else), we can actually program it. 
The first thing to do is upload the ArduinoISP sketch onto
the Arduino board. You find it here:

File/Examples/Arduino ISP
 











And then upload it. What it does is a couple of things: the first thing it 
does is emulate an AVRISP programmer. The computer asks what
it is, and it says it is a AVR programmer instead of a more
generic serial device.

The computer sends it the program (in hexadecimal form) and then it 
goes to its second function. It loads the program hex file onto the 
other chip via SPI and then relays whether or not the operation 
worked to the computer.

So connect your target board, make sure everything is connected,
and (IMPORTANT!) set the Tools/Board Menu to ATtiny85
(w/ Arduino as ISP). Note: you may have to put a 110 ohm resistor
between reset and power on the Arduino board. Then you can upload
your program. I used this one. It is for the board that I fixed in the
last post!

int toast = 0;

void setup(){
  pinMode(0, OUTPUT);
  pinMode(1, OUTPUT);
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  PORTB = B0000100;
}

/*

0 - H
1 _ H
2 - L
3 - H

*/

void loop(){
  PORTB = B0001011;
  delay(int(random(2000))*10);
  toast = int(random(4));
  for(int i = 0; i <= int(random(5,12)); i++){
    delay(int(random(30, 60)));
    digitalWrite(toast, LOW);
    delay(int(random(30,60)));
    digitalWrite(toast, HIGH);
    delay(40);
    PORTB = B0001011;
  }
  //delay(10000);
}

That should do it. You'll get this message in the bottom window:


If another set of text appeared, something is wrong. Here is a 
good site for finding out what the errors mean. Otherwise just
Google it. Now you can test the chips on a breadboard or a
PCB or something... I really hope this helps people. I just
love the ATTiny chips because they're so small yet can still
do many of the same things as a normal Arduino. Remember,
though, not every function works. 

Hacked Cassette Adapter


Bluetooth Cassette Adapter

I've been looking for a new car recently and one feature that I really want is a sound system with Bluetooth connectivity. For ages I've played music in my truck from my phone using a cassette adapter but I hate dealing with the wires. Then inspiration struck. What if I had a cassette adapter with Bluetooth connectivity? Brilliant!

For a starting point I went to eBay and found a cheap pair of Bluetooth headphones for about $15

Opening up my old cassette adapter, this is what I found. The gear drive will need to be kept intact, otherwise the tape deck will think that the tape is at its end. Unfortunately this dramatically cut down the amount of space that I had to work with. Fitting everything into the cassette form factor was the biggest challenge of the project.

This is what the electronics of the headphones looked like after teardown. The electronics are pretty straight forward. I'll need to keep the PCB and the battery. To get the adapter to play through the tape deck I took the leads from the speakers and soldered them to the tape write head from the cassette adapter.

It looks like I got lucky. The Bluetooth PCB will fit along the side of the cassette without having to cut it down or move components. I cut out one corner of the cassette to make space for the mini USB port that is used to charge the device.

To mount the circuit board I cut out a slice in the cassette housing to hold one end and secured the other end with a tiny screw.

 Here is how I arranged the electronics in the cassette. There was just barely enough space, but everything fits, and the gear drive still works.


All that was left was tricky task of reassembling the cassette. Here is the final product. the button on the top is used to turn the system on and off.

The cassette adapter works great! The gear drive is more noisy than it used to be but if you are playing music you don't notice it. I've been driving around with my new adapter for a few days now. It seems like I get about 6-7 hrs of music time between charges. I had originally hoped to be able to charge while playing but the  design of the tape deck in my truck interferes with the cable. Anyway, I'm pretty happy with the results.

Dave from EEVBlog explains open source hardware


What is open source hardware ?

Dave from EEVBlog explains what open source hardware is via this YouTube video.





Additional information can be found via these links.

Open 7400 Logic Competition



The Open 7400 Logic Competition brings awareness to open hardware and software, and fosters understanding of the building blocks of modern integrated circuits. What can you build with logic Chips? 
Entries can be posted via the Dangerous Prototype forum, a personal blog, or even a handy how-to site like Instructables. When you’re ready, please submit a link to your project via the contact form
Entries must be received by October 21, 2011, 6AM GMT. Winners will be announced  via the Dangerous Prototype forum on November 1, 2011. Visit the Dangerous Prototype forum for rules, prizes, and limitations. 


Guide to MOSFET

A Beginner's Guide to MOSFET by Moser


IRFP260N image from warf.com. Pins are Gate, Drain, Source from left to right.
If you need to switch high current and or high voltage loads with a micro controller you’ll need to use some type of transistor. I’m going to be covering how to use a MOSFET since it’s a better option for high power loads. This guide will be just a brief introduction that will discuss how to drive a mosfet in a simple manner with the ultimate goal of making it act like an ideal switch.
Refer to the N or P channel basic wiring schematics and remember the three pins: Gate, Drain, and Source. When I mention something like Gate-Source potential difference, I’m talking about the difference in voltage between the two pins.
N channel MOSFET
How to think of a MOSFET
A MOSFET may be thought of as a variable resistor whose Drain-Source resistance (typically Rds) is a function of the voltage difference on the Gate-Source pin. If there is no potential difference between the Gate-Source, then the Drain-Source resistance is very high and may be thought of as an open switch — so no current may flow through the Drain-Source pins. When there is a large Gate-Source potential difference, the Drain-Source resistance is very low and may be thought of as a closed switch — current may flow through the Drain-Source pins.
P channel MOSFET
N channel: For an N channel MOSFET, the source is connected to ground. If we want to let current flow, we can easily raise the voltage on the gate allowing current to flow.
P channel: Looking at the P channel MOSFET, the source is connected to the power rail V2. In order to allow current to flow the Gate needs to be pulled to ground. To stop the current flow, the gate needs to be pulled to V2. A potential problem is if V2 is a very high voltage it can be difficult raising the gate to the V2 voltage. Also note that logic is inverted for a P type mosfet!
Drain-Source resistance: Ideally we want Drain-Source resistance to be very high when no current is flowing, and very low when current is flowing. The main issue using MOSFETS with micro controllers is that the MOSFET may need 10-15 Gate-Source potential difference to get near its lowest Drain-Source resistance.
IRFP260N gate capacitance
IRFP260N current curves.
Gate-Source Capacitance:There is also a capacitance on the Gate-Source pins which prevents the mosfet from switching states quickly.
Mosfet Driver
A half bridge is needed to quickly turn a mosfet on and off and raise the Gate to a high voltage. There are many ICs available which can do this. Here’s a list of just a few that I’ve tested. Schematics are also provided!
Fet driver is a Half Bridge
  • MIC4422YN – Max of 18v, 9Amps peak, 2 Amps continuous.
  • MCP1407 - Max of 18v, 6Amps peak, 1.3 Amps continuous.
  • UCC27424  – Can drive two MOSFETs, Max of 15v, 4Amps typical.
All of these drivers performed nearly identically (~20ns rise, ~30ns fall).
Mosfets I tested
It was originally part of the plan to get some data about these guys, but I have been very busy with school. The MOSFETs have plenty of graphs inside the datasheets!
UCC27424
MIC4422YN, and MCP1407
An Important Reminder: Don’t forget that typically the heat sink on the back of a mosfet is connected to the Drain! If you mount multiple MOSFETs on a heat sink, the MOSFET must be electrically isolated from the heat sink! It’s good practice to isolate regardless in case the heat sink is bolted to a grounding frame.
Schematic Diode: If the load is somewhat inductive, you’ll need to put a diode to discharge the inductor. If you want more detail, look at the International Rectifier pdf at the end.
Mosfet Example
Arduino Mosfet Example
Without the driver, the Gate takes longer to charge, and it peaks at 5v.

The Cuban Rikimbilis

Engine hacks for people who can buy cars via HackaDay

After the United States enacted a near-total economic embargo against Cuba in 1962, American export of Detroit Iron came to a halt. Since then, some Cubans have been lucky enough to own a classic Chevy or Buick. Soviet imports of Volgas stopped in the 1990s. With a dearth of any sort of motorized transport (and a public transport system that’s even worse than America’s), some Cubans went with the only reasonable solution: they built Rikimbilis, bicycles and engines hacked together into a moped.






Most rikimbilis are based around Chinese bicycles with a motor ‘obtained’ through ‘non-conventional means’. The exhaust can be fabricated from just about any metal tube available, and a plastic soda bottle is the gas tank of choice. Everything on these bikes is done for reasons of economy and availability, and the fuel efficiency is unbeatable with some rikinbilis getting 120 mpg.

Because they’re not especially safe, Riquimbilis are illegal in Cuba, but the police generally turn a blind eye to their use. Lately the Cuban government has begun cracking down on riquimbilis, but with not many cars to go around these machines of necessity will most likely continue plying Havana boulevards.

Single molecule is tiniest electric motor ever

VIA :   New Scientist.
For the first time, an electric motor has been made from a single molecule. At 1 nanometre long, that makes the organic compound the smallest electric motor ever.

Its creators plan to submit their design to Guinness World Records, but the teeny motor could also have practical applications, such as pushing fluid through narrow pipes in “lab-on-a-chip” devices.
Dn20863-1 300

Weather Station


Homebrew weather station plus a pan and tilt camera by Mike Nathan

Sebastian wrote in to share his web site, where he has a bunch of different electronics projects. After looking through them, we found a pair that we thought you might find interesting.
The first project is a homebrew weather monitoring station that Sebastian put together. He designed a weather shield, incorporating humidity, pressure and light sensors, along with digital I/O ports for monitoring an anemometer. The entire setup is powered using solar panels, and data is relayed to his computer via an Xbee.
The second item that caught our eye was a digital camera pan and tilt rig. The system was built using a Lynxmotion pan and tilt kit, which is controlled by an Arduino. The code he provides allows him to capture very large composite images without having to spend too much time “sewing” them together. While this second project mostly consists of schematics for a base plate and pan/tilt code, it struck us as something that could be very useful for any budding photographers looking to take panoramic shots.
All of the schematics and code for his projects are available on his site, so be sure to look around – you might find something interesting!

Advent Calendar

Bare-bones Electronic Advent Calendar, by Brian Benchoff

It’s officially September now (in some parts of the world), and that means we’ve been watching the Christmas decorations go up on the floor of Costco, Walmart and Target for the last few weeks. As a small test of reality, Eric decided to build an electronic advent calendar that counts down the days until Christmas. As a simple build using parts lying around on the bench, Eric did a pretty good job at
deferring his kid’s questions of, “How long until Christmas?” to a machine.
The build is fairly bare-bones, using only an Arduino Pro Mini, RTC and LCD display. For the real-time clock, Eric used the ever popular DS3231 RTC. The software reads the time from the clock and calculates the number of seconds between the present time and the hard-coded target date.
Everything is powered by a 9 Volt battery that wouldn't last the remaining 115 days until Christmas. There is a power switch and the RTC has a battery backup, so the build will probably suffice for all but the most fanatical child.

Cool RC Jet with FPV

via vrfler
A micro camera is installed onboard an r/c plane F-16. The camera transmit live the video to ground and I wear video goggle to fly the plane in real time like if I was in the cockpit. The camera replace the head of the pilot and the movement of the cam is control by the movement of my head on ground via a head mount gyroscope (head tracker)

The whole system cost me around $1500 including the plane. But it is many hours of hand made modifcation. You can start with simpler video system that cost around $500 and install it on your own r/c plane. Search for FPV on the web for more info about my hobby.