Introduction: HackerBox 0053: Chromalux
Greetings to HackerBox Hackers around the world! HackerBox 0053 explores color and light. Configure the Arduino UNO microcontroller board and IDE tools. Connect a full-color 3.5 inch LCD Arduino Shield with touchscreen inputs and explore touch paint demo code. Wire up an I2C color sensor to identify the frequency components of reflected light, display colors on addressable LEDs, solder up an Arduino prototyping shield, and explore a variety of input/output components using a multifunction Arduino Experimentation Shield. Hone your surface mount soldering skills with an LED Chaser PCB. Take an introductory look into artificial neural network technology and deep learning.
This guide contains information for getting started with HackerBox 0053, which can be purchased here while supplies last. If you would like to receive a HackerBox like this right in your mailbox each month, please subscribe at HackerBoxes.com and join the revolution!
HackerBoxes is the monthly subscription box service for hardware hackers and enthusiasts of electronics and computer technology. Join us and live the HACK LIFE.
Step 1: Content List for HackerBox 0053
- TFT Display Shield 3.5 inch 480x320
- Arduino UNO Mega382P with MicroUSB
- Color Sensor Module GY-33 TCS34725
- Multifunction Experiment Shield for Arduino UNO
- OLED 0.96 inch I2C 128x64
- Five 8mm Round Addressable RGB LEDs
- Arduino Prototype PCB Shield with Pins
- LED Chaser Surface Mount Soldering Kit
- Man in the Middle Hacker Sticker
- Hacker Manifesto Sticker
Some other things that will be helpful:
- Soldering iron, solder, and basic soldering tools
- Computer for running software tools
Most importantly, you will need a sense of adventure, hacker spirit, patience, and curiosity. Building and experimenting with electronics, while very rewarding, can be tricky, challenging, and even frustrating at times. The goal is progress, not perfection. When you persist and enjoy the adventure, a great deal of satisfaction can be derived from this hobby. Take each step slowly, mind the details, and don't be afraid to ask for help.
There is a wealth of information for current and prospective members in the HackerBoxes FAQ. Almost all of the non-technical support emails that we receive are already answered there, so we really appreciate your taking a few minutes to read the FAQ.
Step 2: Arduino UNO
This Arduino UNO R3 is designed with easy of use in mind. The MicroUSB interface port is compatible with the same MicroUSB cables used with many mobile phones and tablets.
Specification:
- Microcontroller: ATmega328P (datasheet)
- USB Serial Bridge: CH340G (drivers)
- Operating voltage: 5V
- Input voltage (recommended): 7-12V
- Input voltage (limits): 6-20V
- Digital I/O pins: 14 (of which 6 provide PWM output)
- Analog input pins: 6
- DC current per I/O Pin: 40 mA
- DC current for 3.3V Pin: 50 mA
- Flash memory: 32 KB of which 0.5 KB used by bootloader
- SRAM: 2 KB
- EEPROM: 1 KB
- Clock speed: 16 MHz
Arduino UNO boards feature a built-in USB/Serial bridge chip. On this particular variant, the bridge chip is the CH340G. For the CH340 USB/Serial chips, there are drivers available for many operating systems (UNIX, Mac OS X, or Windows). These can be found through the link above.
When you first plug the Arduino UNO into a USB port of your computer, a red power light (LED) will turn on. Almost immediately after, a red user LED will usually start to blink quickly. This happens because the processor is pre-loaded with the BLINK program, which we will discuss further below.
If you do not yet have the Arduino IDE installed, you can download it from Arduino.cc and if you would like additional introductory information for working in the Arduino ecosystem, we suggest checking out the online guide for the HackerBox Starter Workshop.
Plug the UNO to your computer using a MicroUSB cable. Launch the Arduino IDE software.
In the IDE menu, select "Arduino UNO" in under tools>board. Also, select the appropriate USB port in the IDE under tools>port (likely a name with "wchusb" in it).
Finally, load up a piece of example code:
File->Examples->Basics->Blink
This is actually the code that was preloaded onto the UNO and should be running right now to blink the red user LED. Program the BLINK code into the UNO by clicking the UPLOAD button (the arrow icon) just above the displayed code. Watch below the code for the status info: "compiling" and then "uploading". Eventually, the IDE should indicate "Uploading Complete" and your LED should start blinking again - possibly at a slightly different rate.
Once you are able to download the original BLINK code and verify the change in the LED speed. Take a close look at the code. You can see that the program turns the LED on, waits 1000 milliseconds (one second), turns the LED off, waits another second, and then does it all again - forever. Modify the code by changing both of the "delay(1000)" statements to "delay(100)". This modification will cause the LED to blink ten times faster, right?
Load the modified code into the UNO and your LED should be blinking faster. If so, congratulations! You have just hacked your first piece of embedded code. Once your fast-blink version is loaded and running, why not see if you can you change the code again to cause the LED to blink fast twice and then wait a couple of seconds before repeating? Give it a try! How about some other patterns? Once you succeed at visualizing a desired outcome, coding it, and observing it to work as planned, you have taken an enormous step toward becoming an embedded programmer and hardware hacker.
Step 3: Full Color TFT LCD 480x320 Touch Screen
The Touch Screen Shield features a 3.5 inch TFT display with 480x320 resolution at 16bit (65K) rich color.
The shield plugs directly onto the Arduino UNO as shown. For easy alignment, just line up the 3.3V pin of the shield with the 3.3V pin of the Arduino UNO.
Various details about the shield can be found at the lcdwiki page.
From the Arduino IDE, install the MCUFRIEND_kvb library using the Library Manager.
Open File > Examples > MCUFRIEND_kvb > GLUE_Demo_480x320
Upload and enjoy the graphics demo.
The Touch_Paint.ino sketch included here uses the same library for a brightly colored paint program demo.
Share what colorful applications you cook up for this TFT Display Shield.
Attachments
Step 4: Color Sensor Module
The GY-33 Color Sensor Module is based on the TCS34725 color sensor. The GY-33 Color Sensor Module operates on 3-5V supply and communicates measurements over I2C. The TCS3472 device provides a digital return of red, green, blue (RGB), and clear light sensing values. An IR blocking filter, integrated on-chip and localized to the color sensing photodiodes, minimizes the IR spectral component of the incoming light and allows color measurements to be made accurately.
The GY33.ino sketch can read the sensor over I2C, output the sensed RGB values as text to the serial monitor, and also display the sensed color to a WS2812B RGB LED. The FastLED library is required.
ADD AN OLED DISPLAY: The GY33_OLED.ino sketch shows how to also display the RGB values to a 128x64 I2C OLED. Simply wire up the OLED to the I2C bus (UNO pins A4/A5) in parallel along with the GY33. Both devices can be connected in parallel since they are at different I2C addresses. Also connect 5V and GND to the OLED.
MULTIPLE LEDs: The unused LED pin in the diagram is "Data Out" if you wish to daisy-chain two or more of the addressable LEDs together simply connect Data_Out form LED N to Data_In of LED N+1.
PROTOTYPE PCB SHIELD: The GY-33 Module, the OLED display, and one or more RGB LEDs can be soldered to the prototyping shield to construct a color sensing instrument shield that is easily attached to and detached from the Arduino UNO.
Attachments
Step 5: Multifunction Arduino Experimentation Shield
The Multifunction Arduino Experimentation Shield can be plugged onto the Arduino UNO for experimenting with a variety of components including: red LED indicator, blue LED indicator, two user input buttons, reset button, DHT11 temperature and humidity sensor, analog input potentiometer, piezo buzzer, RGB LED, photocell to detect the light brightness, LM35D temperature sensor, and an infrared receiver.
The Arduino pin(s) for each component are shown on the silkscreen of the shield. Also, details and demo code can be found here.
Step 6: Surface Mount Soldering Practice: LED Chaser
Did you have luck constructing the freeform LED Chaser from HackerBox 0052?
Either way, it is time for another SMT soldering practice session. This one is the same LED Chaser circuit from HackerBox 0052 but constructed using SMT components on a PCB instead of using freeform/deadbug components.
First, a pep talk from Dave Jones in his EEVblog on Soldering Surface Mount Components.
Step 7: What Is a Neural Network?
A neural network (wikipedia) is a network or circuit of neurons, or in a modern sense, an artificial neural network, composed of artificial neurons or nodes. Thus a neural network is either a biological neural network, made up of real biological neurons, or an artificial neural network, for solving artificial intelligence (AI) problems.
Check out this series of four videos on Neural Networks and Deep Learning.
The videos are inspired by the free online book, Neural Networks and Deep Learning.
The web page for the book links to a code repo allowing us to play with the examples in detail.
We can even run a simple neural network on an Arduino. That demo shows that even the humble Arduino UNO can train and converge a simple neural net. However, we quickly run out of RAM for representing hidden layer nodes of even modestly complex nets. Of course, there are other embedded computing platforms with a lot more memory than the simplest Arduino boards, so stay tuned...
Soundtrack: Brain Eno, Nerve Net
Step 8: Hack the Planet
We hope you are enjoying this month's HackerBox adventure into electronics and computer technology. Reach out and share your success in the comments below or on the HackerBox Facebook Group. Also, remember that you can email support@hackerboxes.com anytime if you have a question or need some help.
What's Next? Join the revolution. Live the HackLife. Get a cool box of hackable gear delivered right to your mailbox each month. Surf over to HackerBoxes.com and sign up for your monthly HackerBox subscription.
33 Comments
2 years ago
The Uno/screen are a fun little combo. I would have liked to have found something more fun than touchpaint to do with it but like all my boxes what doesn't have much purpose now will be used again on furture projects. The led chaser had a misprint I think but having all those spare parts was very helpful when losing them from newer boxes. All in all pretty fun.
2 years ago
I just want to say that the "TFT Display Shield 3.5 inch 480x320".... I used it with a HelTec ESP32 and it was super frustrating to figure out how to interface with it. Glad I got to use the part though, Im saving these free unos and nanos for 'other things' muhahahaha
Question 3 years ago on Step 3
Finally got this stag to upload, but my screen is white. I can't see to get an images, even after changing to UTFT myGLCD(ILI9486,A5,A4,A3,A2,A1); I've tried a few variations, both including and excluding A1 and even replacing ILI with CTE. How to fix the white screen?
Question 3 years ago
On step 4 with the GY-33, how is it possible to make these connections?
Answer 3 years ago
I soldered the provided header pins to the GY-33 module. I then used a solderless breadboard and jumper wires to connect all the part together. If you don't know how to solder then you may be out of luck, or you can learn. The other items are available in previous HackerBoxes. You can also solder everything together using the Arduino PCB shield. That too will require basic soldering skills. Good luck!
3 years ago
Can someone tell me what is supposed to happen when you daisy chain the RGB LEDs together? For me the first one still changes but the subsequent ones just stay one color.
Reply 3 years ago
It will turn the daisy chain of lights the color the sensor reads. You just have to change the number of leds in the code before you compile it to the board.
Reply 3 years ago
I think you need to change NUM_LEDS in the sketch from 1.
3 years ago
Has anyone had problems getting their LED Display to work? I've buzzed out the circuit. I see the clock coming out of pin 3 on the 555 timer and going to pin 14 on the decade counter. I verified that the Reset and Clock Inhibit on the counter are low. But all of the outputs on the decade counter are high. So all of the LEDs go on and stay on. They don't cycle.
Reply 3 years ago
Mine worked fine after I figured out the silkscreen on the LEDs was backwards on my board. Did you scrub the board with alcohol to remove the flux? It can sometimes cause a short in the most inconvenient places.
Reply 3 years ago
I replaced all of mine with new ones that I had. They light up fine. But still having problems blinking. I think I burned up the LM555 and the CD4017BM. They were getting too hot to touch. Must be short somewhere.
Reply 3 years ago
It wasn't the silkscreen. It was a bad batch of LEDs. Have a mixed box of LEDs and looking at the cup inside of the plastic and noticed they were reversed.
Question 3 years ago
Hello.
I have many Arduino problems/errors and no one locally to ask for help. Is there an online forum/web chat that semi newbies can communicate in without feeling like an idiot? I've read several "Programming Arduino" books. (Many from Simon Monk) They are great for what they are trying to teach but they (the books) can't see the errors I have and so can't advise me on how to get beyond so I can "build your dreams". (Jumbotron clock). You can't be an "Evil Genius" without being able to know what time your minions are suppose to be back with your pizza.
Once in a while things work out so that I get a small piece of that carrot to keep me going. (from Hackerbox 0011 to current). One of the benefits of being quarantined, is now I have time to work on all those boxes I've had to set aside because of the pesky four letter word (work). So it would be great to get some of these going. Any help would be great. Thanks
Answer 3 years ago
I will probably have time easter Friday or Monday if you want a one on one vid call. Are you using windows?
Answer 3 years ago
This is a great place especially if has to do with a hackerbox. There a lot of Facebook Arduino groups as well. :)
Reply 3 years ago
TimGTech Thanks for the info. I was hoping for something like a face chat. Where I can take my external camera and show that person what I'm talking about. I have seen a few Facebook groups but most of them say, "just google it" or your an idiot and quit wasting our time. I don't know. Can you suggest a group?
Reply 3 years ago
On Facebook Specifically, look for a group called "Arduino Projects" It seems like a pretty good group. Unfortunately they are all going to have some not-so-nice folks on there. There is also the Hackerboxes Facebook group too. You can always take short videos of what you have and post here or there.
3 years ago
Thanks again to Box #49's CY7C68013A Mini Board!! Using that to debug the LED chaser was awesome.
Tip 3 years ago on Step 6
My PCB doesn’t look like the one shown and has its silkscreen LEDs marked backwards. Pls check yours before soldering in the LEDs.
3 years ago on Step 6
I dropped and lost one of my 1UF blocks :( :( Sucks. I had everything else down (I think)! Anyone know if there are any substitutes for it? I don't know enough to know what to substitute. I do have the last like 15 hackerboxes, so I might have an extra thing to substitute.