Close

Does this project spark your interest?

Become a member to follow this project and don't miss any updates

LoFi

LoFi is a very low cost ($5), small, auto-transmitting module. Preassembled and preprogrammed. Simply attach to your appliances or projects!

27 169 157
Enjoy this project?
Share on twitter   Share on Facebook

This project was created on 06/20/2014 and last updated 10 days ago.

Description
Like many hackers and hobbyists, we dream of a smart home. Although there are third-party transceiver modules and data loggers on the market, they are too expensive and complicated to deploy in volume.

LoFi is a very low cost ($5), small, auto-transmitting module. All you need to do is to attach the modules to interesting appliance circuit points or sensors throughout your home and garden. The data arrives on your PC or can be sent to the Internet with a WiFi hotspot.

No programming, no protocols to learn, and no carrier boards for you to make. Just attach!

Using your desktop or laptop, you can set trigger levels on individual modules to tell them when to transmit. For example, send an update when the voltage changes by more than 1 V on the vibration sensor near the garage door opener. You can also set the module on a timer, such as hourly on your garden monitor.

The possibilities are endless!
Details

SENDER

The sender module with transmitter is about the size of a AA battery. It operates from 1.8 to 5.5 V. It consists primarily of an Atmel ATtiny84A which monitors the inputs and outputs the data. A red and green LED provides visual status. In volume, the sender module should cost less than $2 in parts.

The sender module has:

(5) analog or digital inputs with configurable trigger thresholds

(1) digital trigger

(1) internal temperature sensor

(1) voltage reference (useful to convert numbers into voltages)

CONFIGURATION

Without any programming knowledge, the sender module can be configured to transmit:

  • (a) On power up
  • (b) When any analog input goes above a certain value
  • (c) When any analog input goes below a certain value
  • (d) When any analog input changes by more than a certain amount
  • (e) Periodically from 10 seconds (per FCC) to 18 hours

