New Butterfly has another resistor

Go To Last Post
12 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I just got a new Butterfly. I was surprised to discover an additional resistor on the card. It isn't shown on the latest Atmel Butterfly user guide. Well that shouldn't surprise me. The latest user guide still says it has a light sensor.

This new resistor seems to be connected across the light sensor photocell. I should say it would be, if the photocell was present. I guess its purpose is to make the output from the light sensor be more linear. Anyone else care to guess?

I will install a photocell and I think I will remove the new resistor because I want good sensitivity in dim light, and I want minimum current drain on the battery when the light sensor is activated.

P.S. This forum's attachments do a good job with .jpg files but they make .png files look sick. Am I doing something wrong?

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, as the LDR is no longer there, the ADV would only read Vcp.

By adding the 6K6 (Acthally a 6K8 resistor from what I can see of the picture) the ADC will now read 2/3 Vcp.

If Vcp = 3.3 VDC:

                   6K8            6K8
Vsensor2 = Vcp ----------- = 3.3 ----- = 3.3 * 0.653465 = 2.156436 VDC
               (3K3 + 6K8)        10.1

So, the ACD should be reading a fixed 2.156 Volts dc.
The ADC resolution at 3.3 Vref is:

3.3 \ 1023 = 0.003226: Volts per ADC step

then:

ADC value = 2.156436 / 0.003226 = 668.455 = 0x29C = 1010011100b

You can avoid reality, for a while.  But you can't avoid the consequences of reality! - C.W. Livingston

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I installed a LDR on it, and I did not notice the extra resistor, fluctuated very well! but I just recently soldered in a small mic, just to test with... I dont even know if mics can run off ADC like this, but if it can should I remove the resistor?

also: in the image: Butterfly_2_labelled_006.JPG

your little clip is silver, weak, mine came plastic, and just a little metal :) no worrys though that came off as soon as I spotted it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ph0rkeh wrote:
I installed a LDR on it, and I did not notice the extra resistor, fluctuated very well! but I just recently soldered in a small mic, just to test with... I dont even know if mics can run off ADC like this, but if it can should I remove the resistor?

also: in the image: Butterfly_2_labelled_006.JPG

your little clip is silver, weak, mine came plastic, and just a little metal :) no worrys though that came off as soon as I spotted it.

I think the LDR will work okay with the resistor there. I want to measure very low light levels where the photocell has a much higher resistance, in the neighborhood of a million ohms.

I'm also going to increase the value of the series resistor (R210) to something like a million ohms. This will also cut down on battery drain when the cell is activated, especially when exposed to high light levels when the photocell's resistance is low.

In fact it whas when I started to remove R210 that I noticed something strange. There was another resistor there I hadn't seen before.

If I understand correctly, your butterfly has a plastic "safety pin" to pin it to your shirt. Well I guess you are less apt to injure yourself with a plastic pin. :) I usually yank the pin off, but I haven't gotten around to it.

I'm not sure I understand "mic". If that's a microphone, then I suppose it depends on the impedance of the microphone and what kind it is as to whether that LDR circuit is suitable.

In some cases it could make sense to hook a mic up to ADC. Digital sound, you know. You may not be able to convert samples fast enough to produce very good sound, but it could work for some things.

I don't know what you intend to do with the mic, but if you can get the Butterfly to do voice recognition that would be a good trick, especially with only 16k of program memory :D

I guess you know there are other usable ADC channels on the butterfly that might be handier to use. I think it's the JTAG connector, also called port F. If I remember correctly there are 4 pins there that can be used as ADC, and can also be used as digital I/O. It's great that the Atmels have multipurpose pins, but it confuses the hell out of me. :lol:

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I don't know what you intend to do with the mic, but if you can get the Butterfly to do voice recognition that would be a good trick, especially with only 16k of program memory Very Happy

yeah, to tell you the truth I don't either! I had a spare 'tiny' mic lying around, yet no spare LDRs... and I needed it for a project, and didn't want to wait for digikey... so I just switched them out, haven't really played with the mic at all though...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi.

I have the same problem with the new butterfly. But I am doing a example of regulation of enviroment enlightement,so I need full scale light sensoring from dimm to verry bright.

steve17 wrote:

Quote:
I will install a photocell and I think I will remove the new resistor because I want good sensitivity in dim light, and I want minimum current drain on the battery when the light sensor is activated.

I tried with a simple test by shortcutting the ex-LDR sensor pins, by connecting them through an 2kOHM resistance and by leaving them unconnected == infinite resistance. And there was no response from my program.

Did the steve17s trick work? I am tempted by removing the new resistance, but as I do not owe a profi equipment, I would not like to make irreversable changes (at least for me) on the butterfly in question without being shure that it would work.

THX in advance

Radovid
---
You would fall from the edge of the world, they said.
---

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

radovid wrote:

