Star Tracker

Electronic design

Design rules

It was clear that my design was going to work on the Arduino platform. I wanted a mainboard as small as possible, without sacrificing my Arduino ONE, with a hand-made circuit board and a very simple user interface. As a premise, reuse all the possible components and keep the cost to the minimum using the simple tools that I had.

After countless hours studying the subject and searching in the scrap heap of the basement, I started to outline a circuit inside my head. It would consist of an Arduino based on the project "Arduino on a Breadboard", but highly simplified and without external clock (it wasn't available), 8Mhz would be enough.

On the other hand I was not willing to waste the Arduino inputs using LCD screens, joysticks.... I had those components, but they weren't really necessary, simplicity above all. As an interface I would use a button and a buzzer, after all it was just about spinning an engine.

I also had to add safety elements to stop the engine and avoid the collision of both plates or the ejection of the screw out of the gear. To do this I used iR barriers extracted from old printers.

The motor control would be through Darlington transistors as a driver, the ULN2003A extracted from a scanner board would be more than enough. I would have to think how to solder this component to my perfboard because of its SMD form factor.

To make the mount portable, I had to design a power supply based on rechargeable batteries. Having no programmable power supply on my workbench, I was experimenting with different power adapters of 5v, 7v, 9v, 12v, 24v of those available at home. At the end of the tests I concluded that from 9v the engine had enough torque to not be blocked or to lose steps with the camera weight.

So I would build a Li-ion battery of three cells connected in series, reusing 3 old nokia BL-5C batteries, keeping their circuits and safety elements. With this package I would have available near 11v 1020mAh and would have to recharge each cell individually. To secure the battery pack I inserted it into a metal candy box

Batery pack design

In order to control the battery status, I used a voltage divider connected to an ADC input. This way we can measure the remaining voltage level on the battery safely for the CPU and display this value with a two-color led.

With all these design rules the total budget of electronic stuff is about 6€, for the ATmega328P, amazing!

Circuit design

For firsts designs I used Ffritzing and a breadboard, using an Arduino ONE board. The programming of the motor basics movements also took place at that time. They were moments of big learning and some confusion. The firsts prototypes were only a big mess of cables.

Motor control with Arduino
Motor control with Arduino
Basic circuit on protoboard
Basic circuit on protoboard
ATMEGA programming via Aurdino ISP
ATMEGA programming via Aurdino ISP

Once checked the correct operation with the breadboard, I added the power supply to the circuit and replaced the Arduino ONE by the ATMEGA328P. Then I continued working with Eagle for a better board design and components placement.

The resulting schema is quite simple, on the left side of the ATMEGA is located the LM7805 voltage regulator with its typical circuit.

In order to reset the microcontroller when programmed, we will connect the RESET signal between pin 1 and 10kΩ resistor connected to VCC. Thus, the ISP programmer can connect to GND that point and the ATMEGA will detect the LOW state on pin 1 (RESET) to reset.

On the right of the ATMEGA two iR barriers are connected to the ADC0 and ADC1. In the ADC2 we measure the battery level with a voltage divider. The R5 and R6 resistors are measured to obtain voltages up to 5v when the voltage divider input (+12v line) has voltages up to 21, 6v (more than 21v would damage the ATMEGA).

To represent the battery status, I used a bi-color led LD1 connected to PD1 and PD2 digital inputs. R3 and R4 are led current limiting resistors.

At the PD3 input, through a limiting resistor R2, we have a led (LED1) that will indicate the system power status.

The PD4 input is connected to a grounded pushbutton (GND) which will be used to select the different operation modes: running, stopping, fast-forward, rewinding... The system will count the number of consecutive clicks and foreach combination it will assign a command.

The buzzer connected to the PB1 output is used to confirm acoustically the chosen command and as an alarm of the iR barriers activation, indicating mechanical position errors .

The ULN2003A (IC3) connects to the processor using the PD5, PD6, PD7 and PB0 outputs. The stepper motor connects directly to IC3 output connections (O1, O3, O5, O7). Finally you only need to provide the necessary voltage to power the motor using CD+ input of IC3. The IC3 works regulating the output voltage (O1, O3, O5, O7) from 0v to 12v according to the input voltage (I1, I3, I5, I7) from 0v to 5v. So this way we regulate the motor coils tension with the ATMEGA control signals voltage, without electrical risk.

For easy connection of the mainboard and the mount electronics, I grouped the motor control lines, sensor signals, 5v and 12v power lines at the SV1 connector. This allow to use cable ribbon to interconnect everything.

To program the ATMEGA using an Arduino ONE board as ISP (in-system program) I designed the SV2 connector with the necessary signals for programming and powering the ATMEGA by means of the GND and 5v connections present in the SV1.


Once the schematic was made I started the circuit board design. Taking into account that I was going to use a single-sided perfboard with some SMD components, I manually placed the components on the board in a best possible way to avoid more tracks and bridges than necessary. The SMD components would go mainly on the weldings face, except the UNL2003 that I added using cables. As I was not going to etch the PCB professionally, these design was only a guide for mounting all on the perfboard.

Mainboard upper view
Mainboard upper view
Tracks layers.  Upper layer (red) & bottom layer (blue)
Tracks layers. Upper layer (red) & bottom layer (blue)
Final assembly
Final assembly
Tracks. Mirror view for welding
Tracks. Mirror view for welding
Mainboard. Welding view
Mainboard. Welding view
Final assembly
Final assembly

The mount itself barely has electronics, only the necessary circuits for the iR barriers and connectors to attach to the mainboard and motor.

The iR barriers use a basic circuit as described in the figure. The photodiode is fed through a resistor to limit its current, and phototransistor has a pull-down resistor that improves the reading of sensor status.

The lower sensor requires separating iR barrier components so that the threaded rod can pass between them, blocking the infrared light. This weakens the signal received by the phototransistor and allows more outside light to interfere with the barrier. It is therefore advisable to protect the phototransistor with some material that blocks lateral light and reduce the input to a narrow tunnel.

iR barrier circuit
Connector, motor and sensors
Connector, motor and sensor
Lower iR barrier
Lower iR barrier
Upper iR barrier
Upper iR barrier

Once the electronic assembly is complete, the programming is missing.... shall we continue?