This week's assignment was to make a board with sensors, so I used a temperature sensor, light sensor, and hall sensor. In addition to them I placed a RGB LED and a button on the board among the usual giblets for the ATtiny44. I know the soldering looks atrocious, but I had to use my own solder that was such bad stuff that it was next to impossible to make good solder joints with it. I am honestly considering making a second board just so that I can use the proper solder and do it right. Also gives me a chance to see how useful the Attiny841 chip is in this case.
I have been making my board design process more efficient, by using designblocks I have made earlier, some of the sensors needed new design blocks made. Otherwise the design of the board went pretty much routinely. I am using 0.2mm milling bit to make my traces, making my boards look extra nice, also letting me pull 2 neat lines from under the resistors and capacitors making it easier to plan the traces for the board.
As usual for me. I will be using the Arduino to program the board. The goal is to make the sensors control the LED, for the hall sensor to control the brightness for blue colour, for the temperature sensor, to change the colour of the light based on the sensed heat, and for the light sensor, brightness for green colour. So far I have not had much luck with serial communications with my boards, but I will attempt to get it to function with this board, so I get more detailed view of sensor readings.
Note to self: The RGB led's when used with minimum resistors, are painfully bright.
When programming only the hallsensor was demanding to program, and took some extensive trial and error to find the most accurate calibration value for it. For the hallsensor math I used the code example from Arduino Playground.
Because of the memory limitations of the Tiny44 it wasnt possible to use all the features of the board at the same time. The software serial library takes half of the memory of the board, seriously limiting what can be done. This is an another board that would benefit from the ATtiny841 chip, one could use the hardware serial, and have good deal more memory to work with. Of the three sensors I had on the board I got two of them to work. I programmed the gauss sensor to switch the color of the RGB led, and you can see it at the side, the color changes when magnet is brought near. Also I got the light sensor working, and the serial connection to report it.
Unfortunately I was not able to get the temperature sensor to work, as I did a design mistake with it. When I started to look into how to program it, I realized that, there needed to an additional resistor to turn the measurement into voltage division. Without it, the values coming from the temperature sensor read the max value, 1023 and do not vary at all.
Once the sensor was covered the figures changed to indicate it, the full value of 1024 would indicate full darkness, while 0 would mean that a bright lighsource was being held right at the sensor.
When I looked at the serial feed for the hall sensor I saw it can sense the alignment of the field.
With proper calibration of the base values for the sensor, it would be possible to have the RGB led to vary its color based on the north or south of the magnetic field it is detecting.
In this video you can see the RGB led changing colour based on wheter the magnet at the end of the screwdriver is close to it or not.