Configuration is accomplished using a laptop, or desktop connected via a standard FTDI serial cable (Adafruit #70).

TRANSMITTER

The actual transmitter on the sender module is an off-the-shelf, inexpensive 433 MHz AM board and a simple wire antenna. The transmitter can be removed to connect a serial cable for configuration and direct reading. Therefore, this could be used as a wired device.

IS 433 MHz VIABLE?

I purchased the raw transmitter/receiver boards in new condition for $1 on eBay. There are tons of vendors selling them. I was skeptical that such an inexpensive part would produce acceptable results.

Surprisingly, even with a simple wire antenna and only 3 V, the transmitter/receiver pair was successful indoors through walls at more than 75 feet.

Reliability is accomplished with the software algorithm in the LoFi microcontroller:

  • Normally quiet (no transmission) to cooperate with other senders
  • Preamble burst to wake the receiver and set the gain
  • Oversampling on the receiver to ignore minor noise
  • Require stop bit to ignore radio static when not transmitting
  • Error-correcting checksum to correct moderate noise and detect major noise
  • Configurable fine-tuning of bit rate to compensate for inexpensive internal oscillator
  • Message id to detect missing packets
  • Configurable post-trigger messages to increase the odds of a timely packet for weaker or more distant transmitters

In any event, because the transmitter and receiver are detachable, and because they communicate using conventional serial data, you can use different transmitter/receiver boards and spectrum if you prefer. Put another way, the LoFi modules are not dependent on the type of transmitters.

OPEN AND EXPANDABLE

LoFi is designed to open up the devices in your house. Keeping with that philosophy, LoFi is designed to be open itself. This will allow others to apply their creativity in delivering compatible variations. The completed project will be under Apache License, Version 2.0, so that you can use any or all, for fun or commercially.

I’m looking forward to seeing the shields that are produced -- prepopulated with specific sensors or connectors. Some companies will target specific appliances (doorbells, sump pumps, garage door openers, garden monitors, model rockets) while others will create different form factors and features (long range transmissions) for the LoFI sender itself.

Most users will employ the module as-is, however it is definitely hackable. With the transmitter detached, an ISP6 cable can be connected to reprogram the ATtiny microcontroller with whatever modifications you want to the open source code.

NEXT STEPS

The working prototypes successfully proved the concept. Revised PCBs have been ordered to test various attachments. That will lead to writing the configuration application.

I’ll start posting results of experiments and other milestones as they occur.

The final goal will be to publish a tested baseline end-to-end solution that is ready for manufacturer and usage.

Components
  • 1 × C1 Capacitor 10µF (CC1206ZKY5V7BB106)
  • 1 × IC1 Microcontroller, SOIC, ATtiny84A (ATTINY84A-SSU)
  • 1 × J1 Connector, 6-pin right-angle female socket (801-87-006-20-001101)
  • 1 × LED1 Status LED, 1210, bicolor (LTST-C155KGJRKT)
  • 2 × R1, R2 Current-limiting resistor, 220Ω (RC1206FR-07220RL)
  • 1 × R3 Pull-down resistor, 100kΩ (RC1206FR-7100KL)
  • 1 × J3 (optional) ISP6 programming header (75869-131LF)
  • 1 × Configuration cable FTDI USB-to-serial TTL 3.3V (TTL-232R-3V3 Adafruit #70 http://www.adafruit.com/products/70)
  • 1 × Schottky diode SOD123 MBR0520L 20V

Project logs
  • Outdoor Temperature Monitor

    12 days ago • 1 comment

    In the previous logs, I’ve shown LoFi in the remote corner of the basement and in the garage. Now, LoFi ventures outside to the garden to measure temperature and light levels.

    A ‘My M&M’ silver favor candy tin (intended for weddings or parties) is the perfect size container for LoFi, the AM transmitter, a solar panel, coin cell (underneath the PCB), and various sensors. A clear lid permits light but blocks bugs, dirt, and hopefully rain. The transmitter antenna wire sneaks out the side through a #54 drill hole.

    A foam liner was added to the candy tin to avoid electrical shorts. Even though the container has a non-conductive coating to avoid contaminating the candy, I've been burned by scratched or worn areas in the past.

    When there is adequate sunlight, the Adafruit Round Solar Panel Skill Badge (#700) powers the device. This solar panel was chosen because it fits so well, and provides the maximum voltage with good current. At full sunlight, the panel likely exceeds the ATtiny 5.5 V operating limit, but will stay under the absolute maximum of 6 V and has 0.2 volts or more dropped by a Schottky reverse-protection diode.

    Aside: There is a thin clear plastic film covering the Adafruit badge to protect it from scratches. The film had not yet been peeled off in the above picture. The badge is quite lovely when the film is removed.

    The ATtiny internal temperature sensor and voltage reference are ‘no-cost’ inputs. An added photocell provides brightness data, and was selected to be sensitive to conditions after the solar panel yielded to the backup battery.

    With wireless, it is nice to get immediate readings rather than logging to a flash as I have had to do in past experiments: http://www.robotroom.com/Weather-Station.html

    This was not my first choice of locations for LoFi, but I discovered that a spot of land was already claimed by a toad in a hole.

  • Garage Door Monitor

    18 days ago • 1 comment

    An example usage of LoFi is to monitor when the garage door opens and closes, as well as when the garage’s interior light has been left on.

    LoFi is designed to perform such tasks with minimal added parts and no programming. However, Ralph Doncaster (Nerd Ralph) http://nerdralph.blogspot.com/ commented that LoFi should be able to run on a coin cell. So, this is a good opportunity to experiment with that as well.

    Ralph pointed me to a study demonstrating that a bulk capacitor extends the life of a coin cell by supply current during peak demand of low-duty-cycle devices. I also added a Schottky diode to prevent the battery from being charged when the LoFi board is attached to a computer. I almost learned that lesson the hard way when a nasty smell spewed from one of my NiMh battery packs. An improved board has already been designed to include the coin coil and diode, as well as a capacitor connector.

    A simple cadmium sulfide photoresistor cell detects the brightness of the garage, not only to determine if someone has left the light on, but also as a potential non-mechanical means of detecting a change in the door state. Primarily, the garage door position is detected by an Adafruit tilt ball switch (#173).

    Given that LoFi should cost less than $5, it only makes sense to use an equally expensive case. LoFi fits well in a Tic Tac box. The container is mounted to the garage door with Velcro hook and loop fasteners.

    I quickly discovered a problem with my steel garage door: it blocked the transmitter signal (L shaped house). The challenge was overcome by repositioning LoFi to the top of the garage door, such that the antenna stuck out above the top panel.

    All in all, this experiment is a success. LoFi correctly detects a change in garage door state, as well as delivers periodic updates on the door position, light level, temperature, and battery voltage.

  • Battery Life Expectancy

    a month ago • 0 comments

    Power usage depends on the current of any sensors that you add, as well as how often you configure LoFi to check sensors and transmit. Transmitting consumes approximately 15 mA. Not transmitting, but constantly checking the sensors, consumes about 0.5 mA.

    A more likely scenario for battery operation is where LoFi transmits sensor data periodically or is activated by a trigger switch, say every 10 minutes. In that case, LoFi sleeps most of the time. As you will see, this allows for extremely long battery life.

    This weekend, I coded and tested the sleep mode. LoFi uses the ATtiny watchdog to wake every 1/4 of a second to check whether it is time for a periodic transmission. It also examines the receive pin to see if someone is trying to configure the device. The digital trigger input (which can be connected to vibration or door switches) does not require polling. Instead, it will wake the device immediately.

    On the oscilloscope trace below, you can see LoFi wakes up briefly (narrow vertical spikes) before falling back to sleep. Each spike takes about 4.3 ms (oscillator start up + computations). Then, the transmit time occurs and LoFi takes about 200 ms to read the sensors and transmit the data.

    If a transmission occurred every 10 minutes, here is the average current draw:

    Only 18.5 microamps – thank you Atmel! Plug that into some common batteries:

    So, theoretically, you could run LoFi from a coin cell for a year. If you add a diode, capacitor, and small solar panel, then the life of the coin cell could be extended, as it would act as a backup at night. Realistically, with a pair of AA cells, you could forget about it for many, many years.

    Best of all, since LoFi includes the power supply voltage in the sensor data, you’ll know when it is time to change the batteries.

View all 8 project logs

Build instructions
  • 1

    LoFi is expected to be delivered ready-to-use (prepopulated and preprogrammed). These instructions are for people that want to build LoFi themselves from scratch or are interested for curiosity. These instructions are expected to change as the project nears completion.

    Download and decompress the PCB layout and source code [future] files from this project page.

  • 2
  • 3

    Open the PCB layout folder and locate desired PCB you'd like to have made. For example, LoFi-PCB-Layouts/Sender/LoFi-Sender-v5.zip. Drag that zip file onto the OSH Park web page to upload it.

See all instructions

Discussions

Eric Tsai wrote 8 days ago null point

David, we have pretty similar projects. Your MCu design is a lot more battery efficient than mine. I've been using several AA batteries to keep mine running. I'll have to investigate your ATtiny design to see if I could incorporate it into my Arduino sensor node design.

Thanks for the inspiration! I linked your project in my hackaday.

Are you sure? [yes] / [no]

Minimum Effective Dose wrote 10 days ago null point

I love the concept behind this project, it's fantastic. I'm very excited to see how it develops. Really sharp work.

Are you sure? [yes] / [no]

radicalbiscuit wrote 12 days ago null point

I'm excited at the prospects this offers. I've preemptively purchased a few receiver-transmitter pairs and I anxiously await availability.

Two questions, and I must apologize for the first:

When might these be mass produced and available to an end user like me?

What am I supposed to do with all these extra receivers? :P Maybe I can set up multiple receivers for a wider range.

Thanks for your work! I'm most excited about two projects in the world right now: ISEE-3 and this.

Are you sure? [yes] / [no]

David Cook wrote 11 days ago null point

Hello radicalbiscuit,

Thank you so much for the kind words. It is very motivating when someone posts a positive comment like yours!

1. I've been approached by a wonderful reseller about producing the product. But, I need to finish it first. I'm working on the listener board now (up to this point, I've been using a sender board in reverse.) I can't tell whether it would be viewed positively or negatively by the judges for a product to be 'in stores' before the conclusion of the contest.

2. Ha! I also have a bunch of extra receivers. Whenever I dig in my parts container for a transmitter module, I have to toss a couple of receivers back. Nope. Nope. Yes! Maybe you should start a project called 'Triangulation Using Spare AM Receivers'.

David

Are you sure? [yes] / [no]

Pixel Pirate wrote 19 days ago null point

Sorry if I'm being OCD, but those traces on your PCB make me cringe...

Are you sure? [yes] / [no]

David Cook wrote 18 days ago null point

Someone once said, "It should be 'CDO', because then it would be in alphabetical order". But seriously, I'm always open to suggestions. What would you do differently? The Copper Connection file is listed in the downloads. Could you make some sample edits and send the file to me?

Are you sure? [yes] / [no]

Pixel Pirate wrote 6 days ago null point

Mostly it's just aesthetics cringe. I can't stand routing a trace that isn't a 45 degree angle. Nor can I stand uneven spacing.
IT's just a psychological thing.

Are you sure? [yes] / [no]

Ron wrote a month ago null point

Nice project Mike, wireless and ATtiny is the way to go

Are you sure? [yes] / [no]

David Cook wrote 18 days ago null point

Thanks Ron. Yes, the ATtiny has so many built-in features that this project needs: oscillator, deep sleep, long-period watchdog wakeup, voltage reference, temperature sensor, EEPROM for settings, and so on.

Are you sure? [yes] / [no]

wifiwaves wrote a month ago null point

David,

Just something for everyone to be aware of...

The FCC has specific requirements for using transmitters. The FCC has made provisions for unlicensed transmitters throughout the radio spectrum. You can operate just about anywhere, but there are restrictions on the field strength, type of emission, and duty cycle that the system designer needs to be aware of before planning and deploying a system.

Unlicensed transmitters are covered under Part 15. The specific section covering these particular transmitters is at:

http://tiny.cc/a519hx

Briefly, the transmitters under discussion in your project are limited by two provisions:

15.231 (a)

The transmit on time is limited to a maximum of 5 seconds. Video, voice, and control of toys is prohibited, and the transmitter must be manually triggered. No periodic operation is allowed, except to verify system operation. In this case, the transmit time is limited to 2 seconds per hour (1/1800 duty cycle).

15.231 (e)

The on-time is limited to a maximum of 1 second. The off-time shall also be at least 30 times the on time, with no less than 10 seconds between transmissions. The key to using this section is to have the system transmit in short bursts, with a 10 second off time. No restriction on application or modes, but you have to pay attention to the duty cycle.

I ran into these issues when I was designing a remotely located turbidity sensor protecting a surface drinking water supply. Our design accommodated these requirements with no particular impact on the device functionality. We are using this long range device:

http://tiny.cc/lg39hx

It should be noted that where the device performs a fire, security, or other life safety function, the device may transmit for the entire duration of the alarm condition. While not prohibited, one should give due consideration to using homebrew devices in such situations. Commercial devices are rigorously tested under numerous circumstances to insure that they will operate properly when necessary.

Good RF design practice guidelines (aside from the FCC requirements) 'require' that a transmitter not use more power than is necessary to accomplish the given communication. This keeps the spectrum cleaner, and allows greater density. It also keeps the power supply requirements lower.

While these transmitters may not be seen at any great distance, following these limitations keeps one from having 'interesting' discussions with the FCC.

Onward and upward...!

wifiwaves

Are you sure? [yes] / [no]

David Cook wrote a month ago null point

This is great information. You clearly have the voice of experience. : )

At present the duration of messages is 200 ms. I'll make the default configuration include a quiet period of 10 seconds.

Fortunately, LoFi is not tied to a specific transmitter, frequency, or antenna. So, it will be possible to select appropriate modules for a region, governing body, or interference profile.

Are you sure? [yes] / [no]

wifiwaves wrote a month ago null point

David...great work!

For those interested in these kinds of transmitters/receivers, here are a ton of devices out there. Search for "key fob remote control" and a plethora of transmitters & receivers will show up. There are a couple of other bands available, most notably 418MHz (with little interference).

I find this device to be extremely helpful when working with these kinds of devices:

http://www.iautomate.com/products/rf-explorer-433-mhz-spectrum-analyzer.html

No pecuniary interest...just a fine device for cheap.

Keep up the great work!

wifiwaves

Are you sure? [yes] / [no]

David Cook wrote a month ago null point

Hi wifiwaves,

Hmmm. 418 MHz sounds very appealing. Thus far, I haven't had problems with interference in my home, but surely other people will. This would give people a choice. Also, perhaps I could build listener that could connect to two receivers, thus permitting more devices.

Thanks for the tip!

David

Are you sure? [yes] / [no]

Dave Jakopac wrote a month ago null point

David, the Sandwich robot I built--based on your book--still runs in demos at Chibots events. Great project and I'm looking forward to seeing the results.

Are you sure? [yes] / [no]

David Cook wrote a month ago null point

Hi Dave!

On a recent family vacation, we played a game where we were asked about our most prized personal position. I said 'Sandwich' and my family looked at me like I was crazy. Sure, there's epoxy coming out the coupler, ratty wires, and a few cuts that went slightly too far, but it still works and I built it myself. So, I am sincerely pleased to hear your robot is still running as well.

David

Are you sure? [yes] / [no]

barcellos.alvaro wrote a month ago null point

Slow and secure and constant as into the Voyager. My vote sure.
Could open a trend in remote control and sensors.

Are you sure? [yes] / [no]

David Cook wrote a month ago null point

According to Wikipedia, Voyager has a bit rate of 40 bits/s without error correction. So, I'm pleased to have 1970's technology beat. Oh, wait, it can transmit up to 115.2 kbit/s? Never mind.

Thanks for the vote!

David

Are you sure? [yes] / [no]

Mike Gordon wrote a month ago null point

This looks great! I can think of multiple uses around the house for a few of these. With that said, how about adding a 1-byte transmitter identifier character to the header to allow for independent sender/transmitters to be used in the same environment? The identifier could be set in the same interface as the trigger parameters.

It doesn't show in the project, but are you also planning a corresponding output module to plug into the 433 receiver? I'm thinking a small board that would read the transmission and duplicate the states out to corresponding analog and digital pins, either momentary, or latching until a new transmission is received that would change a pin's value, or even for a user configurable (on the output board) number of milliseconds

What is the power consumption of the input board and transmitter combination at rest and while transmitting? One application I'm thinking of would be to send an alert when one of 3 doors opens and closes, possibly with a status update on one every 10 mins. I'd like to power it off of a couple AA batteries, but not if I'd have to change them every couple weeks. Any ballpark estimate on that?

Are you sure? [yes] / [no]

David Cook wrote a month ago null point

Hi Mike,

Currently the header is six bytes and contains:
'L', message length, sender address, message id + retry id, command, subcommand

Therefore, yes!, you can have many transmitters. Also, note the message length byte and command bytes will permit the receiver to be able to deliver a variety of messages that it doesn't know anything about (forward compatibility).

As for the receiver, I am presently using a LoFi sender configured 'backwards'. But, I plan to make a special board to permit direct uplink to WiFi.

As for power consumption, I just added a log post inspired by your question. The answer is: a couple of AAs would power the device for a decade.

David

Are you sure? [yes] / [no]

João Lucas Torres wrote a month ago null point

Great work! I really love low cost networks. I'm finishing my final course project and it's about infrared networks.

Waiting news of this project.

Are you sure? [yes] / [no]

David Cook wrote a month ago null point

Thank you for the encouragement. New boards arrived today, so I'll have interesting material to post this weekend.

Are you sure? [yes] / [no]

Hjorgenogueira wrote a month ago null point

what a great project David, i always thought simple RF without complicate and expensive protocols like zigbee and other would do the trick most of the times...i think i will try to make one of these just to try out, unless if you have already spares ones and are planing to sell these...?!
thanks for the inspiration and sharing with us!

Are you sure? [yes] / [no]

David Cook wrote a month ago null point

Thank you! When the project nears production quality, I'll remember to upload an object file as well, so that you can program bare chips without having to reproduce the compiler environment. That being said, I am optimistic that the ready-to-run modules will be manufactured and available from our favorite sellers.

Are you sure? [yes] / [no]

DeepSOIC wrote a month ago null point

I want this one to go straight into our science lab!

Are you sure? [yes] / [no]

David Cook wrote a month ago null point

All right!

Your thumbnail freaked me out until I clicked on it.

Are you sure? [yes] / [no]

Mike Szczys wrote a month ago null point

Hi David! This already looks like a fantastic entry for The Hackaday Prize.

I actually stopped by to mention that I'm a huge fan of yours. Your book "Robot Building for Beginners" was the second book I read when beginning to learn about electronics and in my mind the most formative. Thanks so much for sharing your knowledge and passion!

Good luck with this entry.

Are you sure? [yes] / [no]

David Cook wrote a month ago null point

Wow! Thanks Mike. That means a lot to me. I visit Hack A Day daily to learn from others and to be inspired. Your site does so much to encourage science that I absolutely had to contribute an entry to your contest. By the way, I am really impressed with how easy it is to post and edit projects here.

Are you sure? [yes] / [no]