💾 Archived View for benjaminja.info › log › 2017 › feed.xml captured on 2024-05-10 at 10:51:17.

View Raw

More Information

➡️ Next capture (2024-07-08)

-=-=-=-=-=-=-

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-us">
  <title>Benjamin Jacobs | Log - 2017</title>
    <link rel="self" type="application/atom+xml" hreflang="" href="gemini://benjaminja.com/log/2017/feed.xml" />
    <link rel="alternate" type="text/gemini" hreflang="" href="gemini://benjaminja.com/log/2017/" /><id>/</id>
  <updated>2017-01-01T07:00:00Z</updated>
  <generator>Hugo 0.125.4</generator>
  <entry>
    <title><![CDATA[RC Remote API: Pairing/Connecting]]></title>
      <link rel="alternate" type="text/gemini" hreflang="" href="gemini://benjaminja.com/log/2017/10/29-rc_remote_pairing/" />
    <id>gemini://benjaminja.com/log/2017/10/29-rc_remote_pairing/</id>
    <updated>2017-10-29T16:37:43Z</updated>
    <summary type="gemini"><![CDATA[I was able to get progress on the api for my remote. It can now successfully pair, and connect. I still have yet to send a steady stream of data; That will be my next goal.
]]></summary><content type="gemini"><![CDATA[I was able to get progress on the api for my remote. It can now successfully pair, and connect. I still have yet to send a steady stream of data; That will be my next goal.

## Pairing

In order to pair, both the receiver, and transmitter must call the `pair` function. The remote will start announcing its ID on the `PAIR0` channel, the receiver will be listening on that channel for any data.

When data is received, the receiver will save the ID, switch to write mode on the received channel and send settings (currently that only consists of its ID). The transmitter will know that data was received, as auto-ack is turned on, and switch to receive mode, waiting for settings. When settings are received, it will pass them on to the remotes firmware to save.

## Connecting

When connecting, The receiver will go into write mode, announcing its ID on the remote ID channel saved from pairing. The transmitter will be listening on its channel. When it gets a transmission, it check if the ID sent was saved.

If any of the Saved IDs matches the sent ID, the transmitter will send back an OK, if not, it will send a FAIL, and will not connect to the receiver.

Right now, nothing happens after that. I will have both devices set a value that the device was connected, and which device it was connected to. This should allow the transmitter to know if it is okay to send data freely.
]]></content>
    <category term="wordpress" label="Wordpress" scheme="gemini://benjaminja.com/tags/wordpress/" />
    <category term="drone" label="Drone" scheme="gemini://benjaminja.com/tags/drone/" />
    <published>2017-10-29T16:37:43Z</published></entry>
  <entry>
    <title><![CDATA[RC Remote Software]]></title>
      <link rel="alternate" type="text/gemini" hreflang="" href="gemini://benjaminja.com/log/2017/10/24-rc-remote-software/" />
    <id>gemini://benjaminja.com/log/2017/10/24-rc-remote-software/</id>
    <updated>2017-10-24T15:00:22Z</updated>
    <summary type="gemini"><![CDATA[Over the course of the past year or so, I have torn apart an old RC Remote and put new electronics in. I think I have blogged about it before I rebuilt my website, and hope to restore those lost posts some day.
]]></summary><content type="gemini"><![CDATA[Over the course of the past year or so, I have torn apart an old RC Remote and put new electronics in. I think I have blogged about it before I rebuilt my website, and hope to restore those lost posts some day. I have since stopped working on it until about a week ago.

=> remote_wiring.jpg đź–Ľ remote_wiring

I discovered [PlatformIO], a plugin for Visual Studio Code, that allows for development on just about any embedded computer. This allowed me to start developing the software for my remote in full.
=> http://platformio.org/ PlatformIO

I have planned to write the software in two parts: The comms library, and the Remote software. The comms library is an API designed to work with nRF24L01 chips and is built for both the transmitter and receiver. The remote Software allows the comms library to work with the hardware of the remote.

## Comms Library

The comms library also has two parts: The Receiver, and the Transmitter. The receiver is the class a device connecting to the remote would use, while the transmitter is the class the remote would use. They are built to work with each other, and so both can be explained simultaneously.

The library will allow a transmitter to pair with more than one device, along with device-specific settings that would be stored in the transmitter (The library doesn’t save the settings, but asks the remote to save/retrieve them). When the transmitter connects, it waits for the receiver to announce its ID on the transmitter’s channel, the transmitter will then load the settings for that device, and check if all the requirements are valid. If the requirements are not valid, the remote should warn the user, and ask what to do, while the device waits for further commands. If everything is good, the remote should alert the user that the connection was successful.

You should also be able to have add-ons: a device that can communicate with the receiver through the transmitter. An example of an add-on is a Gymbal remote; you would be able to control a gimbal mounted on a quadcopter from a second remote without having a second transmitter. The receiver can specify in the settings wither a specific add-on is required, and which channels from an add-on to send, or which telemetry channels to send to an add-on. The main transmitter is also considered to be an add-on (its ID is 0) so can have specific channels excluded from the transmission.

## Remote Software

The software for the remote handles all of the specifics that the comms library can’t. It will control the display, EEPROM, and handle inputs. The screen will be controlled by a UI class that controls several subscreen objects.

The menu structure will be set up something like this

mainscreen

|---Settings

|---System Settings

|---Connect On startup

|---Channels Graph

|---Reverse Channels

|---Change ID

|---Forget All receivers

|---etc

|---Receiver Settings

|---Change Name

|---Change Background Image

|---Forget This Receiver

|---etc


I have already gotten the basic structure for the UI setup, but I haven’t done much more than that. I plan to get a connection between the receiver and transmitter done next.
]]></content>
    <category term="wordpress" label="Wordpress" scheme="gemini://benjaminja.com/tags/wordpress/" />
    <category term="drone" label="Drone" scheme="gemini://benjaminja.com/tags/drone/" />
    <published>2017-10-24T15:00:22Z</published></entry>
  <entry>
    <title><![CDATA[Weatherstation: Software]]></title>
      <link rel="alternate" type="text/gemini" hreflang="" href="gemini://benjaminja.com/log/2017/06/17-weatherstation_software/" />
    <id>gemini://benjaminja.com/log/2017/06/17-weatherstation_software/</id>
    <updated>2017-06-17T21:27:42Z</updated>
    <summary type="gemini"><![CDATA[I finished wiring the station, though I would not be surprised if I need to make some last minute adjustments. The last bit of wiring I have done is interfacing with the existing hardware. The rain gauge and anemometer connect directly to the board with an internal pull-up activated.
]]></summary><content type="gemini"><![CDATA[I finished wiring the station, though I would not be surprised if I need to make some last minute adjustments. The last bit of wiring I have done is interfacing with the existing hardware. The rain gauge and anemometer connect directly to the board with an internal pull-up activated. The language is connected to D11 for PCINT7 which allows for interrupts. The weather vane is connected to A0 through a 5k7 resistor to act as a voltage divider with the resistors in the weather vain as the second resistor. The solar panel connects to the USB pin through a step-up converter to make sure there is a 5V output.

=> wiring.jpg đź–Ľ wiring

As for the software, I created a simple flowchart of what the station will do.

=> flowchart.png đź–Ľ flowchart

The Program will wait for commands, I expect to update once every 30 seconds. It will then process the command, then repeat. It is a very simple system. though will be slightly more complex than that.

I haven’t programmed the commands yet, rather got or getting the processes ready to be commanded. So far have had weatherdump mostly finished, as well as settingdump. They are not yet functional enough to be plugged into a communications API, but the framework is there.

WeatherDump

The weatherdump sends back all of the weather data from about the time the dump was requested. It should start out collecting the wind data as that takes at least 2 seconds. Everything else reads fairly quickly. Next is the weather vain, which just finds which of the eight reed switches are closed. The temperature and humidity come from the DHT22, and pressure comes from the MPL115. The grain count is stored in a variable that may or may not reset after each reading(I haven’t decided yet)

SettingDump

All of the settings are stored in the internal EEPROM. The settings are fairly simple, just conversions or other various settings regarding weather data. I am doing this so that if I find an error with my system, I can easily fix the small issues without having to take down the weather station and reflash it. I am mainly storing Integers, doubles, and booleans. As EEPROM stores its values as bytes and has no conversion systems, I have created a few converters. The first converter simplifies the booleans into bytes to conserve memory. The second converts Integers into two bytes. The third converts doubles into 5 bytes. It starts out by finding out how many bits the double needs to become a long. After that, the long is turned into 2 ints which are then saved using the previous writeInt command. The last 5th byte stores the number of bits the double is compressed by.
]]></content>
    <category term="wordpress" label="Wordpress" scheme="gemini://benjaminja.com/tags/wordpress/" />
    <category term="weather-station" label="Weather-Station" scheme="gemini://benjaminja.com/tags/weather-station/" />
    <published>2017-06-17T21:27:42Z</published></entry>
  <entry>
    <title><![CDATA[Weather Station Part 2]]></title>
      <link rel="alternate" type="text/gemini" hreflang="" href="gemini://benjaminja.com/log/2017/04/15-weatherstation_part2/" />
    <id>gemini://benjaminja.com/log/2017/04/15-weatherstation_part2/</id>
    <updated>2017-04-15T21:11:33Z</updated>
    <summary type="gemini"><![CDATA[I have started working on the main board for the station. Adding the transceiver, barometer, temperature, and humidity sensor. It is going pretty well so far. I have not yet tested the rf24 module, though the two other modules I have confirmed to work.
]]></summary><content type="gemini"><![CDATA[I have started working on the main board for the station. Adding the transceiver, barometer, temperature, and humidity sensor. It is going pretty well so far. I have not yet tested the rf24 module, though the two other modules I have confirmed to work. The MPL115 works pretty well and seems to give good readings, though I can’t really test it without putting it in a vacuum chamber or climb a mountain, which is fairly difficult, let alone try to tether it to a computer. The humidity sensor reads humid in my mouth, and the temperature sensor senses the proper temperature.

=> chip_top.jpg đź–Ľ chip_top
=> chip_wiring.jpg đź–Ľ chip_wiring

I was also able to do some testing on the old equipment. Most of it worked how I expected it would, though with a little twist. I started with the wind meter.

The wind meter will be the easiest to implement. It has a single switch that pulses every 180°. The switch closed most of the time except for when pulsing, which opens the circuit. It will be really easy to implement as I only need to find the amount of time between two pulses. The hard part will be finding the conversion rate between rpm and airspeed. I wouldn’t be surprised if the information is readily online, but if it is not, I can take a few readings in a car ride at a set speed in a no wind environment.

Next is the Rain Gage. It is fairly simple, though it will be a bit harder to implement. The Rain gauge collects water in a see-saw thing. the water goes to one side until its bucket fills up and rocks the see-saw to the other side. This process repeats, but on the other side. when the bucket falls, the switch is pulsed. To implement, you just have to keep track of how many times the bucket dropped. It is really simple in principle, though in practice will require the system to always be listening for the switch to switch. An interrupt should do the trick. As for conversions, I believe each bucket drop is 0.01in, as that was the increment of the station before it broke, but I will have to confirm; Probably by leaving it out on a rainy day with rain bucket as a base.

The last is the weather vain, arguably the most difficult to implement. There are eight switches, one for each direction. each switch is parallel to each other with a different resistor paired with each. The resistor’s value seems to be random, making it more difficult to implement, though not by much. To implement, I would use a 100k5k7 pull-down resistor to get the following table. Though what I found interesting is that my readings from the last post are different to what the calculated resistance is.

I am certain that I am wrong about the resistance, either in my calculations, or my setup, but I remember reading the resistance on my meter to be correct.

## Edit

It turns out that I took out the resistor from a different box then what I thought I did for the pull-down resistor, it is actually a 5k7 resistor. Everything works out as it should though the West direction should read 4.254V instead of the actual 0V. I believe that a connection is somehow broken, but should work out fine in the final setup.
]]></content>
    <category term="wordpress" label="Wordpress" scheme="gemini://benjaminja.com/tags/wordpress/" />
    <category term="weather-station" label="Weather-Station" scheme="gemini://benjaminja.com/tags/weather-station/" />
    <published>2017-04-15T21:11:33Z</published></entry>
  <entry>
    <title><![CDATA[Weather Station]]></title>
      <link rel="alternate" type="text/gemini" hreflang="" href="gemini://benjaminja.com/log/2017/04/04-weatherstation/" />
    <id>gemini://benjaminja.com/log/2017/04/04-weatherstation/</id>
    <updated>2017-04-04T21:03:54Z</updated>
    <summary type="gemini"><![CDATA[I am starting a weather station project, taking an old broken weather station, and getting it to work with Arduino and a Raspberry Pi web server. After a quick inspection of the ports on the old station transmitter, I found that the weather vain uses a 4 wire plug.
]]></summary><content type="gemini"><![CDATA[I am starting a weather station project, taking an old broken weather station, and getting it to work with Arduino and a Raspberry Pi web server. After a quick inspection of the ports on the old station transmitter, I found that the weather vain uses a 4 wire plug. This got me worried as the colors also matched the i2c wire colors. After opening the vain, I found no ICs of any kind in the chip.

# Weather Vain

The board uses two of the four wires, and the other two are relayed from the wind speed device. the vain uses 8 reed switches, each connected from P4 to P1 through a resistor (each switch has a different resistance).

The placement of the resistors seem random, and I don’t know how I would find which switch is active, as I don’t think it is possible to find resistance solely from voltage difference. I’ll have to do some more testing.

=> chip_highlighted.jpg đź–Ľ chip_highlighted
=> chip.jpg đź–Ľ chip

# anemometer

I found that the anemometer also uses reed switches, one to be exact. It seems to switch states every 180°. It seems like it will be the easiest part to implement, though I will have to figure out a conversion between rpm and windspeed.

# Rain Meter

I haven’t yet opened it up, however I can tell that it uses a reed switch. When water enters the device, it will fall into a trough. When the trough fills, It will tip over emptying the water changing the state of the reed switch. Another trough on the other side is now collecting water continueing the cycle.

I think that each switch is equivelent to 0.01in though I’ll have to do some testing to be sure.
]]></content>
    <category term="wordpress" label="Wordpress" scheme="gemini://benjaminja.com/tags/wordpress/" />
    <category term="weather-station" label="Weather-Station" scheme="gemini://benjaminja.com/tags/weather-station/" />
    <published>2017-04-04T21:03:54Z</published></entry>
</feed>