Author Options:

How do I replace the board of a flashlight with a customized perfboard to set up an invidual On/Off frequency? Answered

I am currently  customizing the a flash light (customized intervals between on&off). To program the individual frequency I made use of an attiny 85 microcontroller that has been programmed making use of an arduino. On a breadboard my experiment worked well. I have attached the pins of the attiny 85 as follows:
Pin8: Long lead LED & + side of the battery; Pin5: Small lead LED; Pin 4: - side of the battery; To realize this experiment for a torch light I have disassembled a torch light and replaced the board with a self-made one making use of a perfboard.

Well if I attached the red wire (of an external battery box) to pin 8 and the black wire (of an external battery box) to pin 4 of the attiny85 the torch works well. However I wanted to replace the board and it should work the way it worked before with the programmed mode making use of the battery of the torch light as power source.
The battery within the torch light is placed on the back side. There only the plus side of the battery touches the spring and this gets again in touch with the self made perfboard. Here I am aware that the energy wlil flow through the spring to the soldered microcontrller. Hence alle soldered and connected pins of the attiny 85 will have the voltage of the battery. However I cannot determine certain pins to be charged and some not to be...( here I think I am missing a point) The problem I experience is that only the plus side of the battery, placed in the torch light, gets in touch with the perfboard. The torch light does not work using my perfboard. I know for sure that the torch will work if both the plus and the minus side of the battery are attached to the microcontroller(pin 4/8). However the initial torch light was also attached only to the plus side of the battery, and it did work. I don't know how.
I am pretty sure that there something wrong with my plan or my I do think little naively, can you give some suggestions?


The case of the torch is the -ve terminal for the LED.

I dont understand thoroughly what you mean. The plus terminal of the LED has been attached to pin 8 and the negative one to pin4 ...is that wrong?

I'm sorry, I can't interpret a circuit written in words. You need to draw what you have built. Most certainly though, the LED does not go across the chip like that.

Hereby I attach the circuit I use. Well the circuit works perfectly on the breadboard. Now making a perfboard and attaching the attiny85 I started struggeling ....


So, from your circuit, your LED goes from Pin 8 to Pin 5, not pin 4. You need to make a connection to the case of the torch for the 0V connection to the circuit.

Thx. I have changed the circuit (see image). On the breadboard it works perfectly. The probelem is again if i start to assemble the torchlight attaching my customized perfboard. With the back side of the torch( where the battery is placed) only the plus side of battery. I dont know how I can attach 0 V to pin 4. The only way I see is if i solder a wire from the back side of the battery to until pin 4....do I misunderstand anything...is there a better way?

IMG_1025.JPGattiny 85.png

Thx for your help!.Somehow I don't understandy one point.

As I told the circuit works well on the breadboard.

Issue: How to attach the battery on the perfboard. Since

only the plus side of the battery touches the perfboard.

Hence all the pins of the attiny85 get a voltage since the voltage

is conducted by the spring.

Now my problem is how do I have to attach the battery to the microcontroller.

Connecting pin4 to the case of the torch will lead the pin 4 to be 3.7V instead

of 0V. I am struggeling on this point...

Many more detailed photos of what you have are needed. The case of the torch is always one connection to the light, when the case is metal.

How can the case of the torch make Pin 4 3.7V, when its 0V relative to the battery ?