I have the same problem with the new butterfly. But I am doing a example of regulation of enviroment enlightement,so I need full scale light sensoring from dimm to verry bright.

It may be a couple of days before I do the work on my new butterfly. I will post my findings then.

I'm guessing that the new resistor should be removed as it would probably make very dim light measurement impossible. But like I said, I should know more shortly.

If you want precise measurement from very bright to very dim, you would probably need two or more sensors. Keep in mind that the human eye can function in an enormous range of light intensities. Measuring all that with one light sensor is asking a lot.

These cadmium sulfide photoresistors have a "logarithmic" response. I think they have approximately 3k ohms of resistance in bright room light. That would explain why Atmel puts it in series with the 3k3 resistor. But in dim light, dim enough for a little night light to be effective, the sensor's resistance is several megohms.

I'm interested in turning on night lights when it's dark, so I haven't paid much attention to how it works in daylight, but it works.

Currently I'm using an old Butterfly without the extra resistor. The sensor reading maxes out with a reading of 0x3ff8 when the light is a little bit brighter than a night light would give. It actually works fairly well for it's intended purpose, but I figure if I increase the value of the series resistor, I could get more precise results in dim light. As a bonus, the battery current drain will decrease.

If you need measurements in very bright light, you might need to use a smaller resistor in series, instead of the 3k3 that Atmel uses.

Also keep in mind that these readings are all relative, and logarithmic (or should I say pseudo logarithmic). Getting absolute values of light intensity would require that it be calibrated, and probably calibrated at several light intensities.

The light sensor circuit is fairly simple. You could add more light sensors fairly easily. There are 4 more ADC channels available on port F, also known as the JTAG port.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think it would be interesting to find out the capabilities of the CdS cell on the Butterfly, but I also think that one shouldn't expect too much from a CdS sensor. They might serve well for say a light seeking robot, or to tell if it is daylight, and they were used on camera light meters until better technology came along. If you want high quality metering I think you are going to need to use a photodiode and signal conditioning, for example, Taos has many interesting products: http://www.taosinc.com/index.asp

Smiley

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For the moment the CdS cell served me well. I had a working regulation loop using the mentioned sensor and some colorless diodes until my old butterfly accidentaly died (and now is happilly flying through microcontroller heaven, snurf :( ). I will leave the details on how it happened it's quite embaracing... :D
I'll check the proposed page for shure I will find something better there.

steve17 wrote:

Quote:
It may be a couple of days before I do the work on my new butterfly. I will post my findings then.

I am really courious of your findings. As it would be very helpfull to me if I would be able to use the two ex-LDR pins.
I am sorry for my obsession about the two ex-LDR pins, but I need the Jtag inteface for the regulation loop development.

In any case, this regulation loop is just a sample experiment of a light sensor, couple if diodes, a shoe box and a PI regulation loop for my diploma thesis (but still it should be working). The real issue I am researching is AVR programming in Linux environment. That becouse I do not need to be so picky. It just has to work. Regardless to the said I will treasure the given advices.
When it would be finished I will post it between my projects.

THX a lot for your kind answers.

BTW... smileymicros.com seems quite interesting... I'll forward the link to some interested friends.. ;)

Radovid
---
You would fall from the edge of the world, they said.
---

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I tested the new butterfly. I added the LDR I got from Smiley. As expected, it wasn't as sensitive as my old Butterfly because of the extra resistor in parallel with the sensor.

The reading maxed out at 2b0 in a dimly lit room. It wouldn't go higher than that. In fact 2b0 is what it read with no LDR connected.

I removed the resistor and it worked okay. The readings were somewhat highter than I got with my old butterfly. It seems the LDR from Smiley, and also some I got from Digikey, had a somewhat higher resistance than the one Atmel used. I guess that's okay though.

For instance near a window on a cloudy day, I got 1f5 on the new one, 0d2 on the old one. In a moderately lit room I got 3a1 on the new one, and 2a7 on the old one.

Well anyway I am most interested in dim light for this project so I replaced the 3k3 ohm series resistor with a 330k ohm one. You wouldn't want to do that because you will lose sensitivity in bright light. You might want to increase it a little though if you want more dim sensitivity at the expense of bright sensitivity.

I still have no idea why Atmel added that resistor. It doesn't make sense to me.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't know if you've ever unsoldered an SMD resistor. Today was my first time, but I read about it, and I just bought a controlled temperature soldering station.

I put a little solder on the tip and laid it across the resistor The solder melted quickly and I pushed the resistor off its pads onto a clear area of the board with a toothpick in my other hand.

When I removed the iron, the resistor stuck to it, but banging my fist holding the iron on the table shook it off.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi, sorry for replying to such an old post..
I am using Butterfly as a light trigger for my DSLR.
I added a regualr LDR I took from a night lamp. It was maxing the reading at arround 7xx before. After reading this thread I removed the resistor, and now I am going all the way to 100x. Which helped me to increase the sensitivity. Thank you Steve for this finding.