A better, faster, stronger DAC: An R-2R Ladder!

This is amazing. In this video, he simultaneously explains the concept of making Thevenin equivalent circuits (handy!) and shows the (actually pretty simple) mathematics behind this circuit. This method basically allows you to trade many digital pins and many resistors for a single, excellent analog out. B-E-A-utiful.

Planning on using this on an FPGA for an absolutely stupid-ridiculous resolution analog stream. Why not? I’ve got 36 conductor ribbon cable and 108 matched resistors that would be better served as a 36-bit analog out.

That actually might bring me closer to implementing HDMI…naaahh.

nRF24L01+ Module Documentation

nRF24L01+

Library

Arduino Library Download
Copy to ‘Libraries’ folder within your main Arduino folder.

Pins:

MISO -> 12
MOSI -> 11
SCK -> 13

Configurable:

CE -> 8
CSN -> 7

Properties:

byte cePin
CE Pin controls RX / TX, default 8.

byte csnPin
CSN Pin (Chip select not), default 7.

byte channel
RF Channel 0 – 127 or 0 – 84 in the US, default 0.

byte payload
Size in bytes, default 16, max 32.
Note: channel and payload must be the same for all nodes.

Methods:

void init(void)
Initialize the module, set the pin modes for the configurable pins and initialize the SPI module.
Example:
Mirf.csnPin = 9;
Mirf.cePin = 7;
Mirf.init();
void setRADDR(byte *addr)
Set the receiving address. Addresses are 5 bytes long.
Example:
Mirf.setRADDR((byte *)"addr1");
void setTADDR(byte *addr)
Set the sending address.
Example:
Mirf.setTADDR((byte *)"addr1");
void config(void)
Set channel and payload width. Power up in RX mode and flush RX fifo.
Example:
Mirf.payload = 32;
Mirf.channel = 2;
Mirf.config();
bool dataReady(void)
Is there data ready to be received?.
Example:
if(Mirf.dataReady()){
//Get the data to play with.
}
void getData(byte *data)
Get the received data. 'data' should be an array of bytes Mirf.payload long.
Example:
byte data[Mirf.payload]
Mirf.getData(data);
void send(byte *data)
Send data. 'data' should be Mirf.payload bytes long.
bool isSending(void)
Return true if still trying to send. If the chip is still in transmit mode then this method will return the chip to receive mode.
Example:
Mirf.send(data);
while(Mirf.isSending()){
//Wait.
}
//Chip is now in receive mode.
NB: Lots more information is available from the status registers regarding acknowledgement or failure status. See Mirf.cpp:218.
bool rxFifoEmpty(void)
Is the RX Fifo Empty.
bool txFifoEmpty(void)
Is the TX Fifo Empty.
byte getStatus(void)
Return the status register.
void powerUpRx(void)
Power up chip and set to receive mode. Also clear sending interrupts.
void powerUpTx(void)
Power up tx mode.
Exa

Examples

See examples folder in zip file.
Arduino Library Download

Building A Thermostat Using Arduino

This gives an excellent description of the technique. I’ve still yet to determine the switching current, which I’d like to before I build a potentially hazardous item. End goal of this project? Constructing a ‘Nest’-like learning thermostat. Mostly just to predict when I’ll come stomping in from the cold, and adjust the temperature appropriately an hour or two ahead of schedule.

Keeps it toasty.

Teensy (The once and future king) Model 3.0

ImageThis thing is epic embodied. Go ahead and contact Mr. Teensy Himself on Twitter and tell him how appreciative you are. Because it won’t be long before these things are everywhere. With an ARM Cortex-M4 processor and an independent IC for the bootloader, it’s quite resilient to bricking (necessary for me!) native USB, what else is to be expected from PJRC

Oh yeah, and fully working Arduino bootloader and libraries for everyone who doesn’t want to program in C/C++. This is going to be big. Paul claims they easily overclock to 96MHz, and combined with a 32-bit processor, that’s a lot of computing power. Not to mention the 32bit analogWrite() (billions of levels of precision) and 13bit analogRead() (65536 levels of read, or down to a 134uV precision per level. Compare that to a Arduinos’ precision of 19mV, or 4.2mV for the Mega with the 1v1 voltage reference.

So…basically stoked. Get it here for the next day or so.

P.S. Of course, the Kickstarter for this thing was fufilled basically instantly. I mean, we all have the Teensy 2.0, right?

MQ3 (or MQ303a) Alcohol Sensor Arduino Guide

This little device is wonderful, for parties at least. Accuracy wise, it’s not much more than a toy (without some opamps for signal amplification and filtering) but I digress. Just plugged right straight into an Arduino will be plenty of fun, assuming you read the datasheet.


To wire this properly, check out this diagram, which will get further explanation after the break.
Continue reading

Adafruit /Sparkfun Waterproof RGB LED Strip (60/m)

This this is beyond amazing. Only in real life can you appreciate it’s vibrancy and power to invoke emotion. It shall fulfill you. That money spent on electronics, that time burned grepping Ohm’s and Kirchoff’s laws; time well spent. Once you gaze upon the 16.7 MILLION colors available, as this relic leisurely strolls through them at whatever speed your Arduino/various MCU desires.

View at Sparkfun
View at Adafruit

Color Gallery and ‘How to set it up’ section after…
Continue reading

Programming a breadboard Arduino with Sparkfun’s FTDI Adapter

I required a programmer to program bare AVRs (ATtiny85s and ATtiny84s,) so, In my infinite spendthriftyness, I bought this FTDI breakout from Sparkfun. What is this? Well, I assumed it was an AVR programmer. I was incorrect. It can reprogram AVRs, however it cannot burn bootloaders or change fuse settings as is (the version from ladyada can, and with precious little modifications.) Being the same price, I made the wrong choice.

Anywho, here’s how you get it to work. I also ordered (fortunately) a ATmega328p from Sparkfun with the Optiboot Bootloader. So, essentially, it’s like they yanked the chip out of a new Arduino Uno. Not bad for $5.50. So we take this, plink it down on a breadboard like shown below, then get to wiring it up.

Don't worry, this will all be explained after the break.

One hell of a ratsnest. Don't worry, this will all be explained after the break.


Continue reading

Create a free website or blog at WordPress.com.

%d bloggers like this: