Introduction |
Published date: 29/12/2015
|
I used the Atmel ATtiny45 (you can also use the ATtiny85) micro-controller and I programmed it with the Arduino uno board. To make this possible I used the Arduino board as an ISP programmer. Keep in mind that you can always use an "USB to ISP" programmer or the Arduino ISP board to program your micro-controller.
Please note, this project requires some technical skills, so I am not responsible for any damage in your vehicle!
Watch the video bellow, it's from mine RPi Car Pc, you can see at 00:25 that the system remains on when I am starting up the engine.
Please note, this project requires some technical skills, so I am not responsible for any damage in your vehicle!
Watch the video bellow, it's from mine RPi Car Pc, you can see at 00:25 that the system remains on when I am starting up the engine.
|
|
Arduino uno board as an ISP programmer
In this step we will set the Arduino uno board to act as an ISP programming device.
You will need:
Here's the "Arduino ISP" code, embedded using Codebender!
Try downloading the Codebender plugin and clicking on the "Run on Arduino" button to program your Arduino board with this sketch. And that's it, you've programmed your Arduino with the ISP program!
Now disconnect the Arduino usb cable from your computer and proceed to the next step.
You will need:
- Arduino uno
- Breadboard
- ATtiny45/85
- 10 uF capacitor
- jumper wires
Here's the "Arduino ISP" code, embedded using Codebender!
Try downloading the Codebender plugin and clicking on the "Run on Arduino" button to program your Arduino board with this sketch. And that's it, you've programmed your Arduino with the ISP program!
Now disconnect the Arduino usb cable from your computer and proceed to the next step.
Connecting the Arduino uno with the ATtiny45/85
The connections are pretty easy, see the above image with the breadboard circuit schematic.
Tip: The dot in the corner of the ATtiny shows the first pin.
Tip: The stripe on one side of the capacitor shows the negative pin and should connected with ground. We will use the capacitor because it prevents the Arduino UNO from resetting, so we are sure that the Codebender (or Arduino IDE) talks to the ArduinoISP, and not with the bootloader, during the upload of sketches. You can now connect again the Arduino uno to your computer and proceed to the next step!
Tip: The dot in the corner of the ATtiny shows the first pin.
- Pin 1 to Arduino pin 10
- Pin 2 -
- Pin 3 -
- Pin 4 to Arduino GND pin
- Pin 5 to Arduino pin 11
- Pin 6 to Arduino pin 12
- Pin 7 to Arduino pin 13
- Pin 8 to Arduino 5V pin
Tip: The stripe on one side of the capacitor shows the negative pin and should connected with ground. We will use the capacitor because it prevents the Arduino UNO from resetting, so we are sure that the Codebender (or Arduino IDE) talks to the ArduinoISP, and not with the bootloader, during the upload of sketches. You can now connect again the Arduino uno to your computer and proceed to the next step!
The Code
|
We will use Codebender - online Arduino IDE - to program the ATtiny45/85 micro-controller.
Click here to connect with your Codebender account. |
Here's the main code, embedded using Codebender, click on the "Clone & Edit" button.
For the next steps see the image above:
Click on advanced options button (gear icon on the right)
For the next steps see the image above:
Click on advanced options button (gear icon on the right)
- Select "Arduino as ISP"
- Select port (mine is COM12)
- Select from boards menu the ATtiny45/85 with 8MHz internal osc
- Press the "Run on Arduino" button
The Circuit
What you will need:
|
|
Take your time and build the above circuit. Please don't change anything! As I said before, I am not responsible for any damage in your vehicle.
Some notes:
Some notes:
- The first dc to dc converter is only for our power controlling system and is giving power to the ATtiny45/85 and one channel relay board. I used a simple phone charger. It's recommended to use one 1A fuse in the input on it (if it doesn't have already)
- The second dc to dc converter is for the Raspberry Pi, so the output of the converter (5V) should be connected to the micro usb power port of Raspberry. It's recommended to use a very good converter with up to 2A output current and one 2A fuse.
- The push button must be accessible at any time, so you must connect it with one long cable.
That's it!
I hope you liked this, let me know in the comments!
For more Arduino tutorials and cool projects you can visit our web page:www.ardumotive.com P.S. A detailed guide on how to make your RPi Car Pc system will be available soon! |