---
title: "ambientsensor-rs"
url: "https://maker.wiznet.io/matthew/projects/ambientsensorrs/"
markdown_url: "https://maker.wiznet.io/matthew/projects/ambientsensorrs/md"
type: "UCC: User Created Content"
author: "matthew"
author_url: "https://maker.wiznet.io/matthew/"
original_author: "matthew"
original_url: "https://github.com/newAM/ambientsensor-rs"
published: "2022-05-02"
language: "en"
hardware: ["WIZnet W5500", "Ambient Sensor"]
likes: 0
views: 333
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# ambientsensor-rs

> ambientsensor-rs

Original author: matthew (source: https://github.com/newAM/ambientsensor-rs)

## Components

- **WIZnet W5500** x 1: W5500 ([docs](https://docs.wiznet.io/Product/Chip/Ethernet/W5500))
- **Ambient Sensor** x 1: Customized Board

WIZnet parts: W5500 ([Datasheet](https://docs.wiznet.io/Product/Chip/Ethernet/W5500/datasheet?utm_source=maker&utm_medium=project&utm_campaign=w5500), [product hub](https://maker.wiznet.io/products/w5500/))

## Documents and links

- [ambientsensor-rs](https://github.com/newAM/ambientsensor-rs/blob/main/README.md) (code): ambientsensor-rs

## Article

## ambientsensor-rs

This is a rust re-implementation of an embedded C project I did a while ago:?[AmbientSensor](https://github.com/newam/ambientsensor).

Schematics, photos, ect. will be in that repository, this repository is just for the rust firmware.

### <https://github.com/newAM/ambientsensor-rs/blob/main/README.md#status>Status

This is still a work in progress.

1. The OPT3002 luminosity sensor is not implemented.

2. The panic handler needs to get hooked up to the EEPROM to store error logs then reset.

### <https://github.com/newAM/ambientsensor-rs/blob/main/README.md#purpose>Purpose

Co-workers kept hyping up this new rust language, and I wanted to see if the hype was warranted.

On paper rust seems amazing, but the only way to really evaluate a language is to use it. I specifically wanted to compare embedded rust to embedded C, and?[AmbientSensor](https://github.com/newam/ambientsensor)?was simply the last embedded project I completed in C.

Turns out, the hype was warranted.

There is not a lot of commentary I can offer about embedded rust that has not already been said. The concepts rust introduces (safety, ownership, lifetimes) make developing robust code simple. The language is new and still has a small (but rapidly growing) ecosystem for embedded development. From my experience a lot of embedded development is still C simply because nothing else offers a compelling reason to switch (except C++ depending on who you ask). The features rust brings to the table are incredibly compelling for embedded development, and I think rust has a bright future in this industry.

### <https://github.com/newAM/ambientsensor-rs/blob/main/README.md#notable-crates-used>Notable crates used

- [rtic](https://rtic.rs/0.5/book/en/)?- RTOS

- [rtt_target](https://docs.rs/rtt-target/0.3.0/rtt_target/)?- Probe based logging

- [cargo-embed](https://crates.io/crates/cargo-embed)?- build and run your code with one command

- [embedded-hal](https://github.com/rust-embedded/embedded-hal)?- abstractions for embedded hardware

### <https://github.com/newAM/ambientsensor-rs/blob/main/README.md#crates-developed>Crates Developed

- [eeprom25aa02e48](https://github.com/newAM/eeprom25aa02e48-rs)?- EEPROM driver, my first rust crate

- [w5500-ll](https://github.com/newAM/w5500-ll-rs)?- Low level W5500 Ethernet chip driver

- [w5500-hl](https://github.com/newAM/w5500-hl-rs)?- Higher level W5500 Ethernet chip driver

- [w5500-dhcp](https://github.com/newAM/w5500-dhcp-rs)?- Simple W5500 DHCP client

- [bme280-multibus](https://github.com/newAM/bme280-multibus)?- Bosch BME280 driver

- [newam-mqtt](https://github.com/newAM/newam-mqtt)?- MQTT packet serialization and deserialization

### <https://github.com/newAM/ambientsensor-rs/blob/main/README.md#building>Building

You will need?[rustup](https://rustup.rs/)?and the?`thumbv6m-none-eabi`?target.

```
rustup target add thumbv6m-none-eabi
```

After you have that target available you can build, the default target is already set in?`.cargo/config.toml`.

```
cargo build
```

---

Source: https://maker.wiznet.io/matthew/projects/ambientsensorrs/
