So you've hacked apart some hardware, now what?
Last week you had to get the AVR dude back in line. He just wasn't letting you upload to your Arduino.
Now that he's doing his job properly again, today when you woke up, you woke up with DIY Fever. You decided to hack apart some old tech hoping to hook it up to an Arduino. You're looking down at your shop bench with parts all over and then it hits you. Now what?
Well, now that you've hacked apart some hardware you're looking to get it working with an Arduino.
Problem is, you don't know where to start, and that's okay!
Blocking your path forward is the tough question of how do you make the hardware and the software work together.
You might have a motor, such as a servo or a stepper, a sensor of some kind, or some other interesting part sitting in front you. Regardless of what you have though, the very first thing to do is find a data sheet for it!
Most, but not all, of the time, the hardware that you have will have a part number etched into it or on a sticker.
Looking at the part that I yanked out of a cash register it can be a bit overwhelming. It's got wires, screws, and other stuff hanging off of it, but looking closer and turning it over we find a sticker with some really good information!
See that sticker there. We struck gold!
Not only does it have the serial number (S/N), it also tells us the model number, YAY, and the fact that it operates with a 5-9 VDC power supply, which is always a good thing to double check!
Remember, not every part you yank is going to have all of these juicy tidbits, but you have got to find a model number at the very least.
With that we head right over to our favorite search engine and type the model number in:
So it appears that this part is a thermal printer. What we are looking for now is a datasheet or product manual to go with it.
It just so happens that the first result in the list is the datasheet for this specific model.
That won't always be the case and you might have to dig through a few results until you find the right one.
A good datasheet will have a section for the "general specifications" like I've shown here:
If you haven't already, or are unsure, now is the time to immediately double check what the power requirements are for your device.
After all, if the device requires a voltage that is far outside the typical Arduino voltage of 3.3V or 5V, then it's probably not going to work.
Good news, is this data sheet confirms that printer operates between 5V and 9V.
Now we look into the interface, which is how the device communicates.
With this datasheet we see that it uses RS232/TTL, which is serial communication.
We can use the Arduino's Rx and Tx to communicate with the device.
Now, you've confirmed it'll work at the proper voltage and you've checked to see that it will in fact communicate with your Arduino, what's next?
Well, most of the datasheets will also contain the serial data instructions. Here's an example:
This one is utilized to get the status of the paper sensor, i.e. is the printer out of paper?
Now I know, this is a bit crazy for a beginner, so your best bet is to search for a premade library like I've done in this example. Notice how I typed in the model number followed by "Arduino".
You can easily put in the model number and ESP32, or model number and Arduino nano, or whatever other flavor of Arduino you have, what you need to find is something with the words, "code" or "library" in the search results.
You'll find a plethora of examples and different libraries to tryout, but after the hard part that I outlined above, the most important thing is that you haven't wasted time trying to get a piece of hardware communicating with the Arduino that just doesn't have the ability or worse operates at an improper voltage burning it out and turning it into a paper weight. *Always make sure that you don't try to power a device from the Arduino, always power the device separately so you don't burn out the chip*.
Those are definitely frustrating times and hopefully you've now learned how to avoid them by finding the right information for the device you're hacking apart.
Are you ready to tryout some DIY hacking?
Then I'd love to invite you to check out our entire line of Arduino Uno and Nano based shields.
If you have some electronics experience the Dr.Duino Explorer is the choice for you. Just click the photo below to find out more about.
If you're new to Arduino and electronics, then the Dr.Duino Pioneer version is the best choice. Click the photo below to learn more.
Either will help you out as you learn to hack apart some old tech and breathe new life into it!