Pixelworks
Well-Known Member
I can already say, I will not be able to place the microchips in the reactor section as planned, there is simply not enough space. Because I will need more PWM pins for fading as an Arduino can give me, I will need to connect at least one LED Controller (TLC5940). It was close to impossible to mount the Arduino chip in the reactor section, but 2 chips of this size is just not going to fit.
The second option of mounting the chips in the front section and routing the wires through the central rod, will be almost equally impossible. The 20 or more .04mm wires will fit in the approx. 2mm hollow of the central tube, but I will have to push them through in one bundle, good luck on that figuring out which is which on the other side.
The only other option is to use chips that require less space... welcome to the world of SMD. Both the ATmega328 as well as the LED controller (TLC5940) are available in SMD variants... but as they are meant to be soldered directly to the surface of a circuit board, it is very fiddly trying to solder wires to each pin. To help in this, I printed a "holder" to keep everything in place. Below is the "normal" chip size in DIP-28 format and next to it an ATmega328 in SMD format (QFP-32). Yes, as the names suggest, the SMD variant has 4 more pins, although it is the same chip only smaller (pins 12,13, 28, 29 have no function).
I will mount the SMD TLC5940 LED controller in the reactor section, and connect it to the arduino chip in the nose section. By doing this, I only need to channel 5 wires, plus two more for power and ground, through the central tube. This amount of wires can be color-coded so that I can connect them correctly without too much hassle on the other side. The beauty of this, is that with only one Arduino (that is accessible from the outside), I am now able to change the code controlling the TLC5940 if ever needed.
Here is a diagram of how the two chips need to be connected, these are both in DIP-28 format, but the principle is the same (The status LED [bottom middle] and the push button connected to the reset pin are both optional and here only for the sake of completeness). In a nutshell: all the pins with either a grey (analog) or yellow (digital) circle are capable of controlling an LED, the digital pins with a PWM tag can support fading.
The beauty of the TLC5940 LED controller is that you can "daisy-chain" theoretically an infinite number of them, simply by forwarding the pins connecting it to the arduino to the next TLC5940 and so on. Contrary to chip documentation, according to Arduino Playground: "DCPRG selects the source of the current limiter register, you could just tie it to ground. This uses the default EEPROM value of 63. If tied to high, then you MUST set all ram based current limiter registers at boot time".
(picture from Arduino Playground)
[EDIT]:
One thing to be very conscious about is your voltage/amperage consumption. The recommended maximum voltage for an ATmega328 is 12v (personally, I would stay somewhere between 7v and 9v, to be on the safe side). The TLC5940, on the other hand can take up to 17volts, and if your model is running Servos or something else their minimum may require even more voltage as the max voltages above. Especially if LEDs are directly connected to power (LEDs have a much lower max voltage), you want to make sure that every component gets the amount of current it needs and nobody is getting too much.
One way to prevent this is to have a power jack for different levels of voltage (effective but stupid), or you have one jack rated at the maximum voltage you need for the whole system and then place the components that cannot handle the voltage behind voltage regulators.
I have seen a couple builds were the LEDs were getting too much power, and burnt out after a very short period... Which really bites if the model is already sealed up. Resistors can also reduce the voltage, but are very inefficient, they simply transform the extra voltage into heat (i.e. high voltage consumption), whereas a regulator only allows a specified range of voltage through (like a faucet), that which is not used just stays in the line. Aside from that, it would not be the first time that, years down the road, someone inserts a wrong wall-wart with the right sized plug but the wrong voltage. To save a lot of trouble, I make sure each line is protected by a voltage regulator in front of it.
The second option of mounting the chips in the front section and routing the wires through the central rod, will be almost equally impossible. The 20 or more .04mm wires will fit in the approx. 2mm hollow of the central tube, but I will have to push them through in one bundle, good luck on that figuring out which is which on the other side.
The only other option is to use chips that require less space... welcome to the world of SMD. Both the ATmega328 as well as the LED controller (TLC5940) are available in SMD variants... but as they are meant to be soldered directly to the surface of a circuit board, it is very fiddly trying to solder wires to each pin. To help in this, I printed a "holder" to keep everything in place. Below is the "normal" chip size in DIP-28 format and next to it an ATmega328 in SMD format (QFP-32). Yes, as the names suggest, the SMD variant has 4 more pins, although it is the same chip only smaller (pins 12,13, 28, 29 have no function).
I will mount the SMD TLC5940 LED controller in the reactor section, and connect it to the arduino chip in the nose section. By doing this, I only need to channel 5 wires, plus two more for power and ground, through the central tube. This amount of wires can be color-coded so that I can connect them correctly without too much hassle on the other side. The beauty of this, is that with only one Arduino (that is accessible from the outside), I am now able to change the code controlling the TLC5940 if ever needed.
Here is a diagram of how the two chips need to be connected, these are both in DIP-28 format, but the principle is the same (The status LED [bottom middle] and the push button connected to the reset pin are both optional and here only for the sake of completeness). In a nutshell: all the pins with either a grey (analog) or yellow (digital) circle are capable of controlling an LED, the digital pins with a PWM tag can support fading.
The beauty of the TLC5940 LED controller is that you can "daisy-chain" theoretically an infinite number of them, simply by forwarding the pins connecting it to the arduino to the next TLC5940 and so on. Contrary to chip documentation, according to Arduino Playground: "DCPRG selects the source of the current limiter register, you could just tie it to ground. This uses the default EEPROM value of 63. If tied to high, then you MUST set all ram based current limiter registers at boot time".
(picture from Arduino Playground)
[EDIT]:
One thing to be very conscious about is your voltage/amperage consumption. The recommended maximum voltage for an ATmega328 is 12v (personally, I would stay somewhere between 7v and 9v, to be on the safe side). The TLC5940, on the other hand can take up to 17volts, and if your model is running Servos or something else their minimum may require even more voltage as the max voltages above. Especially if LEDs are directly connected to power (LEDs have a much lower max voltage), you want to make sure that every component gets the amount of current it needs and nobody is getting too much.
One way to prevent this is to have a power jack for different levels of voltage (effective but stupid), or you have one jack rated at the maximum voltage you need for the whole system and then place the components that cannot handle the voltage behind voltage regulators.
I have seen a couple builds were the LEDs were getting too much power, and burnt out after a very short period... Which really bites if the model is already sealed up. Resistors can also reduce the voltage, but are very inefficient, they simply transform the extra voltage into heat (i.e. high voltage consumption), whereas a regulator only allows a specified range of voltage through (like a faucet), that which is not used just stays in the line. Aside from that, it would not be the first time that, years down the road, someone inserts a wrong wall-wart with the right sized plug but the wrong voltage. To save a lot of trouble, I make sure each line is protected by a voltage regulator in front of it.
Last edited: