MQTT Coin Counter Simulator

We were finally able to integrate the previous Node-Red potentiometer demo we created with the coin counter simulator. Now we are able to send the data from the coin counter to the cloud and read it from the Node-Red debug window. The video below shows the demo running.

 

Before getting the values to display properly in the Node-Red debug window, there was an issue with the numbers being shown. For example, if I were to push the “penny” button, the LCD would show $0.01, but the debug window on Node-Red would show $0000.01, which is not particularly aesthetically pleasing. One of the reasons why this was occurring was because I adjusted the Coin Counter simulator program by changing the multiple integer variable types to only one double variable type. The main reason for doing so is so it would shrink my code down. However, because I made the change, unnecessary zeros were added to the debug window. In order for the data to be displayed on Node-Red, the double variable type had to be converted to a string, and that is where the issue was occurring. We quickly looked online for a solution and found one, so we adjusted the program accordingly. You will be able to see the demo program under the “Demos” tab soon.

Next, we will be working on creating a dashboard for the IoT coin counter, allowing anyone to see the data!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s