Thursday, October 30, 2014

Making the Raspberry Pi Talk 5v

Coming from the Arduino world, most everything I do is 5v logic. It's been a switch for me now that I'm integrating my Raspberry Pi's into my Arduino solutions (they really are complementary). We have been following a great guy by the name of Jean-Damien, who has a simple solution to this problem:

When I received my Raspberry Pi the first thing I wanted to try was to use it to communicate with the electronic world.
Looking at the excellent raspberrypi.org official forum I’ve found posts explaining that the Debian image was already configured to redirect the linux system console to the broadcom chipset UART interface. Giving a try by connecting directly a scope to the GPIO pins confirmed it.
As you probably know, the broadcom chip is running at +3.3v so the GPIO pins cannot handle more than that. As “still classic” TTL are running at +5v we need to do some level shifting operation before interfacing devices to the GPIO pins. Note that if you intend to work only with 3.3v devices, this shifting isn’t required.
Read more at http://blog.sunyday.net/?p=36#more-36

Tuesday, October 28, 2014

Printing with the Arduino

http://blog.sunyday.net/
So you built this cool Arduino based test gear that does quality control tests on a piece of hardware. It's time to ship to the customer, and you need to send them a sheet of paper with the test results. How do we get the Arduino to print to a printer?

Years ago, serial printers were quite common. I remember installing a lot of Okidata Line Printers connected to Unix Servers using serial cables. Those printers use a type of serial called RS-232. The signals range from +10v to -10v, which allowed long distance cabling. But how would that work with the 5v signaling the Arduino can handle?

There's a chip called the MAX232. It's a RS-232 to TTL Serial converter. TTL serial is the type of serial the Arduino speaks. With a inexpensive converter board, you can create statements like Serial.println("This is printed text"); and This is printed text shows up on the printer.

All you need now is a serial printer. You can comb the catacombs of discarded computer equipment, or head over to ebay and see what they have!

Mini Thermal Receipt Printer Starter Pack

https://www.adafruit.com/products/600

The Raspberry Pi Laptop, more than just a laptop!

More than just a cool laptop, it's a learning tool you build and expand yourself!
Pi-Top provides a platform to expand your knowledge in hardware creation. The kit takes you through each of its components and their functionality, so that you can use Pi-Top as a tool for your own projects in the future.
Pi-Top focuses on teaching people how to create real hardware. Online and integrated lesson plans teach you how to understand electronics, create Printed Circuit Boards, and 3D print objects.

Learn more at
https://www.indiegogo.com/projects/pi-top-a-raspberry-pi-laptop-you-build-yourself/x/4943498

For more delicious Raspberry Pi goodness, see http://www.sainsmart.com/raspberry-pi.html


Sunday, October 26, 2014

A Calibrated Solid State Radiation Detector

I've been playing with radiation detectors. The common solution is a Geiger - Müller tube, but those solutions tend to be expensive, and contain high voltage connections. PIN Diodes can be used, and are very inexpensive, but are uncalibrated.

A nice in between is a calibrated (3.4 cpm/µSv/h) solid state sensor from Teviso, the RD2007. There are three such sensors in this family, but the RD2007 is a very affordable solution, applicable to civilians and citizen scientists alike.

It has three connections, 5v, Gnd, and data out. The output line ticks high when radioactivity is sensed. Connect this to an interrupt on the arduino, and you can easily display accurate radioactivity readings.

For more information on building Radiation Detectors, see http://opengeiger.de/index_en.html

Schematic:



Code:


#define MAXCNT 10
#define CalFactor 3.4
volatile int counter = 0;
unsigned long oldTime = 0;
float rate = 0.0;
int speaker = 5;

void setup()
{
 pinMode(speaker, OUTPUT);
Serial.begin(9600);
 int i = (int)(rate*10.0);
 Serial.println(i,3);
 attachInterrupt(0, count, RISING);
}
void loop() {
 unsigned long time;
 unsigned long dt;

 time = millis();
 if (counter >= MAXCNT) {
 dt = time-oldTime;
 oldTime = time;
 counter = 0;
 rate = (float)MAXCNT*60.0*1000.0/(float)dt/CalFactor;
 int i = (int)(rate*10.0);
 Serial.println(i,3);
 }
}
void count()
{
 counter++;
 digitalWrite(speaker, HIGH);
 delayMicroseconds(50000);
 digitalWrite(speaker, LOW);
}