Hello everyone! I am Michalis Vasilakis from www.ardumotive.com and in this Instructables.com guide, I will show you how to make a simple - Arduino Based - Power Control System for RPi Car PC.
This system is designed for avoiding the abrupt shutdown of the PRi Car system on engine start up!
Also it has a button to manually switch off/on the system with safety.
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.
Q & A and updates here:http://www.ardumotive.com/power-control-system-for-rpi-car-pc-en.html
Let's get started!
Step 1: 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.
Connecting the Arduino uno with the ATtiny85
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.
- 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
Connect a 10uF electrolytic capacitor between Arduino uno reset pin and ground.
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!
Step 2: Program the ATtiny45/85 With Codebender
We will use Codebender - online Arduino IDE - to program the ATtiny45/85 micro controller.
Clickhere to connect with your Codebender account.
New to Codebender? Codebender is an online Arduino IDE, and free of use! Why Codebender? You can write and program your Arduino boards from your browser and the best part is that you can store all of your sketches online! So there accessible from everywhere! Also you can share them with your friends and social networks. With 517 builtin libraries, codebender offers the most comprehensive list of Arduino libraries in the world, and you can simply include them in your projects to use them.
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)
- 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
That's it, you've programmed the ATtiny45/85 with this sketch!
Step 3: The Circuit
What you will need:
- An PCΒ prototype board
- Programmed (!) ATtiny45/85 (use 8 pin socket)
- Resistors: 10K, 4.7K, 2K, 1K
- Push button
- One channel relay module
- 12V DC to 5V DC converter (max 1A)
- 2 x breadboard "male to female" cables
- and a small box to fit them all
- A very good 12V DC to 5V DC converter to power up the RPi system (max 2A)
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.
- The first dc to dc converter is only for our power controlling system and it gives power to the ATtiny45/85 and to 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 a long cable.